diff --git a/src/appHandshake/appHandEXIDatatypes.c b/src/appHandshake/appHandEXIDatatypes.c index d7bc658..f6281a6 100644 --- a/src/appHandshake/appHandEXIDatatypes.c +++ b/src/appHandshake/appHandEXIDatatypes.c @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

@@ -45,6 +45,10 @@ 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) { } @@ -52,10 +56,6 @@ 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 fe054c8..61b76e3 100644 --- a/src/appHandshake/appHandEXIDatatypes.h +++ b/src/appHandshake/appHandEXIDatatypes.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

@@ -74,15 +74,6 @@ struct appHandAppProtocolType { uint8_t Priority ; }; -/* 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 { - /* element: ResponseCode, urn:iso:15118:2:2010:AppProtocol,responseCodeType */ - appHandresponseCodeType ResponseCode ; - /* element: SchemaID, urn:iso:15118:2:2010:AppProtocol,idType */ - uint8_t SchemaID ; - 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 { @@ -93,6 +84,15 @@ struct appHandAnonType_supportedAppProtocolReq { } AppProtocol; }; +/* 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 { + /* element: ResponseCode, urn:iso:15118:2:2010:AppProtocol,responseCodeType */ + appHandresponseCodeType ResponseCode ; + /* element: SchemaID, urn:iso:15118:2:2010:AppProtocol,idType */ + uint8_t SchemaID ; + unsigned int SchemaID_isUsed:1; +}; + @@ -118,9 +118,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 32b8b36..ff72640 100644 --- a/src/appHandshake/appHandEXIDatatypesDecoder.c +++ b/src/appHandshake/appHandEXIDatatypesDecoder.c @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

@@ -48,23 +48,129 @@ 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,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) { + /* 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'. */ +static int decode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppProtocolType* appHandAppProtocolType) { + int grammarID = 4; + int done = 0; + init_appHandAppProtocolType(appHandAppProtocolType); while(!done) { switch(grammarID) { - case 0: + case 4: /* FirstStartTag[START_ELEMENT(ProtocolNamespace)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -96,7 +202,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 = 1; + grammarID = 5; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -108,7 +214,7 @@ static int decode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppP } } break; - case 1: + case 5: /* Element[START_ELEMENT(VersionNumberMajor)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -128,7 +234,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 = 2; + grammarID = 6; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -140,7 +246,7 @@ static int decode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppP } } break; - case 2: + case 6: /* Element[START_ELEMENT(VersionNumberMinor)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -160,7 +266,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 = 3; + grammarID = 7; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -172,7 +278,7 @@ static int decode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppP } } break; - case 3: + case 7: /* Element[START_ELEMENT(SchemaID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -193,7 +299,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 = 4; + grammarID = 8; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -205,7 +311,7 @@ static int decode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppP } } break; - case 4: + case 8: /* Element[START_ELEMENT(Priority)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -226,7 +332,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 = 5; + grammarID = 2; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -238,14 +344,14 @@ static int decode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppP } } break; - case 5: + case 2: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 6; + grammarID = 3; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -266,58 +372,16 @@ 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 = 7; + int grammarID = 9; int done = 0; init_appHandAnonType_supportedAppProtocolReq(appHandAnonType_supportedAppProtocolReq); while(!done) { switch(grammarID) { - case 7: + case 9: /* 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: @@ -328,10 +392,6 @@ 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; @@ -353,7 +413,7 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s break; case 1: done = 1; - grammarID = 6; + grammarID = 3; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -376,7 +436,7 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s break; case 1: done = 1; - grammarID = 6; + grammarID = 3; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -399,7 +459,7 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s break; case 1: done = 1; - grammarID = 6; + grammarID = 3; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -422,7 +482,7 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s break; case 1: done = 1; - grammarID = 6; + grammarID = 3; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -445,7 +505,7 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s break; case 1: done = 1; - grammarID = 6; + grammarID = 3; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -468,7 +528,7 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s break; case 1: done = 1; - grammarID = 6; + grammarID = 3; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -491,7 +551,7 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s break; case 1: done = 1; - grammarID = 6; + grammarID = 3; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -514,7 +574,7 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s break; case 1: done = 1; - grammarID = 6; + grammarID = 3; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -537,7 +597,7 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s break; case 1: done = 1; - grammarID = 6; + grammarID = 3; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -560,7 +620,7 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s break; case 1: done = 1; - grammarID = 6; + grammarID = 3; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -583,7 +643,7 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s break; case 1: done = 1; - grammarID = 6; + grammarID = 3; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -606,7 +666,7 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s break; case 1: done = 1; - grammarID = 6; + grammarID = 3; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -629,7 +689,7 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s break; case 1: done = 1; - grammarID = 6; + grammarID = 3; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -652,7 +712,7 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s break; case 1: done = 1; - grammarID = 6; + grammarID = 3; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -675,7 +735,7 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s break; case 1: done = 1; - grammarID = 6; + grammarID = 3; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -698,7 +758,7 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s break; case 1: done = 1; - grammarID = 6; + grammarID = 3; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -717,11 +777,11 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 5; + grammarID = 27; break; case 1: done = 1; - grammarID = 6; + grammarID = 3; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -729,66 +789,22 @@ static int decode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s } } break; - case 5: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - 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); + /* Element[START_ELEMENT(AppProtocol), 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, &appHandAnonType_supportedAppProtocolRes->ResponseCode); - } else { - /* Second 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 */ - } + 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; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -797,36 +813,21 @@ static int decode_appHandAnonType_supportedAppProtocolRes(bitstream_t* stream, s } break; case 28: - /* Element[START_ELEMENT(SchemaID), END_ELEMENT] */ + /* Element[START_ELEMENT(AppProtocol), 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 = 5; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } + 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 = 2; break; case 1: done = 1; - grammarID = 6; + grammarID = 3; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -834,14 +835,14 @@ static int decode_appHandAnonType_supportedAppProtocolRes(bitstream_t* stream, s } } break; - case 5: + case 2: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 6; + grammarID = 3; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; diff --git a/src/appHandshake/appHandEXIDatatypesDecoder.h b/src/appHandshake/appHandEXIDatatypesDecoder.h index 92de84c..9fdb02e 100644 --- a/src/appHandshake/appHandEXIDatatypesDecoder.h +++ b/src/appHandshake/appHandEXIDatatypesDecoder.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

diff --git a/src/appHandshake/appHandEXIDatatypesEncoder.c b/src/appHandshake/appHandEXIDatatypesEncoder.c index 8737d59..4be5045 100644 --- a/src/appHandshake/appHandEXIDatatypesEncoder.c +++ b/src/appHandshake/appHandEXIDatatypesEncoder.c @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @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,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) { + /* 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 = 0; int done = 0; @@ -58,6 +58,79 @@ static int encode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppP 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); @@ -74,12 +147,12 @@ static int encode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppP errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 1; + grammarID = 5; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 1: + case 5: /* Element[START_ELEMENT(VersionNumberMajor)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -92,12 +165,12 @@ static int encode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppP errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 2; + grammarID = 6; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 2: + case 6: /* Element[START_ELEMENT(VersionNumberMinor)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -110,12 +183,12 @@ static int encode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppP errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 3; + grammarID = 7; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 3: + case 7: /* Element[START_ELEMENT(SchemaID)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -128,12 +201,12 @@ static int encode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppP errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 4; + grammarID = 8; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 4: + case 8: /* Element[START_ELEMENT(Priority)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -146,19 +219,19 @@ static int encode_appHandAppProtocolType(bitstream_t* stream, struct appHandAppP errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 5; + grammarID = 2; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 5: + case 2: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 6; + grammarID = 3; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -176,57 +249,21 @@ 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 = 7; + int grammarID = 9; int done = 0; unsigned int appHandAnonType_supportedAppProtocolReq_AppProtocol_currArrayIndex = 0; while(!done) { switch(grammarID) { - case 7: + case 9: /* 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; } @@ -244,7 +281,7 @@ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s if(errn == 0) { done = 1; } - grammarID = 6; + grammarID = 3; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -262,7 +299,7 @@ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s if(errn == 0) { done = 1; } - grammarID = 6; + grammarID = 3; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -280,7 +317,7 @@ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s if(errn == 0) { done = 1; } - grammarID = 6; + grammarID = 3; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -298,7 +335,7 @@ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s if(errn == 0) { done = 1; } - grammarID = 6; + grammarID = 3; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -316,7 +353,7 @@ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s if(errn == 0) { done = 1; } - grammarID = 6; + grammarID = 3; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -334,7 +371,7 @@ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s if(errn == 0) { done = 1; } - grammarID = 6; + grammarID = 3; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -352,7 +389,7 @@ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s if(errn == 0) { done = 1; } - grammarID = 6; + grammarID = 3; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -370,7 +407,7 @@ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s if(errn == 0) { done = 1; } - grammarID = 6; + grammarID = 3; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -388,7 +425,7 @@ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s if(errn == 0) { done = 1; } - grammarID = 6; + grammarID = 3; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -406,7 +443,7 @@ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s if(errn == 0) { done = 1; } - grammarID = 6; + grammarID = 3; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -424,7 +461,7 @@ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s if(errn == 0) { done = 1; } - grammarID = 6; + grammarID = 3; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -442,7 +479,7 @@ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s if(errn == 0) { done = 1; } - grammarID = 6; + grammarID = 3; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -460,7 +497,7 @@ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s if(errn == 0) { done = 1; } - grammarID = 6; + grammarID = 3; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -478,7 +515,7 @@ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s if(errn == 0) { done = 1; } - grammarID = 6; + grammarID = 3; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -496,7 +533,7 @@ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s if(errn == 0) { done = 1; } - grammarID = 6; + grammarID = 3; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -514,7 +551,7 @@ static int encode_appHandAnonType_supportedAppProtocolReq(bitstream_t* stream, s if(errn == 0) { done = 1; } - grammarID = 6; + grammarID = 3; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -526,98 +563,61 @@ 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 = 5; + grammarID = 27; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { done = 1; } - grammarID = 6; + grammarID = 3; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 5: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); + 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 = 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; + grammarID = 3; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; case 28: - /* Element[START_ELEMENT(SchemaID), END_ELEMENT] */ - if ( appHandAnonType_supportedAppProtocolRes->SchemaID_isUsed == 1u ) { + /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */ + if (appHandAnonType_supportedAppProtocolReq_AppProtocol_currArrayIndex < appHandAnonType_supportedAppProtocolReq->AppProtocol.arrayLen ) { 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); - } + errn = encode_appHandAppProtocolType(stream, &appHandAnonType_supportedAppProtocolReq->AppProtocol.array [appHandAnonType_supportedAppProtocolReq_AppProtocol_currArrayIndex++]); } - grammarID = 5; + grammarID = 2; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { done = 1; } - grammarID = 6; + grammarID = 3; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 5: + case 2: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 6; + grammarID = 3; } else { errn = EXI_ERROR_UNKOWN_EVENT; } diff --git a/src/appHandshake/appHandEXIDatatypesEncoder.h b/src/appHandshake/appHandEXIDatatypesEncoder.h index 59decd3..135aff0 100644 --- a/src/appHandshake/appHandEXIDatatypesEncoder.h +++ b/src/appHandshake/appHandEXIDatatypesEncoder.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

diff --git a/src/codec/AbstractDecoderChannel.c b/src/codec/AbstractDecoderChannel.c index b048eb7..bad8d06 100644 --- a/src/codec/AbstractDecoderChannel.c +++ b/src/codec/AbstractDecoderChannel.c @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

@@ -107,7 +107,7 @@ static int _decodeUnsignedInteger(bitstream_t* stream, exi_integer_t* iv, int ne iv->val.uint32 = (iv->val.uint32 << 7) | maskedOctets[k]; } if (negative) { - iv->val.int32 = (int32_t)(-( iv->val.uint32 + 1)); + iv->val.int32 = (-(int32_t)(iv->val.uint32 + 1)); if (iv->val.int32 <= INT16_MAX && iv->val.int32 >= INT16_MIN ) { iv->type = EXI_INTEGER_16; } else { @@ -136,7 +136,7 @@ static int _decodeUnsignedInteger(bitstream_t* stream, exi_integer_t* iv, int ne /* too large */ return EXI_UNSUPPORTED_INTEGER_VALUE; } - iv->val.int64 = (int64_t)(-( iv->val.uint64 + 1)); + iv->val.int64 = (-(int64_t)(iv->val.uint64 + 1)); if (iv->val.int64 <= INT32_MAX && iv->val.int64 >= INT32_MIN ) { iv->type = EXI_INTEGER_32; } else { @@ -285,7 +285,7 @@ int decodeInteger32(bitstream_t* stream, int32_t* int32) { /* For negative values, the Unsigned Integer holds the * magnitude of the value minus 1 */ errn = decodeUnsignedInteger32(stream, &uint32); - *int32 = (int32_t)(-(uint32 + 1)); + *int32 = (-(int32_t)(uint32 + 1)); } else { /* positive */ errn = decodeUnsignedInteger32(stream, &uint32); @@ -312,7 +312,7 @@ int decodeInteger64(bitstream_t* stream, int64_t* int64) { /* For negative values, the Unsigned Integer holds the * magnitude of the value minus 1 */ errn = decodeUnsignedInteger64(stream, &uint64); - *int64 = (int64_t)(-(uint64 + 1)); + *int64 = (-(int64_t)(uint64 + 1)); } else { /* positive */ errn = decodeUnsignedInteger64(stream, &uint64); diff --git a/src/codec/AbstractEncoderChannel.c b/src/codec/AbstractEncoderChannel.c index 9b88374..f340fa1 100644 --- a/src/codec/AbstractEncoderChannel.c +++ b/src/codec/AbstractEncoderChannel.c @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

diff --git a/src/codec/BitDecoderChannel.c b/src/codec/BitDecoderChannel.c index d6ee836..7b287c2 100644 --- a/src/codec/BitDecoderChannel.c +++ b/src/codec/BitDecoderChannel.c @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

diff --git a/src/codec/BitEncoderChannel.c b/src/codec/BitEncoderChannel.c index 8ff744b..98ed6ba 100644 --- a/src/codec/BitEncoderChannel.c +++ b/src/codec/BitEncoderChannel.c @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

diff --git a/src/codec/BitInputStream.c b/src/codec/BitInputStream.c index ff9efc7..0f382cd 100644 --- a/src/codec/BitInputStream.c +++ b/src/codec/BitInputStream.c @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

diff --git a/src/codec/BitInputStream.h b/src/codec/BitInputStream.h index 825c0af..a6fd24c 100644 --- a/src/codec/BitInputStream.h +++ b/src/codec/BitInputStream.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

diff --git a/src/codec/BitOutputStream.c b/src/codec/BitOutputStream.c index 3a550ca..7293c85 100644 --- a/src/codec/BitOutputStream.c +++ b/src/codec/BitOutputStream.c @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

diff --git a/src/codec/BitOutputStream.h b/src/codec/BitOutputStream.h index 3e01b10..b8e5e43 100644 --- a/src/codec/BitOutputStream.h +++ b/src/codec/BitOutputStream.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

diff --git a/src/codec/ByteDecoderChannel.c b/src/codec/ByteDecoderChannel.c index efe3705..3a1e376 100644 --- a/src/codec/ByteDecoderChannel.c +++ b/src/codec/ByteDecoderChannel.c @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

diff --git a/src/codec/ByteEncoderChannel.c b/src/codec/ByteEncoderChannel.c index de24da3..af92b22 100644 --- a/src/codec/ByteEncoderChannel.c +++ b/src/codec/ByteEncoderChannel.c @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

diff --git a/src/codec/ByteStream.c b/src/codec/ByteStream.c index ff8bc9a..b95e21c 100644 --- a/src/codec/ByteStream.c +++ b/src/codec/ByteStream.c @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

diff --git a/src/codec/ByteStream.h b/src/codec/ByteStream.h index 279ffe3..e270ed4 100644 --- a/src/codec/ByteStream.h +++ b/src/codec/ByteStream.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

diff --git a/src/codec/DecoderChannel.h b/src/codec/DecoderChannel.h index bbb7a2a..649cbbf 100644 --- a/src/codec/DecoderChannel.h +++ b/src/codec/DecoderChannel.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

diff --git a/src/codec/EXIConfig.h b/src/codec/EXIConfig.h index bb62b39..b20bde5 100644 --- a/src/codec/EXIConfig.h +++ b/src/codec/EXIConfig.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

diff --git a/src/codec/EXIHeaderDecoder.c b/src/codec/EXIHeaderDecoder.c index 616f231..f93f552 100644 --- a/src/codec/EXIHeaderDecoder.c +++ b/src/codec/EXIHeaderDecoder.c @@ -1,4 +1,33 @@ -/* $EXI_SOURCE_PREAMBLE$ */ +/* + * Copyright (C) 2007-2014 Siemens AG + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +/******************************************************************* + * + * @author Daniel.Peintner.EXT@siemens.com + * @version 0.9.1 + * @contact Joerg.Heuer@siemens.com + * + *

Code generated by EXIdizer

+ *

Schema: V2G_CI_MsgDef.xsd

+ * + * + ********************************************************************/ + + #include "EXIHeaderDecoder.h" #include "BitInputStream.h" diff --git a/src/codec/EXIHeaderDecoder.h b/src/codec/EXIHeaderDecoder.h index 0b6a2e2..d29a9be 100644 --- a/src/codec/EXIHeaderDecoder.h +++ b/src/codec/EXIHeaderDecoder.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

diff --git a/src/codec/EXIHeaderEncoder.c b/src/codec/EXIHeaderEncoder.c index 6f237ad..64003f2 100644 --- a/src/codec/EXIHeaderEncoder.c +++ b/src/codec/EXIHeaderEncoder.c @@ -1,4 +1,33 @@ -/* $EXI_SOURCE_PREAMBLE$ */ +/* + * Copyright (C) 2007-2014 Siemens AG + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +/******************************************************************* + * + * @author Daniel.Peintner.EXT@siemens.com + * @version 0.9.1 + * @contact Joerg.Heuer@siemens.com + * + *

Code generated by EXIdizer

+ *

Schema: V2G_CI_MsgDef.xsd

+ * + * + ********************************************************************/ + + #include "EXIHeaderEncoder.h" #include "BitOutputStream.h" diff --git a/src/codec/EXIHeaderEncoder.h b/src/codec/EXIHeaderEncoder.h index 925163d..c0ce7be 100644 --- a/src/codec/EXIHeaderEncoder.h +++ b/src/codec/EXIHeaderEncoder.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

diff --git a/src/codec/EXIOptions.h b/src/codec/EXIOptions.h index b144eae..282b3d8 100644 --- a/src/codec/EXIOptions.h +++ b/src/codec/EXIOptions.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

diff --git a/src/codec/EXITypes.h b/src/codec/EXITypes.h index fa95110..e8cc219 100644 --- a/src/codec/EXITypes.h +++ b/src/codec/EXITypes.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

diff --git a/src/codec/EncoderChannel.h b/src/codec/EncoderChannel.h index 52965de..bf91504 100644 --- a/src/codec/EncoderChannel.h +++ b/src/codec/EncoderChannel.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

diff --git a/src/codec/ErrorCodes.h b/src/codec/ErrorCodes.h index cde339d..4076c9a 100644 --- a/src/codec/ErrorCodes.h +++ b/src/codec/ErrorCodes.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

diff --git a/src/codec/MethodsBag.c b/src/codec/MethodsBag.c index a4fc3c5..19ea920 100644 --- a/src/codec/MethodsBag.c +++ b/src/codec/MethodsBag.c @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

diff --git a/src/codec/MethodsBag.h b/src/codec/MethodsBag.h index 4b50c0b..de8199b 100644 --- a/src/codec/MethodsBag.h +++ b/src/codec/MethodsBag.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

diff --git a/src/codec/v2gEXIDatatypes.c b/src/codec/v2gEXIDatatypes.c index dc8be7d..ce1a7cd 100644 --- a/src/codec/v2gEXIDatatypes.c +++ b/src/codec/v2gEXIDatatypes.c @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

@@ -123,17 +123,123 @@ void init_v2gEXIDocument(struct v2gEXIDocument* exiDoc) { exiDoc->Object_isUsed = 0u; } -void init_v2gServiceDetailResType(struct v2gServiceDetailResType* v2gServiceDetailResType) { - v2gServiceDetailResType->ServiceParameterList_isUsed = 0u; +void init_v2gPowerDeliveryReqType(struct v2gPowerDeliveryReqType* v2gPowerDeliveryReqType) { + v2gPowerDeliveryReqType->ChargingProfile_isUsed = 0u; + v2gPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed = 0u; + v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed = 0u; } -void init_v2gSPKIDataType(struct v2gSPKIDataType* v2gSPKIDataType) { - v2gSPKIDataType->SPKISexp.arrayLen = 0u; +void init_v2gCertificateUpdateReqType(struct v2gCertificateUpdateReqType* v2gCertificateUpdateReqType) { +} + +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_v2gSignatureType(struct v2gSignatureType* v2gSignatureType) { + v2gSignatureType->Id_isUsed = 0u; + v2gSignatureType->KeyInfo_isUsed = 0u; + v2gSignatureType->Object.arrayLen = 0u; +} + +void init_v2gEVPowerDeliveryParameterType(struct v2gEVPowerDeliveryParameterType* v2gEVPowerDeliveryParameterType) { +} + +void init_v2gAC_EVSEChargeParameterType(struct v2gAC_EVSEChargeParameterType* v2gAC_EVSEChargeParameterType) { +} + +void init_v2gSAScheduleListType(struct v2gSAScheduleListType* v2gSAScheduleListType) { + v2gSAScheduleListType->SAScheduleTuple.arrayLen = 0u; +} + +void init_v2gDC_EVPowerDeliveryParameterType(struct v2gDC_EVPowerDeliveryParameterType* v2gDC_EVPowerDeliveryParameterType) { + v2gDC_EVPowerDeliveryParameterType->BulkChargingComplete_isUsed = 0u; +} + +void init_v2gServiceDiscoveryResType(struct v2gServiceDiscoveryResType* v2gServiceDiscoveryResType) { + v2gServiceDiscoveryResType->ServiceList_isUsed = 0u; +} + +void init_v2gServiceParameterListType(struct v2gServiceParameterListType* v2gServiceParameterListType) { + v2gServiceParameterListType->ParameterSet.arrayLen = 0u; +} + +void init_v2gDC_EVChargeParameterType(struct v2gDC_EVChargeParameterType* v2gDC_EVChargeParameterType) { + v2gDC_EVChargeParameterType->DepartureTime_isUsed = 0u; + v2gDC_EVChargeParameterType->EVMaximumPowerLimit_isUsed = 0u; + v2gDC_EVChargeParameterType->EVEnergyCapacity_isUsed = 0u; + v2gDC_EVChargeParameterType->EVEnergyRequest_isUsed = 0u; + v2gDC_EVChargeParameterType->FullSOC_isUsed = 0u; + v2gDC_EVChargeParameterType->BulkSOC_isUsed = 0u; +} + +void init_v2gServiceDiscoveryReqType(struct v2gServiceDiscoveryReqType* v2gServiceDiscoveryReqType) { + v2gServiceDiscoveryReqType->ServiceScope_isUsed = 0u; + v2gServiceDiscoveryReqType->ServiceCategory_isUsed = 0u; +} + +void init_v2gSignatureValueType(struct v2gSignatureValueType* v2gSignatureValueType) { + v2gSignatureValueType->Id_isUsed = 0u; +} + void init_v2gBodyType(struct v2gBodyType* v2gBodyType) { v2gBodyType->BodyElement_isUsed = 0u; v2gBodyType->SessionSetupReq_isUsed = 0u; @@ -172,65 +278,7 @@ void init_v2gBodyType(struct v2gBodyType* v2gBodyType) { v2gBodyType->WeldingDetectionRes_isUsed = 0u; } -void init_v2gPaymentServiceSelectionReqType(struct v2gPaymentServiceSelectionReqType* v2gPaymentServiceSelectionReqType) { -} - -void init_v2gEVSEStatusType(struct v2gEVSEStatusType* v2gEVSEStatusType) { -} - -void init_v2gSelectedServiceType(struct v2gSelectedServiceType* v2gSelectedServiceType) { - v2gSelectedServiceType->ParameterSetID_isUsed = 0u; -} - -void init_v2gEntryType(struct v2gEntryType* v2gEntryType) { - v2gEntryType->TimeInterval_isUsed = 0u; - v2gEntryType->RelativeTimeInterval_isUsed = 0u; -} - -void init_v2gDC_EVSEChargeParameterType(struct v2gDC_EVSEChargeParameterType* v2gDC_EVSEChargeParameterType) { - v2gDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance_isUsed = 0u; - v2gDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered_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_v2gPMaxScheduleType(struct v2gPMaxScheduleType* v2gPMaxScheduleType) { - v2gPMaxScheduleType->PMaxScheduleEntry.arrayLen = 0u; -} - -void init_v2gCostType(struct v2gCostType* v2gCostType) { - v2gCostType->amountMultiplier_isUsed = 0u; -} - -void init_v2gChargeServiceType(struct v2gChargeServiceType* v2gChargeServiceType) { - v2gChargeServiceType->ServiceName_isUsed = 0u; - v2gChargeServiceType->ServiceScope_isUsed = 0u; -} - -void init_v2gPMaxScheduleEntryType(struct v2gPMaxScheduleEntryType* v2gPMaxScheduleEntryType) { - v2gPMaxScheduleEntryType->TimeInterval_isUsed = 0u; - v2gPMaxScheduleEntryType->RelativeTimeInterval_isUsed = 0u; -} - -void init_v2gServiceListType(struct v2gServiceListType* v2gServiceListType) { - v2gServiceListType->Service.arrayLen = 0u; -} - -void init_v2gKeyValueType(struct v2gKeyValueType* v2gKeyValueType) { - v2gKeyValueType->DSAKeyValue_isUsed = 0u; - v2gKeyValueType->RSAKeyValue_isUsed = 0u; -} - -void init_v2gPaymentServiceSelectionResType(struct v2gPaymentServiceSelectionResType* v2gPaymentServiceSelectionResType) { -} - -void init_v2gSignatureMethodType(struct v2gSignatureMethodType* v2gSignatureMethodType) { - v2gSignatureMethodType->HMACOutputLength_isUsed = 0u; +void init_v2gPaymentDetailsResType(struct v2gPaymentDetailsResType* v2gPaymentDetailsResType) { } void init_v2gMeteringReceiptResType(struct v2gMeteringReceiptResType* v2gMeteringReceiptResType) { @@ -239,102 +287,15 @@ void init_v2gMeteringReceiptResType(struct v2gMeteringReceiptResType* v2gMeterin v2gMeteringReceiptResType->DC_EVSEStatus_isUsed = 0u; } -void init_v2gMessageHeaderType(struct v2gMessageHeaderType* v2gMessageHeaderType) { - v2gMessageHeaderType->Notification_isUsed = 0u; - v2gMessageHeaderType->Signature_isUsed = 0u; -} - -void init_v2gRetrievalMethodType(struct v2gRetrievalMethodType* v2gRetrievalMethodType) { - v2gRetrievalMethodType->URI_isUsed = 0u; - v2gRetrievalMethodType->Type_isUsed = 0u; - v2gRetrievalMethodType->Transforms_isUsed = 0u; -} - -void init_v2gEVChargeParameterType(struct v2gEVChargeParameterType* v2gEVChargeParameterType) { - v2gEVChargeParameterType->DepartureTime_isUsed = 0u; -} - -void init_v2gCertificateInstallationReqType(struct v2gCertificateInstallationReqType* v2gCertificateInstallationReqType) { -} - -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_v2gWeldingDetectionReqType(struct v2gWeldingDetectionReqType* v2gWeldingDetectionReqType) { -} - -void init_v2gCableCheckReqType(struct v2gCableCheckReqType* v2gCableCheckReqType) { -} - -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_v2gEVSEChargeParameterType(struct v2gEVSEChargeParameterType* v2gEVSEChargeParameterType) { -} - -void init_v2gManifestType(struct v2gManifestType* v2gManifestType) { - v2gManifestType->Id_isUsed = 0u; - v2gManifestType->Reference.arrayLen = 0u; -} - -void init_v2gDC_EVStatusType(struct v2gDC_EVStatusType* v2gDC_EVStatusType) { -} - -void init_v2gPaymentDetailsReqType(struct v2gPaymentDetailsReqType* v2gPaymentDetailsReqType) { -} - -void init_v2gSAScheduleListType(struct v2gSAScheduleListType* v2gSAScheduleListType) { - v2gSAScheduleListType->SAScheduleTuple.arrayLen = 0u; -} - void init_v2gRSAKeyValueType(struct v2gRSAKeyValueType* v2gRSAKeyValueType) { } -void init_v2gAC_EVSEChargeParameterType(struct v2gAC_EVSEChargeParameterType* v2gAC_EVSEChargeParameterType) { +void init_v2gSessionSetupReqType(struct v2gSessionSetupReqType* v2gSessionSetupReqType) { } -void init_v2gTransformsType(struct v2gTransformsType* v2gTransformsType) { - v2gTransformsType->Transform.arrayLen = 0u; -} - -void init_v2gWeldingDetectionResType(struct v2gWeldingDetectionResType* v2gWeldingDetectionResType) { -} - -void init_v2gConsumptionCostType(struct v2gConsumptionCostType* v2gConsumptionCostType) { - v2gConsumptionCostType->Cost.arrayLen = 0u; -} - -void init_v2gChargingStatusResType(struct v2gChargingStatusResType* v2gChargingStatusResType) { - v2gChargingStatusResType->EVSEMaxCurrent_isUsed = 0u; - v2gChargingStatusResType->MeterInfo_isUsed = 0u; - v2gChargingStatusResType->ReceiptRequired_isUsed = 0u; -} - -void init_v2gEVStatusType(struct v2gEVStatusType* v2gEVStatusType) { -} - -void init_v2gPGPDataType(struct v2gPGPDataType* v2gPGPDataType) { - v2gPGPDataType->PGPKeyID_isUsed = 0u; - v2gPGPDataType->PGPKeyPacket_isUsed = 0u; -} - -void init_v2gSessionStopResType(struct v2gSessionStopResType* v2gSessionStopResType) { -} - -void init_v2gServiceDiscoveryReqType(struct v2gServiceDiscoveryReqType* v2gServiceDiscoveryReqType) { - v2gServiceDiscoveryReqType->ServiceScope_isUsed = 0u; - v2gServiceDiscoveryReqType->ServiceCategory_isUsed = 0u; +void init_v2gSignedInfoType(struct v2gSignedInfoType* v2gSignedInfoType) { + v2gSignedInfoType->Id_isUsed = 0u; + v2gSignedInfoType->Reference.arrayLen = 0u; } void init_v2gAuthorizationReqType(struct v2gAuthorizationReqType* v2gAuthorizationReqType) { @@ -342,178 +303,28 @@ void init_v2gAuthorizationReqType(struct v2gAuthorizationReqType* v2gAuthorizati v2gAuthorizationReqType->GenChallenge_isUsed = 0u; } -void init_v2gSAScheduleTupleType(struct v2gSAScheduleTupleType* v2gSAScheduleTupleType) { - v2gSAScheduleTupleType->SalesTariff_isUsed = 0u; -} - -void init_v2gPhysicalValueType(struct v2gPhysicalValueType* v2gPhysicalValueType) { -} - -void init_v2gDigestMethodType(struct v2gDigestMethodType* v2gDigestMethodType) { -} - -void init_v2gAC_EVSEStatusType(struct v2gAC_EVSEStatusType* v2gAC_EVSEStatusType) { -} - -void init_v2gSessionSetupResType(struct v2gSessionSetupResType* v2gSessionSetupResType) { - v2gSessionSetupResType->EVSETimeStamp_isUsed = 0u; -} - -void init_v2gX509IssuerSerialType(struct v2gX509IssuerSerialType* v2gX509IssuerSerialType) { -} - -void init_v2gSessionStopReqType(struct v2gSessionStopReqType* v2gSessionStopReqType) { -} - -void init_v2gDC_EVSEStatusType(struct v2gDC_EVSEStatusType* v2gDC_EVSEStatusType) { - v2gDC_EVSEStatusType->EVSEIsolationStatus_isUsed = 0u; +void init_v2gChargingProfileType(struct v2gChargingProfileType* v2gChargingProfileType) { + v2gChargingProfileType->ProfileEntry.arrayLen = 0u; } void init_v2gDiffieHellmanPublickeyType(struct v2gDiffieHellmanPublickeyType* v2gDiffieHellmanPublickeyType) { } -void init_v2gCertificateUpdateReqType(struct v2gCertificateUpdateReqType* v2gCertificateUpdateReqType) { -} - -void init_v2gBodyBaseType(struct v2gBodyBaseType* v2gBodyBaseType) { -} - -void init_v2gDC_EVChargeParameterType(struct v2gDC_EVChargeParameterType* v2gDC_EVChargeParameterType) { - v2gDC_EVChargeParameterType->DepartureTime_isUsed = 0u; - v2gDC_EVChargeParameterType->EVMaximumPowerLimit_isUsed = 0u; - v2gDC_EVChargeParameterType->EVEnergyCapacity_isUsed = 0u; - v2gDC_EVChargeParameterType->EVEnergyRequest_isUsed = 0u; - v2gDC_EVChargeParameterType->FullSOC_isUsed = 0u; - v2gDC_EVChargeParameterType->BulkSOC_isUsed = 0u; +void init_v2gSelectedServiceType(struct v2gSelectedServiceType* v2gSelectedServiceType) { + v2gSelectedServiceType->ParameterSetID_isUsed = 0u; } void init_v2gSubCertificatesType(struct v2gSubCertificatesType* v2gSubCertificatesType) { v2gSubCertificatesType->Certificate.arrayLen = 0u; } -void init_v2gSupportedEnergyTransferModeType(struct v2gSupportedEnergyTransferModeType* v2gSupportedEnergyTransferModeType) { - v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen = 0u; -} - -void init_v2gChargingStatusReqType(struct v2gChargingStatusReqType* v2gChargingStatusReqType) { -} - -void init_v2gSignaturePropertyType(struct v2gSignaturePropertyType* v2gSignaturePropertyType) { - v2gSignaturePropertyType->Id_isUsed = 0u; -} - -void init_v2gContractSignatureEncryptedPrivateKeyType(struct v2gContractSignatureEncryptedPrivateKeyType* v2gContractSignatureEncryptedPrivateKeyType) { -} - -void init_v2gReferenceType(struct v2gReferenceType* v2gReferenceType) { - v2gReferenceType->Id_isUsed = 0u; - v2gReferenceType->URI_isUsed = 0u; - v2gReferenceType->Type_isUsed = 0u; - v2gReferenceType->Transforms_isUsed = 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_v2gCanonicalizationMethodType(struct v2gCanonicalizationMethodType* v2gCanonicalizationMethodType) { -} - -void init_v2gTransformType(struct v2gTransformType* v2gTransformType) { - v2gTransformType->XPath.arrayLen = 0u; -} - void init_v2gCertificateChainType(struct v2gCertificateChainType* v2gCertificateChainType) { v2gCertificateChainType->Id_isUsed = 0u; v2gCertificateChainType->SubCertificates_isUsed = 0u; } -void init_v2gSignatureValueType(struct v2gSignatureValueType* v2gSignatureValueType) { - v2gSignatureValueType->Id_isUsed = 0u; -} - -void init_v2gEVPowerDeliveryParameterType(struct v2gEVPowerDeliveryParameterType* v2gEVPowerDeliveryParameterType) { -} - -void init_v2gServiceDetailReqType(struct v2gServiceDetailReqType* v2gServiceDetailReqType) { -} - -void init_v2gPaymentDetailsResType(struct v2gPaymentDetailsResType* v2gPaymentDetailsResType) { -} - -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_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_v2gPowerDeliveryResType(struct v2gPowerDeliveryResType* v2gPowerDeliveryResType) { - v2gPowerDeliveryResType->EVSEStatus_isUsed = 0u; - v2gPowerDeliveryResType->AC_EVSEStatus_isUsed = 0u; - v2gPowerDeliveryResType->DC_EVSEStatus_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_v2gParameterSetType(struct v2gParameterSetType* v2gParameterSetType) { - v2gParameterSetType->Parameter.arrayLen = 0u; -} - -void init_v2gServiceDiscoveryResType(struct v2gServiceDiscoveryResType* v2gServiceDiscoveryResType) { - v2gServiceDiscoveryResType->ServiceList_isUsed = 0u; -} - -void init_v2gAnonType_V2G_Message(struct v2gAnonType_V2G_Message* v2gAnonType_V2G_Message) { -} - -void init_v2gSignatureType(struct v2gSignatureType* v2gSignatureType) { - v2gSignatureType->Id_isUsed = 0u; - v2gSignatureType->KeyInfo_isUsed = 0u; - v2gSignatureType->Object.arrayLen = 0u; -} - -void init_v2gEMAIDType(struct v2gEMAIDType* v2gEMAIDType) { -} - -void init_v2gCertificateInstallationResType(struct v2gCertificateInstallationResType* v2gCertificateInstallationResType) { -} - -void init_v2gCableCheckResType(struct v2gCableCheckResType* v2gCableCheckResType) { -} - -void init_v2gMeterInfoType(struct v2gMeterInfoType* v2gMeterInfoType) { - v2gMeterInfoType->MeterReading_isUsed = 0u; - v2gMeterInfoType->SigMeterReading_isUsed = 0u; - v2gMeterInfoType->MeterStatus_isUsed = 0u; - v2gMeterInfoType->TMeter_isUsed = 0u; -} - -void init_v2gAC_EVChargeParameterType(struct v2gAC_EVChargeParameterType* v2gAC_EVChargeParameterType) { - v2gAC_EVChargeParameterType->DepartureTime_isUsed = 0u; -} - -void init_v2gServiceParameterListType(struct v2gServiceParameterListType* v2gServiceParameterListType) { - v2gServiceParameterListType->ParameterSet.arrayLen = 0u; +void init_v2gSupportedEnergyTransferModeType(struct v2gSupportedEnergyTransferModeType* v2gSupportedEnergyTransferModeType) { + v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen = 0u; } void init_v2gCurrentDemandReqType(struct v2gCurrentDemandReqType* v2gCurrentDemandReqType) { @@ -525,78 +336,191 @@ void init_v2gCurrentDemandReqType(struct v2gCurrentDemandReqType* v2gCurrentDema v2gCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed = 0u; } -void init_v2gSASchedulesType(struct v2gSASchedulesType* v2gSASchedulesType) { +void init_v2gSalesTariffType(struct v2gSalesTariffType* v2gSalesTariffType) { + v2gSalesTariffType->Id_isUsed = 0u; + v2gSalesTariffType->SalesTariffDescription_isUsed = 0u; + v2gSalesTariffType->NumEPriceLevels_isUsed = 0u; + v2gSalesTariffType->SalesTariffEntry.arrayLen = 0u; } -void init_v2gIntervalType(struct v2gIntervalType* v2gIntervalType) { +void init_v2gEMAIDType(struct v2gEMAIDType* v2gEMAIDType) { +} + +void init_v2gCableCheckReqType(struct v2gCableCheckReqType* v2gCableCheckReqType) { } void init_v2gPreChargeResType(struct v2gPreChargeResType* v2gPreChargeResType) { } -void init_v2gSalesTariffEntryType(struct v2gSalesTariffEntryType* v2gSalesTariffEntryType) { - v2gSalesTariffEntryType->TimeInterval_isUsed = 0u; - v2gSalesTariffEntryType->RelativeTimeInterval_isUsed = 0u; - v2gSalesTariffEntryType->EPriceLevel_isUsed = 0u; - v2gSalesTariffEntryType->ConsumptionCost.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_v2gDigestMethodType(struct v2gDigestMethodType* v2gDigestMethodType) { +} + +void init_v2gPGPDataType(struct v2gPGPDataType* v2gPGPDataType) { + v2gPGPDataType->PGPKeyID_isUsed = 0u; + v2gPGPDataType->PGPKeyPacket_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_v2gSignedInfoType(struct v2gSignedInfoType* v2gSignedInfoType) { - v2gSignedInfoType->Id_isUsed = 0u; - v2gSignedInfoType->Reference.arrayLen = 0u; +void init_v2gParameterSetType(struct v2gParameterSetType* v2gParameterSetType) { + v2gParameterSetType->Parameter.arrayLen = 0u; } -void init_v2gSessionSetupReqType(struct v2gSessionSetupReqType* v2gSessionSetupReqType) { +void init_v2gAC_EVChargeParameterType(struct v2gAC_EVChargeParameterType* v2gAC_EVChargeParameterType) { + v2gAC_EVChargeParameterType->DepartureTime_isUsed = 0u; } -void init_v2gSignaturePropertiesType(struct v2gSignaturePropertiesType* v2gSignaturePropertiesType) { - v2gSignaturePropertiesType->Id_isUsed = 0u; - v2gSignaturePropertiesType->SignatureProperty.arrayLen = 0u; +void init_v2gManifestType(struct v2gManifestType* v2gManifestType) { + v2gManifestType->Id_isUsed = 0u; + v2gManifestType->Reference.arrayLen = 0u; } -void init_v2gProfileEntryType(struct v2gProfileEntryType* v2gProfileEntryType) { - v2gProfileEntryType->ChargingProfileEntryMaxNumberOfPhasesInUse_isUsed = 0u; -} - -void init_v2gPreChargeReqType(struct v2gPreChargeReqType* v2gPreChargeReqType) { +void init_v2gServiceDetailResType(struct v2gServiceDetailResType* v2gServiceDetailResType) { + v2gServiceDetailResType->ServiceParameterList_isUsed = 0u; } void init_v2gListOfRootCertificateIDsType(struct v2gListOfRootCertificateIDsType* v2gListOfRootCertificateIDsType) { v2gListOfRootCertificateIDsType->RootCertificateID.arrayLen = 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_v2gChargingProfileType(struct v2gChargingProfileType* v2gChargingProfileType) { - v2gChargingProfileType->ProfileEntry.arrayLen = 0u; -} - -void init_v2gCertificateUpdateResType(struct v2gCertificateUpdateResType* v2gCertificateUpdateResType) { - v2gCertificateUpdateResType->RetryCounter_isUsed = 0u; -} - -void init_v2gMeteringReceiptReqType(struct v2gMeteringReceiptReqType* v2gMeteringReceiptReqType) { - v2gMeteringReceiptReqType->Id_isUsed = 0u; - v2gMeteringReceiptReqType->SAScheduleTupleID_isUsed = 0u; -} - void init_v2gServiceType(struct v2gServiceType* v2gServiceType) { v2gServiceType->ServiceName_isUsed = 0u; v2gServiceType->ServiceScope_isUsed = 0u; } -void init_v2gNotificationType(struct v2gNotificationType* v2gNotificationType) { - v2gNotificationType->FaultMsg_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_v2gServiceDetailReqType(struct v2gServiceDetailReqType* v2gServiceDetailReqType) { } void init_v2gKeyInfoType(struct v2gKeyInfoType* v2gKeyInfoType) { @@ -610,20 +534,96 @@ void init_v2gKeyInfoType(struct v2gKeyInfoType* v2gKeyInfoType) { 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_v2gPowerDeliveryReqType(struct v2gPowerDeliveryReqType* v2gPowerDeliveryReqType) { - v2gPowerDeliveryReqType->ChargingProfile_isUsed = 0u; - v2gPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed = 0u; - v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed = 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_v2gObjectType(struct v2gObjectType* v2gObjectType) { - v2gObjectType->Id_isUsed = 0u; - v2gObjectType->MimeType_isUsed = 0u; - v2gObjectType->Encoding_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_v2gSalesTariffEntryType(struct v2gSalesTariffEntryType* v2gSalesTariffEntryType) { + v2gSalesTariffEntryType->TimeInterval_isUsed = 0u; + v2gSalesTariffEntryType->RelativeTimeInterval_isUsed = 0u; + v2gSalesTariffEntryType->EPriceLevel_isUsed = 0u; + v2gSalesTariffEntryType->ConsumptionCost.arrayLen = 0u; +} + +void init_v2gWeldingDetectionReqType(struct v2gWeldingDetectionReqType* v2gWeldingDetectionReqType) { +} + +void init_v2gSessionSetupResType(struct v2gSessionSetupResType* v2gSessionSetupResType) { + v2gSessionSetupResType->EVSETimeStamp_isUsed = 0u; +} + +void init_v2gSignatureMethodType(struct v2gSignatureMethodType* v2gSignatureMethodType) { + v2gSignatureMethodType->HMACOutputLength_isUsed = 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_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; } diff --git a/src/codec/v2gEXIDatatypes.h b/src/codec/v2gEXIDatatypes.h index 99b8d67..5551f06 100644 --- a/src/codec/v2gEXIDatatypes.h +++ b/src/codec/v2gEXIDatatypes.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

@@ -50,50 +50,20 @@ extern "C" { /* Datatype definitions and structs for given XML Schema definitions */ -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SPKIDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SPKISexp,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-1}){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -#define v2gSPKIDataType_SPKISexp_BYTES_SIZE 350 -#define v2gSPKIDataType_SPKISexp_ARRAY_SIZE 0 -struct v2gSPKIDataType { - /* element: "http://www.w3.org/2000/09/xmldsig#":SPKISexp, http://www.w3.org/2001/XMLSchema,base64Binary */ - struct { - struct { - uint8_t bytes[v2gSPKIDataType_SPKISexp_BYTES_SIZE]; - uint16_t bytesLen; - } array[v2gSPKIDataType_SPKISexp_ARRAY_SIZE]; - uint16_t arrayLen; - } SPKISexp; -}; - typedef enum { - DC_EVErrorCodeType_NO_ERROR = 0, - DC_EVErrorCodeType_FAILED_RESSTemperatureInhibit = 1, - DC_EVErrorCodeType_FAILED_EVShiftPosition = 2, - DC_EVErrorCodeType_FAILED_ChargerConnectorLockFault = 3, - DC_EVErrorCodeType_FAILED_EVRESSMalfunction = 4, - DC_EVErrorCodeType_FAILED_ChargingCurrentdifferential = 5, - DC_EVErrorCodeType_FAILED_ChargingVoltageOutOfRange = 6, - DC_EVErrorCodeType_Reserved_A = 7, - DC_EVErrorCodeType_Reserved_B = 8, - DC_EVErrorCodeType_Reserved_C = 9, - DC_EVErrorCodeType_FAILED_ChargingSystemIncompatibility = 10, - DC_EVErrorCodeType_NoData = 11 -} v2gDC_EVErrorCodeType; + EnergyTransferModeType_AC_single_phase_core = 0, + EnergyTransferModeType_AC_three_phase_core = 1, + EnergyTransferModeType_DC_core = 2, + EnergyTransferModeType_DC_extended = 3, + EnergyTransferModeType_DC_combo_core = 4, + EnergyTransferModeType_DC_unique = 5 +} v2gEnergyTransferModeType; -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SelectedServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID{0-1})', derivedBy='RESTRICTION'. */ -struct v2gSelectedServiceType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":ServiceID, urn:iso:15118:2:2013:MsgDataTypes,serviceIDType */ - uint16_t ServiceID ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID, http://www.w3.org/2001/XMLSchema,short */ - int16_t ParameterSetID ; - unsigned int ParameterSetID_isUsed:1; +/* Complex type name='urn:iso:15118:2:2013:MsgBody,BodyBaseType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +struct v2gBodyBaseType { + int noContent; /* avoid warning */ }; -typedef enum { - chargeProgressType_Start = 0, - chargeProgressType_Stop = 1, - chargeProgressType_Renegotiate = 2 -} v2gchargeProgressType; - typedef enum { isolationLevelType_Invalid = 0, isolationLevelType_Valid = 1, @@ -103,9 +73,29 @@ typedef enum { } v2gisolationLevelType; typedef enum { - paymentOptionType_Contract = 0, - paymentOptionType_ExternalPayment = 1 -} v2gpaymentOptionType; + chargingSessionType_Terminate = 0, + chargingSessionType_Pause = 1 +} v2gchargingSessionType; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define v2gCanonicalizationMethodType_Algorithm_CHARACTERS_SIZE 50 +struct v2gCanonicalizationMethodType { + /* attribute: Algorithm {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[v2gCanonicalizationMethodType_Algorithm_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Algorithm ; +}; + +typedef enum { + unitSymbolType_h = 0, + unitSymbolType_m = 1, + unitSymbolType_s = 2, + unitSymbolType_A = 3, + unitSymbolType_V = 4, + unitSymbolType_W = 5, + unitSymbolType_Wh = 6 +} v2gunitSymbolType; typedef enum { responseCodeType_OK = 0, @@ -136,60 +126,78 @@ typedef enum { responseCodeType_FAILED_CertificateRevoked = 25 } v2gresponseCodeType; -typedef enum { - EVSENotificationType_None = 0, - EVSENotificationType_StopCharging = 1, - EVSENotificationType_ReNegotiation = 2 -} v2gEVSENotificationType; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define v2gSignatureMethodType_Algorithm_CHARACTERS_SIZE 50 -struct v2gSignatureMethodType { - /* attribute: Algorithm {http://www.w3.org/2001/XMLSchema,anyURI} */ - struct { - exi_string_character_t characters[v2gSignatureMethodType_Algorithm_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Algorithm ; - /* element: "http://www.w3.org/2000/09/xmldsig#":HMACOutputLength, http://www.w3.org/2000/09/xmldsig#,HMACOutputLengthType */ - int64_t HMACOutputLength ; - unsigned int HMACOutputLength_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2013: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'. */ -struct v2gPaymentServiceSelectionResType { +/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionStopResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ +struct v2gSessionStopResType { /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ v2gresponseCodeType ResponseCode ; }; -typedef enum { - valueType_bool = 0, - valueType_byte = 1, - valueType_short = 2, - valueType_int = 3, - valueType_physicalValue = 4, - valueType_string = 5 -} v2gvalueType; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVChargeParameterType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1})', derivedBy='RESTRICTION'. */ -struct v2gEVChargeParameterType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":DepartureTime, http://www.w3.org/2001/XMLSchema,unsignedInt */ - uint32_t DepartureTime ; - unsigned int DepartureTime_isUsed:1; -}; - /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVSEChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ struct v2gEVSEChargeParameterType { int noContent; /* avoid warning */ }; -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EVReady,"urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ -struct v2gDC_EVStatusType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVReady, http://www.w3.org/2001/XMLSchema,boolean */ - int EVReady ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode, urn:iso:15118:2:2013:MsgDataTypes,DC_EVErrorCodeType */ - v2gDC_EVErrorCodeType EVErrorCode ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC, urn:iso:15118:2:2013:MsgDataTypes,percentValueType */ - int8_t EVRESSSOC ; +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ +#define v2gX509IssuerSerialType_X509IssuerName_CHARACTERS_SIZE 50 +struct v2gX509IssuerSerialType { + /* element: "http://www.w3.org/2000/09/xmldsig#":X509IssuerName, http://www.w3.org/2001/XMLSchema,string */ + struct { + exi_string_character_t characters[v2gX509IssuerSerialType_X509IssuerName_CHARACTERS_SIZE]; + uint16_t charactersLen; + } X509IssuerName ; + /* element: "http://www.w3.org/2000/09/xmldsig#":X509SerialNumber, http://www.w3.org/2001/XMLSchema,integer */ + int64_t X509SerialNumber ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVPowerDeliveryParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +struct v2gEVPowerDeliveryParameterType { + int noContent; /* avoid warning */ +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +#define v2gSignatureValueType_Id_CHARACTERS_SIZE 50 +#define v2gSignatureValueType_CONTENT_BYTES_SIZE 350 +struct v2gSignatureValueType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[v2gSignatureValueType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* simple content: http://www.w3.org/2001/XMLSchema,base64Binary */ + struct { + uint8_t bytes[v2gSignatureValueType_CONTENT_BYTES_SIZE]; + uint16_t bytesLen; + } CONTENT ; +}; + +typedef enum { + DC_EVSEStatusCodeType_EVSE_NotReady = 0, + DC_EVSEStatusCodeType_EVSE_Ready = 1, + DC_EVSEStatusCodeType_EVSE_Shutdown = 2, + DC_EVSEStatusCodeType_EVSE_UtilityInterruptEvent = 3, + DC_EVSEStatusCodeType_EVSE_IsolationMonitoringActive = 4, + DC_EVSEStatusCodeType_EVSE_EmergencyShutdown = 5, + DC_EVSEStatusCodeType_EVSE_Malfunction = 6, + DC_EVSEStatusCodeType_Reserved_8 = 7, + DC_EVSEStatusCodeType_Reserved_9 = 8, + DC_EVSEStatusCodeType_Reserved_A = 9, + DC_EVSEStatusCodeType_Reserved_B = 10, + DC_EVSEStatusCodeType_Reserved_C = 11 +} v2gDC_EVSEStatusCodeType; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentDetailsResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":GenChallenge,"urn:iso:15118:2:2013:MsgBody":EVSETimeStamp)', derivedBy='EXTENSION'. */ +#define v2gPaymentDetailsResType_GenChallenge_BYTES_SIZE 16 /* XML schema facet length for urn:iso:15118:2:2013:MsgDataTypes,genChallengeType is 16 */ +struct v2gPaymentDetailsResType { + /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ + v2gresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2013:MsgBody":GenChallenge, urn:iso:15118:2:2013:MsgDataTypes,genChallengeType */ + struct { + uint8_t bytes[v2gPaymentDetailsResType_GenChallenge_BYTES_SIZE]; + uint16_t bytesLen; + } GenChallenge ; + /* element: "urn:iso:15118:2:2013:MsgBody":EVSETimeStamp, http://www.w3.org/2001/XMLSchema,long */ + int64_t EVSETimeStamp ; }; /* Complex type name='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'. */ @@ -208,33 +216,19 @@ struct v2gRSAKeyValueType { } Exponent ; }; -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,PGPDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":PGPKeyID,"http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})|("http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED}))', derivedBy='RESTRICTION'. */ -#define v2gPGPDataType_PGPKeyID_BYTES_SIZE 350 -#define v2gPGPDataType_PGPKeyPacket_BYTES_SIZE 350 -struct v2gPGPDataType { - /* element: "http://www.w3.org/2000/09/xmldsig#":PGPKeyID, http://www.w3.org/2001/XMLSchema,base64Binary */ - struct { - uint8_t bytes[v2gPGPDataType_PGPKeyID_BYTES_SIZE]; - uint16_t bytesLen; - } PGPKeyID ; - unsigned int PGPKeyID_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket, http://www.w3.org/2001/XMLSchema,base64Binary */ - struct { - uint8_t bytes[v2gPGPDataType_PGPKeyPacket_BYTES_SIZE]; - uint16_t bytesLen; - } PGPKeyPacket ; - unsigned int PGPKeyPacket_isUsed:1; -}; +typedef enum { + paymentOptionType_Contract = 0, + paymentOptionType_ExternalPayment = 1 +} v2gpaymentOptionType; -/* 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'. */ -struct v2gEVStatusType { - int noContent; /* avoid warning */ -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionStopResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ -struct v2gSessionStopResType { - /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ - v2gresponseCodeType ResponseCode ; +/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionSetupReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":EVCCID)', derivedBy='EXTENSION'. */ +#define v2gSessionSetupReqType_EVCCID_BYTES_SIZE 6 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,evccIDType is 6 */ +struct v2gSessionSetupReqType { + /* element: "urn:iso:15118:2:2013:MsgBody":EVCCID, urn:iso:15118:2:2013:MsgDataTypes,evccIDType */ + struct { + uint8_t bytes[v2gSessionSetupReqType_EVCCID_BYTES_SIZE]; + uint16_t bytesLen; + } EVCCID ; }; /* Complex type name='urn:iso:15118:2:2013: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'. */ @@ -255,60 +249,6 @@ struct v2gAuthorizationReqType { unsigned int GenChallenge_isUsed:1; }; -typedef enum { - serviceCategoryType_EVCharging = 0, - serviceCategoryType_Internet = 1, - serviceCategoryType_ContractCertificate = 2, - serviceCategoryType_OtherCustom = 3 -} v2gserviceCategoryType; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DigestMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define v2gDigestMethodType_Algorithm_CHARACTERS_SIZE 50 -struct v2gDigestMethodType { - /* attribute: Algorithm {http://www.w3.org/2001/XMLSchema,anyURI} */ - struct { - exi_string_character_t characters[v2gDigestMethodType_Algorithm_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Algorithm ; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":RCD))', derivedBy='EXTENSION'. */ -struct v2gAC_EVSEStatusType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay, http://www.w3.org/2001/XMLSchema,unsignedShort */ - uint16_t NotificationMaxDelay ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSENotification, urn:iso:15118:2:2013:MsgDataTypes,EVSENotificationType */ - v2gEVSENotificationType EVSENotification ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":RCD, http://www.w3.org/2001/XMLSchema,boolean */ - int RCD ; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionSetupResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEID,"urn:iso:15118:2:2013:MsgBody":EVSETimeStamp{0-1})', derivedBy='EXTENSION'. */ -#define v2gSessionSetupResType_EVSEID_CHARACTERS_SIZE 37 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,evseIDType is 37 */ -struct v2gSessionSetupResType { - /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ - v2gresponseCodeType ResponseCode ; - /* element: "urn:iso:15118:2:2013:MsgBody":EVSEID, urn:iso:15118:2:2013:MsgDataTypes,evseIDType */ - struct { - exi_string_character_t characters[v2gSessionSetupResType_EVSEID_CHARACTERS_SIZE]; - uint16_t charactersLen; - } EVSEID ; - /* element: "urn:iso:15118:2:2013:MsgBody":EVSETimeStamp, http://www.w3.org/2001/XMLSchema,long */ - int64_t EVSETimeStamp ; - unsigned int EVSETimeStamp_isUsed:1; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ -#define v2gX509IssuerSerialType_X509IssuerName_CHARACTERS_SIZE 50 -struct v2gX509IssuerSerialType { - /* element: "http://www.w3.org/2000/09/xmldsig#":X509IssuerName, http://www.w3.org/2001/XMLSchema,string */ - struct { - exi_string_character_t characters[v2gX509IssuerSerialType_X509IssuerName_CHARACTERS_SIZE]; - uint16_t charactersLen; - } X509IssuerName ; - /* element: "http://www.w3.org/2000/09/xmldsig#":X509SerialNumber, http://www.w3.org/2001/XMLSchema,integer */ - int64_t X509SerialNumber ; -}; - /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DiffieHellmanPublickeyType', base type name='dHpublickeyType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ #define v2gDiffieHellmanPublickeyType_Id_CHARACTERS_SIZE 50 #define v2gDiffieHellmanPublickeyType_CONTENT_BYTES_SIZE 350 @@ -325,32 +265,15 @@ struct v2gDiffieHellmanPublickeyType { } CONTENT ; }; -typedef enum { - costKindType_relativePricePercentage = 0, - costKindType_RenewableGenerationPercentage = 1, - costKindType_CarbonDioxideEmission = 2 -} v2gcostKindType; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,BodyBaseType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -struct v2gBodyBaseType { - int noContent; /* avoid warning */ +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SelectedServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID{0-1})', derivedBy='RESTRICTION'. */ +struct v2gSelectedServiceType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":ServiceID, urn:iso:15118:2:2013:MsgDataTypes,serviceIDType */ + uint16_t ServiceID ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID, http://www.w3.org/2001/XMLSchema,short */ + int16_t ParameterSetID ; + unsigned int ParameterSetID_isUsed:1; }; -typedef enum { - faultCodeType_ParsingError = 0, - faultCodeType_NoTLSRootCertificatAvailable = 1, - faultCodeType_UnknownError = 2 -} v2gfaultCodeType; - -typedef enum { - EnergyTransferModeType_AC_single_phase_core = 0, - EnergyTransferModeType_AC_three_phase_core = 1, - EnergyTransferModeType_DC_core = 2, - EnergyTransferModeType_DC_extended = 3, - EnergyTransferModeType_DC_combo_core = 4, - EnergyTransferModeType_DC_unique = 5 -} v2gEnergyTransferModeType; - /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SubCertificatesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate{1-4})', derivedBy='RESTRICTION'. */ #define v2gSubCertificatesType_Certificate_BYTES_SIZE 800 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,certificateType is 800 */ #define v2gSubCertificatesType_Certificate_ARRAY_SIZE 4 @@ -365,89 +288,6 @@ struct v2gSubCertificatesType { } Certificate; }; -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargingStatusReqType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -struct v2gChargingStatusReqType { - int noContent; /* avoid warning */ -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SupportedEnergyTransferModeType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EnergyTransferMode{1-6})', derivedBy='RESTRICTION'. */ -#define v2gSupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE 5 -struct v2gSupportedEnergyTransferModeType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EnergyTransferMode, urn:iso:15118:2:2013:MsgDataTypes,EnergyTransferModeType */ - struct { - v2gEnergyTransferModeType array[v2gSupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE]; - uint16_t arrayLen; - } EnergyTransferMode; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -#define v2gSignaturePropertyType_Target_CHARACTERS_SIZE 50 -#define v2gSignaturePropertyType_Id_CHARACTERS_SIZE 50 -struct v2gSignaturePropertyType { - /* attribute: Target {http://www.w3.org/2001/XMLSchema,anyURI} */ - struct { - exi_string_character_t characters[v2gSignaturePropertyType_Target_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Target ; - /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ - struct { - exi_string_character_t characters[v2gSignaturePropertyType_Id_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Id ; - unsigned int Id_isUsed:1; -}; - -typedef enum { - chargingSessionType_Terminate = 0, - chargingSessionType_Pause = 1 -} v2gchargingSessionType; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ContractSignatureEncryptedPrivateKeyType', base type name='privateKeyType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -#define v2gContractSignatureEncryptedPrivateKeyType_Id_CHARACTERS_SIZE 50 -#define v2gContractSignatureEncryptedPrivateKeyType_CONTENT_BYTES_SIZE 350 -struct v2gContractSignatureEncryptedPrivateKeyType { - /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ - struct { - exi_string_character_t characters[v2gContractSignatureEncryptedPrivateKeyType_Id_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Id ; - /* simple content: urn:iso:15118:2:2013:MsgDataTypes,privateKeyType */ - struct { - uint8_t bytes[v2gContractSignatureEncryptedPrivateKeyType_CONTENT_BYTES_SIZE]; - uint16_t bytesLen; - } CONTENT ; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define v2gCanonicalizationMethodType_Algorithm_CHARACTERS_SIZE 50 -struct v2gCanonicalizationMethodType { - /* attribute: Algorithm {http://www.w3.org/2001/XMLSchema,anyURI} */ - struct { - exi_string_character_t characters[v2gCanonicalizationMethodType_Algorithm_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Algorithm ; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])|"http://www.w3.org/2000/09/xmldsig#":XPath){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ -#define v2gTransformType_Algorithm_CHARACTERS_SIZE 50 -#define v2gTransformType_XPath_CHARACTERS_SIZE 50 -#define v2gTransformType_XPath_ARRAY_SIZE 0 -struct v2gTransformType { - /* attribute: Algorithm {http://www.w3.org/2001/XMLSchema,anyURI} */ - struct { - exi_string_character_t characters[v2gTransformType_Algorithm_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Algorithm ; - /* element: "http://www.w3.org/2000/09/xmldsig#":XPath, http://www.w3.org/2001/XMLSchema,string */ - struct { - struct { - exi_string_character_t characters[v2gTransformType_XPath_CHARACTERS_SIZE]; - uint16_t charactersLen; - } array[v2gTransformType_XPath_ARRAY_SIZE]; - uint16_t arrayLen; - } XPath; -}; - /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate,"urn:iso:15118:2:2013:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ #define v2gCertificateChainType_Id_CHARACTERS_SIZE 50 #define v2gCertificateChainType_Certificate_BYTES_SIZE 800 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,certificateType is 800 */ @@ -468,58 +308,133 @@ struct v2gCertificateChainType { unsigned int SubCertificates_isUsed:1; }; -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -#define v2gSignatureValueType_Id_CHARACTERS_SIZE 50 -#define v2gSignatureValueType_CONTENT_BYTES_SIZE 350 -struct v2gSignatureValueType { +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SupportedEnergyTransferModeType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EnergyTransferMode{1-6})', derivedBy='RESTRICTION'. */ +#define v2gSupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE 5 +struct v2gSupportedEnergyTransferModeType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EnergyTransferMode, urn:iso:15118:2:2013:MsgDataTypes,EnergyTransferModeType */ + struct { + v2gEnergyTransferModeType array[v2gSupportedEnergyTransferModeType_EnergyTransferMode_ARRAY_SIZE]; + uint16_t arrayLen; + } EnergyTransferMode; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EMAIDType', base type name='eMAIDType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +#define v2gEMAIDType_Id_CHARACTERS_SIZE 50 +#define v2gEMAIDType_CONTENT_CHARACTERS_SIZE 50 +struct v2gEMAIDType { /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ struct { - exi_string_character_t characters[v2gSignatureValueType_Id_CHARACTERS_SIZE]; + exi_string_character_t characters[v2gEMAIDType_Id_CHARACTERS_SIZE]; uint16_t charactersLen; } Id ; - unsigned int Id_isUsed:1; - /* simple content: http://www.w3.org/2001/XMLSchema,base64Binary */ + /* simple content: urn:iso:15118:2:2013:MsgDataTypes,eMAIDType */ struct { - uint8_t bytes[v2gSignatureValueType_CONTENT_BYTES_SIZE]; + exi_string_character_t characters[v2gEMAIDType_CONTENT_CHARACTERS_SIZE]; + uint16_t charactersLen; + } CONTENT ; +}; + +typedef enum { + EVSEProcessingType_Finished = 0, + EVSEProcessingType_Ongoing = 1, + EVSEProcessingType_Ongoing_WaitingForCustomerInteraction = 2 +} v2gEVSEProcessingType; + +/* 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'. */ +struct v2gEVStatusType { + int noContent; /* avoid warning */ +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ +struct v2gPhysicalValueType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":Multiplier, urn:iso:15118:2:2013:MsgDataTypes,unitMultiplierType */ + int8_t Multiplier ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":Unit, urn:iso:15118:2:2013:MsgDataTypes,unitSymbolType */ + v2gunitSymbolType Unit ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":Value, http://www.w3.org/2001/XMLSchema,short */ + int16_t Value ; +}; + +typedef enum { + chargeProgressType_Start = 0, + chargeProgressType_Stop = 1, + chargeProgressType_Renegotiate = 2 +} v2gchargeProgressType; + +typedef enum { + faultCodeType_ParsingError = 0, + faultCodeType_NoTLSRootCertificatAvailable = 1, + faultCodeType_UnknownError = 2 +} v2gfaultCodeType; + +typedef enum { + valueType_bool = 0, + valueType_byte = 1, + valueType_short = 2, + valueType_int = 3, + valueType_physicalValue = 4, + valueType_string = 5 +} v2gvalueType; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ContractSignatureEncryptedPrivateKeyType', base type name='privateKeyType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +#define v2gContractSignatureEncryptedPrivateKeyType_Id_CHARACTERS_SIZE 50 +#define v2gContractSignatureEncryptedPrivateKeyType_CONTENT_BYTES_SIZE 350 +struct v2gContractSignatureEncryptedPrivateKeyType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[v2gContractSignatureEncryptedPrivateKeyType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + /* simple content: urn:iso:15118:2:2013:MsgDataTypes,privateKeyType */ + struct { + uint8_t bytes[v2gContractSignatureEncryptedPrivateKeyType_CONTENT_BYTES_SIZE]; uint16_t bytesLen; } CONTENT ; }; -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVPowerDeliveryParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -struct v2gEVPowerDeliveryParameterType { +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,NotificationType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":FaultCode,"urn:iso:15118:2:2013:MsgDataTypes":FaultMsg{0-1})', derivedBy='RESTRICTION'. */ +#define v2gNotificationType_FaultMsg_CHARACTERS_SIZE 64 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,faultMsgType is 64 */ +struct v2gNotificationType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":FaultCode, urn:iso:15118:2:2013:MsgDataTypes,faultCodeType */ + v2gfaultCodeType FaultCode ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":FaultMsg, urn:iso:15118:2:2013:MsgDataTypes,faultMsgType */ + struct { + exi_string_character_t characters[v2gNotificationType_FaultMsg_CHARACTERS_SIZE]; + uint16_t charactersLen; + } FaultMsg ; + unsigned int FaultMsg_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargingStatusReqType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +struct v2gChargingStatusReqType { int noContent; /* avoid warning */ }; -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentDetailsResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":GenChallenge,"urn:iso:15118:2:2013:MsgBody":EVSETimeStamp)', derivedBy='EXTENSION'. */ -#define v2gPaymentDetailsResType_GenChallenge_BYTES_SIZE 16 /* XML schema facet length for urn:iso:15118:2:2013:MsgDataTypes,genChallengeType is 16 */ -struct v2gPaymentDetailsResType { - /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ - v2gresponseCodeType ResponseCode ; - /* element: "urn:iso:15118:2:2013:MsgBody":GenChallenge, urn:iso:15118:2:2013:MsgDataTypes,genChallengeType */ - struct { - uint8_t bytes[v2gPaymentDetailsResType_GenChallenge_BYTES_SIZE]; - uint16_t bytesLen; - } GenChallenge ; - /* element: "urn:iso:15118:2:2013:MsgBody":EVSETimeStamp, http://www.w3.org/2001/XMLSchema,long */ - int64_t EVSETimeStamp ; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDetailReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ServiceID)', derivedBy='EXTENSION'. */ -struct v2gServiceDetailReqType { - /* element: "urn:iso:15118:2:2013:MsgBody":ServiceID, urn:iso:15118:2:2013:MsgDataTypes,serviceIDType */ - uint16_t ServiceID ; -}; +typedef enum { + DC_EVErrorCodeType_NO_ERROR = 0, + DC_EVErrorCodeType_FAILED_RESSTemperatureInhibit = 1, + DC_EVErrorCodeType_FAILED_EVShiftPosition = 2, + DC_EVErrorCodeType_FAILED_ChargerConnectorLockFault = 3, + DC_EVErrorCodeType_FAILED_EVRESSMalfunction = 4, + DC_EVErrorCodeType_FAILED_ChargingCurrentdifferential = 5, + DC_EVErrorCodeType_FAILED_ChargingVoltageOutOfRange = 6, + DC_EVErrorCodeType_Reserved_A = 7, + DC_EVErrorCodeType_Reserved_B = 8, + DC_EVErrorCodeType_Reserved_C = 9, + DC_EVErrorCodeType_FAILED_ChargingSystemIncompatibility = 10, + DC_EVErrorCodeType_NoData = 11 +} v2gDC_EVErrorCodeType; /* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509DataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial|"http://www.w3.org/2000/09/xmldsig#":X509SKI|"http://www.w3.org/2000/09/xmldsig#":X509SubjectName|"http://www.w3.org/2000/09/xmldsig#":X509Certificate|"http://www.w3.org/2000/09/xmldsig#":X509CRL|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ -#define v2gX509DataType_X509IssuerSerial_ARRAY_SIZE 0 +#define v2gX509DataType_X509IssuerSerial_ARRAY_SIZE 1 #define v2gX509DataType_X509SKI_BYTES_SIZE 350 -#define v2gX509DataType_X509SKI_ARRAY_SIZE 0 +#define v2gX509DataType_X509SKI_ARRAY_SIZE 1 #define v2gX509DataType_X509SubjectName_CHARACTERS_SIZE 50 -#define v2gX509DataType_X509SubjectName_ARRAY_SIZE 0 +#define v2gX509DataType_X509SubjectName_ARRAY_SIZE 1 #define v2gX509DataType_X509Certificate_BYTES_SIZE 350 -#define v2gX509DataType_X509Certificate_ARRAY_SIZE 0 +#define v2gX509DataType_X509Certificate_ARRAY_SIZE 1 #define v2gX509DataType_X509CRL_BYTES_SIZE 350 -#define v2gX509DataType_X509CRL_ARRAY_SIZE 0 +#define v2gX509DataType_X509CRL_ARRAY_SIZE 1 struct v2gX509DataType { /* element: "http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial, Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ struct { @@ -560,11 +475,177 @@ struct v2gX509DataType { } X509CRL; }; +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DigestMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define v2gDigestMethodType_Algorithm_CHARACTERS_SIZE 50 +struct v2gDigestMethodType { + /* attribute: Algorithm {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[v2gDigestMethodType_Algorithm_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Algorithm ; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,PGPDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":PGPKeyID,"http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})|("http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED}))', derivedBy='RESTRICTION'. */ +#define v2gPGPDataType_PGPKeyID_BYTES_SIZE 350 +#define v2gPGPDataType_PGPKeyPacket_BYTES_SIZE 350 +struct v2gPGPDataType { + /* element: "http://www.w3.org/2000/09/xmldsig#":PGPKeyID, http://www.w3.org/2001/XMLSchema,base64Binary */ + struct { + uint8_t bytes[v2gPGPDataType_PGPKeyID_BYTES_SIZE]; + uint16_t bytesLen; + } PGPKeyID ; + unsigned int PGPKeyID_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket, http://www.w3.org/2001/XMLSchema,base64Binary */ + struct { + uint8_t bytes[v2gPGPDataType_PGPKeyPacket_BYTES_SIZE]; + uint16_t bytesLen; + } PGPKeyPacket ; + unsigned int PGPKeyPacket_isUsed:1; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])|"http://www.w3.org/2000/09/xmldsig#":XPath){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ +#define v2gTransformType_Algorithm_CHARACTERS_SIZE 50 +#define v2gTransformType_XPath_CHARACTERS_SIZE 50 +#define v2gTransformType_XPath_ARRAY_SIZE 1 +struct v2gTransformType { + /* attribute: Algorithm {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[v2gTransformType_Algorithm_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Algorithm ; + /* element: "http://www.w3.org/2000/09/xmldsig#":XPath, http://www.w3.org/2001/XMLSchema,string */ + struct { + struct { + exi_string_character_t characters[v2gTransformType_XPath_CHARACTERS_SIZE]; + uint16_t charactersLen; + } array[v2gTransformType_XPath_ARRAY_SIZE]; + uint16_t arrayLen; + } XPath; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SASchedulesType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +struct v2gSASchedulesType { + int noContent; /* avoid warning */ +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentDetailsReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":eMAID,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain)', derivedBy='EXTENSION'. */ +#define v2gPaymentDetailsReqType_eMAID_CHARACTERS_SIZE 15 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,eMAIDType is 15 */ +struct v2gPaymentDetailsReqType { + /* element: "urn:iso:15118:2:2013:MsgBody":eMAID, urn:iso:15118:2:2013:MsgDataTypes,eMAIDType */ + struct { + exi_string_character_t characters[v2gPaymentDetailsReqType_eMAID_CHARACTERS_SIZE]; + uint16_t charactersLen; + } eMAID ; + /* element: "urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate,"urn:iso:15118:2:2013:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ + struct v2gCertificateChainType ContractSignatureCertChain ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EVReady,"urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ +struct v2gDC_EVStatusType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVReady, http://www.w3.org/2001/XMLSchema,boolean */ + int EVReady ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode, urn:iso:15118:2:2013:MsgDataTypes,DC_EVErrorCodeType */ + v2gDC_EVErrorCodeType EVErrorCode ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC, urn:iso:15118:2:2013:MsgDataTypes,percentValueType */ + int8_t EVRESSSOC ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,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'. */ +struct v2gPaymentServiceSelectionResType { + /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ + v2gresponseCodeType ResponseCode ; +}; + typedef enum { - EVSEProcessingType_Finished = 0, - EVSEProcessingType_Ongoing = 1, - EVSEProcessingType_Ongoing_WaitingForCustomerInteraction = 2 -} v2gEVSEProcessingType; + serviceCategoryType_EVCharging = 0, + serviceCategoryType_Internet = 1, + serviceCategoryType_ContractCertificate = 2, + serviceCategoryType_OtherCustom = 3 +} v2gserviceCategoryType; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ +#define v2gObjectType_Id_CHARACTERS_SIZE 50 +#define v2gObjectType_MimeType_CHARACTERS_SIZE 50 +#define v2gObjectType_Encoding_CHARACTERS_SIZE 50 +struct v2gObjectType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[v2gObjectType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* attribute: MimeType {http://www.w3.org/2001/XMLSchema,string} */ + struct { + exi_string_character_t characters[v2gObjectType_MimeType_CHARACTERS_SIZE]; + uint16_t charactersLen; + } MimeType ; + unsigned int MimeType_isUsed:1; + /* attribute: Encoding {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[v2gObjectType_Encoding_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Encoding ; + unsigned int Encoding_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PaymentOptionListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":PaymentOption{1-2})', derivedBy='RESTRICTION'. */ +#define v2gPaymentOptionListType_PaymentOption_ARRAY_SIZE 2 +struct v2gPaymentOptionListType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":PaymentOption, urn:iso:15118:2:2013:MsgDataTypes,paymentOptionType */ + struct { + v2gpaymentOptionType array[v2gPaymentOptionListType_PaymentOption_ARRAY_SIZE]; + uint16_t arrayLen; + } PaymentOption; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1}),("urn:iso:15118:2:2013:MsgDataTypes":EAmount,"urn:iso:15118:2:2013:MsgDataTypes":EVMaxVoltage,"urn:iso:15118:2:2013:MsgDataTypes":EVMaxCurrent,"urn:iso:15118:2:2013:MsgDataTypes":EVMinCurrent))', derivedBy='EXTENSION'. */ +struct v2gAC_EVChargeParameterType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":DepartureTime, http://www.w3.org/2001/XMLSchema,unsignedInt */ + uint32_t DepartureTime ; + unsigned int DepartureTime_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EAmount, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EAmount ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVMaxVoltage, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVMaxVoltage ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVMaxCurrent, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVMaxCurrent ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVMinCurrent, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVMinCurrent ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ListOfRootCertificateIDsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":RootCertificateID{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define v2gListOfRootCertificateIDsType_RootCertificateID_ARRAY_SIZE 5 +struct v2gListOfRootCertificateIDsType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":RootCertificateID, Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ + struct { + struct v2gX509IssuerSerialType array[v2gListOfRootCertificateIDsType_RootCertificateID_ARRAY_SIZE]; + uint16_t arrayLen; + } RootCertificateID; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2013:MsgDataTypes":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FreeService)', derivedBy='RESTRICTION'. */ +#define v2gServiceType_ServiceName_CHARACTERS_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,serviceNameType is 32 */ +#define v2gServiceType_ServiceScope_CHARACTERS_SIZE 64 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,serviceScopeType is 64 */ +struct v2gServiceType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":ServiceID, urn:iso:15118:2:2013:MsgDataTypes,serviceIDType */ + uint16_t ServiceID ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":ServiceName, urn:iso:15118:2:2013:MsgDataTypes,serviceNameType */ + struct { + exi_string_character_t characters[v2gServiceType_ServiceName_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ServiceName ; + unsigned int ServiceName_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory, urn:iso:15118:2:2013:MsgDataTypes,serviceCategoryType */ + v2gserviceCategoryType ServiceCategory ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":ServiceScope, urn:iso:15118:2:2013:MsgDataTypes,serviceScopeType */ + struct { + exi_string_character_t characters[v2gServiceType_ServiceScope_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ServiceScope ; + unsigned int ServiceScope_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":FreeService, http://www.w3.org/2001/XMLSchema,boolean */ + int FreeService ; +}; /* Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ #define v2gDSAKeyValueType_P_BYTES_SIZE 350 @@ -618,35 +699,103 @@ struct v2gDSAKeyValueType { unsigned int PgenCounter_isUsed:1; }; -typedef enum { - DC_EVSEStatusCodeType_EVSE_NotReady = 0, - DC_EVSEStatusCodeType_EVSE_Ready = 1, - DC_EVSEStatusCodeType_EVSE_Shutdown = 2, - DC_EVSEStatusCodeType_EVSE_UtilityInterruptEvent = 3, - DC_EVSEStatusCodeType_EVSE_IsolationMonitoringActive = 4, - DC_EVSEStatusCodeType_EVSE_EmergencyShutdown = 5, - DC_EVSEStatusCodeType_EVSE_Malfunction = 6, - DC_EVSEStatusCodeType_Reserved_8 = 7, - DC_EVSEStatusCodeType_Reserved_9 = 8, - DC_EVSEStatusCodeType_Reserved_A = 9, - DC_EVSEStatusCodeType_Reserved_B = 10, - DC_EVSEStatusCodeType_Reserved_C = 11 -} v2gDC_EVSEStatusCodeType; +/* 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'. */ +#define v2gParameterType_Name_CHARACTERS_SIZE 50 +#define v2gParameterType_stringValue_CHARACTERS_SIZE 50 +struct v2gParameterType { + /* attribute: Name {http://www.w3.org/2001/XMLSchema,string} */ + struct { + exi_string_character_t characters[v2gParameterType_Name_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Name ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":boolValue, http://www.w3.org/2001/XMLSchema,boolean */ + int boolValue ; + unsigned int boolValue_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":byteValue, http://www.w3.org/2001/XMLSchema,byte */ + int8_t byteValue ; + unsigned int byteValue_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":shortValue, http://www.w3.org/2001/XMLSchema,short */ + int16_t shortValue ; + unsigned int shortValue_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":intValue, http://www.w3.org/2001/XMLSchema,int */ + int32_t intValue ; + unsigned int intValue_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":physicalValue, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType physicalValue ; + unsigned int physicalValue_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":stringValue, http://www.w3.org/2001/XMLSchema,string */ + struct { + exi_string_character_t characters[v2gParameterType_stringValue_CHARACTERS_SIZE]; + uint16_t charactersLen; + } stringValue ; + unsigned int stringValue_isUsed:1; +}; -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EMAIDType', base type name='eMAIDType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -#define v2gEMAIDType_Id_CHARACTERS_SIZE 50 -#define v2gEMAIDType_CONTENT_CHARACTERS_SIZE 50 -struct v2gEMAIDType { +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVChargeParameterType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1})', derivedBy='RESTRICTION'. */ +struct v2gEVChargeParameterType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":DepartureTime, http://www.w3.org/2001/XMLSchema,unsignedInt */ + uint32_t DepartureTime ; + unsigned int DepartureTime_isUsed:1; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +#define v2gSignaturePropertyType_Target_CHARACTERS_SIZE 50 +#define v2gSignaturePropertyType_Id_CHARACTERS_SIZE 50 +struct v2gSignaturePropertyType { + /* attribute: Target {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[v2gSignaturePropertyType_Target_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Target ; /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ struct { - exi_string_character_t characters[v2gEMAIDType_Id_CHARACTERS_SIZE]; + exi_string_character_t characters[v2gSignaturePropertyType_Id_CHARACTERS_SIZE]; uint16_t charactersLen; } Id ; - /* simple content: urn:iso:15118:2:2013:MsgDataTypes,eMAIDType */ + unsigned int Id_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ProfileEntryType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryStart,"urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxPower,"urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxNumberOfPhasesInUse{0-1})', derivedBy='RESTRICTION'. */ +struct v2gProfileEntryType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryStart, http://www.w3.org/2001/XMLSchema,unsignedInt */ + uint32_t ChargingProfileEntryStart ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxPower, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType ChargingProfileEntryMaxPower ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxNumberOfPhasesInUse, urn:iso:15118:2:2013:MsgDataTypes,maxNumPhasesType */ + int8_t ChargingProfileEntryMaxNumberOfPhasesInUse ; + unsigned int ChargingProfileEntryMaxNumberOfPhasesInUse_isUsed:1; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyValueType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":DSAKeyValue|"http://www.w3.org/2000/09/xmldsig#":RSAKeyValue|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))', derivedBy='RESTRICTION'. */ +struct v2gKeyValueType { + /* element: "http://www.w3.org/2000/09/xmldsig#":DSAKeyValue, Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ + struct v2gDSAKeyValueType DSAKeyValue ; + unsigned int DSAKeyValue_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":RSAKeyValue, Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ + struct v2gRSAKeyValueType RSAKeyValue ; + unsigned int RSAKeyValue_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionStopReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ChargingSession)', derivedBy='EXTENSION'. */ +struct v2gSessionStopReqType { + /* element: "urn:iso:15118:2:2013:MsgBody":ChargingSession, urn:iso:15118:2:2013:MsgDataTypes,chargingSessionType */ + v2gchargingSessionType ChargingSession ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDetailReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ServiceID)', derivedBy='EXTENSION'. */ +struct v2gServiceDetailReqType { + /* element: "urn:iso:15118:2:2013:MsgBody":ServiceID, urn:iso:15118:2:2013:MsgDataTypes,serviceIDType */ + uint16_t ServiceID ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SelectedServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SelectedService{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define v2gSelectedServiceListType_SelectedService_ARRAY_SIZE 5 +struct v2gSelectedServiceListType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":SelectedService, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SelectedServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID{0-1})', derivedBy='RESTRICTION'. */ struct { - exi_string_character_t characters[v2gEMAIDType_CONTENT_CHARACTERS_SIZE]; - uint16_t charactersLen; - } CONTENT ; + struct v2gSelectedServiceType array[v2gSelectedServiceListType_SelectedService_ARRAY_SIZE]; + uint16_t arrayLen; + } SelectedService; }; /* 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'. */ @@ -675,82 +824,68 @@ struct v2gMeterInfoType { unsigned int TMeter_isUsed:1; }; -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -struct v2gIntervalType { - int noContent; /* avoid warning */ -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SASchedulesType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ -struct v2gSASchedulesType { - int noContent; /* avoid warning */ +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SPKIDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SPKISexp,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-1}){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +#define v2gSPKIDataType_SPKISexp_BYTES_SIZE 350 +#define v2gSPKIDataType_SPKISexp_ARRAY_SIZE 1 +struct v2gSPKIDataType { + /* element: "http://www.w3.org/2000/09/xmldsig#":SPKISexp, http://www.w3.org/2001/XMLSchema,base64Binary */ + struct { + struct { + uint8_t bytes[v2gSPKIDataType_SPKISexp_BYTES_SIZE]; + uint16_t bytesLen; + } array[v2gSPKIDataType_SPKISexp_ARRAY_SIZE]; + uint16_t arrayLen; + } SPKISexp; }; typedef enum { - unitSymbolType_h = 0, - unitSymbolType_m = 1, - unitSymbolType_s = 2, - unitSymbolType_A = 3, - unitSymbolType_V = 4, - unitSymbolType_W = 5, - unitSymbolType_Wh = 6 -} v2gunitSymbolType; + costKindType_relativePricePercentage = 0, + costKindType_RenewableGenerationPercentage = 1, + costKindType_CarbonDioxideEmission = 2 +} v2gcostKindType; -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PaymentOptionListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":PaymentOption{1-2})', derivedBy='RESTRICTION'. */ -#define v2gPaymentOptionListType_PaymentOption_ARRAY_SIZE 2 -struct v2gPaymentOptionListType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":PaymentOption, urn:iso:15118:2:2013:MsgDataTypes,paymentOptionType */ +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define v2gTransformsType_Transform_ARRAY_SIZE 1 +struct v2gTransformsType { + /* element: "http://www.w3.org/2000/09/xmldsig#":Transform, Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])|"http://www.w3.org/2000/09/xmldsig#":XPath){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ struct { - v2gpaymentOptionType array[v2gPaymentOptionListType_PaymentOption_ARRAY_SIZE]; + struct v2gTransformType array[v2gTransformsType_Transform_ARRAY_SIZE]; uint16_t arrayLen; - } PaymentOption; + } Transform; }; -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertiesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignatureProperty{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define v2gSignaturePropertiesType_Id_CHARACTERS_SIZE 50 -#define v2gSignaturePropertiesType_SignatureProperty_ARRAY_SIZE 0 -struct v2gSignaturePropertiesType { - /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ - struct { - exi_string_character_t characters[v2gSignaturePropertiesType_Id_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Id ; - unsigned int Id_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":SignatureProperty, Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ - struct { - struct v2gSignaturePropertyType array[v2gSignaturePropertiesType_SignatureProperty_ARRAY_SIZE]; - uint16_t arrayLen; - } SignatureProperty; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionSetupReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":EVCCID)', derivedBy='EXTENSION'. */ -#define v2gSessionSetupReqType_EVCCID_BYTES_SIZE 6 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,evccIDType is 6 */ -struct v2gSessionSetupReqType { - /* element: "urn:iso:15118:2:2013:MsgBody":EVCCID, urn:iso:15118:2:2013:MsgDataTypes,evccIDType */ - struct { - uint8_t bytes[v2gSessionSetupReqType_EVCCID_BYTES_SIZE]; - uint16_t bytesLen; - } EVCCID ; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ListOfRootCertificateIDsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":RootCertificateID{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define v2gListOfRootCertificateIDsType_RootCertificateID_ARRAY_SIZE 5 -struct v2gListOfRootCertificateIDsType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":RootCertificateID, Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ - struct { - struct v2gX509IssuerSerialType array[v2gListOfRootCertificateIDsType_RootCertificateID_ARRAY_SIZE]; - uint16_t arrayLen; - } RootCertificateID; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVPowerDeliveryParameterType', base type name='EVPowerDeliveryParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2013:MsgDataTypes":BulkChargingComplete{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ChargingComplete)', derivedBy='EXTENSION'. */ -struct v2gDC_EVPowerDeliveryParameterType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EVReady,"urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ +/* Complex type name='urn:iso:15118:2:2013:MsgBody,WeldingDetectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ +struct v2gWeldingDetectionReqType { + /* element: "urn:iso:15118:2:2013:MsgBody":DC_EVStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EVReady,"urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ struct v2gDC_EVStatusType DC_EVStatus ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":BulkChargingComplete, http://www.w3.org/2001/XMLSchema,boolean */ - int BulkChargingComplete ; - unsigned int BulkChargingComplete_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":ChargingComplete, http://www.w3.org/2001/XMLSchema,boolean */ - int ChargingComplete ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionSetupResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEID,"urn:iso:15118:2:2013:MsgBody":EVSETimeStamp{0-1})', derivedBy='EXTENSION'. */ +#define v2gSessionSetupResType_EVSEID_CHARACTERS_SIZE 37 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,evseIDType is 37 */ +struct v2gSessionSetupResType { + /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ + v2gresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2013:MsgBody":EVSEID, urn:iso:15118:2:2013:MsgDataTypes,evseIDType */ + struct { + exi_string_character_t characters[v2gSessionSetupResType_EVSEID_CHARACTERS_SIZE]; + uint16_t charactersLen; + } EVSEID ; + /* element: "urn:iso:15118:2:2013:MsgBody":EVSETimeStamp, http://www.w3.org/2001/XMLSchema,long */ + int64_t EVSETimeStamp ; + unsigned int EVSETimeStamp_isUsed:1; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define v2gSignatureMethodType_Algorithm_CHARACTERS_SIZE 50 +struct v2gSignatureMethodType { + /* attribute: Algorithm {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[v2gSignatureMethodType_Algorithm_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Algorithm ; + /* element: "http://www.w3.org/2000/09/xmldsig#":HMACOutputLength, http://www.w3.org/2000/09/xmldsig#,HMACOutputLengthType */ + int64_t HMACOutputLength ; + unsigned int HMACOutputLength_isUsed:1; }; /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,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'. */ @@ -762,293 +897,11 @@ struct v2gRelativeTimeIntervalType { unsigned int duration_isUsed:1; }; -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateUpdateResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":SAProvisioningCertificateChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2013:MsgBody":DHpublickey,"urn:iso:15118:2:2013:MsgBody":eMAID,"urn:iso:15118:2:2013:MsgBody":RetryCounter{0-1})', derivedBy='EXTENSION'. */ -struct v2gCertificateUpdateResType { - /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ - v2gresponseCodeType ResponseCode ; - /* element: "urn:iso:15118:2:2013:MsgBody":SAProvisioningCertificateChain, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate,"urn:iso:15118:2:2013:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ - struct v2gCertificateChainType SAProvisioningCertificateChain ; - /* element: "urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate,"urn:iso:15118:2:2013:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ - struct v2gCertificateChainType ContractSignatureCertChain ; - /* element: "urn:iso:15118:2:2013:MsgBody":ContractSignatureEncryptedPrivateKey, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ContractSignatureEncryptedPrivateKeyType', base type name='privateKeyType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ - struct v2gContractSignatureEncryptedPrivateKeyType ContractSignatureEncryptedPrivateKey ; - /* element: "urn:iso:15118:2:2013:MsgBody":DHpublickey, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DiffieHellmanPublickeyType', base type name='dHpublickeyType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ - struct v2gDiffieHellmanPublickeyType DHpublickey ; - /* element: "urn:iso:15118:2:2013:MsgBody":eMAID, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EMAIDType', base type name='eMAIDType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ - struct v2gEMAIDType eMAID ; - /* element: "urn:iso:15118:2:2013:MsgBody":RetryCounter, http://www.w3.org/2001/XMLSchema,short */ - int16_t RetryCounter ; - unsigned int RetryCounter_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,MeteringReceiptReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":SessionID,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID{0-1},"urn:iso:15118:2:2013:MsgBody":MeterInfo)', derivedBy='EXTENSION'. */ -#define v2gMeteringReceiptReqType_Id_CHARACTERS_SIZE 50 -#define v2gMeteringReceiptReqType_SessionID_BYTES_SIZE 8 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,sessionIDType is 8 */ -struct v2gMeteringReceiptReqType { - /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ - struct { - exi_string_character_t characters[v2gMeteringReceiptReqType_Id_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Id ; - unsigned int Id_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgBody":SessionID, urn:iso:15118:2:2013:MsgDataTypes,sessionIDType */ - struct { - uint8_t bytes[v2gMeteringReceiptReqType_SessionID_BYTES_SIZE]; - uint16_t bytesLen; - } SessionID ; - /* element: "urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID, urn:iso:15118:2:2013:MsgDataTypes,SAIDType */ - uint8_t SAScheduleTupleID ; - unsigned int SAScheduleTupleID_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgBody":MeterInfo, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,MeterInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":MeterID,"urn:iso:15118:2:2013:MsgDataTypes":MeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":SigMeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":MeterStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":TMeter{0-1})', derivedBy='RESTRICTION'. */ - struct v2gMeterInfoType MeterInfo ; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2013:MsgDataTypes":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FreeService)', derivedBy='RESTRICTION'. */ -#define v2gServiceType_ServiceName_CHARACTERS_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,serviceNameType is 32 */ -#define v2gServiceType_ServiceScope_CHARACTERS_SIZE 64 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,serviceScopeType is 64 */ -struct v2gServiceType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":ServiceID, urn:iso:15118:2:2013:MsgDataTypes,serviceIDType */ - uint16_t ServiceID ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":ServiceName, urn:iso:15118:2:2013:MsgDataTypes,serviceNameType */ - struct { - exi_string_character_t characters[v2gServiceType_ServiceName_CHARACTERS_SIZE]; - uint16_t charactersLen; - } ServiceName ; - unsigned int ServiceName_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory, urn:iso:15118:2:2013:MsgDataTypes,serviceCategoryType */ - v2gserviceCategoryType ServiceCategory ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":ServiceScope, urn:iso:15118:2:2013:MsgDataTypes,serviceScopeType */ - struct { - exi_string_character_t characters[v2gServiceType_ServiceScope_CHARACTERS_SIZE]; - uint16_t charactersLen; - } ServiceScope ; - unsigned int ServiceScope_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":FreeService, http://www.w3.org/2001/XMLSchema,boolean */ - int FreeService ; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,NotificationType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":FaultCode,"urn:iso:15118:2:2013:MsgDataTypes":FaultMsg{0-1})', derivedBy='RESTRICTION'. */ -#define v2gNotificationType_FaultMsg_CHARACTERS_SIZE 64 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,faultMsgType is 64 */ -struct v2gNotificationType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":FaultCode, urn:iso:15118:2:2013:MsgDataTypes,faultCodeType */ - v2gfaultCodeType FaultCode ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":FaultMsg, urn:iso:15118:2:2013:MsgDataTypes,faultMsgType */ - struct { - exi_string_character_t characters[v2gNotificationType_FaultMsg_CHARACTERS_SIZE]; - uint16_t charactersLen; - } FaultMsg ; - unsigned int FaultMsg_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SelectedServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SelectedService{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define v2gSelectedServiceListType_SelectedService_ARRAY_SIZE 5 -struct v2gSelectedServiceListType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":SelectedService, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SelectedServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID{0-1})', derivedBy='RESTRICTION'. */ - struct { - struct v2gSelectedServiceType array[v2gSelectedServiceListType_SelectedService_ARRAY_SIZE]; - uint16_t arrayLen; - } SelectedService; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ -#define v2gObjectType_Id_CHARACTERS_SIZE 50 -#define v2gObjectType_MimeType_CHARACTERS_SIZE 50 -#define v2gObjectType_Encoding_CHARACTERS_SIZE 50 -struct v2gObjectType { - /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ - struct { - exi_string_character_t characters[v2gObjectType_Id_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Id ; - unsigned int Id_isUsed:1; - /* attribute: MimeType {http://www.w3.org/2001/XMLSchema,string} */ - struct { - exi_string_character_t characters[v2gObjectType_MimeType_CHARACTERS_SIZE]; - uint16_t charactersLen; - } MimeType ; - unsigned int MimeType_isUsed:1; - /* attribute: Encoding {http://www.w3.org/2001/XMLSchema,anyURI} */ - struct { - exi_string_character_t characters[v2gObjectType_Encoding_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Encoding ; - unsigned int Encoding_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,AuthorizationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ -struct v2gAuthorizationResType { - /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ - v2gresponseCodeType ResponseCode ; - /* element: "urn:iso:15118:2:2013:MsgBody":EVSEProcessing, urn:iso:15118:2:2013:MsgDataTypes,EVSEProcessingType */ - v2gEVSEProcessingType EVSEProcessing ; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVSEStatusType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification)', derivedBy='RESTRICTION'. */ -struct v2gEVSEStatusType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay, http://www.w3.org/2001/XMLSchema,unsignedShort */ - uint16_t NotificationMaxDelay ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSENotification, urn:iso:15118:2:2013:MsgDataTypes,EVSENotificationType */ - v2gEVSENotificationType EVSENotification ; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentServiceSelectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":SelectedPaymentOption,"urn:iso:15118:2:2013:MsgBody":SelectedServiceList)', derivedBy='EXTENSION'. */ -struct v2gPaymentServiceSelectionReqType { - /* element: "urn:iso:15118:2:2013:MsgBody":SelectedPaymentOption, urn:iso:15118:2:2013:MsgDataTypes,paymentOptionType */ - v2gpaymentOptionType SelectedPaymentOption ; - /* element: "urn:iso:15118:2:2013:MsgBody":SelectedServiceList, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SelectedServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SelectedService{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct v2gSelectedServiceListType SelectedServiceList ; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EntryType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval)', derivedBy='RESTRICTION'. */ -struct v2gEntryType { - union { /* substitutionGroup */ - /* element: "urn:iso:15118:2:2013:MsgDataTypes":TimeInterval, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ - struct v2gIntervalType TimeInterval ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":RelativeTimeInterval, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":start,"urn:iso:15118:2:2013:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ - struct v2gRelativeTimeIntervalType RelativeTimeInterval ; - }; /* union */ - unsigned int TimeInterval_isUsed:1; - unsigned int RelativeTimeInterval_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":costKind,"urn:iso:15118:2:2013:MsgDataTypes":amount,"urn:iso:15118:2:2013:MsgDataTypes":amountMultiplier{0-1})', derivedBy='RESTRICTION'. */ -struct v2gCostType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":costKind, urn:iso:15118:2:2013:MsgDataTypes,costKindType */ - v2gcostKindType costKind ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":amount, http://www.w3.org/2001/XMLSchema,unsignedInt */ - uint32_t amount ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":amountMultiplier, urn:iso:15118:2:2013:MsgDataTypes,unitMultiplierType */ - int8_t amountMultiplier ; - unsigned int amountMultiplier_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ChargeServiceType', base type name='ServiceType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2013:MsgDataTypes":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FreeService),("urn:iso:15118:2:2013:MsgDataTypes":SupportedEnergyTransferMode))', derivedBy='EXTENSION'. */ -#define v2gChargeServiceType_ServiceName_CHARACTERS_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,serviceNameType is 32 */ -#define v2gChargeServiceType_ServiceScope_CHARACTERS_SIZE 64 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,serviceScopeType is 64 */ -struct v2gChargeServiceType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":ServiceID, urn:iso:15118:2:2013:MsgDataTypes,serviceIDType */ - uint16_t ServiceID ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":ServiceName, urn:iso:15118:2:2013:MsgDataTypes,serviceNameType */ - struct { - exi_string_character_t characters[v2gChargeServiceType_ServiceName_CHARACTERS_SIZE]; - uint16_t charactersLen; - } ServiceName ; - unsigned int ServiceName_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory, urn:iso:15118:2:2013:MsgDataTypes,serviceCategoryType */ - v2gserviceCategoryType ServiceCategory ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":ServiceScope, urn:iso:15118:2:2013:MsgDataTypes,serviceScopeType */ - struct { - exi_string_character_t characters[v2gChargeServiceType_ServiceScope_CHARACTERS_SIZE]; - uint16_t charactersLen; - } ServiceScope ; - unsigned int ServiceScope_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":FreeService, http://www.w3.org/2001/XMLSchema,boolean */ - int FreeService ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":SupportedEnergyTransferMode, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SupportedEnergyTransferModeType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EnergyTransferMode{1-6})', derivedBy='RESTRICTION'. */ - struct v2gSupportedEnergyTransferModeType SupportedEnergyTransferMode ; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Service{1-8})', derivedBy='RESTRICTION'. */ -#define v2gServiceListType_Service_ARRAY_SIZE 5 -struct v2gServiceListType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":Service, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2013:MsgDataTypes":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FreeService)', derivedBy='RESTRICTION'. */ - struct { - struct v2gServiceType array[v2gServiceListType_Service_ARRAY_SIZE]; - uint16_t arrayLen; - } Service; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyValueType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":DSAKeyValue|"http://www.w3.org/2000/09/xmldsig#":RSAKeyValue|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))', derivedBy='RESTRICTION'. */ -struct v2gKeyValueType { - /* element: "http://www.w3.org/2000/09/xmldsig#":DSAKeyValue, Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ - struct v2gDSAKeyValueType DSAKeyValue ; - unsigned int DSAKeyValue_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":RSAKeyValue, Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ - struct v2gRSAKeyValueType RSAKeyValue ; - unsigned int RSAKeyValue_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateInstallationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":OEMProvisioningCert,"urn:iso:15118:2:2013:MsgBody":ListOfRootCertificateIDs)', derivedBy='EXTENSION'. */ -#define v2gCertificateInstallationReqType_Id_CHARACTERS_SIZE 50 -#define v2gCertificateInstallationReqType_OEMProvisioningCert_BYTES_SIZE 800 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,certificateType is 800 */ -struct v2gCertificateInstallationReqType { - /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ - struct { - exi_string_character_t characters[v2gCertificateInstallationReqType_Id_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Id ; - /* element: "urn:iso:15118:2:2013:MsgBody":OEMProvisioningCert, urn:iso:15118:2:2013:MsgDataTypes,certificateType */ - struct { - uint8_t bytes[v2gCertificateInstallationReqType_OEMProvisioningCert_BYTES_SIZE]; - uint16_t bytesLen; - } OEMProvisioningCert ; - /* element: "urn:iso:15118:2:2013:MsgBody":ListOfRootCertificateIDs, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ListOfRootCertificateIDsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":RootCertificateID{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct v2gListOfRootCertificateIDsType ListOfRootCertificateIDs ; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CableCheckReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ -struct v2gCableCheckReqType { - /* element: "urn:iso:15118:2:2013:MsgBody":DC_EVStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EVReady,"urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ - struct v2gDC_EVStatusType DC_EVStatus ; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,WeldingDetectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ -struct v2gWeldingDetectionReqType { - /* element: "urn:iso:15118:2:2013:MsgBody":DC_EVStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EVReady,"urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ - struct v2gDC_EVStatusType DC_EVStatus ; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentDetailsReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":eMAID,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain)', derivedBy='EXTENSION'. */ -#define v2gPaymentDetailsReqType_eMAID_CHARACTERS_SIZE 15 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,eMAIDType is 15 */ -struct v2gPaymentDetailsReqType { - /* element: "urn:iso:15118:2:2013:MsgBody":eMAID, urn:iso:15118:2:2013:MsgDataTypes,eMAIDType */ - struct { - exi_string_character_t characters[v2gPaymentDetailsReqType_eMAID_CHARACTERS_SIZE]; - uint16_t charactersLen; - } eMAID ; - /* element: "urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate,"urn:iso:15118:2:2013:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ - struct v2gCertificateChainType ContractSignatureCertChain ; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define v2gTransformsType_Transform_ARRAY_SIZE 0 -struct v2gTransformsType { - /* element: "http://www.w3.org/2000/09/xmldsig#":Transform, Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])|"http://www.w3.org/2000/09/xmldsig#":XPath){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ - struct { - struct v2gTransformType array[v2gTransformsType_Transform_ARRAY_SIZE]; - uint16_t arrayLen; - } Transform; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgBody":ServiceCategory{0-1})', derivedBy='EXTENSION'. */ -#define v2gServiceDiscoveryReqType_ServiceScope_CHARACTERS_SIZE 64 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,serviceScopeType is 64 */ -struct v2gServiceDiscoveryReqType { - /* element: "urn:iso:15118:2:2013:MsgBody":ServiceScope, urn:iso:15118:2:2013:MsgDataTypes,serviceScopeType */ - struct { - exi_string_character_t characters[v2gServiceDiscoveryReqType_ServiceScope_CHARACTERS_SIZE]; - uint16_t charactersLen; - } ServiceScope ; - unsigned int ServiceScope_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgBody":ServiceCategory, urn:iso:15118:2:2013:MsgDataTypes,serviceCategoryType */ - v2gserviceCategoryType ServiceCategory ; - unsigned int ServiceCategory_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ -struct v2gPhysicalValueType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":Multiplier, urn:iso:15118:2:2013:MsgDataTypes,unitMultiplierType */ - int8_t Multiplier ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":Unit, urn:iso:15118:2:2013:MsgDataTypes,unitSymbolType */ - v2gunitSymbolType Unit ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":Value, http://www.w3.org/2001/XMLSchema,short */ - int16_t Value ; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,SessionStopReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ChargingSession)', derivedBy='EXTENSION'. */ -struct v2gSessionStopReqType { - /* element: "urn:iso:15118:2:2013:MsgBody":ChargingSession, urn:iso:15118:2:2013:MsgDataTypes,chargingSessionType */ - v2gchargingSessionType ChargingSession ; -}; +typedef enum { + EVSENotificationType_None = 0, + EVSENotificationType_StopCharging = 1, + EVSENotificationType_ReNegotiation = 2 +} v2gEVSENotificationType; /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatusCode))', derivedBy='EXTENSION'. */ struct v2gDC_EVSEStatusType { @@ -1063,54 +916,6 @@ struct v2gDC_EVSEStatusType { v2gDC_EVSEStatusCodeType EVSEStatusCode ; }; -/* 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'. */ -#define v2gCertificateUpdateReqType_Id_CHARACTERS_SIZE 50 -#define v2gCertificateUpdateReqType_eMAID_CHARACTERS_SIZE 15 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,eMAIDType is 15 */ -struct v2gCertificateUpdateReqType { - /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ - struct { - exi_string_character_t characters[v2gCertificateUpdateReqType_Id_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Id ; - /* element: "urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate,"urn:iso:15118:2:2013:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ - struct v2gCertificateChainType ContractSignatureCertChain ; - /* element: "urn:iso:15118:2:2013:MsgBody":eMAID, urn:iso:15118:2:2013:MsgDataTypes,eMAIDType */ - struct { - exi_string_character_t characters[v2gCertificateUpdateReqType_eMAID_CHARACTERS_SIZE]; - uint16_t charactersLen; - } eMAID ; - /* element: "urn:iso:15118:2:2013:MsgBody":ListOfRootCertificateIDs, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ListOfRootCertificateIDsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":RootCertificateID{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct v2gListOfRootCertificateIDsType ListOfRootCertificateIDs ; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1}),("urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVEnergyCapacity{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVEnergyRequest{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FullSOC{0-1},"urn:iso:15118:2:2013:MsgDataTypes":BulkSOC{0-1}))', derivedBy='EXTENSION'. */ -struct v2gDC_EVChargeParameterType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":DepartureTime, http://www.w3.org/2001/XMLSchema,unsignedInt */ - uint32_t DepartureTime ; - unsigned int DepartureTime_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EVReady,"urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ - struct v2gDC_EVStatusType DC_EVStatus ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVMaximumCurrentLimit, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVMaximumCurrentLimit ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVMaximumPowerLimit, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVMaximumPowerLimit ; - unsigned int EVMaximumPowerLimit_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVMaximumVoltageLimit, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVMaximumVoltageLimit ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVEnergyCapacity, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVEnergyCapacity ; - unsigned int EVEnergyCapacity_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVEnergyRequest, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVEnergyRequest ; - unsigned int EVEnergyRequest_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":FullSOC, urn:iso:15118:2:2013:MsgDataTypes,percentValueType */ - int8_t FullSOC ; - unsigned int FullSOC_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":BulkSOC, urn:iso:15118:2:2013:MsgDataTypes,percentValueType */ - int8_t BulkSOC ; - unsigned int BulkSOC_isUsed:1; -}; - /* Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ #define v2gReferenceType_Id_CHARACTERS_SIZE 50 #define v2gReferenceType_URI_CHARACTERS_SIZE 50 @@ -1147,73 +952,144 @@ struct v2gReferenceType { } DigestValue ; }; -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CurrentDemandResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage,"urn:iso:15118:2:2013:MsgBody":EVSEPresentCurrent,"urn:iso:15118:2:2013:MsgBody":EVSECurrentLimitAchieved,"urn:iso:15118:2:2013:MsgBody":EVSEVoltageLimitAchieved,"urn:iso:15118:2:2013:MsgBody":EVSEPowerLimitAchieved,"urn:iso:15118:2:2013:MsgBody":EVSEMaximumVoltageLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVSEMaximumCurrentLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVSEMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVSEID,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":MeterInfo{0-1},"urn:iso:15118:2:2013:MsgBody":ReceiptRequired{0-1})', derivedBy='EXTENSION'. */ -#define v2gCurrentDemandResType_EVSEID_CHARACTERS_SIZE 37 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,evseIDType is 37 */ -struct v2gCurrentDemandResType { +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +struct v2gIntervalType { + int noContent; /* avoid warning */ +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateUpdateResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":SAProvisioningCertificateChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2013:MsgBody":DHpublickey,"urn:iso:15118:2:2013:MsgBody":eMAID,"urn:iso:15118:2:2013:MsgBody":RetryCounter{0-1})', derivedBy='EXTENSION'. */ +struct v2gCertificateUpdateResType { + /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ + v2gresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2013:MsgBody":SAProvisioningCertificateChain, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate,"urn:iso:15118:2:2013:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ + struct v2gCertificateChainType SAProvisioningCertificateChain ; + /* element: "urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate,"urn:iso:15118:2:2013:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ + struct v2gCertificateChainType ContractSignatureCertChain ; + /* element: "urn:iso:15118:2:2013:MsgBody":ContractSignatureEncryptedPrivateKey, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ContractSignatureEncryptedPrivateKeyType', base type name='privateKeyType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ + struct v2gContractSignatureEncryptedPrivateKeyType ContractSignatureEncryptedPrivateKey ; + /* element: "urn:iso:15118:2:2013:MsgBody":DHpublickey, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DiffieHellmanPublickeyType', base type name='dHpublickeyType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ + struct v2gDiffieHellmanPublickeyType DHpublickey ; + /* element: "urn:iso:15118:2:2013:MsgBody":eMAID, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EMAIDType', base type name='eMAIDType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ + struct v2gEMAIDType eMAID ; + /* element: "urn:iso:15118:2:2013:MsgBody":RetryCounter, http://www.w3.org/2001/XMLSchema,short */ + int16_t RetryCounter ; + unsigned int RetryCounter_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,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'. */ +#define v2gCertificateUpdateReqType_Id_CHARACTERS_SIZE 50 +#define v2gCertificateUpdateReqType_eMAID_CHARACTERS_SIZE 15 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,eMAIDType is 15 */ +struct v2gCertificateUpdateReqType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[v2gCertificateUpdateReqType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + /* element: "urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Certificate,"urn:iso:15118:2:2013:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ + struct v2gCertificateChainType ContractSignatureCertChain ; + /* element: "urn:iso:15118:2:2013:MsgBody":eMAID, urn:iso:15118:2:2013:MsgDataTypes,eMAIDType */ + struct { + exi_string_character_t characters[v2gCertificateUpdateReqType_eMAID_CHARACTERS_SIZE]; + uint16_t charactersLen; + } eMAID ; + /* element: "urn:iso:15118:2:2013:MsgBody":ListOfRootCertificateIDs, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ListOfRootCertificateIDsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":RootCertificateID{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct v2gListOfRootCertificateIDsType ListOfRootCertificateIDs ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,WeldingDetectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ +struct v2gWeldingDetectionResType { /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ v2gresponseCodeType ResponseCode ; /* element: "urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatusCode))', derivedBy='EXTENSION'. */ struct v2gDC_EVSEStatusType DC_EVSEStatus ; /* element: "urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ struct v2gPhysicalValueType EVSEPresentVoltage ; - /* element: "urn:iso:15118:2:2013:MsgBody":EVSEPresentCurrent, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVSEPresentCurrent ; - /* element: "urn:iso:15118:2:2013:MsgBody":EVSECurrentLimitAchieved, http://www.w3.org/2001/XMLSchema,boolean */ - int EVSECurrentLimitAchieved ; - /* element: "urn:iso:15118:2:2013:MsgBody":EVSEVoltageLimitAchieved, http://www.w3.org/2001/XMLSchema,boolean */ - int EVSEVoltageLimitAchieved ; - /* element: "urn:iso:15118:2:2013:MsgBody":EVSEPowerLimitAchieved, http://www.w3.org/2001/XMLSchema,boolean */ - int EVSEPowerLimitAchieved ; - /* element: "urn:iso:15118:2:2013:MsgBody":EVSEMaximumVoltageLimit, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVSEMaximumVoltageLimit ; - unsigned int EVSEMaximumVoltageLimit_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgBody":EVSEMaximumCurrentLimit, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVSEMaximumCurrentLimit ; - unsigned int EVSEMaximumCurrentLimit_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgBody":EVSEMaximumPowerLimit, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVSEMaximumPowerLimit ; - unsigned int EVSEMaximumPowerLimit_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgBody":EVSEID, urn:iso:15118:2:2013:MsgDataTypes,evseIDType */ +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":costKind,"urn:iso:15118:2:2013:MsgDataTypes":amount,"urn:iso:15118:2:2013:MsgDataTypes":amountMultiplier{0-1})', derivedBy='RESTRICTION'. */ +struct v2gCostType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":costKind, urn:iso:15118:2:2013:MsgDataTypes,costKindType */ + v2gcostKindType costKind ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":amount, http://www.w3.org/2001/XMLSchema,unsignedInt */ + uint32_t amount ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":amountMultiplier, urn:iso:15118:2:2013:MsgDataTypes,unitMultiplierType */ + int8_t amountMultiplier ; + unsigned int amountMultiplier_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateInstallationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":OEMProvisioningCert,"urn:iso:15118:2:2013:MsgBody":ListOfRootCertificateIDs)', derivedBy='EXTENSION'. */ +#define v2gCertificateInstallationReqType_Id_CHARACTERS_SIZE 50 +#define v2gCertificateInstallationReqType_OEMProvisioningCert_BYTES_SIZE 800 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,certificateType is 800 */ +struct v2gCertificateInstallationReqType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ struct { - exi_string_character_t characters[v2gCurrentDemandResType_EVSEID_CHARACTERS_SIZE]; + exi_string_character_t characters[v2gCertificateInstallationReqType_Id_CHARACTERS_SIZE]; uint16_t charactersLen; - } EVSEID ; - /* element: "urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID, urn:iso:15118:2:2013:MsgDataTypes,SAIDType */ - uint8_t SAScheduleTupleID ; - /* element: "urn:iso:15118:2:2013:MsgBody":MeterInfo, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,MeterInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":MeterID,"urn:iso:15118:2:2013:MsgDataTypes":MeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":SigMeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":MeterStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":TMeter{0-1})', derivedBy='RESTRICTION'. */ - struct v2gMeterInfoType MeterInfo ; - unsigned int MeterInfo_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgBody":ReceiptRequired, http://www.w3.org/2001/XMLSchema,boolean */ - int ReceiptRequired ; - unsigned int ReceiptRequired_isUsed:1; + } Id ; + /* element: "urn:iso:15118:2:2013:MsgBody":OEMProvisioningCert, urn:iso:15118:2:2013:MsgDataTypes,certificateType */ + struct { + uint8_t bytes[v2gCertificateInstallationReqType_OEMProvisioningCert_BYTES_SIZE]; + uint16_t bytesLen; + } OEMProvisioningCert ; + /* element: "urn:iso:15118:2:2013:MsgBody":ListOfRootCertificateIDs, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ListOfRootCertificateIDsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":RootCertificateID{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct v2gListOfRootCertificateIDsType ListOfRootCertificateIDs ; }; -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PowerDeliveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ -struct v2gPowerDeliveryResType { - /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ - v2gresponseCodeType ResponseCode ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVSEStatusType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification)', derivedBy='RESTRICTION'. */ - struct v2gEVSEStatusType EVSEStatus ; - unsigned int EVSEStatus_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":AC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":RCD))', derivedBy='EXTENSION'. */ - struct v2gAC_EVSEStatusType AC_EVSEStatus ; - unsigned int AC_EVSEStatus_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatusCode))', derivedBy='EXTENSION'. */ - struct v2gDC_EVSEStatusType DC_EVSEStatus ; - unsigned int DC_EVSEStatus_isUsed:1; +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EntryType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval)', derivedBy='RESTRICTION'. */ +struct v2gEntryType { + union { /* substitutionGroup */ + /* element: "urn:iso:15118:2:2013:MsgDataTypes":TimeInterval, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ + struct v2gIntervalType TimeInterval ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":RelativeTimeInterval, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":start,"urn:iso:15118:2:2013:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ + struct v2gRelativeTimeIntervalType RelativeTimeInterval ; + }; /* union */ + unsigned int TimeInterval_isUsed:1; + unsigned int RelativeTimeInterval_isUsed:1; }; -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":PaymentOptionList,"urn:iso:15118:2:2013:MsgBody":ChargeService,"urn:iso:15118:2:2013:MsgBody":ServiceList{0-1})', derivedBy='EXTENSION'. */ -struct v2gServiceDiscoveryResType { +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertiesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignatureProperty{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define v2gSignaturePropertiesType_Id_CHARACTERS_SIZE 50 +#define v2gSignaturePropertiesType_SignatureProperty_ARRAY_SIZE 1 +struct v2gSignaturePropertiesType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[v2gSignaturePropertiesType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":SignatureProperty, Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ + struct { + struct v2gSignaturePropertyType array[v2gSignaturePropertiesType_SignatureProperty_ARRAY_SIZE]; + uint16_t arrayLen; + } SignatureProperty; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PaymentServiceSelectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":SelectedPaymentOption,"urn:iso:15118:2:2013:MsgBody":SelectedServiceList)', derivedBy='EXTENSION'. */ +struct v2gPaymentServiceSelectionReqType { + /* element: "urn:iso:15118:2:2013:MsgBody":SelectedPaymentOption, urn:iso:15118:2:2013:MsgDataTypes,paymentOptionType */ + v2gpaymentOptionType SelectedPaymentOption ; + /* element: "urn:iso:15118:2:2013:MsgBody":SelectedServiceList, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SelectedServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SelectedService{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct v2gSelectedServiceListType SelectedServiceList ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,AuthorizationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ +struct v2gAuthorizationResType { /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ v2gresponseCodeType ResponseCode ; - /* element: "urn:iso:15118:2:2013:MsgBody":PaymentOptionList, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PaymentOptionListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":PaymentOption{1-2})', derivedBy='RESTRICTION'. */ - struct v2gPaymentOptionListType PaymentOptionList ; - /* element: "urn:iso:15118:2:2013:MsgBody":ChargeService, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ChargeServiceType', base type name='ServiceType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2013:MsgDataTypes":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FreeService),("urn:iso:15118:2:2013:MsgDataTypes":SupportedEnergyTransferMode))', derivedBy='EXTENSION'. */ - struct v2gChargeServiceType ChargeService ; - /* element: "urn:iso:15118:2:2013:MsgBody":ServiceList, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Service{1-8})', derivedBy='RESTRICTION'. */ - struct v2gServiceListType ServiceList ; - unsigned int ServiceList_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgBody":EVSEProcessing, urn:iso:15118:2:2013:MsgDataTypes,EVSEProcessingType */ + v2gEVSEProcessingType EVSEProcessing ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ConsumptionCostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":startValue,"urn:iso:15118:2:2013:MsgDataTypes":Cost{1-3})', derivedBy='RESTRICTION'. */ +#define v2gConsumptionCostType_Cost_ARRAY_SIZE 3 +struct v2gConsumptionCostType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":startValue, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType startValue ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":Cost, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":costKind,"urn:iso:15118:2:2013:MsgDataTypes":amount,"urn:iso:15118:2:2013:MsgDataTypes":amountMultiplier{0-1})', derivedBy='RESTRICTION'. */ + struct { + struct v2gCostType array[v2gConsumptionCostType_Cost_ARRAY_SIZE]; + uint16_t arrayLen; + } Cost; }; /* 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'. */ @@ -1232,29 +1108,120 @@ struct v2gCertificateInstallationResType { struct v2gEMAIDType eMAID ; }; -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CableCheckResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ -struct v2gCableCheckResType { - /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ - v2gresponseCodeType ResponseCode ; - /* element: "urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatusCode))', derivedBy='EXTENSION'. */ - struct v2gDC_EVSEStatusType DC_EVSEStatus ; - /* element: "urn:iso:15118:2:2013:MsgBody":EVSEProcessing, urn:iso:15118:2:2013:MsgDataTypes,EVSEProcessingType */ - v2gEVSEProcessingType EVSEProcessing ; +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Service{1-8})', derivedBy='RESTRICTION'. */ +#define v2gServiceListType_Service_ARRAY_SIZE 5 +struct v2gServiceListType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":Service, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2013:MsgDataTypes":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FreeService)', derivedBy='RESTRICTION'. */ + struct { + struct v2gServiceType array[v2gServiceListType_Service_ARRAY_SIZE]; + uint16_t arrayLen; + } Service; }; -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1}),("urn:iso:15118:2:2013:MsgDataTypes":EAmount,"urn:iso:15118:2:2013:MsgDataTypes":EVMaxVoltage,"urn:iso:15118:2:2013:MsgDataTypes":EVMaxCurrent,"urn:iso:15118:2:2013:MsgDataTypes":EVMinCurrent))', derivedBy='EXTENSION'. */ -struct v2gAC_EVChargeParameterType { +/* Complex type name='urn:iso:15118:2:2013:MsgBody,MeteringReceiptReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":SessionID,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID{0-1},"urn:iso:15118:2:2013:MsgBody":MeterInfo)', derivedBy='EXTENSION'. */ +#define v2gMeteringReceiptReqType_Id_CHARACTERS_SIZE 50 +#define v2gMeteringReceiptReqType_SessionID_BYTES_SIZE 8 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,sessionIDType is 8 */ +struct v2gMeteringReceiptReqType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[v2gMeteringReceiptReqType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgBody":SessionID, urn:iso:15118:2:2013:MsgDataTypes,sessionIDType */ + struct { + uint8_t bytes[v2gMeteringReceiptReqType_SessionID_BYTES_SIZE]; + uint16_t bytesLen; + } SessionID ; + /* element: "urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID, urn:iso:15118:2:2013:MsgDataTypes,SAIDType */ + uint8_t SAScheduleTupleID ; + unsigned int SAScheduleTupleID_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgBody":MeterInfo, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,MeterInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":MeterID,"urn:iso:15118:2:2013:MsgDataTypes":MeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":SigMeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":MeterStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":TMeter{0-1})', derivedBy='RESTRICTION'. */ + struct v2gMeterInfoType MeterInfo ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVPowerDeliveryParameterType', base type name='EVPowerDeliveryParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2013:MsgDataTypes":BulkChargingComplete{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ChargingComplete)', derivedBy='EXTENSION'. */ +struct v2gDC_EVPowerDeliveryParameterType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EVReady,"urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ + struct v2gDC_EVStatusType DC_EVStatus ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":BulkChargingComplete, http://www.w3.org/2001/XMLSchema,boolean */ + int BulkChargingComplete ; + unsigned int BulkChargingComplete_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":ChargingComplete, http://www.w3.org/2001/XMLSchema,boolean */ + int ChargingComplete ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1}),("urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVEnergyCapacity{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVEnergyRequest{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FullSOC{0-1},"urn:iso:15118:2:2013:MsgDataTypes":BulkSOC{0-1}))', derivedBy='EXTENSION'. */ +struct v2gDC_EVChargeParameterType { /* element: "urn:iso:15118:2:2013:MsgDataTypes":DepartureTime, http://www.w3.org/2001/XMLSchema,unsignedInt */ uint32_t DepartureTime ; unsigned int DepartureTime_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EAmount, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EAmount ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVMaxVoltage, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVMaxVoltage ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVMaxCurrent, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVMaxCurrent ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVMinCurrent, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVMinCurrent ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EVReady,"urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ + struct v2gDC_EVStatusType DC_EVStatus ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVMaximumCurrentLimit, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVMaximumCurrentLimit ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVMaximumPowerLimit, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVMaximumPowerLimit ; + unsigned int EVMaximumPowerLimit_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVMaximumVoltageLimit, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVMaximumVoltageLimit ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVEnergyCapacity, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVEnergyCapacity ; + unsigned int EVEnergyCapacity_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVEnergyRequest, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVEnergyRequest ; + unsigned int EVEnergyRequest_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":FullSOC, urn:iso:15118:2:2013:MsgDataTypes,percentValueType */ + int8_t FullSOC ; + unsigned int FullSOC_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":BulkSOC, urn:iso:15118:2:2013:MsgDataTypes,percentValueType */ + int8_t BulkSOC ; + unsigned int BulkSOC_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgBody":ServiceCategory{0-1})', derivedBy='EXTENSION'. */ +#define v2gServiceDiscoveryReqType_ServiceScope_CHARACTERS_SIZE 64 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,serviceScopeType is 64 */ +struct v2gServiceDiscoveryReqType { + /* element: "urn:iso:15118:2:2013:MsgBody":ServiceScope, urn:iso:15118:2:2013:MsgDataTypes,serviceScopeType */ + struct { + exi_string_character_t characters[v2gServiceDiscoveryReqType_ServiceScope_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ServiceScope ; + unsigned int ServiceScope_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgBody":ServiceCategory, urn:iso:15118:2:2013:MsgDataTypes,serviceCategoryType */ + v2gserviceCategoryType ServiceCategory ; + unsigned int ServiceCategory_isUsed:1; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define v2gSignedInfoType_Id_CHARACTERS_SIZE 50 +#define v2gSignedInfoType_Reference_ARRAY_SIZE 1 +struct v2gSignedInfoType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[v2gSignedInfoType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod, Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct v2gCanonicalizationMethodType CanonicalizationMethod ; + /* element: "http://www.w3.org/2000/09/xmldsig#":SignatureMethod, Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct v2gSignatureMethodType SignatureMethod ; + /* element: "http://www.w3.org/2000/09/xmldsig#":Reference, Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ + struct { + struct v2gReferenceType array[v2gSignedInfoType_Reference_ARRAY_SIZE]; + uint16_t arrayLen; + } Reference; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ChargingProfileType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ProfileEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define v2gChargingProfileType_ProfileEntry_ARRAY_SIZE 5 +struct v2gChargingProfileType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":ProfileEntry, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ProfileEntryType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryStart,"urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxPower,"urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxNumberOfPhasesInUse{0-1})', derivedBy='RESTRICTION'. */ + struct { + struct v2gProfileEntryType array[v2gChargingProfileType_ProfileEntry_ARRAY_SIZE]; + uint16_t arrayLen; + } ProfileEntry; }; /* Complex type name='urn:iso:15118:2:2013: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'. */ @@ -1287,6 +1254,12 @@ struct v2gCurrentDemandReqType { struct v2gPhysicalValueType EVTargetVoltage ; }; +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CableCheckReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ +struct v2gCableCheckReqType { + /* element: "urn:iso:15118:2:2013:MsgBody":DC_EVStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EVReady,"urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ + struct v2gDC_EVStatusType DC_EVStatus ; +}; + /* Complex type name='urn:iso:15118:2:2013:MsgBody,PreChargeResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ struct v2gPreChargeResType { /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ @@ -1297,36 +1270,38 @@ struct v2gPreChargeResType { struct v2gPhysicalValueType EVSEPresentVoltage ; }; -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define v2gSignedInfoType_Id_CHARACTERS_SIZE 50 -#define v2gSignedInfoType_Reference_ARRAY_SIZE 0 -struct v2gSignedInfoType { - /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ChargeServiceType', base type name='ServiceType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2013:MsgDataTypes":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FreeService),("urn:iso:15118:2:2013:MsgDataTypes":SupportedEnergyTransferMode))', derivedBy='EXTENSION'. */ +#define v2gChargeServiceType_ServiceName_CHARACTERS_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,serviceNameType is 32 */ +#define v2gChargeServiceType_ServiceScope_CHARACTERS_SIZE 64 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,serviceScopeType is 64 */ +struct v2gChargeServiceType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":ServiceID, urn:iso:15118:2:2013:MsgDataTypes,serviceIDType */ + uint16_t ServiceID ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":ServiceName, urn:iso:15118:2:2013:MsgDataTypes,serviceNameType */ struct { - exi_string_character_t characters[v2gSignedInfoType_Id_CHARACTERS_SIZE]; + exi_string_character_t characters[v2gChargeServiceType_ServiceName_CHARACTERS_SIZE]; uint16_t charactersLen; - } Id ; - unsigned int Id_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod, Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct v2gCanonicalizationMethodType CanonicalizationMethod ; - /* element: "http://www.w3.org/2000/09/xmldsig#":SignatureMethod, Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct v2gSignatureMethodType SignatureMethod ; - /* element: "http://www.w3.org/2000/09/xmldsig#":Reference, Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ + } ServiceName ; + unsigned int ServiceName_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory, urn:iso:15118:2:2013:MsgDataTypes,serviceCategoryType */ + v2gserviceCategoryType ServiceCategory ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":ServiceScope, urn:iso:15118:2:2013:MsgDataTypes,serviceScopeType */ struct { - struct v2gReferenceType array[v2gSignedInfoType_Reference_ARRAY_SIZE]; - uint16_t arrayLen; - } Reference; + exi_string_character_t characters[v2gChargeServiceType_ServiceScope_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ServiceScope ; + unsigned int ServiceScope_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":FreeService, http://www.w3.org/2001/XMLSchema,boolean */ + int FreeService ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":SupportedEnergyTransferMode, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SupportedEnergyTransferModeType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EnergyTransferMode{1-6})', derivedBy='RESTRICTION'. */ + struct v2gSupportedEnergyTransferModeType SupportedEnergyTransferMode ; }; -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ProfileEntryType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryStart,"urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxPower,"urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxNumberOfPhasesInUse{0-1})', derivedBy='RESTRICTION'. */ -struct v2gProfileEntryType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryStart, http://www.w3.org/2001/XMLSchema,unsignedInt */ - uint32_t ChargingProfileEntryStart ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxPower, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType ChargingProfileEntryMaxPower ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxNumberOfPhasesInUse, urn:iso:15118:2:2013:MsgDataTypes,maxNumPhasesType */ - int8_t ChargingProfileEntryMaxNumberOfPhasesInUse ; - unsigned int ChargingProfileEntryMaxNumberOfPhasesInUse_isUsed:1; +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVSEStatusType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification)', derivedBy='RESTRICTION'. */ +struct v2gEVSEStatusType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay, http://www.w3.org/2001/XMLSchema,unsignedShort */ + uint16_t NotificationMaxDelay ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSENotification, urn:iso:15118:2:2013:MsgDataTypes,EVSENotificationType */ + v2gEVSENotificationType EVSENotification ; }; /* Complex type name='urn:iso:15118:2:2013:MsgBody,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'. */ @@ -1339,33 +1314,6 @@ struct v2gPreChargeReqType { struct v2gPhysicalValueType EVTargetCurrent ; }; -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ChargingProfileType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ProfileEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define v2gChargingProfileType_ProfileEntry_ARRAY_SIZE 5 -struct v2gChargingProfileType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":ProfileEntry, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ProfileEntryType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryStart,"urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxPower,"urn:iso:15118:2:2013:MsgDataTypes":ChargingProfileEntryMaxNumberOfPhasesInUse{0-1})', derivedBy='RESTRICTION'. */ - struct { - struct v2gProfileEntryType array[v2gChargingProfileType_ProfileEntry_ARRAY_SIZE]; - uint16_t arrayLen; - } ProfileEntry; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,PowerDeliveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ChargeProgress,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":ChargingProfile{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVPowerDeliveryParameter{0-1})', derivedBy='EXTENSION'. */ -struct v2gPowerDeliveryReqType { - /* element: "urn:iso:15118:2:2013:MsgBody":ChargeProgress, urn:iso:15118:2:2013:MsgDataTypes,chargeProgressType */ - v2gchargeProgressType ChargeProgress ; - /* element: "urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID, urn:iso:15118:2:2013:MsgDataTypes,SAIDType */ - uint8_t SAScheduleTupleID ; - /* element: "urn:iso:15118:2:2013:MsgBody":ChargingProfile, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ChargingProfileType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ProfileEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct v2gChargingProfileType ChargingProfile ; - unsigned int ChargingProfile_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVPowerDeliveryParameter, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVPowerDeliveryParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ - struct v2gEVPowerDeliveryParameterType EVPowerDeliveryParameter ; - unsigned int EVPowerDeliveryParameter_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":DC_EVPowerDeliveryParameter, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVPowerDeliveryParameterType', base type name='EVPowerDeliveryParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2013:MsgDataTypes":BulkChargingComplete{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ChargingComplete)', derivedBy='EXTENSION'. */ - struct v2gDC_EVPowerDeliveryParameterType DC_EVPowerDeliveryParameter ; - unsigned int DC_EVPowerDeliveryParameter_isUsed:1; -}; - /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumPowerLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaximumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMinimumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMinimumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVSECurrentRegulationTolerance{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEPeakCurrentRipple,"urn:iso:15118:2:2013:MsgDataTypes":EVSEEnergyToBeDelivered{0-1})', derivedBy='EXTENSION'. */ struct v2gDC_EVSEChargeParameterType { /* element: "urn:iso:15118:2:2013:MsgDataTypes":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatusCode))', derivedBy='EXTENSION'. */ @@ -1390,6 +1338,35 @@ struct v2gDC_EVSEChargeParameterType { unsigned int EVSEEnergyToBeDelivered_isUsed:1; }; +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ParameterSetType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID,"urn:iso:15118:2:2013:MsgDataTypes":Parameter{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define v2gParameterSetType_Parameter_ARRAY_SIZE 5 +struct v2gParameterSetType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID, http://www.w3.org/2001/XMLSchema,short */ + int16_t ParameterSetID ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":Parameter, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ParameterType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":boolValue|"urn:iso:15118:2:2013:MsgDataTypes":byteValue|"urn:iso:15118:2:2013:MsgDataTypes":shortValue|"urn:iso:15118:2:2013:MsgDataTypes":intValue|"urn:iso:15118:2:2013:MsgDataTypes":physicalValue|"urn:iso:15118:2:2013:MsgDataTypes":stringValue)', derivedBy='RESTRICTION'. */ + struct { + struct v2gParameterType array[v2gParameterSetType_Parameter_ARRAY_SIZE]; + uint16_t arrayLen; + } Parameter; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ManifestType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define v2gManifestType_Id_CHARACTERS_SIZE 50 +#define v2gManifestType_Reference_ARRAY_SIZE 1 +struct v2gManifestType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[v2gManifestType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":Reference, Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ + struct { + struct v2gReferenceType array[v2gManifestType_Reference_ARRAY_SIZE]; + uint16_t arrayLen; + } Reference; +}; + /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PMaxScheduleEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2013:MsgDataTypes":PMax))', derivedBy='EXTENSION'. */ struct v2gPMaxScheduleEntryType { /* element: "urn:iso:15118:2:2013:MsgDataTypes":TimeInterval, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ @@ -1402,21 +1379,6 @@ struct v2gPMaxScheduleEntryType { struct v2gPhysicalValueType PMax ; }; -/* Complex type name='urn:iso:15118:2:2013:MsgBody,MeteringReceiptResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ -struct v2gMeteringReceiptResType { - /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ - v2gresponseCodeType ResponseCode ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVSEStatusType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification)', derivedBy='RESTRICTION'. */ - struct v2gEVSEStatusType EVSEStatus ; - unsigned int EVSEStatus_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":AC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":RCD))', derivedBy='EXTENSION'. */ - struct v2gAC_EVSEStatusType AC_EVSEStatus ; - unsigned int AC_EVSEStatus_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatusCode))', derivedBy='EXTENSION'. */ - struct v2gDC_EVSEStatusType DC_EVSEStatus ; - unsigned int DC_EVSEStatus_isUsed:1; -}; - /* Complex type name='http://www.w3.org/2000/09/xmldsig#,RetrievalMethodType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1})', derivedBy='RESTRICTION'. */ #define v2gRetrievalMethodType_URI_CHARACTERS_SIZE 50 #define v2gRetrievalMethodType_Type_CHARACTERS_SIZE 50 @@ -1438,182 +1400,17 @@ struct v2gRetrievalMethodType { unsigned int Transforms_isUsed:1; }; -/* 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'. */ -#define v2gParameterType_Name_CHARACTERS_SIZE 50 -#define v2gParameterType_stringValue_CHARACTERS_SIZE 50 -struct v2gParameterType { - /* attribute: Name {http://www.w3.org/2001/XMLSchema,string} */ - struct { - exi_string_character_t characters[v2gParameterType_Name_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Name ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":boolValue, http://www.w3.org/2001/XMLSchema,boolean */ - int boolValue ; - unsigned int boolValue_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":byteValue, http://www.w3.org/2001/XMLSchema,byte */ - int8_t byteValue ; - unsigned int byteValue_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":shortValue, http://www.w3.org/2001/XMLSchema,short */ - int16_t shortValue ; - unsigned int shortValue_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":intValue, http://www.w3.org/2001/XMLSchema,int */ - int32_t intValue ; - unsigned int intValue_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":physicalValue, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType physicalValue ; - unsigned int physicalValue_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":stringValue, http://www.w3.org/2001/XMLSchema,string */ - struct { - exi_string_character_t characters[v2gParameterType_stringValue_CHARACTERS_SIZE]; - uint16_t charactersLen; - } stringValue ; - unsigned int stringValue_isUsed:1; -}; - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ManifestType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define v2gManifestType_Id_CHARACTERS_SIZE 50 -#define v2gManifestType_Reference_ARRAY_SIZE 0 -struct v2gManifestType { - /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ - struct { - exi_string_character_t characters[v2gManifestType_Id_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Id ; - unsigned int Id_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":Reference, Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ - struct { - struct v2gReferenceType array[v2gManifestType_Reference_ARRAY_SIZE]; - uint16_t arrayLen; - } Reference; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":AC_EVSEStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVSENominalVoltage,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaxCurrent)', derivedBy='EXTENSION'. */ -struct v2gAC_EVSEChargeParameterType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":AC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":RCD))', derivedBy='EXTENSION'. */ - struct v2gAC_EVSEStatusType AC_EVSEStatus ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSENominalVoltage, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVSENominalVoltage ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSEMaxCurrent, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVSEMaxCurrent ; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,WeldingDetectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ -struct v2gWeldingDetectionResType { - /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ - v2gresponseCodeType ResponseCode ; - /* element: "urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatusCode))', derivedBy='EXTENSION'. */ - struct v2gDC_EVSEStatusType DC_EVSEStatus ; - /* element: "urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVSEPresentVoltage ; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ConsumptionCostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":startValue,"urn:iso:15118:2:2013:MsgDataTypes":Cost{1-3})', derivedBy='RESTRICTION'. */ -#define v2gConsumptionCostType_Cost_ARRAY_SIZE 3 -struct v2gConsumptionCostType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":startValue, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType startValue ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":Cost, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,CostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":costKind,"urn:iso:15118:2:2013:MsgDataTypes":amount,"urn:iso:15118:2:2013:MsgDataTypes":amountMultiplier{0-1})', derivedBy='RESTRICTION'. */ - struct { - struct v2gCostType array[v2gConsumptionCostType_Cost_ARRAY_SIZE]; - uint16_t arrayLen; - } Cost; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargingStatusResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEID,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":EVSEMaxCurrent{0-1},"urn:iso:15118:2:2013:MsgBody":MeterInfo{0-1},"urn:iso:15118:2:2013:MsgBody":ReceiptRequired{0-1},"urn:iso:15118:2:2013:MsgBody":AC_EVSEStatus)', derivedBy='EXTENSION'. */ -#define v2gChargingStatusResType_EVSEID_CHARACTERS_SIZE 37 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,evseIDType is 37 */ -struct v2gChargingStatusResType { - /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ - v2gresponseCodeType ResponseCode ; - /* element: "urn:iso:15118:2:2013:MsgBody":EVSEID, urn:iso:15118:2:2013:MsgDataTypes,evseIDType */ - struct { - exi_string_character_t characters[v2gChargingStatusResType_EVSEID_CHARACTERS_SIZE]; - uint16_t charactersLen; - } EVSEID ; - /* element: "urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID, urn:iso:15118:2:2013:MsgDataTypes,SAIDType */ - uint8_t SAScheduleTupleID ; - /* element: "urn:iso:15118:2:2013:MsgBody":EVSEMaxCurrent, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ - struct v2gPhysicalValueType EVSEMaxCurrent ; - unsigned int EVSEMaxCurrent_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgBody":MeterInfo, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,MeterInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":MeterID,"urn:iso:15118:2:2013:MsgDataTypes":MeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":SigMeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":MeterStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":TMeter{0-1})', derivedBy='RESTRICTION'. */ - struct v2gMeterInfoType MeterInfo ; - unsigned int MeterInfo_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgBody":ReceiptRequired, http://www.w3.org/2001/XMLSchema,boolean */ - int ReceiptRequired ; - unsigned int ReceiptRequired_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgBody":AC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":RCD))', derivedBy='EXTENSION'. */ - struct v2gAC_EVSEStatusType AC_EVSEStatus ; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargeParameterDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":MaxEntriesSAScheduleTuple{0-1},"urn:iso:15118:2:2013:MsgBody":RequestedEnergyTransferMode,"urn:iso:15118:2:2013:MsgDataTypes":EVChargeParameter)', derivedBy='EXTENSION'. */ -struct v2gChargeParameterDiscoveryReqType { - /* element: "urn:iso:15118:2:2013:MsgBody":MaxEntriesSAScheduleTuple, http://www.w3.org/2001/XMLSchema,unsignedShort */ - uint16_t MaxEntriesSAScheduleTuple ; - unsigned int MaxEntriesSAScheduleTuple_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgBody":RequestedEnergyTransferMode, urn:iso:15118:2:2013:MsgDataTypes,EnergyTransferModeType */ - v2gEnergyTransferModeType RequestedEnergyTransferMode ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVChargeParameter, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVChargeParameterType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1})', derivedBy='RESTRICTION'. */ - struct v2gEVChargeParameterType EVChargeParameter ; - unsigned int EVChargeParameter_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":AC_EVChargeParameter, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1}),("urn:iso:15118:2:2013:MsgDataTypes":EAmount,"urn:iso:15118:2:2013:MsgDataTypes":EVMaxVoltage,"urn:iso:15118:2:2013:MsgDataTypes":EVMaxCurrent,"urn:iso:15118:2:2013:MsgDataTypes":EVMinCurrent))', derivedBy='EXTENSION'. */ - struct v2gAC_EVChargeParameterType AC_EVChargeParameter ; - unsigned int AC_EVChargeParameter_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":DC_EVChargeParameter, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1}),("urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVEnergyCapacity{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVEnergyRequest{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FullSOC{0-1},"urn:iso:15118:2:2013:MsgDataTypes":BulkSOC{0-1}))', derivedBy='EXTENSION'. */ - struct v2gDC_EVChargeParameterType DC_EVChargeParameter ; - unsigned int DC_EVChargeParameter_isUsed:1; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ParameterSetType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID,"urn:iso:15118:2:2013:MsgDataTypes":Parameter{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define v2gParameterSetType_Parameter_ARRAY_SIZE 5 -struct v2gParameterSetType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID, http://www.w3.org/2001/XMLSchema,short */ - int16_t ParameterSetID ; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":Parameter, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ParameterType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":boolValue|"urn:iso:15118:2:2013:MsgDataTypes":byteValue|"urn:iso:15118:2:2013:MsgDataTypes":shortValue|"urn:iso:15118:2:2013:MsgDataTypes":intValue|"urn:iso:15118:2:2013:MsgDataTypes":physicalValue|"urn:iso:15118:2:2013:MsgDataTypes":stringValue)', derivedBy='RESTRICTION'. */ - struct { - struct v2gParameterType array[v2gParameterSetType_Parameter_ARRAY_SIZE]; - uint16_t arrayLen; - } Parameter; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceParameterListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ParameterSet{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define v2gServiceParameterListType_ParameterSet_ARRAY_SIZE 5 -struct v2gServiceParameterListType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":ParameterSet, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ParameterSetType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID,"urn:iso:15118:2:2013:MsgDataTypes":Parameter{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct { - struct v2gParameterSetType array[v2gServiceParameterListType_ParameterSet_ARRAY_SIZE]; - uint16_t arrayLen; - } ParameterSet; -}; - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SalesTariffEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2013:MsgDataTypes":EPriceLevel{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ConsumptionCost{0-3}))', derivedBy='EXTENSION'. */ -#define v2gSalesTariffEntryType_ConsumptionCost_ARRAY_SIZE 3 -struct v2gSalesTariffEntryType { - /* element: "urn:iso:15118:2:2013:MsgDataTypes":TimeInterval, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ - struct v2gIntervalType TimeInterval ; - unsigned int TimeInterval_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":RelativeTimeInterval, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":start,"urn:iso:15118:2:2013:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ - struct v2gRelativeTimeIntervalType RelativeTimeInterval ; - unsigned int RelativeTimeInterval_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":EPriceLevel, http://www.w3.org/2001/XMLSchema,unsignedByte */ - uint8_t EPriceLevel ; - unsigned int EPriceLevel_isUsed:1; - /* element: "urn:iso:15118:2:2013:MsgDataTypes":ConsumptionCost, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ConsumptionCostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":startValue,"urn:iso:15118:2:2013:MsgDataTypes":Cost{1-3})', derivedBy='RESTRICTION'. */ - struct { - struct v2gConsumptionCostType array[v2gSalesTariffEntryType_ConsumptionCost_ARRAY_SIZE]; - uint16_t arrayLen; - } ConsumptionCost; -}; - /* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyInfoType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":KeyName|"http://www.w3.org/2000/09/xmldsig#":KeyValue|"http://www.w3.org/2000/09/xmldsig#":RetrievalMethod|"http://www.w3.org/2000/09/xmldsig#":X509Data|"http://www.w3.org/2000/09/xmldsig#":PGPData|"http://www.w3.org/2000/09/xmldsig#":SPKIData|"http://www.w3.org/2000/09/xmldsig#":MgmtData|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ #define v2gKeyInfoType_Id_CHARACTERS_SIZE 50 #define v2gKeyInfoType_KeyName_CHARACTERS_SIZE 50 -#define v2gKeyInfoType_KeyName_ARRAY_SIZE 0 -#define v2gKeyInfoType_KeyValue_ARRAY_SIZE 0 -#define v2gKeyInfoType_RetrievalMethod_ARRAY_SIZE 0 -#define v2gKeyInfoType_X509Data_ARRAY_SIZE 0 -#define v2gKeyInfoType_PGPData_ARRAY_SIZE 0 -#define v2gKeyInfoType_SPKIData_ARRAY_SIZE 0 +#define v2gKeyInfoType_KeyName_ARRAY_SIZE 1 +#define v2gKeyInfoType_KeyValue_ARRAY_SIZE 1 +#define v2gKeyInfoType_RetrievalMethod_ARRAY_SIZE 1 +#define v2gKeyInfoType_X509Data_ARRAY_SIZE 1 +#define v2gKeyInfoType_PGPData_ARRAY_SIZE 1 +#define v2gKeyInfoType_SPKIData_ARRAY_SIZE 1 #define v2gKeyInfoType_MgmtData_CHARACTERS_SIZE 50 -#define v2gKeyInfoType_MgmtData_ARRAY_SIZE 0 +#define v2gKeyInfoType_MgmtData_ARRAY_SIZE 1 struct v2gKeyInfoType { /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ struct { @@ -1664,15 +1461,191 @@ struct v2gKeyInfoType { } MgmtData; }; -/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDetailResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":ServiceID,"urn:iso:15118:2:2013:MsgBody":ServiceParameterList{0-1})', derivedBy='EXTENSION'. */ -struct v2gServiceDetailResType { +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":RCD))', derivedBy='EXTENSION'. */ +struct v2gAC_EVSEStatusType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay, http://www.w3.org/2001/XMLSchema,unsignedShort */ + uint16_t NotificationMaxDelay ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSENotification, urn:iso:15118:2:2013:MsgDataTypes,EVSENotificationType */ + v2gEVSENotificationType EVSENotification ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":RCD, http://www.w3.org/2001/XMLSchema,boolean */ + int RCD ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SalesTariffEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2013:MsgDataTypes":EPriceLevel{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ConsumptionCost{0-3}))', derivedBy='EXTENSION'. */ +#define v2gSalesTariffEntryType_ConsumptionCost_ARRAY_SIZE 3 +struct v2gSalesTariffEntryType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":TimeInterval, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ + struct v2gIntervalType TimeInterval ; + unsigned int TimeInterval_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":RelativeTimeInterval, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":start,"urn:iso:15118:2:2013:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ + struct v2gRelativeTimeIntervalType RelativeTimeInterval ; + unsigned int RelativeTimeInterval_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EPriceLevel, http://www.w3.org/2001/XMLSchema,unsignedByte */ + uint8_t EPriceLevel ; + unsigned int EPriceLevel_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":ConsumptionCost, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ConsumptionCostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":startValue,"urn:iso:15118:2:2013:MsgDataTypes":Cost{1-3})', derivedBy='RESTRICTION'. */ + struct { + struct v2gConsumptionCostType array[v2gSalesTariffEntryType_ConsumptionCost_ARRAY_SIZE]; + uint16_t arrayLen; + } ConsumptionCost; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CurrentDemandResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage,"urn:iso:15118:2:2013:MsgBody":EVSEPresentCurrent,"urn:iso:15118:2:2013:MsgBody":EVSECurrentLimitAchieved,"urn:iso:15118:2:2013:MsgBody":EVSEVoltageLimitAchieved,"urn:iso:15118:2:2013:MsgBody":EVSEPowerLimitAchieved,"urn:iso:15118:2:2013:MsgBody":EVSEMaximumVoltageLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVSEMaximumCurrentLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVSEMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgBody":EVSEID,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":MeterInfo{0-1},"urn:iso:15118:2:2013:MsgBody":ReceiptRequired{0-1})', derivedBy='EXTENSION'. */ +#define v2gCurrentDemandResType_EVSEID_CHARACTERS_SIZE 37 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,evseIDType is 37 */ +struct v2gCurrentDemandResType { /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ v2gresponseCodeType ResponseCode ; - /* element: "urn:iso:15118:2:2013:MsgBody":ServiceID, urn:iso:15118:2:2013:MsgDataTypes,serviceIDType */ - uint16_t ServiceID ; - /* element: "urn:iso:15118:2:2013:MsgBody":ServiceParameterList, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceParameterListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ParameterSet{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct v2gServiceParameterListType ServiceParameterList ; - unsigned int ServiceParameterList_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatusCode))', derivedBy='EXTENSION'. */ + struct v2gDC_EVSEStatusType DC_EVSEStatus ; + /* element: "urn:iso:15118:2:2013:MsgBody":EVSEPresentVoltage, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVSEPresentVoltage ; + /* element: "urn:iso:15118:2:2013:MsgBody":EVSEPresentCurrent, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVSEPresentCurrent ; + /* element: "urn:iso:15118:2:2013:MsgBody":EVSECurrentLimitAchieved, http://www.w3.org/2001/XMLSchema,boolean */ + int EVSECurrentLimitAchieved ; + /* element: "urn:iso:15118:2:2013:MsgBody":EVSEVoltageLimitAchieved, http://www.w3.org/2001/XMLSchema,boolean */ + int EVSEVoltageLimitAchieved ; + /* element: "urn:iso:15118:2:2013:MsgBody":EVSEPowerLimitAchieved, http://www.w3.org/2001/XMLSchema,boolean */ + int EVSEPowerLimitAchieved ; + /* element: "urn:iso:15118:2:2013:MsgBody":EVSEMaximumVoltageLimit, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVSEMaximumVoltageLimit ; + unsigned int EVSEMaximumVoltageLimit_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgBody":EVSEMaximumCurrentLimit, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVSEMaximumCurrentLimit ; + unsigned int EVSEMaximumCurrentLimit_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgBody":EVSEMaximumPowerLimit, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVSEMaximumPowerLimit ; + unsigned int EVSEMaximumPowerLimit_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgBody":EVSEID, urn:iso:15118:2:2013:MsgDataTypes,evseIDType */ + struct { + exi_string_character_t characters[v2gCurrentDemandResType_EVSEID_CHARACTERS_SIZE]; + uint16_t charactersLen; + } EVSEID ; + /* element: "urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID, urn:iso:15118:2:2013:MsgDataTypes,SAIDType */ + uint8_t SAScheduleTupleID ; + /* element: "urn:iso:15118:2:2013:MsgBody":MeterInfo, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,MeterInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":MeterID,"urn:iso:15118:2:2013:MsgDataTypes":MeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":SigMeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":MeterStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":TMeter{0-1})', derivedBy='RESTRICTION'. */ + struct v2gMeterInfoType MeterInfo ; + unsigned int MeterInfo_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgBody":ReceiptRequired, http://www.w3.org/2001/XMLSchema,boolean */ + int ReceiptRequired ; + unsigned int ReceiptRequired_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargeParameterDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":MaxEntriesSAScheduleTuple{0-1},"urn:iso:15118:2:2013:MsgBody":RequestedEnergyTransferMode,"urn:iso:15118:2:2013:MsgDataTypes":EVChargeParameter)', derivedBy='EXTENSION'. */ +struct v2gChargeParameterDiscoveryReqType { + /* element: "urn:iso:15118:2:2013:MsgBody":MaxEntriesSAScheduleTuple, http://www.w3.org/2001/XMLSchema,unsignedShort */ + uint16_t MaxEntriesSAScheduleTuple ; + unsigned int MaxEntriesSAScheduleTuple_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgBody":RequestedEnergyTransferMode, urn:iso:15118:2:2013:MsgDataTypes,EnergyTransferModeType */ + v2gEnergyTransferModeType RequestedEnergyTransferMode ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVChargeParameter, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVChargeParameterType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1})', derivedBy='RESTRICTION'. */ + struct v2gEVChargeParameterType EVChargeParameter ; + unsigned int EVChargeParameter_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":AC_EVChargeParameter, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1}),("urn:iso:15118:2:2013:MsgDataTypes":EAmount,"urn:iso:15118:2:2013:MsgDataTypes":EVMaxVoltage,"urn:iso:15118:2:2013:MsgDataTypes":EVMaxCurrent,"urn:iso:15118:2:2013:MsgDataTypes":EVMinCurrent))', derivedBy='EXTENSION'. */ + struct v2gAC_EVChargeParameterType AC_EVChargeParameter ; + unsigned int AC_EVChargeParameter_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":DC_EVChargeParameter, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":DepartureTime{0-1}),("urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumCurrentLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVMaximumVoltageLimit,"urn:iso:15118:2:2013:MsgDataTypes":EVEnergyCapacity{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVEnergyRequest{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FullSOC{0-1},"urn:iso:15118:2:2013:MsgDataTypes":BulkSOC{0-1}))', derivedBy='EXTENSION'. */ + struct v2gDC_EVChargeParameterType DC_EVChargeParameter ; + unsigned int DC_EVChargeParameter_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,CableCheckResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2013:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ +struct v2gCableCheckResType { + /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ + v2gresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2013:MsgBody":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatusCode))', derivedBy='EXTENSION'. */ + struct v2gDC_EVSEStatusType DC_EVSEStatus ; + /* element: "urn:iso:15118:2:2013:MsgBody":EVSEProcessing, urn:iso:15118:2:2013:MsgDataTypes,EVSEProcessingType */ + v2gEVSEProcessingType EVSEProcessing ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PowerDeliveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ChargeProgress,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":ChargingProfile{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVPowerDeliveryParameter{0-1})', derivedBy='EXTENSION'. */ +struct v2gPowerDeliveryReqType { + /* element: "urn:iso:15118:2:2013:MsgBody":ChargeProgress, urn:iso:15118:2:2013:MsgDataTypes,chargeProgressType */ + v2gchargeProgressType ChargeProgress ; + /* element: "urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID, urn:iso:15118:2:2013:MsgDataTypes,SAIDType */ + uint8_t SAScheduleTupleID ; + /* element: "urn:iso:15118:2:2013:MsgBody":ChargingProfile, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ChargingProfileType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ProfileEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct v2gChargingProfileType ChargingProfile ; + unsigned int ChargingProfile_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVPowerDeliveryParameter, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVPowerDeliveryParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ + struct v2gEVPowerDeliveryParameterType EVPowerDeliveryParameter ; + unsigned int EVPowerDeliveryParameter_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":DC_EVPowerDeliveryParameter, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVPowerDeliveryParameterType', base type name='EVPowerDeliveryParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2013:MsgDataTypes":BulkChargingComplete{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ChargingComplete)', derivedBy='EXTENSION'. */ + struct v2gDC_EVPowerDeliveryParameterType DC_EVPowerDeliveryParameter ; + unsigned int DC_EVPowerDeliveryParameter_isUsed:1; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignedInfo,"http://www.w3.org/2000/09/xmldsig#":SignatureValue,"http://www.w3.org/2000/09/xmldsig#":KeyInfo{0-1},"http://www.w3.org/2000/09/xmldsig#":Object{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define v2gSignatureType_Id_CHARACTERS_SIZE 50 +#define v2gSignatureType_Object_ARRAY_SIZE 1 +struct v2gSignatureType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[v2gSignatureType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":SignedInfo, Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct v2gSignedInfoType SignedInfo ; + /* element: "http://www.w3.org/2000/09/xmldsig#":SignatureValue, Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ + struct v2gSignatureValueType SignatureValue ; + /* element: "http://www.w3.org/2000/09/xmldsig#":KeyInfo, Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyInfoType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":KeyName|"http://www.w3.org/2000/09/xmldsig#":KeyValue|"http://www.w3.org/2000/09/xmldsig#":RetrievalMethod|"http://www.w3.org/2000/09/xmldsig#":X509Data|"http://www.w3.org/2000/09/xmldsig#":PGPData|"http://www.w3.org/2000/09/xmldsig#":SPKIData|"http://www.w3.org/2000/09/xmldsig#":MgmtData|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ + struct v2gKeyInfoType KeyInfo ; + unsigned int KeyInfo_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":Object, Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ + struct { + struct v2gObjectType array[v2gSignatureType_Object_ARRAY_SIZE]; + uint16_t arrayLen; + } Object; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":AC_EVSEStatus,"urn:iso:15118:2:2013:MsgDataTypes":EVSENominalVoltage,"urn:iso:15118:2:2013:MsgDataTypes":EVSEMaxCurrent)', derivedBy='EXTENSION'. */ +struct v2gAC_EVSEChargeParameterType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":AC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":RCD))', derivedBy='EXTENSION'. */ + struct v2gAC_EVSEStatusType AC_EVSEStatus ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSENominalVoltage, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVSENominalVoltage ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSEMaxCurrent, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVSEMaxCurrent ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":PaymentOptionList,"urn:iso:15118:2:2013:MsgBody":ChargeService,"urn:iso:15118:2:2013:MsgBody":ServiceList{0-1})', derivedBy='EXTENSION'. */ +struct v2gServiceDiscoveryResType { + /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ + v2gresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2013:MsgBody":PaymentOptionList, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PaymentOptionListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":PaymentOption{1-2})', derivedBy='RESTRICTION'. */ + struct v2gPaymentOptionListType PaymentOptionList ; + /* element: "urn:iso:15118:2:2013:MsgBody":ChargeService, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ChargeServiceType', base type name='ServiceType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":ServiceID,"urn:iso:15118:2:2013:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2013:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2013:MsgDataTypes":ServiceScope{0-1},"urn:iso:15118:2:2013:MsgDataTypes":FreeService),("urn:iso:15118:2:2013:MsgDataTypes":SupportedEnergyTransferMode))', derivedBy='EXTENSION'. */ + struct v2gChargeServiceType ChargeService ; + /* element: "urn:iso:15118:2:2013:MsgBody":ServiceList, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Service{1-8})', derivedBy='RESTRICTION'. */ + struct v2gServiceListType ServiceList ; + unsigned int ServiceList_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceParameterListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ParameterSet{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define v2gServiceParameterListType_ParameterSet_ARRAY_SIZE 5 +struct v2gServiceParameterListType { + /* element: "urn:iso:15118:2:2013:MsgDataTypes":ParameterSet, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ParameterSetType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ParameterSetID,"urn:iso:15118:2:2013:MsgDataTypes":Parameter{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct { + struct v2gParameterSetType array[v2gServiceParameterListType_ParameterSet_ARRAY_SIZE]; + uint16_t arrayLen; + } ParameterSet; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,MeteringReceiptResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ +struct v2gMeteringReceiptResType { + /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ + v2gresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVSEStatusType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification)', derivedBy='RESTRICTION'. */ + struct v2gEVSEStatusType EVSEStatus ; + unsigned int EVSEStatus_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":AC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":RCD))', derivedBy='EXTENSION'. */ + struct v2gAC_EVSEStatusType AC_EVSEStatus ; + unsigned int AC_EVSEStatus_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatusCode))', derivedBy='EXTENSION'. */ + struct v2gDC_EVSEStatusType DC_EVSEStatus ; + unsigned int DC_EVSEStatus_isUsed:1; }; /* Complex type name='urn:iso:15118:2:2013: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'. */ @@ -1714,6 +1687,57 @@ struct v2gPMaxScheduleType { } PMaxScheduleEntry; }; +/* Complex type name='urn:iso:15118:2:2013:MsgBody,PowerDeliveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ +struct v2gPowerDeliveryResType { + /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ + v2gresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EVSEStatusType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification)', derivedBy='RESTRICTION'. */ + struct v2gEVSEStatusType EVSEStatus ; + unsigned int EVSEStatus_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":AC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":RCD))', derivedBy='EXTENSION'. */ + struct v2gAC_EVSEStatusType AC_EVSEStatus ; + unsigned int AC_EVSEStatus_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgDataTypes":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":EVSEStatusCode))', derivedBy='EXTENSION'. */ + struct v2gDC_EVSEStatusType DC_EVSEStatus ; + unsigned int DC_EVSEStatus_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ChargingStatusResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":EVSEID,"urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgBody":EVSEMaxCurrent{0-1},"urn:iso:15118:2:2013:MsgBody":MeterInfo{0-1},"urn:iso:15118:2:2013:MsgBody":ReceiptRequired{0-1},"urn:iso:15118:2:2013:MsgBody":AC_EVSEStatus)', derivedBy='EXTENSION'. */ +#define v2gChargingStatusResType_EVSEID_CHARACTERS_SIZE 37 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,evseIDType is 37 */ +struct v2gChargingStatusResType { + /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ + v2gresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2013:MsgBody":EVSEID, urn:iso:15118:2:2013:MsgDataTypes,evseIDType */ + struct { + exi_string_character_t characters[v2gChargingStatusResType_EVSEID_CHARACTERS_SIZE]; + uint16_t charactersLen; + } EVSEID ; + /* element: "urn:iso:15118:2:2013:MsgBody":SAScheduleTupleID, urn:iso:15118:2:2013:MsgDataTypes,SAIDType */ + uint8_t SAScheduleTupleID ; + /* element: "urn:iso:15118:2:2013:MsgBody":EVSEMaxCurrent, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":Multiplier,"urn:iso:15118:2:2013:MsgDataTypes":Unit,"urn:iso:15118:2:2013:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct v2gPhysicalValueType EVSEMaxCurrent ; + unsigned int EVSEMaxCurrent_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgBody":MeterInfo, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,MeterInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":MeterID,"urn:iso:15118:2:2013:MsgDataTypes":MeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":SigMeterReading{0-1},"urn:iso:15118:2:2013:MsgDataTypes":MeterStatus{0-1},"urn:iso:15118:2:2013:MsgDataTypes":TMeter{0-1})', derivedBy='RESTRICTION'. */ + struct v2gMeterInfoType MeterInfo ; + unsigned int MeterInfo_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgBody":ReceiptRequired, http://www.w3.org/2001/XMLSchema,boolean */ + int ReceiptRequired ; + unsigned int ReceiptRequired_isUsed:1; + /* element: "urn:iso:15118:2:2013:MsgBody":AC_EVSEStatus, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2013:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2013:MsgDataTypes":EVSENotification),("urn:iso:15118:2:2013:MsgDataTypes":RCD))', derivedBy='EXTENSION'. */ + struct v2gAC_EVSEStatusType AC_EVSEStatus ; +}; + +/* Complex type name='urn:iso:15118:2:2013:MsgBody,ServiceDetailResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":ServiceID,"urn:iso:15118:2:2013:MsgBody":ServiceParameterList{0-1})', derivedBy='EXTENSION'. */ +struct v2gServiceDetailResType { + /* element: "urn:iso:15118:2:2013:MsgBody":ResponseCode, urn:iso:15118:2:2013:MsgDataTypes,responseCodeType */ + v2gresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2013:MsgBody":ServiceID, urn:iso:15118:2:2013:MsgDataTypes,serviceIDType */ + uint16_t ServiceID ; + /* element: "urn:iso:15118:2:2013:MsgBody":ServiceParameterList, Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ServiceParameterListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":ParameterSet{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct v2gServiceParameterListType ServiceParameterList ; + unsigned int ServiceParameterList_isUsed:1; +}; + /* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SAScheduleTupleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2013:MsgDataTypes":PMaxSchedule,"urn:iso:15118:2:2013:MsgDataTypes":SalesTariff{0-1})', derivedBy='RESTRICTION'. */ struct v2gSAScheduleTupleType { /* element: "urn:iso:15118:2:2013:MsgDataTypes":SAScheduleTupleID, urn:iso:15118:2:2013:MsgDataTypes,SAIDType */ @@ -1725,30 +1749,6 @@ struct v2gSAScheduleTupleType { unsigned int SalesTariff_isUsed:1; }; -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignedInfo,"http://www.w3.org/2000/09/xmldsig#":SignatureValue,"http://www.w3.org/2000/09/xmldsig#":KeyInfo{0-1},"http://www.w3.org/2000/09/xmldsig#":Object{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ -#define v2gSignatureType_Id_CHARACTERS_SIZE 50 -#define v2gSignatureType_Object_ARRAY_SIZE 0 -struct v2gSignatureType { - /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ - struct { - exi_string_character_t characters[v2gSignatureType_Id_CHARACTERS_SIZE]; - uint16_t charactersLen; - } Id ; - unsigned int Id_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":SignedInfo, Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ - struct v2gSignedInfoType SignedInfo ; - /* element: "http://www.w3.org/2000/09/xmldsig#":SignatureValue, Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ - struct v2gSignatureValueType SignatureValue ; - /* element: "http://www.w3.org/2000/09/xmldsig#":KeyInfo, Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyInfoType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":KeyName|"http://www.w3.org/2000/09/xmldsig#":KeyValue|"http://www.w3.org/2000/09/xmldsig#":RetrievalMethod|"http://www.w3.org/2000/09/xmldsig#":X509Data|"http://www.w3.org/2000/09/xmldsig#":PGPData|"http://www.w3.org/2000/09/xmldsig#":SPKIData|"http://www.w3.org/2000/09/xmldsig#":MgmtData|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ - struct v2gKeyInfoType KeyInfo ; - unsigned int KeyInfo_isUsed:1; - /* element: "http://www.w3.org/2000/09/xmldsig#":Object, Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ - struct { - struct v2gObjectType array[v2gSignatureType_Object_ARRAY_SIZE]; - uint16_t arrayLen; - } Object; -}; - /* Complex type name='urn:iso:15118:2:2013:MsgHeader,MessageHeaderType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgHeader":SessionID,"urn:iso:15118:2:2013:MsgHeader":Notification{0-1},"http://www.w3.org/2000/09/xmldsig#":Signature{0-1})', derivedBy='RESTRICTION'. */ #define v2gMessageHeaderType_SessionID_BYTES_SIZE 8 /* XML schema facet maxLength for urn:iso:15118:2:2013:MsgDataTypes,sessionIDType is 8 */ struct v2gMessageHeaderType { @@ -2110,112 +2110,112 @@ struct v2gEXIDocument { /* Initialization methods for structs */ void init_v2gEXIDocument(struct v2gEXIDocument* exiDoc); -void init_v2gServiceDetailResType(struct v2gServiceDetailResType* v2gServiceDetailResType); -void init_v2gSPKIDataType(struct v2gSPKIDataType* v2gSPKIDataType); -void init_v2gAuthorizationResType(struct v2gAuthorizationResType* v2gAuthorizationResType); -void init_v2gBodyType(struct v2gBodyType* v2gBodyType); -void init_v2gPaymentServiceSelectionReqType(struct v2gPaymentServiceSelectionReqType* v2gPaymentServiceSelectionReqType); -void init_v2gEVSEStatusType(struct v2gEVSEStatusType* v2gEVSEStatusType); -void init_v2gSelectedServiceType(struct v2gSelectedServiceType* v2gSelectedServiceType); -void init_v2gEntryType(struct v2gEntryType* v2gEntryType); -void init_v2gDC_EVSEChargeParameterType(struct v2gDC_EVSEChargeParameterType* v2gDC_EVSEChargeParameterType); -void init_v2gSalesTariffType(struct v2gSalesTariffType* v2gSalesTariffType); -void init_v2gPMaxScheduleType(struct v2gPMaxScheduleType* v2gPMaxScheduleType); -void init_v2gCostType(struct v2gCostType* v2gCostType); -void init_v2gChargeServiceType(struct v2gChargeServiceType* v2gChargeServiceType); -void init_v2gPMaxScheduleEntryType(struct v2gPMaxScheduleEntryType* v2gPMaxScheduleEntryType); -void init_v2gServiceListType(struct v2gServiceListType* v2gServiceListType); -void init_v2gKeyValueType(struct v2gKeyValueType* v2gKeyValueType); -void init_v2gPaymentServiceSelectionResType(struct v2gPaymentServiceSelectionResType* v2gPaymentServiceSelectionResType); -void init_v2gSignatureMethodType(struct v2gSignatureMethodType* v2gSignatureMethodType); -void init_v2gMeteringReceiptResType(struct v2gMeteringReceiptResType* v2gMeteringReceiptResType); -void init_v2gMessageHeaderType(struct v2gMessageHeaderType* v2gMessageHeaderType); -void init_v2gRetrievalMethodType(struct v2gRetrievalMethodType* v2gRetrievalMethodType); -void init_v2gEVChargeParameterType(struct v2gEVChargeParameterType* v2gEVChargeParameterType); -void init_v2gCertificateInstallationReqType(struct v2gCertificateInstallationReqType* v2gCertificateInstallationReqType); -void init_v2gChargeParameterDiscoveryResType(struct v2gChargeParameterDiscoveryResType* v2gChargeParameterDiscoveryResType); -void init_v2gWeldingDetectionReqType(struct v2gWeldingDetectionReqType* v2gWeldingDetectionReqType); -void init_v2gCableCheckReqType(struct v2gCableCheckReqType* v2gCableCheckReqType); -void init_v2gParameterType(struct v2gParameterType* v2gParameterType); -void init_v2gEVSEChargeParameterType(struct v2gEVSEChargeParameterType* v2gEVSEChargeParameterType); -void init_v2gManifestType(struct v2gManifestType* v2gManifestType); -void init_v2gDC_EVStatusType(struct v2gDC_EVStatusType* v2gDC_EVStatusType); -void init_v2gPaymentDetailsReqType(struct v2gPaymentDetailsReqType* v2gPaymentDetailsReqType); -void init_v2gSAScheduleListType(struct v2gSAScheduleListType* v2gSAScheduleListType); -void init_v2gRSAKeyValueType(struct v2gRSAKeyValueType* v2gRSAKeyValueType); -void init_v2gAC_EVSEChargeParameterType(struct v2gAC_EVSEChargeParameterType* v2gAC_EVSEChargeParameterType); -void init_v2gTransformsType(struct v2gTransformsType* v2gTransformsType); -void init_v2gWeldingDetectionResType(struct v2gWeldingDetectionResType* v2gWeldingDetectionResType); -void init_v2gConsumptionCostType(struct v2gConsumptionCostType* v2gConsumptionCostType); -void init_v2gChargingStatusResType(struct v2gChargingStatusResType* v2gChargingStatusResType); -void init_v2gEVStatusType(struct v2gEVStatusType* v2gEVStatusType); -void init_v2gPGPDataType(struct v2gPGPDataType* v2gPGPDataType); -void init_v2gSessionStopResType(struct v2gSessionStopResType* v2gSessionStopResType); -void init_v2gServiceDiscoveryReqType(struct v2gServiceDiscoveryReqType* v2gServiceDiscoveryReqType); -void init_v2gAuthorizationReqType(struct v2gAuthorizationReqType* v2gAuthorizationReqType); -void init_v2gSAScheduleTupleType(struct v2gSAScheduleTupleType* v2gSAScheduleTupleType); -void init_v2gPhysicalValueType(struct v2gPhysicalValueType* v2gPhysicalValueType); -void init_v2gDigestMethodType(struct v2gDigestMethodType* v2gDigestMethodType); -void init_v2gAC_EVSEStatusType(struct v2gAC_EVSEStatusType* v2gAC_EVSEStatusType); -void init_v2gSessionSetupResType(struct v2gSessionSetupResType* v2gSessionSetupResType); -void init_v2gX509IssuerSerialType(struct v2gX509IssuerSerialType* v2gX509IssuerSerialType); -void init_v2gSessionStopReqType(struct v2gSessionStopReqType* v2gSessionStopReqType); -void init_v2gDC_EVSEStatusType(struct v2gDC_EVSEStatusType* v2gDC_EVSEStatusType); -void init_v2gDiffieHellmanPublickeyType(struct v2gDiffieHellmanPublickeyType* v2gDiffieHellmanPublickeyType); -void init_v2gCertificateUpdateReqType(struct v2gCertificateUpdateReqType* v2gCertificateUpdateReqType); -void init_v2gBodyBaseType(struct v2gBodyBaseType* v2gBodyBaseType); -void init_v2gDC_EVChargeParameterType(struct v2gDC_EVChargeParameterType* v2gDC_EVChargeParameterType); -void init_v2gSubCertificatesType(struct v2gSubCertificatesType* v2gSubCertificatesType); -void init_v2gSupportedEnergyTransferModeType(struct v2gSupportedEnergyTransferModeType* v2gSupportedEnergyTransferModeType); -void init_v2gChargingStatusReqType(struct v2gChargingStatusReqType* v2gChargingStatusReqType); -void init_v2gSignaturePropertyType(struct v2gSignaturePropertyType* v2gSignaturePropertyType); -void init_v2gContractSignatureEncryptedPrivateKeyType(struct v2gContractSignatureEncryptedPrivateKeyType* v2gContractSignatureEncryptedPrivateKeyType); -void init_v2gReferenceType(struct v2gReferenceType* v2gReferenceType); -void init_v2gCurrentDemandResType(struct v2gCurrentDemandResType* v2gCurrentDemandResType); -void init_v2gCanonicalizationMethodType(struct v2gCanonicalizationMethodType* v2gCanonicalizationMethodType); -void init_v2gTransformType(struct v2gTransformType* v2gTransformType); -void init_v2gCertificateChainType(struct v2gCertificateChainType* v2gCertificateChainType); -void init_v2gSignatureValueType(struct v2gSignatureValueType* v2gSignatureValueType); -void init_v2gEVPowerDeliveryParameterType(struct v2gEVPowerDeliveryParameterType* v2gEVPowerDeliveryParameterType); -void init_v2gServiceDetailReqType(struct v2gServiceDetailReqType* v2gServiceDetailReqType); -void init_v2gPaymentDetailsResType(struct v2gPaymentDetailsResType* v2gPaymentDetailsResType); -void init_v2gX509DataType(struct v2gX509DataType* v2gX509DataType); -void init_v2gDSAKeyValueType(struct v2gDSAKeyValueType* v2gDSAKeyValueType); -void init_v2gPowerDeliveryResType(struct v2gPowerDeliveryResType* v2gPowerDeliveryResType); -void init_v2gChargeParameterDiscoveryReqType(struct v2gChargeParameterDiscoveryReqType* v2gChargeParameterDiscoveryReqType); -void init_v2gParameterSetType(struct v2gParameterSetType* v2gParameterSetType); -void init_v2gServiceDiscoveryResType(struct v2gServiceDiscoveryResType* v2gServiceDiscoveryResType); -void init_v2gAnonType_V2G_Message(struct v2gAnonType_V2G_Message* v2gAnonType_V2G_Message); -void init_v2gSignatureType(struct v2gSignatureType* v2gSignatureType); -void init_v2gEMAIDType(struct v2gEMAIDType* v2gEMAIDType); -void init_v2gCertificateInstallationResType(struct v2gCertificateInstallationResType* v2gCertificateInstallationResType); -void init_v2gCableCheckResType(struct v2gCableCheckResType* v2gCableCheckResType); -void init_v2gMeterInfoType(struct v2gMeterInfoType* v2gMeterInfoType); -void init_v2gAC_EVChargeParameterType(struct v2gAC_EVChargeParameterType* v2gAC_EVChargeParameterType); -void init_v2gServiceParameterListType(struct v2gServiceParameterListType* v2gServiceParameterListType); -void init_v2gCurrentDemandReqType(struct v2gCurrentDemandReqType* v2gCurrentDemandReqType); -void init_v2gSASchedulesType(struct v2gSASchedulesType* v2gSASchedulesType); -void init_v2gIntervalType(struct v2gIntervalType* v2gIntervalType); -void init_v2gPreChargeResType(struct v2gPreChargeResType* v2gPreChargeResType); -void init_v2gSalesTariffEntryType(struct v2gSalesTariffEntryType* v2gSalesTariffEntryType); -void init_v2gPaymentOptionListType(struct v2gPaymentOptionListType* v2gPaymentOptionListType); -void init_v2gSignedInfoType(struct v2gSignedInfoType* v2gSignedInfoType); -void init_v2gSessionSetupReqType(struct v2gSessionSetupReqType* v2gSessionSetupReqType); -void init_v2gSignaturePropertiesType(struct v2gSignaturePropertiesType* v2gSignaturePropertiesType); -void init_v2gProfileEntryType(struct v2gProfileEntryType* v2gProfileEntryType); -void init_v2gPreChargeReqType(struct v2gPreChargeReqType* v2gPreChargeReqType); -void init_v2gListOfRootCertificateIDsType(struct v2gListOfRootCertificateIDsType* v2gListOfRootCertificateIDsType); -void init_v2gDC_EVPowerDeliveryParameterType(struct v2gDC_EVPowerDeliveryParameterType* v2gDC_EVPowerDeliveryParameterType); -void init_v2gRelativeTimeIntervalType(struct v2gRelativeTimeIntervalType* v2gRelativeTimeIntervalType); -void init_v2gChargingProfileType(struct v2gChargingProfileType* v2gChargingProfileType); -void init_v2gCertificateUpdateResType(struct v2gCertificateUpdateResType* v2gCertificateUpdateResType); -void init_v2gMeteringReceiptReqType(struct v2gMeteringReceiptReqType* v2gMeteringReceiptReqType); -void init_v2gServiceType(struct v2gServiceType* v2gServiceType); -void init_v2gNotificationType(struct v2gNotificationType* v2gNotificationType); -void init_v2gKeyInfoType(struct v2gKeyInfoType* v2gKeyInfoType); -void init_v2gSelectedServiceListType(struct v2gSelectedServiceListType* v2gSelectedServiceListType); void init_v2gPowerDeliveryReqType(struct v2gPowerDeliveryReqType* v2gPowerDeliveryReqType); +void init_v2gCertificateUpdateReqType(struct v2gCertificateUpdateReqType* v2gCertificateUpdateReqType); +void init_v2gMessageHeaderType(struct v2gMessageHeaderType* v2gMessageHeaderType); +void init_v2gBodyBaseType(struct v2gBodyBaseType* v2gBodyBaseType); +void init_v2gWeldingDetectionResType(struct v2gWeldingDetectionResType* v2gWeldingDetectionResType); +void init_v2gCostType(struct v2gCostType* v2gCostType); +void init_v2gCertificateInstallationReqType(struct v2gCertificateInstallationReqType* v2gCertificateInstallationReqType); +void init_v2gEntryType(struct v2gEntryType* v2gEntryType); +void init_v2gCanonicalizationMethodType(struct v2gCanonicalizationMethodType* v2gCanonicalizationMethodType); +void init_v2gSignaturePropertiesType(struct v2gSignaturePropertiesType* v2gSignaturePropertiesType); +void init_v2gPaymentServiceSelectionReqType(struct v2gPaymentServiceSelectionReqType* v2gPaymentServiceSelectionReqType); +void init_v2gAuthorizationResType(struct v2gAuthorizationResType* v2gAuthorizationResType); +void init_v2gConsumptionCostType(struct v2gConsumptionCostType* v2gConsumptionCostType); +void init_v2gCertificateInstallationResType(struct v2gCertificateInstallationResType* v2gCertificateInstallationResType); +void init_v2gSessionStopResType(struct v2gSessionStopResType* v2gSessionStopResType); +void init_v2gServiceListType(struct v2gServiceListType* v2gServiceListType); +void init_v2gEVSEChargeParameterType(struct v2gEVSEChargeParameterType* v2gEVSEChargeParameterType); +void init_v2gMeteringReceiptReqType(struct v2gMeteringReceiptReqType* v2gMeteringReceiptReqType); +void init_v2gX509IssuerSerialType(struct v2gX509IssuerSerialType* v2gX509IssuerSerialType); +void init_v2gSignatureType(struct v2gSignatureType* v2gSignatureType); +void init_v2gEVPowerDeliveryParameterType(struct v2gEVPowerDeliveryParameterType* v2gEVPowerDeliveryParameterType); +void init_v2gAC_EVSEChargeParameterType(struct v2gAC_EVSEChargeParameterType* v2gAC_EVSEChargeParameterType); +void init_v2gSAScheduleListType(struct v2gSAScheduleListType* v2gSAScheduleListType); +void init_v2gDC_EVPowerDeliveryParameterType(struct v2gDC_EVPowerDeliveryParameterType* v2gDC_EVPowerDeliveryParameterType); +void init_v2gServiceDiscoveryResType(struct v2gServiceDiscoveryResType* v2gServiceDiscoveryResType); +void init_v2gServiceParameterListType(struct v2gServiceParameterListType* v2gServiceParameterListType); +void init_v2gDC_EVChargeParameterType(struct v2gDC_EVChargeParameterType* v2gDC_EVChargeParameterType); +void init_v2gServiceDiscoveryReqType(struct v2gServiceDiscoveryReqType* v2gServiceDiscoveryReqType); +void init_v2gSignatureValueType(struct v2gSignatureValueType* v2gSignatureValueType); +void init_v2gBodyType(struct v2gBodyType* v2gBodyType); +void init_v2gPaymentDetailsResType(struct v2gPaymentDetailsResType* v2gPaymentDetailsResType); +void init_v2gMeteringReceiptResType(struct v2gMeteringReceiptResType* v2gMeteringReceiptResType); +void init_v2gRSAKeyValueType(struct v2gRSAKeyValueType* v2gRSAKeyValueType); +void init_v2gSessionSetupReqType(struct v2gSessionSetupReqType* v2gSessionSetupReqType); +void init_v2gSignedInfoType(struct v2gSignedInfoType* v2gSignedInfoType); +void init_v2gAuthorizationReqType(struct v2gAuthorizationReqType* v2gAuthorizationReqType); +void init_v2gChargingProfileType(struct v2gChargingProfileType* v2gChargingProfileType); +void init_v2gDiffieHellmanPublickeyType(struct v2gDiffieHellmanPublickeyType* v2gDiffieHellmanPublickeyType); +void init_v2gSelectedServiceType(struct v2gSelectedServiceType* v2gSelectedServiceType); +void init_v2gSubCertificatesType(struct v2gSubCertificatesType* v2gSubCertificatesType); +void init_v2gCertificateChainType(struct v2gCertificateChainType* v2gCertificateChainType); +void init_v2gSupportedEnergyTransferModeType(struct v2gSupportedEnergyTransferModeType* v2gSupportedEnergyTransferModeType); +void init_v2gCurrentDemandReqType(struct v2gCurrentDemandReqType* v2gCurrentDemandReqType); +void init_v2gSalesTariffType(struct v2gSalesTariffType* v2gSalesTariffType); +void init_v2gEMAIDType(struct v2gEMAIDType* v2gEMAIDType); +void init_v2gCableCheckReqType(struct v2gCableCheckReqType* v2gCableCheckReqType); +void init_v2gPreChargeResType(struct v2gPreChargeResType* v2gPreChargeResType); +void init_v2gEVStatusType(struct v2gEVStatusType* v2gEVStatusType); +void init_v2gPhysicalValueType(struct v2gPhysicalValueType* v2gPhysicalValueType); +void init_v2gContractSignatureEncryptedPrivateKeyType(struct v2gContractSignatureEncryptedPrivateKeyType* v2gContractSignatureEncryptedPrivateKeyType); +void init_v2gPMaxScheduleType(struct v2gPMaxScheduleType* v2gPMaxScheduleType); +void init_v2gNotificationType(struct v2gNotificationType* v2gNotificationType); +void init_v2gChargingStatusReqType(struct v2gChargingStatusReqType* v2gChargingStatusReqType); +void init_v2gChargeServiceType(struct v2gChargeServiceType* v2gChargeServiceType); +void init_v2gPowerDeliveryResType(struct v2gPowerDeliveryResType* v2gPowerDeliveryResType); +void init_v2gEVSEStatusType(struct v2gEVSEStatusType* v2gEVSEStatusType); +void init_v2gX509DataType(struct v2gX509DataType* v2gX509DataType); +void init_v2gPreChargeReqType(struct v2gPreChargeReqType* v2gPreChargeReqType); +void init_v2gDigestMethodType(struct v2gDigestMethodType* v2gDigestMethodType); +void init_v2gPGPDataType(struct v2gPGPDataType* v2gPGPDataType); +void init_v2gSASchedulesType(struct v2gSASchedulesType* v2gSASchedulesType); +void init_v2gTransformType(struct v2gTransformType* v2gTransformType); +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); +void init_v2gChargingStatusResType(struct v2gChargingStatusResType* v2gChargingStatusResType); void init_v2gObjectType(struct v2gObjectType* v2gObjectType); +void init_v2gPaymentOptionListType(struct v2gPaymentOptionListType* v2gPaymentOptionListType); +void init_v2gParameterSetType(struct v2gParameterSetType* v2gParameterSetType); +void init_v2gAC_EVChargeParameterType(struct v2gAC_EVChargeParameterType* v2gAC_EVChargeParameterType); +void init_v2gManifestType(struct v2gManifestType* v2gManifestType); +void init_v2gServiceDetailResType(struct v2gServiceDetailResType* v2gServiceDetailResType); +void init_v2gListOfRootCertificateIDsType(struct v2gListOfRootCertificateIDsType* v2gListOfRootCertificateIDsType); +void init_v2gServiceType(struct v2gServiceType* v2gServiceType); +void init_v2gParameterType(struct v2gParameterType* v2gParameterType); +void init_v2gDSAKeyValueType(struct v2gDSAKeyValueType* v2gDSAKeyValueType); +void init_v2gAnonType_V2G_Message(struct v2gAnonType_V2G_Message* v2gAnonType_V2G_Message); +void init_v2gEVChargeParameterType(struct v2gEVChargeParameterType* v2gEVChargeParameterType); +void init_v2gProfileEntryType(struct v2gProfileEntryType* v2gProfileEntryType); +void init_v2gSignaturePropertyType(struct v2gSignaturePropertyType* v2gSignaturePropertyType); +void init_v2gPMaxScheduleEntryType(struct v2gPMaxScheduleEntryType* v2gPMaxScheduleEntryType); +void init_v2gKeyValueType(struct v2gKeyValueType* v2gKeyValueType); +void init_v2gRetrievalMethodType(struct v2gRetrievalMethodType* v2gRetrievalMethodType); +void init_v2gSessionStopReqType(struct v2gSessionStopReqType* v2gSessionStopReqType); +void init_v2gServiceDetailReqType(struct v2gServiceDetailReqType* v2gServiceDetailReqType); +void init_v2gKeyInfoType(struct v2gKeyInfoType* v2gKeyInfoType); +void init_v2gAC_EVSEStatusType(struct v2gAC_EVSEStatusType* v2gAC_EVSEStatusType); +void init_v2gSelectedServiceListType(struct v2gSelectedServiceListType* v2gSelectedServiceListType); +void init_v2gMeterInfoType(struct v2gMeterInfoType* v2gMeterInfoType); +void init_v2gSPKIDataType(struct v2gSPKIDataType* v2gSPKIDataType); +void init_v2gChargeParameterDiscoveryResType(struct v2gChargeParameterDiscoveryResType* v2gChargeParameterDiscoveryResType); +void init_v2gTransformsType(struct v2gTransformsType* v2gTransformsType); +void init_v2gSalesTariffEntryType(struct v2gSalesTariffEntryType* v2gSalesTariffEntryType); +void init_v2gWeldingDetectionReqType(struct v2gWeldingDetectionReqType* v2gWeldingDetectionReqType); +void init_v2gSessionSetupResType(struct v2gSessionSetupResType* v2gSessionSetupResType); +void init_v2gSignatureMethodType(struct v2gSignatureMethodType* v2gSignatureMethodType); +void init_v2gCurrentDemandResType(struct v2gCurrentDemandResType* v2gCurrentDemandResType); +void init_v2gChargeParameterDiscoveryReqType(struct v2gChargeParameterDiscoveryReqType* v2gChargeParameterDiscoveryReqType); +void init_v2gCableCheckResType(struct v2gCableCheckResType* v2gCableCheckResType); +void init_v2gRelativeTimeIntervalType(struct v2gRelativeTimeIntervalType* v2gRelativeTimeIntervalType); +void init_v2gSAScheduleTupleType(struct v2gSAScheduleTupleType* v2gSAScheduleTupleType); +void init_v2gDC_EVSEStatusType(struct v2gDC_EVSEStatusType* v2gDC_EVSEStatusType); +void init_v2gIntervalType(struct v2gIntervalType* v2gIntervalType); +void init_v2gReferenceType(struct v2gReferenceType* v2gReferenceType); +void init_v2gCertificateUpdateResType(struct v2gCertificateUpdateResType* v2gCertificateUpdateResType); #ifdef __cplusplus diff --git a/src/codec/v2gEXIDatatypesDecoder.c b/src/codec/v2gEXIDatatypesDecoder.c index c5d7ffa..b490599 100644 --- a/src/codec/v2gEXIDatatypesDecoder.c +++ b/src/codec/v2gEXIDatatypesDecoder.c @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

@@ -48,112 +48,112 @@ static uint32_t uint32; /* Forward Declarations */ -static int decode_v2gServiceDetailResType(bitstream_t* stream, struct v2gServiceDetailResType* v2gServiceDetailResType); -static int decode_v2gSPKIDataType(bitstream_t* stream, struct v2gSPKIDataType* v2gSPKIDataType); -static int decode_v2gAuthorizationResType(bitstream_t* stream, struct v2gAuthorizationResType* v2gAuthorizationResType); -static int decode_v2gBodyType(bitstream_t* stream, struct v2gBodyType* v2gBodyType); -static int decode_v2gPaymentServiceSelectionReqType(bitstream_t* stream, struct v2gPaymentServiceSelectionReqType* v2gPaymentServiceSelectionReqType); -static int decode_v2gEVSEStatusType(bitstream_t* stream, struct v2gEVSEStatusType* v2gEVSEStatusType); -static int decode_v2gSelectedServiceType(bitstream_t* stream, struct v2gSelectedServiceType* v2gSelectedServiceType); -static int decode_v2gEntryType(bitstream_t* stream, struct v2gEntryType* v2gEntryType); -static int decode_v2gDC_EVSEChargeParameterType(bitstream_t* stream, struct v2gDC_EVSEChargeParameterType* v2gDC_EVSEChargeParameterType); -static int decode_v2gSalesTariffType(bitstream_t* stream, struct v2gSalesTariffType* v2gSalesTariffType); -static int decode_v2gPMaxScheduleType(bitstream_t* stream, struct v2gPMaxScheduleType* v2gPMaxScheduleType); -static int decode_v2gCostType(bitstream_t* stream, struct v2gCostType* v2gCostType); -static int decode_v2gChargeServiceType(bitstream_t* stream, struct v2gChargeServiceType* v2gChargeServiceType); -static int decode_v2gPMaxScheduleEntryType(bitstream_t* stream, struct v2gPMaxScheduleEntryType* v2gPMaxScheduleEntryType); -static int decode_v2gServiceListType(bitstream_t* stream, struct v2gServiceListType* v2gServiceListType); -static int decode_v2gKeyValueType(bitstream_t* stream, struct v2gKeyValueType* v2gKeyValueType); -static int decode_v2gPaymentServiceSelectionResType(bitstream_t* stream, struct v2gPaymentServiceSelectionResType* v2gPaymentServiceSelectionResType); -static int decode_v2gSignatureMethodType(bitstream_t* stream, struct v2gSignatureMethodType* v2gSignatureMethodType); -static int decode_v2gMeteringReceiptResType(bitstream_t* stream, struct v2gMeteringReceiptResType* v2gMeteringReceiptResType); -static int decode_v2gMessageHeaderType(bitstream_t* stream, struct v2gMessageHeaderType* v2gMessageHeaderType); -static int decode_v2gRetrievalMethodType(bitstream_t* stream, struct v2gRetrievalMethodType* v2gRetrievalMethodType); -static int decode_v2gEVChargeParameterType(bitstream_t* stream, struct v2gEVChargeParameterType* v2gEVChargeParameterType); -static int decode_v2gCertificateInstallationReqType(bitstream_t* stream, struct v2gCertificateInstallationReqType* v2gCertificateInstallationReqType); -static int decode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct v2gChargeParameterDiscoveryResType* v2gChargeParameterDiscoveryResType); -static int decode_v2gWeldingDetectionReqType(bitstream_t* stream, struct v2gWeldingDetectionReqType* v2gWeldingDetectionReqType); -static int decode_v2gCableCheckReqType(bitstream_t* stream, struct v2gCableCheckReqType* v2gCableCheckReqType); -static int decode_v2gParameterType(bitstream_t* stream, struct v2gParameterType* v2gParameterType); -static int decode_v2gEVSEChargeParameterType(bitstream_t* stream, struct v2gEVSEChargeParameterType* v2gEVSEChargeParameterType); -static int decode_v2gManifestType(bitstream_t* stream, struct v2gManifestType* v2gManifestType); -static int decode_v2gDC_EVStatusType(bitstream_t* stream, struct v2gDC_EVStatusType* v2gDC_EVStatusType); -static int decode_v2gPaymentDetailsReqType(bitstream_t* stream, struct v2gPaymentDetailsReqType* v2gPaymentDetailsReqType); -static int decode_v2gSAScheduleListType(bitstream_t* stream, struct v2gSAScheduleListType* v2gSAScheduleListType); -static int decode_v2gRSAKeyValueType(bitstream_t* stream, struct v2gRSAKeyValueType* v2gRSAKeyValueType); -static int decode_v2gAC_EVSEChargeParameterType(bitstream_t* stream, struct v2gAC_EVSEChargeParameterType* v2gAC_EVSEChargeParameterType); -static int decode_v2gTransformsType(bitstream_t* stream, struct v2gTransformsType* v2gTransformsType); -static int decode_v2gWeldingDetectionResType(bitstream_t* stream, struct v2gWeldingDetectionResType* v2gWeldingDetectionResType); -static int decode_v2gConsumptionCostType(bitstream_t* stream, struct v2gConsumptionCostType* v2gConsumptionCostType); -static int decode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargingStatusResType* v2gChargingStatusResType); -static int decode_v2gEVStatusType(bitstream_t* stream, struct v2gEVStatusType* v2gEVStatusType); -static int decode_v2gPGPDataType(bitstream_t* stream, struct v2gPGPDataType* v2gPGPDataType); -static int decode_v2gSessionStopResType(bitstream_t* stream, struct v2gSessionStopResType* v2gSessionStopResType); -static int decode_v2gServiceDiscoveryReqType(bitstream_t* stream, struct v2gServiceDiscoveryReqType* v2gServiceDiscoveryReqType); -static int decode_v2gAuthorizationReqType(bitstream_t* stream, struct v2gAuthorizationReqType* v2gAuthorizationReqType); -static int decode_v2gSAScheduleTupleType(bitstream_t* stream, struct v2gSAScheduleTupleType* v2gSAScheduleTupleType); -static int decode_v2gPhysicalValueType(bitstream_t* stream, struct v2gPhysicalValueType* v2gPhysicalValueType); -static int decode_v2gDigestMethodType(bitstream_t* stream, struct v2gDigestMethodType* v2gDigestMethodType); -static int decode_v2gAC_EVSEStatusType(bitstream_t* stream, struct v2gAC_EVSEStatusType* v2gAC_EVSEStatusType); -static int decode_v2gSessionSetupResType(bitstream_t* stream, struct v2gSessionSetupResType* v2gSessionSetupResType); -static int decode_v2gX509IssuerSerialType(bitstream_t* stream, struct v2gX509IssuerSerialType* v2gX509IssuerSerialType); -static int decode_v2gSessionStopReqType(bitstream_t* stream, struct v2gSessionStopReqType* v2gSessionStopReqType); -static int decode_v2gDC_EVSEStatusType(bitstream_t* stream, struct v2gDC_EVSEStatusType* v2gDC_EVSEStatusType); -static int decode_v2gDiffieHellmanPublickeyType(bitstream_t* stream, struct v2gDiffieHellmanPublickeyType* v2gDiffieHellmanPublickeyType); -static int decode_v2gCertificateUpdateReqType(bitstream_t* stream, struct v2gCertificateUpdateReqType* v2gCertificateUpdateReqType); -static int decode_v2gBodyBaseType(bitstream_t* stream, struct v2gBodyBaseType* v2gBodyBaseType); -static int decode_v2gDC_EVChargeParameterType(bitstream_t* stream, struct v2gDC_EVChargeParameterType* v2gDC_EVChargeParameterType); -static int decode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCertificatesType* v2gSubCertificatesType); -static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct v2gSupportedEnergyTransferModeType* v2gSupportedEnergyTransferModeType); -static int decode_v2gChargingStatusReqType(bitstream_t* stream, struct v2gChargingStatusReqType* v2gChargingStatusReqType); -static int decode_v2gSignaturePropertyType(bitstream_t* stream, struct v2gSignaturePropertyType* v2gSignaturePropertyType); -static int decode_v2gContractSignatureEncryptedPrivateKeyType(bitstream_t* stream, struct v2gContractSignatureEncryptedPrivateKeyType* v2gContractSignatureEncryptedPrivateKeyType); -static int decode_v2gReferenceType(bitstream_t* stream, struct v2gReferenceType* v2gReferenceType); -static int decode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrentDemandResType* v2gCurrentDemandResType); -static int decode_v2gCanonicalizationMethodType(bitstream_t* stream, struct v2gCanonicalizationMethodType* v2gCanonicalizationMethodType); -static int decode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* v2gTransformType); -static int decode_v2gCertificateChainType(bitstream_t* stream, struct v2gCertificateChainType* v2gCertificateChainType); -static int decode_v2gSignatureValueType(bitstream_t* stream, struct v2gSignatureValueType* v2gSignatureValueType); -static int decode_v2gEVPowerDeliveryParameterType(bitstream_t* stream, struct v2gEVPowerDeliveryParameterType* v2gEVPowerDeliveryParameterType); -static int decode_v2gServiceDetailReqType(bitstream_t* stream, struct v2gServiceDetailReqType* v2gServiceDetailReqType); -static int decode_v2gPaymentDetailsResType(bitstream_t* stream, struct v2gPaymentDetailsResType* v2gPaymentDetailsResType); -static int decode_v2gX509DataType(bitstream_t* stream, struct v2gX509DataType* v2gX509DataType); -static int decode_v2gDSAKeyValueType(bitstream_t* stream, struct v2gDSAKeyValueType* v2gDSAKeyValueType); -static int decode_v2gPowerDeliveryResType(bitstream_t* stream, struct v2gPowerDeliveryResType* v2gPowerDeliveryResType); -static int decode_v2gChargeParameterDiscoveryReqType(bitstream_t* stream, struct v2gChargeParameterDiscoveryReqType* v2gChargeParameterDiscoveryReqType); -static int decode_v2gParameterSetType(bitstream_t* stream, struct v2gParameterSetType* v2gParameterSetType); -static int decode_v2gServiceDiscoveryResType(bitstream_t* stream, struct v2gServiceDiscoveryResType* v2gServiceDiscoveryResType); -static int decode_v2gAnonType_V2G_Message(bitstream_t* stream, struct v2gAnonType_V2G_Message* v2gAnonType_V2G_Message); -static int decode_v2gSignatureType(bitstream_t* stream, struct v2gSignatureType* v2gSignatureType); -static int decode_v2gEMAIDType(bitstream_t* stream, struct v2gEMAIDType* v2gEMAIDType); -static int decode_v2gCertificateInstallationResType(bitstream_t* stream, struct v2gCertificateInstallationResType* v2gCertificateInstallationResType); -static int decode_v2gCableCheckResType(bitstream_t* stream, struct v2gCableCheckResType* v2gCableCheckResType); -static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* v2gMeterInfoType); -static int decode_v2gAC_EVChargeParameterType(bitstream_t* stream, struct v2gAC_EVChargeParameterType* v2gAC_EVChargeParameterType); -static int decode_v2gServiceParameterListType(bitstream_t* stream, struct v2gServiceParameterListType* v2gServiceParameterListType); -static int decode_v2gCurrentDemandReqType(bitstream_t* stream, struct v2gCurrentDemandReqType* v2gCurrentDemandReqType); -static int decode_v2gSASchedulesType(bitstream_t* stream, struct v2gSASchedulesType* v2gSASchedulesType); -static int decode_v2gIntervalType(bitstream_t* stream, struct v2gIntervalType* v2gIntervalType); -static int decode_v2gPreChargeResType(bitstream_t* stream, struct v2gPreChargeResType* v2gPreChargeResType); -static int decode_v2gSalesTariffEntryType(bitstream_t* stream, struct v2gSalesTariffEntryType* v2gSalesTariffEntryType); -static int decode_v2gPaymentOptionListType(bitstream_t* stream, struct v2gPaymentOptionListType* v2gPaymentOptionListType); -static int decode_v2gSignedInfoType(bitstream_t* stream, struct v2gSignedInfoType* v2gSignedInfoType); -static int decode_v2gSessionSetupReqType(bitstream_t* stream, struct v2gSessionSetupReqType* v2gSessionSetupReqType); -static int decode_v2gSignaturePropertiesType(bitstream_t* stream, struct v2gSignaturePropertiesType* v2gSignaturePropertiesType); -static int decode_v2gProfileEntryType(bitstream_t* stream, struct v2gProfileEntryType* v2gProfileEntryType); -static int decode_v2gPreChargeReqType(bitstream_t* stream, struct v2gPreChargeReqType* v2gPreChargeReqType); -static int decode_v2gListOfRootCertificateIDsType(bitstream_t* stream, struct v2gListOfRootCertificateIDsType* v2gListOfRootCertificateIDsType); -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_v2gChargingProfileType(bitstream_t* stream, struct v2gChargingProfileType* v2gChargingProfileType); -static int decode_v2gCertificateUpdateResType(bitstream_t* stream, struct v2gCertificateUpdateResType* v2gCertificateUpdateResType); -static int decode_v2gMeteringReceiptReqType(bitstream_t* stream, struct v2gMeteringReceiptReqType* v2gMeteringReceiptReqType); -static int decode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2gServiceType); -static int decode_v2gNotificationType(bitstream_t* stream, struct v2gNotificationType* v2gNotificationType); -static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2gKeyInfoType); -static int decode_v2gSelectedServiceListType(bitstream_t* stream, struct v2gSelectedServiceListType* v2gSelectedServiceListType); 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_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_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_v2gSignedInfoType(bitstream_t* stream, struct v2gSignedInfoType* v2gSignedInfoType); +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_v2gCableCheckResType(bitstream_t* stream, struct v2gCableCheckResType* v2gCableCheckResType); +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_v2gCertificateUpdateResType(bitstream_t* stream, struct v2gCertificateUpdateResType* v2gCertificateUpdateResType); /* Deviant data decoding (skip functions) */ static int decodeDeviationsCH(bitstream_t* stream) { @@ -171,17 +171,17 @@ static int decodeDeviationsCH(bitstream_t* stream) { } - /* 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) { + /* 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 = 0; int done = 0; - init_v2gServiceDetailResType(v2gServiceDetailResType); + init_v2gPowerDeliveryReqType(v2gPowerDeliveryReqType); while(!done) { switch(grammarID) { case 0: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeProgress)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { @@ -190,14 +190,15 @@ static int decode_v2gServiceDetailResType(bitstream_t* stream, struct v2gService errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &v2gServiceDetailResType->ResponseCode); + 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}ResponseCode) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeProgress) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { grammarID = 1; @@ -213,23 +214,24 @@ static int decode_v2gServiceDetailResType(bitstream_t* stream, struct v2gService } break; case 1: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceID)] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gServiceDetailResType->ServiceID); + 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}ServiceID) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { grammarID = 2; @@ -245,19 +247,29 @@ static int decode_v2gServiceDetailResType(bitstream_t* stream, struct v2gService } break; case 2: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceParameterList), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + /* 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_v2gServiceParameterListType(stream, &v2gServiceDetailResType->ServiceParameterList); - v2gServiceDetailResType->ServiceParameterList_isUsed = 1u; + errn = decode_v2gChargingProfileType(stream, &v2gPowerDeliveryReqType->ChargingProfile); + v2gPowerDeliveryReqType->ChargingProfile_isUsed = 1u; grammarID = 3; break; case 1: - done = 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; + break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; break; @@ -265,13 +277,38 @@ static int decode_v2gServiceDetailResType(bitstream_t* stream, struct v2gService } 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 = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -290,104 +327,36 @@ static int decode_v2gServiceDetailResType(bitstream_t* stream, struct v2gService 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 = 5; +/* 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; int done = 0; - init_v2gSPKIDataType(v2gSPKIDataType); + init_v2gCertificateUpdateReqType(v2gCertificateUpdateReqType); while(!done) { switch(grammarID) { - case 5: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp)] */ + case 6: + /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgBody}Id)] */ 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; + errn = decodeUnsignedInteger16(stream, &v2gCertificateUpdateReqType->Id.charactersLen); + if (errn == 0) { + errn = (v2gCertificateUpdateReqType->Id.charactersLen - 2) <= v2gCertificateUpdateReqType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 6; + 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 { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; } } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 6: - /* 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 = 6; - } 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 = 7; break; - case 2: - done = 1; - grammarID = 4; - break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; break; @@ -395,45 +364,13 @@ static int decode_v2gSPKIDataType(bitstream_t* stream, struct v2gSPKIDataType* v } break; case 7: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */ + 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 = 6; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; + errn = decode_v2gCertificateChainType(stream, &v2gCertificateUpdateReqType->ContractSignatureCertChain); + grammarID = 8; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -441,44 +378,36 @@ static int decode_v2gSPKIDataType(bitstream_t* stream, struct v2gSPKIDataType* v } } 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 = 8; - int done = 0; - - init_v2gAuthorizationResType(v2gAuthorizationResType); - - while(!done) { - switch(grammarID) { case 8: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &v2gAuthorizationResType->ResponseCode); + 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}ResponseCode) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { grammarID = 9; @@ -494,30 +423,13 @@ static int decode_v2gAuthorizationResType(bitstream_t* stream, struct v2gAuthori } break; case 9: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing)] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ListOfRootCertificateIDs)] */ 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, &v2gAuthorizationResType->EVSEProcessing); - } else { - /* Second level event (e.g., xsi:type, 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 */ - } - } + errn = decode_v2gListOfRootCertificateIDsType(stream, &v2gCertificateUpdateReqType->ListOfRootCertificateIDs); + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -525,2203 +437,14 @@ static int decode_v2gAuthorizationResType(bitstream_t* stream, struct v2gAuthori } } break; - case 3: + case 4: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - 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 = 10; - int done = 0; - - init_v2gBodyType(v2gBodyType); - - while(!done) { - switch(grammarID) { - case 10: - /* 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,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 = 11; - int done = 0; - - init_v2gPaymentServiceSelectionReqType(v2gPaymentServiceSelectionReqType); - - while(!done) { - switch(grammarID) { - case 11: - /* 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, &v2gPaymentServiceSelectionReqType->SelectedPaymentOption); - } else { - /* Second level event (e.g., xsi:type, 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 = 12; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 12: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}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='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 = 13; - int done = 0; - - init_v2gEVSEStatusType(v2gEVSEStatusType); - - while(!done) { - switch(grammarID) { - case 13: - /* 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 = 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: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, &v2gEVSEStatusType->EVSENotification); - } else { - /* Second level event (e.g., xsi:type, 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: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 = 15; - int done = 0; - - init_v2gSelectedServiceType(v2gSelectedServiceType); - - while(!done) { - switch(grammarID) { - case 15: - /* 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 = 16; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 16: - /* Element[START_ELEMENT({urn:iso:15118:2:2013: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,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 = 17; - int done = 0; - - init_v2gEntryType(v2gEntryType); - - while(!done) { - switch(grammarID) { - case 17: - /* 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: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 = 18; - int done = 0; - - init_v2gDC_EVSEChargeParameterType(v2gDC_EVSEChargeParameterType); - - while(!done) { - switch(grammarID) { - case 18: - /* 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 = 19; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 19: - /* 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 = 20; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 20: - /* 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 = 21; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 21: - /* 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 = 22; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 22: - /* 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 = 23; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 23: - /* 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 = 24; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 24: - /* 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 = 25; - break; - case 1: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEPeakCurrentRipple); - grammarID = 26; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 25: - /* 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 = 26; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 26: - /* 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: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 = 27; - int done = 0; - - init_v2gSalesTariffType(v2gSalesTariffType); - - while(!done) { - switch(grammarID) { - case 27: - /* 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 = 28; - 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 = 29; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 28: - /* 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 = 29; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 29: - /* 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 = 30; - } 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 = 31; - } 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 = 32; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 30: - /* 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 = 31; - } 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 = 32; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 31: - /* 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 = 32; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 32: - /* 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 = 32; - 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,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 = 33; - int done = 0; - - init_v2gPMaxScheduleType(v2gPMaxScheduleType); - - while(!done) { - switch(grammarID) { - case 33: - /* 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 = 34; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 34: - /* 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 = 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,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 = 35; - int done = 0; - - init_v2gCostType(v2gCostType); - - while(!done) { - switch(grammarID) { - case 35: - /* 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, &v2gCostType->costKind); - } else { - /* Second level event (e.g., xsi:type, 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 = 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}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 = 37; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 37: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}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: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 = 38; - int done = 0; - - init_v2gChargeServiceType(v2gChargeServiceType); - - while(!done) { - switch(grammarID) { - case 38: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gChargeServiceType->ServiceID); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 39; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 39: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceName), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gChargeServiceType->ServiceName.charactersLen); - if (errn == 0) { - errn = (v2gChargeServiceType->ServiceName.charactersLen - 2) <= v2gChargeServiceType_ServiceName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gChargeServiceType->ServiceName.charactersLen >= 2) { - v2gChargeServiceType->ServiceName.charactersLen = (uint16_t)(v2gChargeServiceType->ServiceName.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gChargeServiceType->ServiceName.charactersLen, v2gChargeServiceType->ServiceName.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gChargeServiceType->ServiceName_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceName) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 40; - } 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, &v2gChargeServiceType->ServiceCategory); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 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: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &v2gChargeServiceType->ServiceCategory); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 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:MsgDataTypes}ServiceScope), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gChargeServiceType->ServiceScope.charactersLen); - if (errn == 0) { - errn = (v2gChargeServiceType->ServiceScope.charactersLen - 2) <= v2gChargeServiceType_ServiceScope_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gChargeServiceType->ServiceScope.charactersLen >= 2) { - v2gChargeServiceType->ServiceScope.charactersLen = (uint16_t)(v2gChargeServiceType->ServiceScope.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gChargeServiceType->ServiceScope.charactersLen, v2gChargeServiceType->ServiceScope.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gChargeServiceType->ServiceScope_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceScope) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 42; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gChargeServiceType->FreeService); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 43; - } 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:MsgDataTypes}FreeService)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gChargeServiceType->FreeService); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 43; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 43: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SupportedEnergyTransferMode)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gSupportedEnergyTransferModeType(stream, &v2gChargeServiceType->SupportedEnergyTransferMode); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,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 = 44; - int done = 0; - - init_v2gPMaxScheduleEntryType(v2gPMaxScheduleEntryType); - - while(!done) { - switch(grammarID) { - case 44: - /* 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 = 45; - break; - case 1: - errn = decode_v2gIntervalType(stream, &v2gPMaxScheduleEntryType->TimeInterval); - v2gPMaxScheduleEntryType->TimeInterval_isUsed = 1u; - grammarID = 45; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 45: - /* 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: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 = 46; - int done = 0; - - init_v2gServiceListType(v2gServiceListType); - - while(!done) { - switch(grammarID) { - case 46: - /* 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 = 47; - 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 = 4; - 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 = 4; - 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 = 4; - 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 = 4; - 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 = 52; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 52: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}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 = 53; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 53: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}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='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 = 54; - int done = 0; - - init_v2gKeyValueType(v2gKeyValueType); - - while(!done) { - switch(grammarID) { - case 54: - /* 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 = 55; - break; - case 1: - errn = decode_v2gRSAKeyValueType(stream, &v2gKeyValueType->RSAKeyValue); - v2gKeyValueType->RSAKeyValue_isUsed = 1u; - grammarID = 55; - break; - case 2: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 55; - break; - case 3: - errn = decodeDeviationsCH(stream); - grammarID = 56; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 55: - /* 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 = 55; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 56: - /* 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 = 55; - break; - case 1: - errn = decode_v2gRSAKeyValueType(stream, &v2gKeyValueType->RSAKeyValue); - v2gKeyValueType->RSAKeyValue_isUsed = 1u; - grammarID = 55; - break; - case 2: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 55; - break; - case 3: - grammarID = 56; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='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 = 57; - int done = 0; - - init_v2gPaymentServiceSelectionResType(v2gPaymentServiceSelectionResType); - - while(!done) { - switch(grammarID) { - case 57: - /* 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, &v2gPaymentServiceSelectionResType->ResponseCode); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,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 = 58; - int done = 0; - - init_v2gSignatureMethodType(v2gSignatureMethodType); - - while(!done) { - switch(grammarID) { - case 58: - /* 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 = 59; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 59: - /* 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 = 60; - } 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 = 60; - break; - case 2: - done = 1; - grammarID = 4; - break; - case 3: - grammarID = 61; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 60: - /* 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 = 60; - break; - case 1: - done = 1; - grammarID = 4; - break; - case 2: - grammarID = 60; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 61: - /* 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 = 60; - } 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 = 60; - break; - case 2: - done = 1; - grammarID = 4; - break; - case 3: - grammarID = 61; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - 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 = 62; - int done = 0; - - init_v2gMeteringReceiptResType(v2gMeteringReceiptResType); - - while(!done) { - switch(grammarID) { - case 62: - /* 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, &v2gMeteringReceiptResType->ResponseCode); - } else { - /* Second level event (e.g., xsi:type, 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 = 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: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; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -2742,14 +465,14 @@ static int decode_v2gMeteringReceiptResType(bitstream_t* stream, struct v2gMeter /* 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 = 64; + int grammarID = 10; int done = 0; init_v2gMessageHeaderType(v2gMessageHeaderType); while(!done) { switch(grammarID) { - case 64: + case 10: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgHeader}SessionID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -2775,7 +498,7 @@ static int decode_v2gMessageHeaderType(bitstream_t* stream, struct v2gMessageHea /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgHeader}SessionID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 65; + grammarID = 11; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -2787,7 +510,7 @@ static int decode_v2gMessageHeaderType(bitstream_t* stream, struct v2gMessageHea } } break; - case 65: + 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) { @@ -2795,16 +518,16 @@ static int decode_v2gMessageHeaderType(bitstream_t* stream, struct v2gMessageHea case 0: errn = decode_v2gNotificationType(stream, &v2gMessageHeaderType->Notification); v2gMessageHeaderType->Notification_isUsed = 1u; - grammarID = 66; + grammarID = 12; break; case 1: errn = decode_v2gSignatureType(stream, &v2gMessageHeaderType->Signature); v2gMessageHeaderType->Signature_isUsed = 1u; - grammarID = 3; + grammarID = 4; break; case 2: done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -2812,7 +535,7 @@ static int decode_v2gMessageHeaderType(bitstream_t* stream, struct v2gMessageHea } } break; - case 66: + case 12: /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -2820,11 +543,11 @@ static int decode_v2gMessageHeaderType(bitstream_t* stream, struct v2gMessageHea case 0: errn = decode_v2gSignatureType(stream, &v2gMessageHeaderType->Signature); v2gMessageHeaderType->Signature_isUsed = 1u; - grammarID = 3; + grammarID = 4; break; case 1: done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -2832,14 +555,14 @@ static int decode_v2gMessageHeaderType(bitstream_t* stream, struct v2gMessageHea } } break; - case 3: + case 4: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -2858,134 +581,23 @@ static int decode_v2gMessageHeaderType(bitstream_t* stream, struct v2gMessageHea 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 = 67; +/* 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_v2gRetrievalMethodType(v2gRetrievalMethodType); + init_v2gBodyBaseType(v2gBodyBaseType); while(!done) { switch(grammarID) { - case 67: - /* 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 = 68; - 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 = 69; - 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 68: - /* 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 = 69; - 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 69: - /* 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] */ + case 13: + /* FirstStartTag[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -3004,18 +616,149 @@ static int decode_v2gRetrievalMethodType(bitstream_t* stream, struct v2gRetrieva 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 = 70; +/* 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_v2gEVChargeParameterType(v2gEVChargeParameterType); + init_v2gWeldingDetectionResType(v2gWeldingDetectionResType); while(!done) { switch(grammarID) { - case 70: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + 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: @@ -3023,41 +766,74 @@ static int decode_v2gEVChargeParameterType(bitstream_t* stream, struct v2gEVChar errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger32(stream, &v2gEVChargeParameterType->DepartureTime); - v2gEVChargeParameterType->DepartureTime_isUsed = 1u; + 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}DepartureTime) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}amount) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 19; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } } break; - case 1: - done = 1; - grammarID = 4; - break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; break; } } break; - case 3: + case 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 = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -3078,14 +854,14 @@ static int decode_v2gEVChargeParameterType(bitstream_t* stream, struct v2gEVChar /* 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 = 71; + int grammarID = 20; int done = 0; init_v2gCertificateInstallationReqType(v2gCertificateInstallationReqType); while(!done) { switch(grammarID) { - case 71: + case 20: /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgBody}Id)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -3104,7 +880,7 @@ static int decode_v2gCertificateInstallationReqType(bitstream_t* stream, struct errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; } } - grammarID = 72; + grammarID = 21; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -3112,7 +888,7 @@ static int decode_v2gCertificateInstallationReqType(bitstream_t* stream, struct } } break; - case 72: + case 21: /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}OEMProvisioningCert)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -3138,7 +914,7 @@ static int decode_v2gCertificateInstallationReqType(bitstream_t* stream, struct /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}OEMProvisioningCert) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 73; + grammarID = 9; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -3150,14 +926,14 @@ static int decode_v2gCertificateInstallationReqType(bitstream_t* stream, struct } } break; - case 73: + 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 = 3; + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -3165,14 +941,14 @@ static int decode_v2gCertificateInstallationReqType(bitstream_t* stream, struct } } break; - case 3: + case 4: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -3191,17 +967,265 @@ static int decode_v2gCertificateInstallationReqType(bitstream_t* stream, struct 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 = 74; +/* 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_v2gChargeParameterDiscoveryResType(v2gChargeParameterDiscoveryResType); + init_v2gEntryType(v2gEntryType); while(!done) { switch(grammarID) { - case 74: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + 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) { @@ -3210,17 +1234,18 @@ static int decode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &v2gChargeParameterDiscoveryResType->ResponseCode); + 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}ResponseCode) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SelectedPaymentOption) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 75; + grammarID = 30; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -3232,7 +1257,90 @@ static int decode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct } } break; - case 75: + 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) { @@ -3242,7 +1350,8 @@ static int decode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &v2gChargeParameterDiscoveryResType->EVSEProcessing); + 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; @@ -3252,7 +1361,7 @@ static int decode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 76; + grammarID = 4; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -3264,1186 +1373,14 @@ static int decode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct } } break; - case 76: - /* 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 = 77; - break; - case 1: - errn = decode_v2gSASchedulesType(stream, &v2gChargeParameterDiscoveryResType->SASchedules); - v2gChargeParameterDiscoveryResType->SASchedules_isUsed = 1u; - grammarID = 77; - 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 77: - /* 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: + case 4: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - 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 = 78; - int done = 0; - - init_v2gWeldingDetectionReqType(v2gWeldingDetectionReqType); - - while(!done) { - switch(grammarID) { - case 78: - /* 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='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 = 78; - int done = 0; - - init_v2gCableCheckReqType(v2gCableCheckReqType); - - while(!done) { - switch(grammarID) { - case 78: - /* 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,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 = 79; - int done = 0; - - init_v2gParameterType(v2gParameterType); - - while(!done) { - switch(grammarID) { - case 79: - /* 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 = 80; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 80: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}boolValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}byteValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}shortValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}intValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}physicalValue), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}stringValue)] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeBoolean(stream, &v2gParameterType->boolValue); - v2gParameterType->boolValue_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}boolValue) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); - v2gParameterType->byteValue = (int8_t)(uint32 -128); - v2gParameterType->byteValue_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}byteValue) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &v2gParameterType->shortValue); - v2gParameterType->shortValue_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}shortValue) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 3: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger32(stream, &v2gParameterType->intValue); - v2gParameterType->intValue_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}intValue) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 4: - errn = decode_v2gPhysicalValueType(stream, &v2gParameterType->physicalValue); - v2gParameterType->physicalValue_isUsed = 1u; - grammarID = 3; - break; - case 5: - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gParameterType->stringValue.charactersLen); - if (errn == 0) { - errn = (v2gParameterType->stringValue.charactersLen - 2) <= v2gParameterType_stringValue_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gParameterType->stringValue.charactersLen >= 2) { - v2gParameterType->stringValue.charactersLen = (uint16_t)(v2gParameterType->stringValue.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gParameterType->stringValue.charactersLen, v2gParameterType->stringValue.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gParameterType->stringValue_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}stringValue) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,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 = 81; - int done = 0; - - init_v2gEVSEChargeParameterType(v2gEVSEChargeParameterType); - - while(!done) { - switch(grammarID) { - case 81: - /* 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#,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 = 82; - int done = 0; - - init_v2gManifestType(v2gManifestType); - - while(!done) { - switch(grammarID) { - case 82: - /* 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 = 83; - 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 = 84; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 83: - /* 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 = 84; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 84: - /* 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 = 84; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":EVReady,"urn:iso:15118:2:2013:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2013:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ -static int decode_v2gDC_EVStatusType(bitstream_t* stream, struct v2gDC_EVStatusType* v2gDC_EVStatusType) { - int grammarID = 85; - int done = 0; - - init_v2gDC_EVStatusType(v2gDC_EVStatusType); - - while(!done) { - switch(grammarID) { - case 85: - /* 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 = 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: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, &v2gDC_EVStatusType->EVErrorCode); - } else { - /* Second level event (e.g., xsi:type, 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 = 87; - } 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: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,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 = 88; - int done = 0; - - init_v2gPaymentDetailsReqType(v2gPaymentDetailsReqType); - - while(!done) { - switch(grammarID) { - case 88: - /* 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 = 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: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; - 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 = 90; - int done = 0; - - init_v2gSAScheduleListType(v2gSAScheduleListType); - - while(!done) { - switch(grammarID) { - case 90: - /* 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 = 91; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 91: - /* 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 = 92; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 92: - /* 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#,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 = 93; - int done = 0; - - init_v2gRSAKeyValueType(v2gRSAKeyValueType); - - while(!done) { - switch(grammarID) { - case 93: - /* 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 = 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({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='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 = 95; - int done = 0; - - init_v2gAC_EVSEChargeParameterType(v2gAC_EVSEChargeParameterType); - - while(!done) { - switch(grammarID) { - case 95: - /* 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 = 96; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 96: - /* 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 = 97; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 97: - /* 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#,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 = 98; - int done = 0; - - init_v2gTransformsType(v2gTransformsType); - - while(!done) { - switch(grammarID) { - case 98: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gTransformsType->Transform.arrayLen < v2gTransformsType_Transform_ARRAY_SIZE) { - errn = decode_v2gTransformType(stream, &v2gTransformsType->Transform.array[v2gTransformsType->Transform.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 99; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 99: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - if (v2gTransformsType->Transform.arrayLen < v2gTransformsType_Transform_ARRAY_SIZE) { - errn = decode_v2gTransformType(stream, &v2gTransformsType->Transform.array[v2gTransformsType->Transform.arrayLen++]); - } else { - errn = EXI_ERROR_OUT_OF_BOUNDS; - } - grammarID = 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: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 = 100; - int done = 0; - - init_v2gWeldingDetectionResType(v2gWeldingDetectionResType); - - while(!done) { - switch(grammarID) { - case 100: - /* 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, &v2gWeldingDetectionResType->ResponseCode); - } else { - /* Second level event (e.g., xsi:type, 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 = 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: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 = 102; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 102: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEPresentVoltage)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gWeldingDetectionResType->EVSEPresentVoltage); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -4464,21 +1401,21 @@ static int decode_v2gWeldingDetectionResType(bitstream_t* stream, struct v2gWeld /* 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 = 103; + int grammarID = 33; int done = 0; init_v2gConsumptionCostType(v2gConsumptionCostType); while(!done) { switch(grammarID) { - case 103: + 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 = 104; + grammarID = 34; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -4486,7 +1423,7 @@ static int decode_v2gConsumptionCostType(bitstream_t* stream, struct v2gConsumpt } } break; - case 104: + case 34: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Cost)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -4497,7 +1434,7 @@ static int decode_v2gConsumptionCostType(bitstream_t* stream, struct v2gConsumpt } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 105; + grammarID = 35; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -4505,7 +1442,7 @@ static int decode_v2gConsumptionCostType(bitstream_t* stream, struct v2gConsumpt } } break; - case 105: + case 35: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Cost), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -4516,11 +1453,11 @@ static int decode_v2gConsumptionCostType(bitstream_t* stream, struct v2gConsumpt } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 106; + grammarID = 36; break; case 1: done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -4528,7 +1465,7 @@ static int decode_v2gConsumptionCostType(bitstream_t* stream, struct v2gConsumpt } } break; - case 106: + case 36: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Cost), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -4539,11 +1476,11 @@ static int decode_v2gConsumptionCostType(bitstream_t* stream, struct v2gConsumpt } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 3; + grammarID = 4; break; case 1: done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -4551,14 +1488,14 @@ static int decode_v2gConsumptionCostType(bitstream_t* stream, struct v2gConsumpt } } break; - case 3: + case 4: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -4577,16 +1514,16 @@ static int decode_v2gConsumptionCostType(bitstream_t* stream, struct v2gConsumpt 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 = 107; +/* 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_v2gChargingStatusResType(v2gChargingStatusResType); + init_v2gCertificateInstallationResType(v2gCertificateInstallationResType); while(!done) { switch(grammarID) { - case 107: + case 37: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -4596,7 +1533,8 @@ static int decode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargi errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &v2gChargingStatusResType->ResponseCode); + 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; @@ -4606,7 +1544,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 = 108; + grammarID = 38; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -4618,43 +1556,14 @@ static int decode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargi } } break; - case 108: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEID)] */ + case 38: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAProvisioningCertificateChain)] */ 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 = 109; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } + errn = decode_v2gCertificateChainType(stream, &v2gCertificateInstallationResType->SAProvisioningCertificateChain); + grammarID = 39; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -4662,32 +1571,14 @@ static int decode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargi } } break; - case 109: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID)] */ + case 39: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */ 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 = 110; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } + errn = decode_v2gCertificateChainType(stream, &v2gCertificateInstallationResType->ContractSignatureCertChain); + grammarID = 40; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -4695,140 +1586,14 @@ static int decode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargi } } break; - case 110: - /* 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 = 111; - break; - case 1: - errn = decode_v2gMeterInfoType(stream, &v2gChargingStatusResType->MeterInfo); - v2gChargingStatusResType->MeterInfo_isUsed = 1u; - grammarID = 112; - 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 = 113; - } 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 111: - /* 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 = 112; - 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 = 113; - } 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 112: - /* 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 = 113; - } 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 113: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}AC_EVSEStatus)] */ + 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_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus); - grammarID = 3; + errn = decode_v2gContractSignatureEncryptedPrivateKeyType(stream, &v2gCertificateInstallationResType->ContractSignatureEncryptedPrivateKey); + grammarID = 41; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -4836,204 +1601,44 @@ static int decode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargi } } break; - case 3: + 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 = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - 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 = 81; - int done = 0; - - init_v2gEVStatusType(v2gEVStatusType); - - while(!done) { - switch(grammarID) { - case 81: - /* 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#,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 = 114; - int done = 0; - - init_v2gPGPDataType(v2gPGPDataType); - - while(!done) { - switch(grammarID) { - case 114: - /* 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 = 115; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gPGPDataType->PGPKeyPacket.bytesLen); - if (errn == 0) { - errn = (v2gPGPDataType->PGPKeyPacket.bytesLen) <= v2gPGPDataType_PGPKeyPacket_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gPGPDataType->PGPKeyPacket.bytesLen, v2gPGPDataType->PGPKeyPacket.bytes); - } - v2gPGPDataType->PGPKeyPacket_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 116; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 115: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket), START_ELEMENT_GENERIC, END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gPGPDataType->PGPKeyPacket.bytesLen); - if (errn == 0) { - errn = (v2gPGPDataType->PGPKeyPacket.bytesLen) <= v2gPGPDataType_PGPKeyPacket_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gPGPDataType->PGPKeyPacket.bytesLen, v2gPGPDataType->PGPKeyPacket.bytes); - } - v2gPGPDataType->PGPKeyPacket_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 116; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 116; - break; - case 2: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 116: - /* 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 = 116; - break; - case 1: - done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -5054,14 +1659,14 @@ static int decode_v2gPGPDataType(bitstream_t* stream, struct v2gPGPDataType* v2g /* 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 = 57; + int grammarID = 43; int done = 0; init_v2gSessionStopResType(v2gSessionStopResType); while(!done) { switch(grammarID) { - case 57: + case 43: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -5071,7 +1676,8 @@ static int decode_v2gSessionStopResType(bitstream_t* stream, struct v2gSessionSt errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &v2gSessionStopResType->ResponseCode); + 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; @@ -5081,7 +1687,7 @@ static int decode_v2gSessionStopResType(bitstream_t* stream, struct v2gSessionSt /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 4; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -5093,15 +1699,1594 @@ static int decode_v2gSessionStopResType(bitstream_t* stream, struct v2gSessionSt } } break; - case 3: + 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; @@ -5121,14 +3306,14 @@ static int decode_v2gSessionStopResType(bitstream_t* stream, struct v2gSessionSt /* 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 = 117; + int grammarID = 87; int done = 0; init_v2gServiceDiscoveryReqType(v2gServiceDiscoveryReqType); while(!done) { switch(grammarID) { - case 117: + case 87: /* 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) { @@ -5161,7 +3346,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 = 118; + grammarID = 88; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -5172,7 +3357,8 @@ static int decode_v2gServiceDiscoveryReqType(bitstream_t* stream, struct v2gServ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &v2gServiceDiscoveryReqType->ServiceCategory); + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + v2gServiceDiscoveryReqType->ServiceCategory = (v2gserviceCategoryType) uint32; v2gServiceDiscoveryReqType->ServiceCategory_isUsed = 1u; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ @@ -5183,7 +3369,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 = 3; + grammarID = 4; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -5191,7 +3377,7 @@ static int decode_v2gServiceDiscoveryReqType(bitstream_t* stream, struct v2gServ break; case 2: done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -5199,7 +3385,7 @@ static int decode_v2gServiceDiscoveryReqType(bitstream_t* stream, struct v2gServ } } break; - case 118: + case 88: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceCategory), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -5209,7 +3395,8 @@ static int decode_v2gServiceDiscoveryReqType(bitstream_t* stream, struct v2gServ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &v2gServiceDiscoveryReqType->ServiceCategory); + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + v2gServiceDiscoveryReqType->ServiceCategory = (v2gserviceCategoryType) uint32; v2gServiceDiscoveryReqType->ServiceCategory_isUsed = 1u; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ @@ -5220,7 +3407,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 = 3; + grammarID = 4; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -5228,6 +3415,79 @@ static int decode_v2gServiceDiscoveryReqType(bitstream_t* stream, struct v2gServ 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#,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; + int done = 0; + + init_v2gSignatureValueType(v2gSignatureValueType); + + while(!done) { + switch(grammarID) { + case 89: + /* 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 = 90; + 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; break; default: @@ -5236,15 +3496,801 @@ static int decode_v2gServiceDiscoveryReqType(bitstream_t* stream, struct v2gServ } } break; - case 3: + case 90: + /* 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 = 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,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)] */ + 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; + 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++]); + } 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; @@ -5264,14 +4310,14 @@ static int decode_v2gServiceDiscoveryReqType(bitstream_t* stream, struct v2gServ /* 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 = 119; + int grammarID = 105; int done = 0; init_v2gAuthorizationReqType(v2gAuthorizationReqType); while(!done) { switch(grammarID) { - case 119: + 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) { @@ -5291,7 +4337,7 @@ static int decode_v2gAuthorizationReqType(bitstream_t* stream, struct v2gAuthori } } v2gAuthorizationReqType->Id_isUsed = 1u; - grammarID = 120; + grammarID = 106; break; case 1: /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ @@ -5315,7 +4361,7 @@ static int decode_v2gAuthorizationReqType(bitstream_t* stream, struct v2gAuthori /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 4; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -5323,7 +4369,7 @@ static int decode_v2gAuthorizationReqType(bitstream_t* stream, struct v2gAuthori break; case 2: done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -5331,7 +4377,7 @@ static int decode_v2gAuthorizationReqType(bitstream_t* stream, struct v2gAuthori } } break; - case 120: + case 106: /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -5358,7 +4404,7 @@ static int decode_v2gAuthorizationReqType(bitstream_t* stream, struct v2gAuthori /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}GenChallenge) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 4; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -5366,7 +4412,7 @@ static int decode_v2gAuthorizationReqType(bitstream_t* stream, struct v2gAuthori break; case 1: done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -5374,14 +4420,14 @@ static int decode_v2gAuthorizationReqType(bitstream_t* stream, struct v2gAuthori } } break; - case 3: + case 4: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -5400,41 +4446,27 @@ static int decode_v2gAuthorizationReqType(bitstream_t* stream, struct v2gAuthori 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 = 121; +/* 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_v2gSAScheduleTupleType(v2gSAScheduleTupleType); + init_v2gChargingProfileType(v2gChargingProfileType); while(!done) { switch(grammarID) { - case 121: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SAScheduleTupleID)] */ + case 107: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ProfileEntry)] */ 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 = 122; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } + 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; @@ -5442,916 +4474,22 @@ static int decode_v2gSAScheduleTupleType(bitstream_t* stream, struct v2gSASchedu } } break; - case 122: - /* 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 = 123; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 123: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SalesTariff), END_ELEMENT] */ + 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: - errn = decode_v2gSalesTariffType(stream, &v2gSAScheduleTupleType->SalesTariff); - v2gSAScheduleTupleType->SalesTariff_isUsed = 1u; - grammarID = 3; + 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 = 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 = 124; - int done = 0; - - init_v2gPhysicalValueType(v2gPhysicalValueType); - - while(!done) { - switch(grammarID) { - case 124: - /* 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 = 125; - } 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: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, &v2gPhysicalValueType->Unit); - } else { - /* Second level event (e.g., xsi:type, 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 = 126; - } 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: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='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 = 127; - int done = 0; - - init_v2gDigestMethodType(v2gDigestMethodType); - - while(!done) { - switch(grammarID) { - case 127: - /* 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 = 128; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 128: - /* 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 = 60; - break; - case 1: - done = 1; - grammarID = 4; - break; - case 2: - grammarID = 60; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 60: - /* 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 = 60; - break; - case 1: - done = 1; - grammarID = 4; - break; - case 2: - grammarID = 60; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - 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 = 129; - int done = 0; - - init_v2gAC_EVSEStatusType(v2gAC_EVSEStatusType); - - while(!done) { - switch(grammarID) { - case 129: - /* 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 = 130; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 130: - /* Element[START_ELEMENT({urn:iso:15118:2:2013: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, &v2gAC_EVSEStatusType->EVSENotification); - } else { - /* Second level event (e.g., xsi:type, 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 = 131; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 131: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}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: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 = 132; - int done = 0; - - init_v2gSessionSetupResType(v2gSessionSetupResType); - - while(!done) { - switch(grammarID) { - case 132: - /* 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, &v2gSessionSetupResType->ResponseCode); - } else { - /* Second level event (e.g., xsi:type, 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 = 133; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 133: - /* Element[START_ELEMENT({urn:iso:15118:2:2013: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 = 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:2013:MsgBody}EVSETimeStamp), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger64(stream, &v2gSessionSetupResType->EVSETimeStamp); - v2gSessionSetupResType->EVSETimeStamp_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSETimeStamp) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='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 = 135; - int done = 0; - - init_v2gX509IssuerSerialType(v2gX509IssuerSerialType); - - while(!done) { - switch(grammarID) { - case 135: - /* 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 = 136; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 136: - /* 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='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 = 137; - int done = 0; - - init_v2gSessionStopReqType(v2gSessionStopReqType); - - while(!done) { - switch(grammarID) { - case 137: - /* 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, &v2gSessionStopReqType->ChargingSession); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingSession) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,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 = 138; - int done = 0; - - init_v2gDC_EVSEStatusType(v2gDC_EVSEStatusType); - - while(!done) { - switch(grammarID) { - case 138: - /* 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 = 139; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 139: - /* 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, &v2gDC_EVSEStatusType->EVSENotification); - } else { - /* Second level event (e.g., xsi:type, 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 = 140; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 140: - /* 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, &v2gDC_EVSEStatusType->EVSEIsolationStatus); - 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 = 141; - } 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, &v2gDC_EVSEStatusType->EVSEStatusCode); - } else { - /* Second level event (e.g., xsi:type, 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 141: - /* 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, &v2gDC_EVSEStatusType->EVSEStatusCode); - } else { - /* Second level event (e.g., xsi:type, 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; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -6372,14 +4510,14 @@ static int decode_v2gDC_EVSEStatusType(bitstream_t* stream, struct v2gDC_EVSESta /* 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 = 142; + int grammarID = 109; int done = 0; init_v2gDiffieHellmanPublickeyType(v2gDiffieHellmanPublickeyType); while(!done) { switch(grammarID) { - case 142: + case 109: /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -6398,7 +4536,7 @@ static int decode_v2gDiffieHellmanPublickeyType(bitstream_t* stream, struct v2gD errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; } } - grammarID = 143; + grammarID = 90; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -6406,7 +4544,7 @@ static int decode_v2gDiffieHellmanPublickeyType(bitstream_t* stream, struct v2gD } } break; - case 143: + case 90: /* StartTag[CHARACTERS[BINARY_BASE64]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -6419,7 +4557,7 @@ static int decode_v2gDiffieHellmanPublickeyType(bitstream_t* stream, struct v2gD if (errn == 0) { errn = decodeBytes(stream, v2gDiffieHellmanPublickeyType->CONTENT.bytesLen, v2gDiffieHellmanPublickeyType->CONTENT.bytes); } - grammarID = 3; + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -6427,14 +4565,14 @@ static int decode_v2gDiffieHellmanPublickeyType(bitstream_t* stream, struct v2gD } } break; - case 3: + case 4: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -6453,90 +4591,36 @@ static int decode_v2gDiffieHellmanPublickeyType(bitstream_t* stream, struct v2gD 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 = 144; +/* 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_v2gCertificateUpdateReqType(v2gCertificateUpdateReqType); + init_v2gSelectedServiceType(v2gSelectedServiceType); while(!done) { switch(grammarID) { - case 144: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgBody}Id)] */ + case 110: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decodeUnsignedInteger16(stream, &v2gCertificateUpdateReqType->Id.charactersLen); - if (errn == 0) { - errn = (v2gCertificateUpdateReqType->Id.charactersLen - 2) <= v2gCertificateUpdateReqType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - 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; - } - } - grammarID = 145; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 145: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gCertificateChainType(stream, &v2gCertificateUpdateReqType->ContractSignatureCertChain); - grammarID = 146; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 146: - /* 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]] */ + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ 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; - } - } + 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:MsgBody}eMAID) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 73; + grammarID = 111; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -6548,14 +4632,36 @@ static int decode_v2gCertificateUpdateReqType(bitstream_t* stream, struct v2gCer } } break; - case 73: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ListOfRootCertificateIDs)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + 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: - errn = decode_v2gListOfRootCertificateIDsType(stream, &v2gCertificateUpdateReqType->ListOfRootCertificateIDs); - grammarID = 3; + /* 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; @@ -6563,422 +4669,14 @@ static int decode_v2gCertificateUpdateReqType(bitstream_t* stream, struct v2gCer } } break; - case 3: + case 4: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - 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 = 81; - int done = 0; - - init_v2gBodyBaseType(v2gBodyBaseType); - - while(!done) { - switch(grammarID) { - case 81: - /* FirstStartTag[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_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 = 147; - int done = 0; - - init_v2gDC_EVChargeParameterType(v2gDC_EVChargeParameterType); - - while(!done) { - switch(grammarID) { - case 147: - /* 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 = 148; - } 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 = 149; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 148: - /* 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 = 149; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 149: - /* 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 = 150; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 150: - /* 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 = 151; - break; - case 1: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumVoltageLimit); - grammarID = 152; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 151: - /* 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 = 152; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 152: - /* 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 = 153; - break; - case 1: - errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVEnergyRequest); - v2gDC_EVChargeParameterType->EVEnergyRequest_isUsed = 1u; - grammarID = 154; - 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 = 155; - } 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 153: - /* 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 = 154; - 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 = 155; - } 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 154: - /* 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 = 155; - } 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 155: - /* 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; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -6999,14 +4697,14 @@ static int decode_v2gDC_EVChargeParameterType(bitstream_t* stream, struct v2gDC_ /* 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 = 156; + int grammarID = 112; int done = 0; init_v2gSubCertificatesType(v2gSubCertificatesType); while(!done) { switch(grammarID) { - case 156: + case 112: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -7037,7 +4735,7 @@ static int decode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCerti /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 157; + grammarID = 113; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -7049,7 +4747,7 @@ static int decode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCerti } } break; - case 157: + case 113: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -7080,7 +4778,7 @@ static int decode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCerti /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 158; + grammarID = 114; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -7088,7 +4786,7 @@ static int decode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCerti break; case 1: done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -7096,7 +4794,7 @@ static int decode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCerti } } break; - case 158: + case 114: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -7127,7 +4825,7 @@ static int decode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCerti /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 159; + grammarID = 115; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -7135,7 +4833,7 @@ static int decode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCerti break; case 1: done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -7143,7 +4841,7 @@ static int decode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCerti } } break; - case 159: + case 115: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -7174,7 +4872,7 @@ static int decode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCerti /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 4; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -7182,7 +4880,7 @@ static int decode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCerti break; case 1: done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -7190,15 +4888,163 @@ static int decode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCerti } } break; - case 3: + 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; @@ -7218,14 +5064,14 @@ static int decode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCerti /* 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 = 160; + int grammarID = 119; int done = 0; init_v2gSupportedEnergyTransferModeType(v2gSupportedEnergyTransferModeType); while(!done) { switch(grammarID) { - case 160: + case 119: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -7236,7 +5082,8 @@ static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 3, &v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen]); + 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, ...) */ @@ -7250,7 +5097,7 @@ static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 161; + grammarID = 120; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -7262,7 +5109,7 @@ static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct } } break; - case 161: + case 120: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -7273,7 +5120,8 @@ static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 3, &v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen]); + 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, ...) */ @@ -7287,7 +5135,7 @@ static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 162; + grammarID = 121; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -7295,7 +5143,7 @@ static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct break; case 1: done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -7303,7 +5151,7 @@ static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct } } break; - case 162: + case 121: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -7314,7 +5162,8 @@ static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 3, &v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen]); + 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, ...) */ @@ -7328,7 +5177,7 @@ static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 163; + grammarID = 122; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -7336,7 +5185,7 @@ static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct break; case 1: done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -7344,7 +5193,7 @@ static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct } } break; - case 163: + case 122: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -7355,7 +5204,8 @@ static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 3, &v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen]); + 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, ...) */ @@ -7369,7 +5219,7 @@ static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 164; + grammarID = 123; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -7377,7 +5227,7 @@ static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct break; case 1: done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -7385,7 +5235,7 @@ static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct } } break; - case 164: + case 123: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -7396,7 +5246,8 @@ static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 3, &v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen]); + 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, ...) */ @@ -7410,7 +5261,7 @@ static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 165; + grammarID = 124; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -7418,7 +5269,7 @@ static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct break; case 1: done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -7426,7 +5277,7 @@ static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct } } break; - case 165: + case 124: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -7437,7 +5288,8 @@ static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 3, &v2gSupportedEnergyTransferModeType->EnergyTransferMode.array[v2gSupportedEnergyTransferModeType->EnergyTransferMode.arrayLen]); + 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, ...) */ @@ -7451,7 +5303,7 @@ static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EnergyTransferMode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 4; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -7459,7 +5311,7 @@ static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct break; case 1: done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -7467,14 +5319,14 @@ static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct } } break; - case 3: + case 4: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -7493,23 +5345,926 @@ static int decode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct 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 = 81; +/* 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_v2gChargingStatusReqType(v2gChargingStatusReqType); + init_v2gCurrentDemandReqType(v2gCurrentDemandReqType); while(!done) { switch(grammarID) { - case 81: + 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 = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -7528,79 +6283,41 @@ static int decode_v2gChargingStatusReqType(bitstream_t* stream, struct v2gChargi 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 = 166; +/* 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_v2gSignaturePropertyType(v2gSignaturePropertyType); + init_v2gPhysicalValueType(v2gPhysicalValueType); while(!done) { switch(grammarID) { - case 166: - /* 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 = 167; - 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 = 168; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 167: - /* StartTag[ATTRIBUTE[STRING](Target)] */ + case 144: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Multiplier)] */ 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); + /* 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 { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Multiplier) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 145; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } } - grammarID = 168; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -7608,18 +6325,32 @@ static int decode_v2gSignaturePropertyType(bitstream_t* stream, struct v2gSignat } } break; - case 168: - /* StartTag[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + case 145: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Unit)] */ + 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 = 60; - break; - case 1: - grammarID = 169; + /* 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; @@ -7627,41 +6358,46 @@ static int decode_v2gSignaturePropertyType(bitstream_t* stream, struct v2gSignat } } break; - case 60: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + case 146: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Value)] */ + 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 = 60; + /* 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; - case 1: + 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 = 4; - break; - case 2: - grammarID = 60; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 169: - /* 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 = 60; - break; - case 1: - grammarID = 169; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -7682,14 +6418,14 @@ static int decode_v2gSignaturePropertyType(bitstream_t* stream, struct v2gSignat /* 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 = 142; + int grammarID = 109; int done = 0; init_v2gContractSignatureEncryptedPrivateKeyType(v2gContractSignatureEncryptedPrivateKeyType); while(!done) { switch(grammarID) { - case 142: + case 109: /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -7708,7 +6444,7 @@ static int decode_v2gContractSignatureEncryptedPrivateKeyType(bitstream_t* strea errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; } } - grammarID = 143; + grammarID = 90; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -7716,7 +6452,7 @@ static int decode_v2gContractSignatureEncryptedPrivateKeyType(bitstream_t* strea } } break; - case 143: + case 90: /* StartTag[CHARACTERS[BINARY_BASE64]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -7729,7 +6465,7 @@ static int decode_v2gContractSignatureEncryptedPrivateKeyType(bitstream_t* strea if (errn == 0) { errn = decodeBytes(stream, v2gContractSignatureEncryptedPrivateKeyType->CONTENT.bytesLen, v2gContractSignatureEncryptedPrivateKeyType->CONTENT.bytes); } - grammarID = 3; + grammarID = 4; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -7737,14 +6473,14 @@ static int decode_v2gContractSignatureEncryptedPrivateKeyType(bitstream_t* strea } } break; - case 3: + case 4: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -7763,205 +6499,27 @@ static int decode_v2gContractSignatureEncryptedPrivateKeyType(bitstream_t* strea 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 = 170; +/* 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_v2gReferenceType(v2gReferenceType); + init_v2gPMaxScheduleType(v2gPMaxScheduleType); while(!done) { switch(grammarID) { - case 170: - /* 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 = 171; - 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 = 172; - 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 = 173; - break; - case 3: - errn = decode_v2gTransformsType(stream, &v2gReferenceType->Transforms); - v2gReferenceType->Transforms_isUsed = 1u; - grammarID = 174; - break; - case 4: - errn = decode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod); - grammarID = 175; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 171: - /* 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 = 172; - 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 = 173; - break; - case 2: - errn = decode_v2gTransformsType(stream, &v2gReferenceType->Transforms); - v2gReferenceType->Transforms_isUsed = 1u; - grammarID = 174; - break; - case 3: - errn = decode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod); - grammarID = 175; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 172: - /* 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 = 173; - break; - case 1: - errn = decode_v2gTransformsType(stream, &v2gReferenceType->Transforms); - v2gReferenceType->Transforms_isUsed = 1u; - grammarID = 174; - break; - case 2: - errn = decode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod); - grammarID = 175; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 173: - /* 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 = 174; - break; - case 1: - errn = decode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod); - grammarID = 175; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 174: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + case 147: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PMaxScheduleEntry)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod); - grammarID = 175; + 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; @@ -7969,33 +6527,71 @@ static int decode_v2gReferenceType(bitstream_t* stream, struct v2gReferenceType* } } break; - case 175: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue)] */ + case 148: + /* 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 = 148; + 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,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 done = 0; + + init_v2gNotificationType(v2gNotificationType); + + while(!done) { + switch(grammarID) { + case 149: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FaultCode)] */ 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, &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); - } + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + v2gNotificationType->FaultCode = (v2gfaultCodeType) 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#}DigestValue) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FaultCode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 150; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -8007,14 +6603,63 @@ static int decode_v2gReferenceType(bitstream_t* stream, struct v2gReferenceType* } } break; - case 3: + case 150: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FaultMsg), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gNotificationType->FaultMsg.charactersLen); + if (errn == 0) { + errn = (v2gNotificationType->FaultMsg.charactersLen - 2) <= v2gNotificationType_FaultMsg_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gNotificationType->FaultMsg.charactersLen >= 2) { + v2gNotificationType->FaultMsg.charactersLen = (uint16_t)(v2gNotificationType->FaultMsg.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gNotificationType->FaultMsg.charactersLen, v2gNotificationType->FaultMsg.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gNotificationType->FaultMsg_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FaultMsg) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 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 = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -8033,16 +6678,331 @@ static int decode_v2gReferenceType(bitstream_t* stream, struct v2gReferenceType* 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; +/* 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; int done = 0; - init_v2gCurrentDemandResType(v2gCurrentDemandResType); + init_v2gChargingStatusReqType(v2gChargingStatusReqType); while(!done) { switch(grammarID) { - case 176: + 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,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 done = 0; + + init_v2gChargeServiceType(v2gChargeServiceType); + + while(!done) { + switch(grammarID) { + case 151: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gChargeServiceType->ServiceID); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 152; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 152: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceName), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gChargeServiceType->ServiceName.charactersLen); + if (errn == 0) { + errn = (v2gChargeServiceType->ServiceName.charactersLen - 2) <= v2gChargeServiceType_ServiceName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gChargeServiceType->ServiceName.charactersLen >= 2) { + v2gChargeServiceType->ServiceName.charactersLen = (uint16_t)(v2gChargeServiceType->ServiceName.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gChargeServiceType->ServiceName.charactersLen, v2gChargeServiceType->ServiceName.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gChargeServiceType->ServiceName_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceName) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 153; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + v2gChargeServiceType->ServiceCategory = (v2gserviceCategoryType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 154; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 153: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + v2gChargeServiceType->ServiceCategory = (v2gserviceCategoryType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 154; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 154: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceScope), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gChargeServiceType->ServiceScope.charactersLen); + if (errn == 0) { + errn = (v2gChargeServiceType->ServiceScope.charactersLen - 2) <= v2gChargeServiceType_ServiceScope_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gChargeServiceType->ServiceScope.charactersLen >= 2) { + v2gChargeServiceType->ServiceScope.charactersLen = (uint16_t)(v2gChargeServiceType->ServiceScope.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gChargeServiceType->ServiceScope.charactersLen, v2gChargeServiceType->ServiceScope.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + v2gChargeServiceType->ServiceScope_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceScope) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 155; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gChargeServiceType->FreeService); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 156; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 155: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &v2gChargeServiceType->FreeService); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 156; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 156: + /* 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; + 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,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) { @@ -8052,7 +7012,8 @@ static int decode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrent errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &v2gCurrentDemandResType->ResponseCode); + 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; @@ -8062,7 +7023,7 @@ static int decode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrent /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 177; + grammarID = 96; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -8074,420 +7035,24 @@ static int decode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrent } } 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)] */ + 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_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumCurrentLimit); - v2gCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed = 1u; - grammarID = 185; + errn = decode_v2gAC_EVSEStatusType(stream, &v2gPowerDeliveryResType->AC_EVSEStatus); + v2gPowerDeliveryResType->AC_EVSEStatus_isUsed = 1u; + grammarID = 4; break; case 1: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandResType->EVSEMaximumPowerLimit); - v2gCurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 1u; - grammarID = 186; + errn = decode_v2gDC_EVSEStatusType(stream, &v2gPowerDeliveryResType->DC_EVSEStatus); + v2gPowerDeliveryResType->DC_EVSEStatus_isUsed = 1u; + grammarID = 4; 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; + errn = decode_v2gEVSEStatusType(stream, &v2gPowerDeliveryResType->EVSEStatus); + v2gPowerDeliveryResType->EVSEStatus_isUsed = 1u; grammarID = 4; break; default: @@ -8496,51 +7061,14 @@ static int decode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrent } } 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: + case 4: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -8559,35 +7087,40 @@ static int decode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrent 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 = 127; +/* 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; int done = 0; - init_v2gCanonicalizationMethodType(v2gCanonicalizationMethodType); + init_v2gEVSEStatusType(v2gEVSEStatusType); while(!done) { switch(grammarID) { - case 127: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ + case 157: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}NotificationMaxDelay)] */ 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); + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gEVSEStatusType->NotificationMaxDelay); } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2: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 */ } } - grammarID = 128; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -8595,7 +7128,522 @@ static int decode_v2gCanonicalizationMethodType(bitstream_t* stream, struct v2gC } } break; - case 128: + 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); + 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 = 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) { @@ -8603,14 +7651,14 @@ static int decode_v2gCanonicalizationMethodType(bitstream_t* stream, struct v2gC case 0: errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 60; + grammarID = 25; break; case 1: done = 1; - grammarID = 4; + grammarID = 5; break; case 2: - grammarID = 60; + grammarID = 25; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -8618,7 +7666,7 @@ static int decode_v2gCanonicalizationMethodType(bitstream_t* stream, struct v2gC } } break; - case 60: + case 25: /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -8626,14 +7674,204 @@ static int decode_v2gCanonicalizationMethodType(bitstream_t* stream, struct v2gC case 0: errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 60; + grammarID = 25; break; case 1: done = 1; - grammarID = 4; + grammarID = 5; break; case 2: - grammarID = 60; + 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]] */ + 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 = 165; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gPGPDataType->PGPKeyPacket.bytesLen); + if (errn == 0) { + errn = (v2gPGPDataType->PGPKeyPacket.bytesLen) <= v2gPGPDataType_PGPKeyPacket_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gPGPDataType->PGPKeyPacket.bytesLen, v2gPGPDataType->PGPKeyPacket.bytes); + } + v2gPGPDataType->PGPKeyPacket_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 166; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 165: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket), START_ELEMENT_GENERIC, END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gPGPDataType->PGPKeyPacket.bytesLen); + if (errn == 0) { + errn = (v2gPGPDataType->PGPKeyPacket.bytesLen) <= v2gPGPDataType_PGPKeyPacket_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gPGPDataType->PGPKeyPacket.bytesLen, v2gPGPDataType->PGPKeyPacket.bytes); + } + v2gPGPDataType->PGPKeyPacket_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 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; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,SASchedulesType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +static int decode_v2gSASchedulesType(bitstream_t* stream, struct v2gSASchedulesType* v2gSASchedulesType) { + int grammarID = 13; + int done = 0; + + init_v2gSASchedulesType(v2gSASchedulesType); + + 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; @@ -8654,14 +7892,14 @@ static int decode_v2gCanonicalizationMethodType(bitstream_t* stream, struct v2gC /* 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 = 190; + int grammarID = 167; int done = 0; init_v2gTransformType(v2gTransformType); while(!done) { switch(grammarID) { - case 190: + case 167: /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -8680,7 +7918,7 @@ static int decode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; } } - grammarID = 191; + grammarID = 168; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -8688,7 +7926,7 @@ static int decode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* } } break; - case 191: + 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) { @@ -8725,7 +7963,7 @@ static int decode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 192; + grammarID = 169; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -8734,14 +7972,14 @@ static int decode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* case 1: errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 192; + grammarID = 169; break; case 2: done = 1; - grammarID = 4; + grammarID = 5; break; case 3: - grammarID = 192; + grammarID = 169; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -8749,7 +7987,7 @@ static int decode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* } } break; - case 192: + 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) { @@ -8786,7 +8024,7 @@ static int decode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 192; + grammarID = 169; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -8795,14 +8033,14 @@ static int decode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* case 1: errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 192; + grammarID = 169; break; case 2: done = 1; - grammarID = 4; + grammarID = 5; break; case 3: - grammarID = 192; + grammarID = 169; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -8821,2273 +8059,33 @@ static int decode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* 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 = 193; +/* 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_v2gCertificateChainType(v2gCertificateChainType); + init_v2gPaymentDetailsReqType(v2gPaymentDetailsReqType); while(!done) { switch(grammarID) { - case 193: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}Certificate)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + case 170: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &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 = 194; - break; - case 1: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gCertificateChainType->Certificate.bytesLen); + errn = decodeUnsignedInteger16(stream, &v2gPaymentDetailsReqType->eMAID.charactersLen); if (errn == 0) { - errn = (v2gCertificateChainType->Certificate.bytesLen) <= v2gCertificateChainType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + errn = (v2gPaymentDetailsReqType->eMAID.charactersLen - 2) <= v2gPaymentDetailsReqType_eMAID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; } 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 = 195; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 194: - /* 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 = 195; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 195: - /* Element[START_ELEMENT({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#,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 = 196; - int done = 0; - - init_v2gSignatureValueType(v2gSignatureValueType); - - while(!done) { - switch(grammarID) { - case 196: - /* 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 = 143; - 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 143: - /* 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: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 = 81; - int done = 0; - - init_v2gEVPowerDeliveryParameterType(v2gEVPowerDeliveryParameterType); - - while(!done) { - switch(grammarID) { - case 81: - /* 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,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 = 197; - int done = 0; - - init_v2gServiceDetailReqType(v2gServiceDetailReqType); - - while(!done) { - switch(grammarID) { - case 197: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gServiceDetailReqType->ServiceID); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceID) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='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 = 198; - int done = 0; - - init_v2gPaymentDetailsResType(v2gPaymentDetailsResType); - - while(!done) { - switch(grammarID) { - case 198: - /* 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, &v2gPaymentDetailsResType->ResponseCode); - } else { - /* Second level event (e.g., xsi:type, 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 = 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: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 = 200; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 200: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSETimeStamp)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger64(stream, &v2gPaymentDetailsResType->EVSETimeStamp); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSETimeStamp) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,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 = 201; - int done = 0; - - init_v2gX509DataType(v2gX509DataType); - - while(!done) { - switch(grammarID) { - case 201: - /* 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 = 202; - 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 = 202; - } 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 = 202; - } 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 = 202; - } 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 = 202; - } 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 = 202; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 202: - /* 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 = 202; - 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 = 202; - } 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 = 202; - } 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 = 202; - } 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 = 202; - } 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 = 202; - 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#,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 = 203; - int done = 0; - - init_v2gDSAKeyValueType(v2gDSAKeyValueType); - - while(!done) { - switch(grammarID) { - case 203: - /* 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 = 204; - } 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 = 205; - } 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 = 206; - } 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({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 = 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({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 = 205; - } 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 = 206; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 205: - /* Element[START_ELEMENT({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 = 206; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 206: - /* 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 = 208; - } 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 = 209; - } 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 208: - /* 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 = 209; - } 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 209: - /* 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,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 = 62; - int done = 0; - - init_v2gPowerDeliveryResType(v2gPowerDeliveryResType); - - while(!done) { - switch(grammarID) { - case 62: - /* 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, &v2gPowerDeliveryResType->ResponseCode); - } else { - /* Second level event (e.g., xsi:type, 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 = 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: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: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 = 210; - int done = 0; - - init_v2gChargeParameterDiscoveryReqType(v2gChargeParameterDiscoveryReqType); - - while(!done) { - switch(grammarID) { - case 210: - /* 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 = 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, 3, &v2gChargeParameterDiscoveryReqType->RequestedEnergyTransferMode); - } else { - /* Second level event (e.g., xsi:type, 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 = 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: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, &v2gChargeParameterDiscoveryReqType->RequestedEnergyTransferMode); - } else { - /* Second level event (e.g., xsi:type, 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 = 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: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,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 = 213; - int done = 0; - - init_v2gParameterSetType(v2gParameterSetType); - - while(!done) { - switch(grammarID) { - case 213: - /* 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 = 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: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 = 215; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 215: - /* 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 = 215; - 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 = 216; - int done = 0; - - init_v2gServiceDiscoveryResType(v2gServiceDiscoveryResType); - - while(!done) { - switch(grammarID) { - case 216: - /* 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, &v2gServiceDiscoveryResType->ResponseCode); - } else { - /* Second level event (e.g., xsi:type, 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 = 217; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 217: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}PaymentOptionList)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPaymentOptionListType(stream, &v2gServiceDiscoveryResType->PaymentOptionList); - grammarID = 218; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 218: - /* 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 = 219; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 219: - /* 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 = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - 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 = 220; - int done = 0; - - init_v2gAnonType_V2G_Message(v2gAnonType_V2G_Message); - - while(!done) { - switch(grammarID) { - case 220: - /* 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 = 221; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 221: - /* 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='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 = 222; - int done = 0; - - init_v2gSignatureType(v2gSignatureType); - - while(!done) { - switch(grammarID) { - case 222: - /* 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 = 223; - break; - case 1: - errn = decode_v2gSignedInfoType(stream, &v2gSignatureType->SignedInfo); - grammarID = 224; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 223: - /* 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 = 224; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 224: - /* 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 = 225; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 225: - /* 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 = 226; - 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 = 226; - break; - case 2: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 226: - /* 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 = 226; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,EMAIDType', base type name='eMAIDType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ -static int decode_v2gEMAIDType(bitstream_t* stream, struct v2gEMAIDType* v2gEMAIDType) { - int grammarID = 227; - int done = 0; - - init_v2gEMAIDType(v2gEMAIDType); - - while(!done) { - switch(grammarID) { - case 227: - /* 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 = 228; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 228: - /* 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: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 = 229; - int done = 0; - - init_v2gCertificateInstallationResType(v2gCertificateInstallationResType); - - while(!done) { - switch(grammarID) { - case 229: - /* 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, &v2gCertificateInstallationResType->ResponseCode); - } else { - /* Second level event (e.g., xsi:type, 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 = 230; - } 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:2013:MsgBody}SAProvisioningCertificateChain)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gCertificateChainType(stream, &v2gCertificateInstallationResType->SAProvisioningCertificateChain); - grammarID = 231; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 231: - /* 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 = 232; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 232: - /* 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 = 233; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 233: - /* 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 = 234; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 234: - /* 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 = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - 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 = 235; - int done = 0; - - init_v2gCableCheckResType(v2gCableCheckResType); - - while(!done) { - switch(grammarID) { - case 235: - /* 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, &v2gCableCheckResType->ResponseCode); - } else { - /* Second level event (e.g., xsi:type, 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 = 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}DC_EVSEStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gDC_EVSEStatusType(stream, &v2gCableCheckResType->DC_EVSEStatus); - grammarID = 9; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 9: - /* 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, &v2gCableCheckResType->EVSEProcessing); - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,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 = 237; - int done = 0; - - init_v2gMeterInfoType(v2gMeterInfoType); - - while(!done) { - switch(grammarID) { - case 237: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterID)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gMeterInfoType->MeterID.charactersLen); - if (errn == 0) { - errn = (v2gMeterInfoType->MeterID.charactersLen - 2) <= v2gMeterInfoType_MeterID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gMeterInfoType->MeterID.charactersLen >= 2) { - v2gMeterInfoType->MeterID.charactersLen = (uint16_t)(v2gMeterInfoType->MeterID.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gMeterInfoType->MeterID.charactersLen, v2gMeterInfoType->MeterID.characters); + 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; @@ -11099,10 +8097,10 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterID) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 238; + grammarID = 171; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -11114,107 +8112,13 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* } } break; - case 238: - /* 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); + case 171: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureCertChain)] */ + 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 = decodeUnsignedInteger64(stream, &v2gMeterInfoType->MeterReading); - v2gMeterInfoType->MeterReading_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterReading) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 239; - } 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, &v2gMeterInfoType->SigMeterReading.bytesLen); - if (errn == 0) { - errn = (v2gMeterInfoType->SigMeterReading.bytesLen) <= v2gMeterInfoType_SigMeterReading_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gMeterInfoType->SigMeterReading.bytesLen, v2gMeterInfoType->SigMeterReading.bytes); - } - v2gMeterInfoType->SigMeterReading_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SigMeterReading) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 240; - } 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, &v2gMeterInfoType->MeterStatus); - v2gMeterInfoType->MeterStatus_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 241; - } 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, &v2gMeterInfoType->TMeter); - v2gMeterInfoType->TMeter_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 4: - done = 1; + errn = decode_v2gCertificateChainType(stream, &v2gPaymentDetailsReqType->ContractSignatureCertChain); grammarID = 4; break; default: @@ -11223,197 +8127,14 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* } } break; - case 239: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SigMeterReading), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gMeterInfoType->SigMeterReading.bytesLen); - if (errn == 0) { - errn = (v2gMeterInfoType->SigMeterReading.bytesLen) <= v2gMeterInfoType_SigMeterReading_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; - } - if (errn == 0) { - errn = decodeBytes(stream, v2gMeterInfoType->SigMeterReading.bytesLen, v2gMeterInfoType->SigMeterReading.bytes); - } - v2gMeterInfoType->SigMeterReading_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SigMeterReading) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 240; - } 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, &v2gMeterInfoType->MeterStatus); - v2gMeterInfoType->MeterStatus_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 241; - } 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, &v2gMeterInfoType->TMeter); - v2gMeterInfoType->TMeter_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 3: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 240: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger16(stream, &v2gMeterInfoType->MeterStatus); - v2gMeterInfoType->MeterStatus_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 241; - } 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, &v2gMeterInfoType->TMeter); - v2gMeterInfoType->TMeter_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 2: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 241: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeInteger64(stream, &v2gMeterInfoType->TMeter); - v2gMeterInfoType->TMeter_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: + case 4: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -11432,60 +8153,73 @@ static int decode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* 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 = 242; +/* 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_v2gAC_EVChargeParameterType(v2gAC_EVChargeParameterType); + init_v2gDC_EVStatusType(v2gDC_EVStatusType); while(!done) { switch(grammarID) { - case 242: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EAmount)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + case 172: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVReady)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger32(stream, &v2gAC_EVChargeParameterType->DepartureTime); - v2gAC_EVChargeParameterType->DepartureTime_isUsed = 1u; + 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}DepartureTime) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVReady) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 243; + grammarID = 173; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } } break; - case 1: - errn = decode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EAmount); - grammarID = 244; - break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; break; } } break; - case 243: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EAmount)] */ + case 173: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVErrorCode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EAmount); - grammarID = 244; + /* 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; @@ -11493,14 +8227,32 @@ static int decode_v2gAC_EVChargeParameterType(bitstream_t* stream, struct v2gAC_ } } break; - case 244: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVMaxVoltage)] */ + case 174: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVRESSSOC)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EVMaxVoltage); - grammarID = 245; + /* 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; @@ -11508,44 +8260,14 @@ static int decode_v2gAC_EVChargeParameterType(bitstream_t* stream, struct v2gAC_ } } break; - case 245: - /* 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 = 246; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 246: - /* 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: + case 4: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -11564,551 +8286,16 @@ static int decode_v2gAC_EVChargeParameterType(bitstream_t* stream, struct v2gAC_ 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 = 247; +/* 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 done = 0; - init_v2gServiceParameterListType(v2gServiceParameterListType); + init_v2gPaymentServiceSelectionResType(v2gPaymentServiceSelectionResType); while(!done) { switch(grammarID) { - case 247: - /* 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 = 248; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 248: - /* 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 = 248; - 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,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 = 249; - int done = 0; - - init_v2gCurrentDemandReqType(v2gCurrentDemandReqType); - - while(!done) { - switch(grammarID) { - case 249: - /* 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 = 250; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 250: - /* 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 = 251; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 251: - /* 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 = 252; - break; - case 1: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumCurrentLimit); - v2gCurrentDemandReqType->EVMaximumCurrentLimit_isUsed = 1u; - grammarID = 253; - break; - case 2: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumPowerLimit); - v2gCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 1u; - grammarID = 254; - 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 = 255; - } 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 = 256; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 252: - /* 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 = 253; - break; - case 1: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumPowerLimit); - v2gCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 1u; - grammarID = 254; - 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 = 255; - } 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 = 256; - } 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: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 = 254; - 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 = 255; - } 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 = 256; - } 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: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 = 255; - } 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 = 256; - } 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: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 = 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: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 = 257; - break; - case 1: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->RemainingTimeToBulkSoC); - v2gCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed = 1u; - grammarID = 258; - break; - case 2: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetVoltage); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 257: - /* 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 = 258; - break; - case 1: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetVoltage); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 258: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVTargetVoltage); - grammarID = 3; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: - /* Element[END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,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 = 81; - int done = 0; - - init_v2gSASchedulesType(v2gSASchedulesType); - - while(!done) { - switch(grammarID) { - case 81: - /* 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,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 = 81; - int done = 0; - - init_v2gIntervalType(v2gIntervalType); - - while(!done) { - switch(grammarID) { - case 81: - /* 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,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 = 100; - int done = 0; - - init_v2gPreChargeResType(v2gPreChargeResType); - - while(!done) { - switch(grammarID) { - case 100: + case 43: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -12118,7 +8305,8 @@ static int decode_v2gPreChargeResType(bitstream_t* stream, struct v2gPreChargeRe errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 5, &v2gPreChargeResType->ResponseCode); + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + v2gPaymentServiceSelectionResType->ResponseCode = (v2gresponseCodeType) uint32; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; @@ -12128,7 +8316,7 @@ static int decode_v2gPreChargeResType(bitstream_t* stream, struct v2gPreChargeRe /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 101; + grammarID = 4; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -12140,44 +8328,14 @@ static int decode_v2gPreChargeResType(bitstream_t* stream, struct v2gPreChargeRe } } break; - case 101: - /* 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 = 102; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 102: - /* 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: + case 4: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -12196,29 +8354,23 @@ static int decode_v2gPreChargeResType(bitstream_t* stream, struct v2gPreChargeRe 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 = 259; +/* 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; int done = 0; - init_v2gSalesTariffEntryType(v2gSalesTariffEntryType); + init_v2gDC_EVSEChargeParameterType(v2gDC_EVSEChargeParameterType); while(!done) { switch(grammarID) { - case 259: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TimeInterval)] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + case 175: + /* 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_v2gRelativeTimeIntervalType(stream, &v2gSalesTariffEntryType->RelativeTimeInterval); - v2gSalesTariffEntryType->RelativeTimeInterval_isUsed = 1u; - grammarID = 260; - break; - case 1: - errn = decode_v2gIntervalType(stream, &v2gSalesTariffEntryType->TimeInterval); - v2gSalesTariffEntryType->TimeInterval_isUsed = 1u; - grammarID = 260; + errn = decode_v2gDC_EVSEStatusType(stream, &v2gDC_EVSEChargeParameterType->DC_EVSEStatus); + grammarID = 176; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -12226,68 +8378,129 @@ static int decode_v2gSalesTariffEntryType(bitstream_t* stream, struct v2gSalesTa } } break; - case 260: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EPriceLevel), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ConsumptionCost), END_ELEMENT] */ + 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: - /* 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 = 261; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance); + v2gDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance_isUsed = 1u; + grammarID = 182; 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 = 262; + errn = decode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEPeakCurrentRipple); + grammarID = 183; break; - case 2: - done = 1; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + 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] */ + 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 = 4; break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 261: - /* 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 = 262; - break; case 1: done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -12295,59 +8508,190 @@ static int decode_v2gSalesTariffEntryType(bitstream_t* stream, struct v2gSalesTa } } break; - case 262: - /* 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 = 263; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 263: - /* 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: + 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,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; + int done = 0; + + init_v2gChargingStatusResType(v2gChargingStatusResType); + + while(!done) { + switch(grammarID) { + case 184: + /* 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 = 185; + } 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}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 = 186; + } 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}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: @@ -12356,6 +8700,352 @@ static int decode_v2gSalesTariffEntryType(bitstream_t* stream, struct v2gSalesTa } } 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)] */ + 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]] */ + 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 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; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + errn = decode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus); + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + 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: + /* 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#,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; + int done = 0; + + init_v2gObjectType(v2gObjectType); + + while(!done) { + switch(grammarID) { + case 191: + /* 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 = 192; + 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 = 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 (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 = 24; + break; + case 3: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 25; + break; + case 4: + done = 1; + grammarID = 5; + break; + case 5: + grammarID = 25; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 192: + /* 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 = 193; + 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 = 24; + break; + case 2: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 25; + break; + case 3: + done = 1; + grammarID = 5; + break; + case 4: + grammarID = 25; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 193: + /* 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 = 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; + 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: + 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; @@ -12369,14 +9059,14 @@ static int decode_v2gSalesTariffEntryType(bitstream_t* stream, struct v2gSalesTa /* 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 = 264; + int grammarID = 194; int done = 0; init_v2gPaymentOptionListType(v2gPaymentOptionListType); while(!done) { switch(grammarID) { - case 264: + case 194: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PaymentOption)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -12387,7 +9077,8 @@ static int decode_v2gPaymentOptionListType(bitstream_t* stream, struct v2gPaymen errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 1, &v2gPaymentOptionListType->PaymentOption.array[v2gPaymentOptionListType->PaymentOption.arrayLen]); + errn = decodeNBitUnsignedInteger(stream, 1, &uint32); + v2gPaymentOptionListType->PaymentOption.array[v2gPaymentOptionListType->PaymentOption.arrayLen] = (v2gpaymentOptionType) uint32; v2gPaymentOptionListType->PaymentOption.arrayLen++; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ @@ -12401,7 +9092,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 = 265; + grammarID = 195; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -12413,7 +9104,7 @@ static int decode_v2gPaymentOptionListType(bitstream_t* stream, struct v2gPaymen } } break; - case 265: + case 195: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}PaymentOption), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -12424,7 +9115,8 @@ static int decode_v2gPaymentOptionListType(bitstream_t* stream, struct v2gPaymen errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 1, &v2gPaymentOptionListType->PaymentOption.array[v2gPaymentOptionListType->PaymentOption.arrayLen]); + errn = decodeNBitUnsignedInteger(stream, 1, &uint32); + v2gPaymentOptionListType->PaymentOption.array[v2gPaymentOptionListType->PaymentOption.arrayLen] = (v2gpaymentOptionType) uint32; v2gPaymentOptionListType->PaymentOption.arrayLen++; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ @@ -12438,7 +9130,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 = 3; + grammarID = 4; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -12446,7 +9138,7 @@ static int decode_v2gPaymentOptionListType(bitstream_t* stream, struct v2gPaymen break; case 1: done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -12454,14 +9146,14 @@ static int decode_v2gPaymentOptionListType(bitstream_t* stream, struct v2gPaymen } } break; - case 3: + case 4: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -12480,166 +9172,36 @@ static int decode_v2gPaymentOptionListType(bitstream_t* stream, struct v2gPaymen 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 = 266; +/* 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_v2gSignedInfoType(v2gSignedInfoType); + init_v2gParameterSetType(v2gParameterSetType); while(!done) { switch(grammarID) { - case 266: - /* 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 = 267; - break; - case 1: - errn = decode_v2gCanonicalizationMethodType(stream, &v2gSignedInfoType->CanonicalizationMethod); - grammarID = 268; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 267: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ + case 196: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSetID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gCanonicalizationMethodType(stream, &v2gSignedInfoType->CanonicalizationMethod); - grammarID = 268; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 268: - /* 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 = 269; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 269: - /* 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 = 84; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 84: - /* 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 = 84; - 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,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 = 270; - int done = 0; - - init_v2gSessionSetupReqType(v2gSessionSetupReqType); - - while(!done) { - switch(grammarID) { - case 270: - /* 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]] */ + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ 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); - } + 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:MsgBody}EVCCID) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ParameterSetID) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 3; + grammarID = 197; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -12651,14 +9213,41 @@ static int decode_v2gSessionSetupReqType(bitstream_t* stream, struct v2gSessionS } } break; - case 3: - /* Element[END_ELEMENT] */ + 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 = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -12677,116 +9266,18 @@ static int decode_v2gSessionSetupReqType(bitstream_t* stream, struct v2gSessionS 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 = 271; +/* 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_v2gSignaturePropertiesType(v2gSignaturePropertiesType); + init_v2gAC_EVChargeParameterType(v2gAC_EVChargeParameterType); while(!done) { switch(grammarID) { - case 271: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ + 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: - 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 = 272; - 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 = 273; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 272: - /* 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 = 273; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 273: - /* 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 = 273; - 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,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 = 274; - int done = 0; - - init_v2gProfileEntryType(v2gProfileEntryType); - - while(!done) { - switch(grammarID) { - case 274: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryStart)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: @@ -12794,73 +9285,85 @@ static int decode_v2gProfileEntryType(bitstream_t* stream, struct v2gProfileEntr errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeUnsignedInteger32(stream, &v2gProfileEntryType->ChargingProfileEntryStart); + 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}ChargingProfileEntryStart) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}DepartureTime) ? */ 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:MsgDataTypes}ChargingProfileEntryMaxPower)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gProfileEntryType->ChargingProfileEntryMaxPower); - grammarID = 276; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 276: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryMaxNumberOfPhasesInUse), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &(uint32)); - v2gProfileEntryType->ChargingProfileEntryMaxNumberOfPhasesInUse = (int8_t)(uint32 + 1); - v2gProfileEntryType->ChargingProfileEntryMaxNumberOfPhasesInUse_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryMaxNumberOfPhasesInUse) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; + grammarID = 200; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } } break; case 1: - done = 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: @@ -12869,14 +9372,14 @@ static int decode_v2gProfileEntryType(bitstream_t* stream, struct v2gProfileEntr } } break; - case 3: + case 4: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -12895,23 +9398,44 @@ static int decode_v2gProfileEntryType(bitstream_t* stream, struct v2gProfileEntr 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 = 277; +/* 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; int done = 0; - init_v2gPreChargeReqType(v2gPreChargeReqType); + init_v2gManifestType(v2gManifestType); while(!done) { switch(grammarID) { - case 277: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVStatus)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + 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 = decode_v2gDC_EVStatusType(stream, &v2gPreChargeReqType->DC_EVStatus); - grammarID = 278; + 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; @@ -12919,14 +9443,18 @@ static int decode_v2gPreChargeReqType(bitstream_t* stream, struct v2gPreChargeRe } } break; - case 278: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetVoltage)] */ + case 205: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gPhysicalValueType(stream, &v2gPreChargeReqType->EVTargetVoltage); - grammarID = 279; + 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; @@ -12934,14 +9462,22 @@ static int decode_v2gPreChargeReqType(bitstream_t* stream, struct v2gPreChargeRe } } break; - case 279: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVTargetCurrent)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + 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: - errn = decode_v2gPhysicalValueType(stream, &v2gPreChargeReqType->EVTargetCurrent); - grammarID = 3; + 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; + case 1: + done = 1; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -12949,14 +9485,119 @@ static int decode_v2gPreChargeReqType(bitstream_t* stream, struct v2gPreChargeRe } } break; - case 3: + 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 = 206; + int done = 0; + + init_v2gServiceDetailResType(v2gServiceDetailResType); + + while(!done) { + switch(grammarID) { + case 206: + /* 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 = 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: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 = 208; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 208: + /* Element[START_ELEMENT({urn:iso:15118:2: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 = 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 = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -12977,14 +9618,14 @@ static int decode_v2gPreChargeReqType(bitstream_t* stream, struct v2gPreChargeRe /* 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 = 280; + int grammarID = 209; int done = 0; init_v2gListOfRootCertificateIDsType(v2gListOfRootCertificateIDsType); while(!done) { switch(grammarID) { - case 280: + case 209: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RootCertificateID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -12995,7 +9636,7 @@ static int decode_v2gListOfRootCertificateIDsType(bitstream_t* stream, struct v2 } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 281; + grammarID = 210; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -13003,7 +9644,7 @@ static int decode_v2gListOfRootCertificateIDsType(bitstream_t* stream, struct v2 } } break; - case 281: + case 210: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}RootCertificateID), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -13014,673 +9655,11 @@ static int decode_v2gListOfRootCertificateIDsType(bitstream_t* stream, struct v2 } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 281; + grammarID = 210; break; case 1: done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,DC_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 = 282; - int done = 0; - - init_v2gDC_EVPowerDeliveryParameterType(v2gDC_EVPowerDeliveryParameterType); - - while(!done) { - switch(grammarID) { - case 282: - /* 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 = 283; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 283: - /* 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 = 284; - } 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 284: - /* 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 = 285; - int done = 0; - - init_v2gRelativeTimeIntervalType(v2gRelativeTimeIntervalType); - - while(!done) { - switch(grammarID) { - case 285: - /* 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 = 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: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='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 = 287; - int done = 0; - - init_v2gChargingProfileType(v2gChargingProfileType); - - while(!done) { - switch(grammarID) { - case 287: - /* 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 = 288; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 288: - /* 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 = 288; - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateUpdateResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":SAProvisioningCertificateChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2013:MsgBody":DHpublickey,"urn:iso:15118:2:2013:MsgBody":eMAID,"urn:iso:15118:2:2013:MsgBody":RetryCounter{0-1})', derivedBy='EXTENSION'. */ -static int decode_v2gCertificateUpdateResType(bitstream_t* stream, struct v2gCertificateUpdateResType* v2gCertificateUpdateResType) { - int grammarID = 289; - int done = 0; - - init_v2gCertificateUpdateResType(v2gCertificateUpdateResType); - - while(!done) { - switch(grammarID) { - case 289: - /* 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, &v2gCertificateUpdateResType->ResponseCode); - } else { - /* Second level event (e.g., xsi:type, 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 = 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}SAProvisioningCertificateChain)] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - errn = decode_v2gCertificateChainType(stream, &v2gCertificateUpdateResType->SAProvisioningCertificateChain); - grammarID = 291; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 291: - /* 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 = 292; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 292: - /* 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 = 293; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 293: - /* 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 = 294; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 294: - /* 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 = 295; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 295: - /* 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,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 = 296; - int done = 0; - - init_v2gMeteringReceiptReqType(v2gMeteringReceiptReqType); - - while(!done) { - switch(grammarID) { - case 296: - /* 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 = 297; - 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 = 298; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 297: - /* 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 = 298; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 298: - /* 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 = 299; - } 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 299: - /* 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; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -13701,14 +9680,14 @@ static int decode_v2gMeteringReceiptReqType(bitstream_t* stream, struct v2gMeter /* 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 = 300; + int grammarID = 211; int done = 0; init_v2gServiceType(v2gServiceType); while(!done) { switch(grammarID) { - case 300: + case 211: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceID)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -13728,7 +9707,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 = 301; + grammarID = 212; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -13740,7 +9719,7 @@ static int decode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2g } } break; - case 301: + case 212: /* 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) { @@ -13773,7 +9752,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 = 302; + grammarID = 213; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -13784,7 +9763,8 @@ static int decode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2g errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &v2gServiceType->ServiceCategory); + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + v2gServiceType->ServiceCategory = (v2gserviceCategoryType) uint32; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; @@ -13794,7 +9774,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 = 303; + grammarID = 214; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -13806,7 +9786,7 @@ static int decode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2g } } break; - case 302: + case 213: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -13816,7 +9796,8 @@ static int decode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2g errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &v2gServiceType->ServiceCategory); + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + v2gServiceType->ServiceCategory = (v2gserviceCategoryType) uint32; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; @@ -13826,7 +9807,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 = 303; + grammarID = 214; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -13838,7 +9819,7 @@ static int decode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2g } } break; - case 303: + case 214: /* 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) { @@ -13871,7 +9852,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 = 304; + grammarID = 215; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -13892,7 +9873,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 = 3; + grammarID = 4; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -13904,7 +9885,7 @@ static int decode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2g } } break; - case 304: + case 215: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FreeService)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -13924,7 +9905,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 = 3; + grammarID = 4; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -13936,14 +9917,14 @@ static int decode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2g } } break; - case 3: + case 4: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -13962,17 +9943,1365 @@ static int decode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2g return errn; } -/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,NotificationType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgDataTypes":FaultCode,"urn:iso:15118:2:2013:MsgDataTypes":FaultMsg{0-1})', derivedBy='RESTRICTION'. */ -static int decode_v2gNotificationType(bitstream_t* stream, struct v2gNotificationType* v2gNotificationType) { - int grammarID = 305; +/* 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_v2gNotificationType(v2gNotificationType); + init_v2gParameterType(v2gParameterType); while(!done) { switch(grammarID) { - case 305: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FaultCode)] */ + 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: + 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,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; + int done = 0; + + init_v2gEVChargeParameterType(v2gEVChargeParameterType); + + 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)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { @@ -13981,17 +11310,18 @@ static int decode_v2gNotificationType(bitstream_t* stream, struct v2gNotificatio errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &v2gNotificationType->FaultCode); + errn = decodeNBitUnsignedInteger(stream, 1, &uint32); + v2gSessionStopReqType->ChargingSession = (v2gchargingSessionType) uint32; } else { /* Second level event (e.g., xsi:type, xsi:nil, ...) */ errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; } } if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FaultCode) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargingSession) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { - grammarID = 306; + grammarID = 4; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -14003,63 +11333,81 @@ static int decode_v2gNotificationType(bitstream_t* stream, struct v2gNotificatio } } break; - case 306: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FaultMsg), END_ELEMENT] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); - if (errn == 0) { - switch(eventCode) { - case 0: - /* FirstStartTag[CHARACTERS[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(errn == 0) { - if(eventCode == 0) { - errn = decodeUnsignedInteger16(stream, &v2gNotificationType->FaultMsg.charactersLen); - if (errn == 0) { - errn = (v2gNotificationType->FaultMsg.charactersLen - 2) <= v2gNotificationType_FaultMsg_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gNotificationType->FaultMsg.charactersLen >= 2) { - v2gNotificationType->FaultMsg.charactersLen = (uint16_t)(v2gNotificationType->FaultMsg.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gNotificationType->FaultMsg.charactersLen, v2gNotificationType->FaultMsg.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gNotificationType->FaultMsg_isUsed = 1u; - } else { - /* Second level event (e.g., xsi:type, xsi:nil, ...) */ - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - } - } - if(errn == 0) { - /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FaultMsg) ? */ - errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); - if(eventCode == 0) { - grammarID = 3; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } - break; - case 1: - done = 1; - grammarID = 4; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 3: + case 4: /* Element[END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: done = 1; - grammarID = 4; + 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,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; + int done = 0; + + init_v2gServiceDetailReqType(v2gServiceDetailReqType); + + while(!done) { + switch(grammarID) { + case 244: + /* 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 = 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; @@ -14080,14 +11428,14 @@ static int decode_v2gNotificationType(bitstream_t* stream, struct v2gNotificatio /* 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 = 307; + int grammarID = 245; int done = 0; init_v2gKeyInfoType(v2gKeyInfoType); while(!done) { switch(grammarID) { - case 307: + 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]] */ errn = decodeNBitUnsignedInteger(stream, 4, &eventCode); if (errn == 0) { @@ -14107,7 +11455,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } } v2gKeyInfoType->Id_isUsed = 1u; - grammarID = 308; + grammarID = 246; break; case 1: if (v2gKeyInfoType->KeyName.arrayLen < v2gKeyInfoType_KeyName_ARRAY_SIZE) { @@ -14141,7 +11489,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 = 309; + grammarID = 247; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -14153,7 +11501,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 309; + grammarID = 247; break; case 3: if (v2gKeyInfoType->RetrievalMethod.arrayLen < v2gKeyInfoType_RetrievalMethod_ARRAY_SIZE) { @@ -14161,7 +11509,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 309; + grammarID = 247; break; case 4: if (v2gKeyInfoType->X509Data.arrayLen < v2gKeyInfoType_X509Data_ARRAY_SIZE) { @@ -14169,7 +11517,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 309; + grammarID = 247; break; case 5: if (v2gKeyInfoType->PGPData.arrayLen < v2gKeyInfoType_PGPData_ARRAY_SIZE) { @@ -14177,7 +11525,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 309; + grammarID = 247; break; case 6: if (v2gKeyInfoType->SPKIData.arrayLen < v2gKeyInfoType_SPKIData_ARRAY_SIZE) { @@ -14185,7 +11533,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 309; + grammarID = 247; break; case 7: if (v2gKeyInfoType->MgmtData.arrayLen < v2gKeyInfoType_MgmtData_ARRAY_SIZE) { @@ -14219,7 +11567,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 = 309; + grammarID = 247; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -14228,10 +11576,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 = 309; + grammarID = 247; break; case 9: - grammarID = 310; + grammarID = 248; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -14239,7 +11587,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } } break; - case 308: + 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]] */ errn = decodeNBitUnsignedInteger(stream, 4, &eventCode); if (errn == 0) { @@ -14276,7 +11624,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 = 309; + grammarID = 247; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -14288,7 +11636,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 309; + grammarID = 247; break; case 2: if (v2gKeyInfoType->RetrievalMethod.arrayLen < v2gKeyInfoType_RetrievalMethod_ARRAY_SIZE) { @@ -14296,7 +11644,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 309; + grammarID = 247; break; case 3: if (v2gKeyInfoType->X509Data.arrayLen < v2gKeyInfoType_X509Data_ARRAY_SIZE) { @@ -14304,7 +11652,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 309; + grammarID = 247; break; case 4: if (v2gKeyInfoType->PGPData.arrayLen < v2gKeyInfoType_PGPData_ARRAY_SIZE) { @@ -14312,7 +11660,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 309; + grammarID = 247; break; case 5: if (v2gKeyInfoType->SPKIData.arrayLen < v2gKeyInfoType_SPKIData_ARRAY_SIZE) { @@ -14320,7 +11668,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 309; + grammarID = 247; break; case 6: if (v2gKeyInfoType->MgmtData.arrayLen < v2gKeyInfoType_MgmtData_ARRAY_SIZE) { @@ -14354,7 +11702,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 = 309; + grammarID = 247; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -14363,10 +11711,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 = 309; + grammarID = 247; break; case 8: - grammarID = 310; + grammarID = 248; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -14374,7 +11722,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } } break; - case 309: + 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]] */ errn = decodeNBitUnsignedInteger(stream, 4, &eventCode); if (errn == 0) { @@ -14411,7 +11759,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 = 309; + grammarID = 247; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -14423,7 +11771,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 309; + grammarID = 247; break; case 2: if (v2gKeyInfoType->RetrievalMethod.arrayLen < v2gKeyInfoType_RetrievalMethod_ARRAY_SIZE) { @@ -14431,7 +11779,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 309; + grammarID = 247; break; case 3: if (v2gKeyInfoType->X509Data.arrayLen < v2gKeyInfoType_X509Data_ARRAY_SIZE) { @@ -14439,7 +11787,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 309; + grammarID = 247; break; case 4: if (v2gKeyInfoType->PGPData.arrayLen < v2gKeyInfoType_PGPData_ARRAY_SIZE) { @@ -14447,7 +11795,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 309; + grammarID = 247; break; case 5: if (v2gKeyInfoType->SPKIData.arrayLen < v2gKeyInfoType_SPKIData_ARRAY_SIZE) { @@ -14455,7 +11803,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 309; + grammarID = 247; break; case 6: if (v2gKeyInfoType->MgmtData.arrayLen < v2gKeyInfoType_MgmtData_ARRAY_SIZE) { @@ -14489,7 +11837,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 = 309; + grammarID = 247; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -14498,14 +11846,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 = 309; + grammarID = 247; break; case 8: done = 1; - grammarID = 4; + grammarID = 5; break; case 9: - grammarID = 309; + grammarID = 247; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -14513,7 +11861,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } } break; - case 310: + 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]] */ errn = decodeNBitUnsignedInteger(stream, 4, &eventCode); if (errn == 0) { @@ -14550,7 +11898,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 = 309; + grammarID = 247; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -14562,7 +11910,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 309; + grammarID = 247; break; case 2: if (v2gKeyInfoType->RetrievalMethod.arrayLen < v2gKeyInfoType_RetrievalMethod_ARRAY_SIZE) { @@ -14570,7 +11918,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 309; + grammarID = 247; break; case 3: if (v2gKeyInfoType->X509Data.arrayLen < v2gKeyInfoType_X509Data_ARRAY_SIZE) { @@ -14578,7 +11926,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 309; + grammarID = 247; break; case 4: if (v2gKeyInfoType->PGPData.arrayLen < v2gKeyInfoType_PGPData_ARRAY_SIZE) { @@ -14586,7 +11934,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 309; + grammarID = 247; break; case 5: if (v2gKeyInfoType->SPKIData.arrayLen < v2gKeyInfoType_SPKIData_ARRAY_SIZE) { @@ -14594,7 +11942,7 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 309; + grammarID = 247; break; case 6: if (v2gKeyInfoType->MgmtData.arrayLen < v2gKeyInfoType_MgmtData_ARRAY_SIZE) { @@ -14628,7 +11976,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 = 309; + grammarID = 247; } else { errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } @@ -14637,10 +11985,142 @@ 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 = 309; + grammarID = 247; break; case 8: - grammarID = 310; + 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: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; + int done = 0; + + init_v2gAC_EVSEStatusType(v2gAC_EVSEStatusType); + + while(!done) { + switch(grammarID) { + case 249: + /* 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 = 250; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 250: + /* Element[START_ELEMENT({urn:iso:15118:2: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 = 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: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: + /* 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; @@ -14661,14 +12141,14 @@ static int decode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2g /* 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 = 311; + int grammarID = 252; int done = 0; init_v2gSelectedServiceListType(v2gSelectedServiceListType); while(!done) { switch(grammarID) { - case 311: + case 252: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SelectedService)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { @@ -14679,7 +12159,7 @@ static int decode_v2gSelectedServiceListType(bitstream_t* stream, struct v2gSele } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 312; + grammarID = 253; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -14687,7 +12167,7 @@ static int decode_v2gSelectedServiceListType(bitstream_t* stream, struct v2gSele } } break; - case 312: + case 253: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SelectedService), END_ELEMENT] */ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { @@ -14698,11 +12178,11 @@ static int decode_v2gSelectedServiceListType(bitstream_t* stream, struct v2gSele } else { errn = EXI_ERROR_OUT_OF_BOUNDS; } - grammarID = 312; + grammarID = 253; break; case 1: done = 1; - grammarID = 4; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -14721,17 +12201,550 @@ static int decode_v2gSelectedServiceListType(bitstream_t* stream, struct v2gSele 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 = 313; +/* 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 done = 0; - init_v2gPowerDeliveryReqType(v2gPowerDeliveryReqType); + init_v2gMeterInfoType(v2gMeterInfoType); while(!done) { switch(grammarID) { - case 313: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeProgress)] */ + case 254: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &v2gMeterInfoType->MeterID.charactersLen); + if (errn == 0) { + errn = (v2gMeterInfoType->MeterID.charactersLen - 2) <= v2gMeterInfoType_MeterID_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (v2gMeterInfoType->MeterID.charactersLen >= 2) { + v2gMeterInfoType->MeterID.charactersLen = (uint16_t)(v2gMeterInfoType->MeterID.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, v2gMeterInfoType->MeterID.charactersLen, v2gMeterInfoType->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:2013:MsgDataTypes}MeterID) ? */ + 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:2013:MsgDataTypes}MeterReading), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SigMeterReading), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger64(stream, &v2gMeterInfoType->MeterReading); + v2gMeterInfoType->MeterReading_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterReading) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 256; + } 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, &v2gMeterInfoType->SigMeterReading.bytesLen); + if (errn == 0) { + errn = (v2gMeterInfoType->SigMeterReading.bytesLen) <= v2gMeterInfoType_SigMeterReading_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gMeterInfoType->SigMeterReading.bytesLen, v2gMeterInfoType->SigMeterReading.bytes); + } + v2gMeterInfoType->SigMeterReading_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SigMeterReading) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 257; + } 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, &v2gMeterInfoType->MeterStatus); + v2gMeterInfoType->MeterStatus_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 258; + } 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, &v2gMeterInfoType->TMeter); + v2gMeterInfoType->TMeter_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 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 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] */ + 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, &v2gMeterInfoType->SigMeterReading.bytesLen); + if (errn == 0) { + errn = (v2gMeterInfoType->SigMeterReading.bytesLen) <= v2gMeterInfoType_SigMeterReading_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, v2gMeterInfoType->SigMeterReading.bytesLen, v2gMeterInfoType->SigMeterReading.bytes); + } + v2gMeterInfoType->SigMeterReading_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SigMeterReading) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 257; + } 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, &v2gMeterInfoType->MeterStatus); + v2gMeterInfoType->MeterStatus_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 258; + } 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, &v2gMeterInfoType->TMeter); + v2gMeterInfoType->TMeter_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 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 257: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &v2gMeterInfoType->MeterStatus); + v2gMeterInfoType->MeterStatus_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}MeterStatus) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 258; + } 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, &v2gMeterInfoType->TMeter); + v2gMeterInfoType->TMeter_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 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 258: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger64(stream, &v2gMeterInfoType->TMeter); + v2gMeterInfoType->TMeter_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}TMeter) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 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#,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; + int done = 0; + + init_v2gSPKIDataType(v2gSPKIDataType); + + while(!done) { + switch(grammarID) { + case 259: + /* 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 = 260; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 260: + /* Element[START_ELEMENT({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 = 260; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + /* TODO unsupported event : START_ELEMENT_GENERIC */ + grammarID = 261; + break; + case 2: + done = 1; + grammarID = 5; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 261: + /* 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 = 260; + } 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; + 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 = 262; + int done = 0; + + init_v2gChargeParameterDiscoveryResType(v2gChargeParameterDiscoveryResType); + + while(!done) { + switch(grammarID) { + case 262: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { @@ -14740,14 +12753,2263 @@ static int decode_v2gPowerDeliveryReqType(bitstream_t* stream, struct v2gPowerDe errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(errn == 0) { if(eventCode == 0) { - errn = decodeNBitUnsignedInteger(stream, 2, &v2gPowerDeliveryReqType->ChargeProgress); + 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}ChargeProgress) ? */ + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 263; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 263: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}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 = 264; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 264: + /* Element[START_ELEMENT({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 = 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; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + 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); + 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; + 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#,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 done = 0; + + init_v2gTransformsType(v2gTransformsType); + + while(!done) { + switch(grammarID) { + case 266: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gTransformsType->Transform.arrayLen < v2gTransformsType_Transform_ARRAY_SIZE) { + errn = decode_v2gTransformType(stream, &v2gTransformsType->Transform.array[v2gTransformsType->Transform.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 267; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 267: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (v2gTransformsType->Transform.arrayLen < v2gTransformsType_Transform_ARRAY_SIZE) { + errn = decode_v2gTransformType(stream, &v2gTransformsType->Transform.array[v2gTransformsType->Transform.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 267; + 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: + 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,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) { + int grammarID = 296; + int done = 0; + + init_v2gCableCheckResType(v2gCableCheckResType); + + while(!done) { + switch(grammarID) { + case 296: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + 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 = 297; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 297: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DC_EVSEStatus)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_v2gDC_EVSEStatusType(stream, &v2gCableCheckResType->DC_EVSEStatus); + grammarID = 32; + 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); + 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)] */ + 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 */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + 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: + /* 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; + } + } + 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 = 303; + int done = 0; + + init_v2gDC_EVSEStatusType(v2gDC_EVSEStatusType); + + 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: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + v2gCertificateUpdateResType->ResponseCode = (v2gresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode) ? */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if(eventCode == 0) { grammarID = 314; @@ -14763,31 +15025,13 @@ static int decode_v2gPowerDeliveryReqType(bitstream_t* stream, struct v2gPowerDe } break; case 314: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID)] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAProvisioningCertificateChain)] */ 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 = 315; - } else { - errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ - } - } + errn = decode_v2gCertificateChainType(stream, &v2gCertificateUpdateResType->SAProvisioningCertificateChain); + grammarID = 315; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -14796,29 +15040,14 @@ static int decode_v2gPowerDeliveryReqType(bitstream_t* stream, struct v2gPowerDe } break; case 315: - /* 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:MsgBody}ContractSignatureCertChain)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decode_v2gChargingProfileType(stream, &v2gPowerDeliveryReqType->ChargingProfile); - v2gPowerDeliveryReqType->ChargingProfile_isUsed = 1u; + errn = decode_v2gCertificateChainType(stream, &v2gCertificateUpdateResType->ContractSignatureCertChain); grammarID = 316; 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; @@ -14826,38 +15055,13 @@ static int decode_v2gPowerDeliveryReqType(bitstream_t* stream, struct v2gPowerDe } break; case 316: - /* 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] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ContractSignatureEncryptedPrivateKey)] */ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - done = 1; - grammarID = 4; + errn = decode_v2gContractSignatureEncryptedPrivateKeyType(stream, &v2gCertificateUpdateResType->ContractSignatureEncryptedPrivateKey); + grammarID = 317; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -14865,94 +15069,15 @@ static int decode_v2gPowerDeliveryReqType(bitstream_t* stream, struct v2gPowerDe } } break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ -static int decode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gObjectType) { - int grammarID = 317; - int done = 0; - - init_v2gObjectType(v2gObjectType); - - while(!done) { - switch(grammarID) { case 317: - /* FirstStartTag[ATTRIBUTE[STRING](Encoding), ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}DHpublickey)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &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; + errn = decode_v2gDiffieHellmanPublickeyType(stream, &v2gCertificateUpdateResType->DHpublickey); grammarID = 318; 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 = 319; - 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 = 128; - break; - case 3: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 60; - break; - case 4: - done = 1; - grammarID = 4; - break; - case 5: - grammarID = 60; - break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; break; @@ -14960,56 +15085,14 @@ static int decode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gOb } break; case 318: - /* StartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = decodeUnsignedInteger16(stream, &v2gObjectType->Id.charactersLen); - if (errn == 0) { - errn = (v2gObjectType->Id.charactersLen - 2) <= v2gObjectType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; - } - if (errn == 0) { - if (v2gObjectType->Id.charactersLen >= 2) { - v2gObjectType->Id.charactersLen = (uint16_t)(v2gObjectType->Id.charactersLen - 2); /* string table miss */ - errn = decodeCharacters(stream, v2gObjectType->Id.charactersLen, v2gObjectType->Id.characters); - } else { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; - } - } - v2gObjectType->Id_isUsed = 1u; + errn = decode_v2gEMAIDType(stream, &v2gCertificateUpdateResType->eMAID); grammarID = 319; 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 = 128; - break; - case 2: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 60; - break; - case 3: - done = 1; - grammarID = 4; - break; - case 4: - grammarID = 60; - break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; break; @@ -15017,38 +15100,35 @@ static int decode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gOb } break; case 319: - /* StartTag[ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RetryCounter), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = 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); + /* 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 { - /* string table hit */ - errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RetryCounter) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 4; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ } } - v2gObjectType->MimeType_isUsed = 1u; - grammarID = 128; break; case 1: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 60; - break; - case 2: done = 1; - grammarID = 4; - break; - case 3: - grammarID = 60; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; @@ -15056,45 +15136,14 @@ static int decode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gOb } } break; - case 128: - /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + case 4: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); if (errn == 0) { switch(eventCode) { case 0: - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - /* TODO unsupported event : START_ELEMENT_GENERIC */ - grammarID = 60; - break; - case 1: done = 1; - grammarID = 4; - break; - case 2: - grammarID = 60; - break; - default: - errn = EXI_ERROR_UNKOWN_EVENT_CODE; - break; - } - } - break; - case 60: - /* 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 = 60; - break; - case 1: - done = 1; - grammarID = 4; - break; - case 2: - grammarID = 60; + grammarID = 5; break; default: errn = EXI_ERROR_UNKOWN_EVENT_CODE; diff --git a/src/codec/v2gEXIDatatypesDecoder.h b/src/codec/v2gEXIDatatypesDecoder.h index f7c847d..f07dddb 100644 --- a/src/codec/v2gEXIDatatypesDecoder.h +++ b/src/codec/v2gEXIDatatypesDecoder.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

diff --git a/src/codec/v2gEXIDatatypesEncoder.c b/src/codec/v2gEXIDatatypesEncoder.c index 63fbb13..a40997f 100644 --- a/src/codec/v2gEXIDatatypesEncoder.c +++ b/src/codec/v2gEXIDatatypesEncoder.c @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

@@ -44,116 +44,116 @@ static int errn; /* Forward Declarations */ -static int encode_v2gServiceDetailResType(bitstream_t* stream, struct v2gServiceDetailResType* v2gServiceDetailResType); -static int encode_v2gSPKIDataType(bitstream_t* stream, struct v2gSPKIDataType* v2gSPKIDataType); -static int encode_v2gAuthorizationResType(bitstream_t* stream, struct v2gAuthorizationResType* v2gAuthorizationResType); -static int encode_v2gBodyType(bitstream_t* stream, struct v2gBodyType* v2gBodyType); -static int encode_v2gPaymentServiceSelectionReqType(bitstream_t* stream, struct v2gPaymentServiceSelectionReqType* v2gPaymentServiceSelectionReqType); -static int encode_v2gEVSEStatusType(bitstream_t* stream, struct v2gEVSEStatusType* v2gEVSEStatusType); -static int encode_v2gSelectedServiceType(bitstream_t* stream, struct v2gSelectedServiceType* v2gSelectedServiceType); -static int encode_v2gEntryType(bitstream_t* stream, struct v2gEntryType* v2gEntryType); -static int encode_v2gDC_EVSEChargeParameterType(bitstream_t* stream, struct v2gDC_EVSEChargeParameterType* v2gDC_EVSEChargeParameterType); -static int encode_v2gSalesTariffType(bitstream_t* stream, struct v2gSalesTariffType* v2gSalesTariffType); -static int encode_v2gPMaxScheduleType(bitstream_t* stream, struct v2gPMaxScheduleType* v2gPMaxScheduleType); -static int encode_v2gCostType(bitstream_t* stream, struct v2gCostType* v2gCostType); -static int encode_v2gChargeServiceType(bitstream_t* stream, struct v2gChargeServiceType* v2gChargeServiceType); -static int encode_v2gPMaxScheduleEntryType(bitstream_t* stream, struct v2gPMaxScheduleEntryType* v2gPMaxScheduleEntryType); -static int encode_v2gServiceListType(bitstream_t* stream, struct v2gServiceListType* v2gServiceListType); -static int encode_v2gKeyValueType(bitstream_t* stream, struct v2gKeyValueType* v2gKeyValueType); -static int encode_v2gPaymentServiceSelectionResType(bitstream_t* stream, struct v2gPaymentServiceSelectionResType* v2gPaymentServiceSelectionResType); -static int encode_v2gSignatureMethodType(bitstream_t* stream, struct v2gSignatureMethodType* v2gSignatureMethodType); -static int encode_v2gMeteringReceiptResType(bitstream_t* stream, struct v2gMeteringReceiptResType* v2gMeteringReceiptResType); -static int encode_v2gMessageHeaderType(bitstream_t* stream, struct v2gMessageHeaderType* v2gMessageHeaderType); -static int encode_v2gRetrievalMethodType(bitstream_t* stream, struct v2gRetrievalMethodType* v2gRetrievalMethodType); -static int encode_v2gEVChargeParameterType(bitstream_t* stream, struct v2gEVChargeParameterType* v2gEVChargeParameterType); -static int encode_v2gCertificateInstallationReqType(bitstream_t* stream, struct v2gCertificateInstallationReqType* v2gCertificateInstallationReqType); -static int encode_v2gChargeParameterDiscoveryResType(bitstream_t* stream, struct v2gChargeParameterDiscoveryResType* v2gChargeParameterDiscoveryResType); -static int encode_v2gWeldingDetectionReqType(bitstream_t* stream, struct v2gWeldingDetectionReqType* v2gWeldingDetectionReqType); -static int encode_v2gCableCheckReqType(bitstream_t* stream, struct v2gCableCheckReqType* v2gCableCheckReqType); -static int encode_v2gParameterType(bitstream_t* stream, struct v2gParameterType* v2gParameterType); -static int encode_v2gEVSEChargeParameterType(bitstream_t* stream, struct v2gEVSEChargeParameterType* v2gEVSEChargeParameterType); -static int encode_v2gManifestType(bitstream_t* stream, struct v2gManifestType* v2gManifestType); -static int encode_v2gDC_EVStatusType(bitstream_t* stream, struct v2gDC_EVStatusType* v2gDC_EVStatusType); -static int encode_v2gPaymentDetailsReqType(bitstream_t* stream, struct v2gPaymentDetailsReqType* v2gPaymentDetailsReqType); -static int encode_v2gSAScheduleListType(bitstream_t* stream, struct v2gSAScheduleListType* v2gSAScheduleListType); -static int encode_v2gRSAKeyValueType(bitstream_t* stream, struct v2gRSAKeyValueType* v2gRSAKeyValueType); -static int encode_v2gAC_EVSEChargeParameterType(bitstream_t* stream, struct v2gAC_EVSEChargeParameterType* v2gAC_EVSEChargeParameterType); -static int encode_v2gTransformsType(bitstream_t* stream, struct v2gTransformsType* v2gTransformsType); -static int encode_v2gWeldingDetectionResType(bitstream_t* stream, struct v2gWeldingDetectionResType* v2gWeldingDetectionResType); -static int encode_v2gConsumptionCostType(bitstream_t* stream, struct v2gConsumptionCostType* v2gConsumptionCostType); -static int encode_v2gChargingStatusResType(bitstream_t* stream, struct v2gChargingStatusResType* v2gChargingStatusResType); -static int encode_v2gEVStatusType(bitstream_t* stream, struct v2gEVStatusType* v2gEVStatusType); -static int encode_v2gPGPDataType(bitstream_t* stream, struct v2gPGPDataType* v2gPGPDataType); -static int encode_v2gSessionStopResType(bitstream_t* stream, struct v2gSessionStopResType* v2gSessionStopResType); -static int encode_v2gServiceDiscoveryReqType(bitstream_t* stream, struct v2gServiceDiscoveryReqType* v2gServiceDiscoveryReqType); -static int encode_v2gAuthorizationReqType(bitstream_t* stream, struct v2gAuthorizationReqType* v2gAuthorizationReqType); -static int encode_v2gSAScheduleTupleType(bitstream_t* stream, struct v2gSAScheduleTupleType* v2gSAScheduleTupleType); -static int encode_v2gPhysicalValueType(bitstream_t* stream, struct v2gPhysicalValueType* v2gPhysicalValueType); -static int encode_v2gDigestMethodType(bitstream_t* stream, struct v2gDigestMethodType* v2gDigestMethodType); -static int encode_v2gAC_EVSEStatusType(bitstream_t* stream, struct v2gAC_EVSEStatusType* v2gAC_EVSEStatusType); -static int encode_v2gSessionSetupResType(bitstream_t* stream, struct v2gSessionSetupResType* v2gSessionSetupResType); -static int encode_v2gX509IssuerSerialType(bitstream_t* stream, struct v2gX509IssuerSerialType* v2gX509IssuerSerialType); -static int encode_v2gSessionStopReqType(bitstream_t* stream, struct v2gSessionStopReqType* v2gSessionStopReqType); -static int encode_v2gDC_EVSEStatusType(bitstream_t* stream, struct v2gDC_EVSEStatusType* v2gDC_EVSEStatusType); -static int encode_v2gDiffieHellmanPublickeyType(bitstream_t* stream, struct v2gDiffieHellmanPublickeyType* v2gDiffieHellmanPublickeyType); -static int encode_v2gCertificateUpdateReqType(bitstream_t* stream, struct v2gCertificateUpdateReqType* v2gCertificateUpdateReqType); -static int encode_v2gBodyBaseType(bitstream_t* stream, struct v2gBodyBaseType* v2gBodyBaseType); -static int encode_v2gDC_EVChargeParameterType(bitstream_t* stream, struct v2gDC_EVChargeParameterType* v2gDC_EVChargeParameterType); -static int encode_v2gSubCertificatesType(bitstream_t* stream, struct v2gSubCertificatesType* v2gSubCertificatesType); -static int encode_v2gSupportedEnergyTransferModeType(bitstream_t* stream, struct v2gSupportedEnergyTransferModeType* v2gSupportedEnergyTransferModeType); -static int encode_v2gChargingStatusReqType(bitstream_t* stream, struct v2gChargingStatusReqType* v2gChargingStatusReqType); -static int encode_v2gSignaturePropertyType(bitstream_t* stream, struct v2gSignaturePropertyType* v2gSignaturePropertyType); -static int encode_v2gContractSignatureEncryptedPrivateKeyType(bitstream_t* stream, struct v2gContractSignatureEncryptedPrivateKeyType* v2gContractSignatureEncryptedPrivateKeyType); -static int encode_v2gReferenceType(bitstream_t* stream, struct v2gReferenceType* v2gReferenceType); -static int encode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrentDemandResType* v2gCurrentDemandResType); -static int encode_v2gCanonicalizationMethodType(bitstream_t* stream, struct v2gCanonicalizationMethodType* v2gCanonicalizationMethodType); -static int encode_v2gTransformType(bitstream_t* stream, struct v2gTransformType* v2gTransformType); -static int encode_v2gCertificateChainType(bitstream_t* stream, struct v2gCertificateChainType* v2gCertificateChainType); -static int encode_v2gSignatureValueType(bitstream_t* stream, struct v2gSignatureValueType* v2gSignatureValueType); -static int encode_v2gEVPowerDeliveryParameterType(bitstream_t* stream, struct v2gEVPowerDeliveryParameterType* v2gEVPowerDeliveryParameterType); -static int encode_v2gServiceDetailReqType(bitstream_t* stream, struct v2gServiceDetailReqType* v2gServiceDetailReqType); -static int encode_v2gPaymentDetailsResType(bitstream_t* stream, struct v2gPaymentDetailsResType* v2gPaymentDetailsResType); -static int encode_v2gX509DataType(bitstream_t* stream, struct v2gX509DataType* v2gX509DataType); -static int encode_v2gDSAKeyValueType(bitstream_t* stream, struct v2gDSAKeyValueType* v2gDSAKeyValueType); -static int encode_v2gPowerDeliveryResType(bitstream_t* stream, struct v2gPowerDeliveryResType* v2gPowerDeliveryResType); -static int encode_v2gChargeParameterDiscoveryReqType(bitstream_t* stream, struct v2gChargeParameterDiscoveryReqType* v2gChargeParameterDiscoveryReqType); -static int encode_v2gParameterSetType(bitstream_t* stream, struct v2gParameterSetType* v2gParameterSetType); -static int encode_v2gServiceDiscoveryResType(bitstream_t* stream, struct v2gServiceDiscoveryResType* v2gServiceDiscoveryResType); -static int encode_v2gAnonType_V2G_Message(bitstream_t* stream, struct v2gAnonType_V2G_Message* v2gAnonType_V2G_Message); -static int encode_v2gSignatureType(bitstream_t* stream, struct v2gSignatureType* v2gSignatureType); -static int encode_v2gEMAIDType(bitstream_t* stream, struct v2gEMAIDType* v2gEMAIDType); -static int encode_v2gCertificateInstallationResType(bitstream_t* stream, struct v2gCertificateInstallationResType* v2gCertificateInstallationResType); -static int encode_v2gCableCheckResType(bitstream_t* stream, struct v2gCableCheckResType* v2gCableCheckResType); -static int encode_v2gMeterInfoType(bitstream_t* stream, struct v2gMeterInfoType* v2gMeterInfoType); -static int encode_v2gAC_EVChargeParameterType(bitstream_t* stream, struct v2gAC_EVChargeParameterType* v2gAC_EVChargeParameterType); -static int encode_v2gServiceParameterListType(bitstream_t* stream, struct v2gServiceParameterListType* v2gServiceParameterListType); -static int encode_v2gCurrentDemandReqType(bitstream_t* stream, struct v2gCurrentDemandReqType* v2gCurrentDemandReqType); -static int encode_v2gSASchedulesType(bitstream_t* stream, struct v2gSASchedulesType* v2gSASchedulesType); -static int encode_v2gIntervalType(bitstream_t* stream, struct v2gIntervalType* v2gIntervalType); -static int encode_v2gPreChargeResType(bitstream_t* stream, struct v2gPreChargeResType* v2gPreChargeResType); -static int encode_v2gSalesTariffEntryType(bitstream_t* stream, struct v2gSalesTariffEntryType* v2gSalesTariffEntryType); -static int encode_v2gPaymentOptionListType(bitstream_t* stream, struct v2gPaymentOptionListType* v2gPaymentOptionListType); -static int encode_v2gSignedInfoType(bitstream_t* stream, struct v2gSignedInfoType* v2gSignedInfoType); -static int encode_v2gSessionSetupReqType(bitstream_t* stream, struct v2gSessionSetupReqType* v2gSessionSetupReqType); -static int encode_v2gSignaturePropertiesType(bitstream_t* stream, struct v2gSignaturePropertiesType* v2gSignaturePropertiesType); -static int encode_v2gProfileEntryType(bitstream_t* stream, struct v2gProfileEntryType* v2gProfileEntryType); -static int encode_v2gPreChargeReqType(bitstream_t* stream, struct v2gPreChargeReqType* v2gPreChargeReqType); -static int encode_v2gListOfRootCertificateIDsType(bitstream_t* stream, struct v2gListOfRootCertificateIDsType* v2gListOfRootCertificateIDsType); -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_v2gChargingProfileType(bitstream_t* stream, struct v2gChargingProfileType* v2gChargingProfileType); -static int encode_v2gCertificateUpdateResType(bitstream_t* stream, struct v2gCertificateUpdateResType* v2gCertificateUpdateResType); -static int encode_v2gMeteringReceiptReqType(bitstream_t* stream, struct v2gMeteringReceiptReqType* v2gMeteringReceiptReqType); -static int encode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2gServiceType); -static int encode_v2gNotificationType(bitstream_t* stream, struct v2gNotificationType* v2gNotificationType); -static int encode_v2gKeyInfoType(bitstream_t* stream, struct v2gKeyInfoType* v2gKeyInfoType); -static int encode_v2gSelectedServiceListType(bitstream_t* stream, struct v2gSelectedServiceListType* v2gSelectedServiceListType); 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_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_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_v2gSignedInfoType(bitstream_t* stream, struct v2gSignedInfoType* v2gSignedInfoType); +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_v2gCableCheckResType(bitstream_t* stream, struct v2gCableCheckResType* v2gCableCheckResType); +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_v2gCertificateUpdateResType(bitstream_t* stream, struct v2gCertificateUpdateResType* v2gCertificateUpdateResType); - /* 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) { + /* 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 = 0; int done = 0; @@ -161,14 +161,14 @@ static int encode_v2gServiceDetailResType(bitstream_t* stream, struct v2gService while(!done) { switch(grammarID) { case 0: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + /* 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, 5, v2gServiceDetailResType->ResponseCode); + errn = encodeNBitUnsignedInteger(stream, 2, v2gPowerDeliveryReqType->ChargeProgress); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } @@ -179,14 +179,14 @@ static int encode_v2gServiceDetailResType(bitstream_t* stream, struct v2gService } break; case 1: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceID)] */ + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAScheduleTupleID)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeUnsignedInteger16(stream, v2gServiceDetailResType->ServiceID); + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gPowerDeliveryReqType->SAScheduleTupleID - 1)); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } @@ -197,4508 +197,67 @@ static int encode_v2gServiceDetailResType(bitstream_t* stream, struct v2gService } break; case 2: - /* 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='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 = 5; - int done = 0; - - unsigned int v2gSPKIDataType_SPKISexp_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 5: - /* 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 = 6; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 6: - /* 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 = 6; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 7; - } 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#}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 = 6; - } 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,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 = 8; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 8: - /* 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 = 9; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 9: - /* 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='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 = 10; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 10: - /* 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,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 = 11; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 11: - /* 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 = 12; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 12: - /* 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='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 = 13; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 13: - /* 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 = 14; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 14: - /* 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: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 = 15; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 15: - /* 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 = 16; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 16: - /* 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,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 = 17; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 17: - /* 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: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 = 18; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 18: - /* 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 = 19; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 19: - /* 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 = 20; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 20: - /* 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 = 21; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 21: - /* 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 = 22; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 22: - /* 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 = 23; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 23: - /* 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 = 24; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 24: - /* 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 = 25; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVSEChargeParameterType->EVSEPeakCurrentRipple ); - } - grammarID = 26; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 25: - /* 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 = 26; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 26: - /* 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: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 = 27; - int done = 0; - - unsigned int v2gSalesTariffType_SalesTariffEntry_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 27: - /* 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 = 28; - } 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 = 29; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 28: - /* 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 = 29; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 29: - /* 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 = 30; - } 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 = 31; - } 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 = 32; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 30: - /* 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 = 31; - } 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 = 32; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 31: - /* 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 = 32; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 32: - /* 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 = 32; - } 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,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 = 33; - int done = 0; - - unsigned int v2gPMaxScheduleType_PMaxScheduleEntry_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 33: - /* 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 = 34; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 34: - /* 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 = 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,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 = 35; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 35: - /* 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 = 36; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 36: - /* 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 = 37; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 37: - /* 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: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 = 38; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 38: - /* 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 = 39; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 39: - /* 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 = 40; - } 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 = 41; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 40: - /* 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 = 41; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 41: - /* 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 = 42; - } 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 = 43; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 42: - /* 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 = 43; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 43: - /* 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,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 = 44; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 44: - /* 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 = 45; - } else if ( v2gPMaxScheduleEntryType->TimeInterval_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gIntervalType(stream, &v2gPMaxScheduleEntryType->TimeInterval ); - } - grammarID = 45; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 45: - /* 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: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 = 46; - int done = 0; - - unsigned int v2gServiceListType_Service_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 46: - /* 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 = 47; - } 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 = 4; - } 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 = 4; - } 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 = 4; - } 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 = 4; - } 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 = 52; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 52: - /* 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 = 53; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 53: - /* 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='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 = 54; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 54: - /* 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 ) { + /* 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_v2gDSAKeyValueType(stream, &v2gKeyValueType->DSAKeyValue ); + errn = encode_v2gChargingProfileType(stream, &v2gPowerDeliveryReqType->ChargingProfile ); } - grammarID = 55; - } else if ( v2gKeyValueType->RSAKeyValue_isUsed == 1u ) { + grammarID = 3; + } else if ( v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 3, 1); if(errn == 0) { - errn = encode_v2gRSAKeyValueType(stream, &v2gKeyValueType->RSAKeyValue ); - } - grammarID = 55; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 55; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 56; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 55: - /* Element[END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - done = 1; + errn = encode_v2gDC_EVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter ); } grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 55; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 56: - /* 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 = 55; - } else if ( v2gKeyValueType->RSAKeyValue_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_v2gRSAKeyValueType(stream, &v2gKeyValueType->RSAKeyValue ); - } - grammarID = 55; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 55; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 56; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='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 = 57; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 57: - /* 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#,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 = 58; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 58: - /* 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 = 59; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 59: - /* 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 = 60; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 60; - } else if (1==1) { + } else if ( v2gPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 3, 2); if(errn == 0) { - done = 1; + errn = encode_v2gEVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->EVPowerDeliveryParameter ); } grammarID = 4; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 61; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 60: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 60; - } 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 = 60; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 61: - /* 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 = 60; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 60; - } 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 = 61; - } else { - errn = EXI_ERROR_UNKOWN_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 = 62; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 62: - /* 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 = 63; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 63: - /* 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: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 = 64; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 64: - /* 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 = 65; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 65: - /* 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 = 66; - } 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 66: - /* 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='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 = 67; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 67: - /* 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 = 68; - } 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 = 69; - } 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; + grammarID = 5; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 68: - /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */ - if ( v2gRetrievalMethodType->URI_isUsed == 1u ) { + 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) { - /* 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); - } + errn = encode_v2gDC_EVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter ); } - grammarID = 69; - } else if ( v2gRetrievalMethodType->Transforms_isUsed == 1u ) { + grammarID = 4; + } else if ( v2gPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { - errn = encode_v2gTransformsType(stream, &v2gRetrievalMethodType->Transforms ); + errn = encode_v2gEVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->EVPowerDeliveryParameter ); } - grammarID = 3; + grammarID = 4; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 2); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 5; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 69: - /* 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: + case 4: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_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 = 70; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 70: - /* 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: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 = 71; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 71: - /* 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 = 72; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 72: - /* 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 = 73; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 73: - /* 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: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 = 74; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 74: - /* 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 = 75; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 75: - /* 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 = 76; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 76: - /* 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 = 77; - } else if ( v2gChargeParameterDiscoveryResType->SASchedules_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_v2gSASchedulesType(stream, &v2gChargeParameterDiscoveryResType->SASchedules ); - } - grammarID = 77; - } 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 77: - /* 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: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 = 78; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 78: - /* 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='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 = 78; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 78: - /* 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,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 = 79; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 79: - /* 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 = 80; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 80: - /* 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,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 = 81; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 81: - /* 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#,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 = 82; - int done = 0; - - unsigned int v2gManifestType_Reference_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 82: - /* 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 = 83; - } 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 = 84; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 83: - /* 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 = 84; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 84: - /* 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 = 84; - } 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 = 85; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 85: - /* 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 = 86; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 86: - /* 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 = 87; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 87: - /* 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,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 = 88; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 88: - /* 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 = 89; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 89: - /* 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,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 = 90; - int done = 0; - - unsigned int v2gSAScheduleListType_SAScheduleTuple_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 90: - /* 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 = 91; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 91: - /* 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 = 92; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 92: - /* 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#,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 = 93; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 93: - /* 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 = 94; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 94: - /* 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='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 = 95; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 95: - /* 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 = 96; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 96: - /* 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 = 97; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 97: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}EVSEMaxCurrent)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gAC_EVSEChargeParameterType->EVSEMaxCurrent ); - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='http://www.w3.org/2000/09/xmldsig#,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 = 98; - int done = 0; - - unsigned int v2gTransformsType_Transform_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 98: - /* 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 = 99; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 99: - /* 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 = 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: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 = 100; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 100: - /* 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 = 101; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 101: - /* 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 = 102; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 102: - /* 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: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 = 103; - int done = 0; - - unsigned int v2gConsumptionCostType_Cost_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 103: - /* 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 = 104; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 104: - /* 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 = 105; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 105: - /* 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 = 106; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 106: - /* 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,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 = 107; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 107: - /* 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 = 108; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 108: - /* 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 = 109; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 109: - /* 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 = 110; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 110: - /* 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 = 111; - } else if ( v2gChargingStatusResType->MeterInfo_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_v2gMeterInfoType(stream, &v2gChargingStatusResType->MeterInfo ); - } - grammarID = 112; - } 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 = 113; - } 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 111: - /* 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 = 112; - } 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 = 113; - } 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 112: - /* 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 = 113; - } 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 113: - /* 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,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 = 81; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 81: - /* 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#,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 = 114; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 114: - /* 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 = 115; - } 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 = 116; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 115: - /* 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 = 116; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 116; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 116: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - 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: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 = 57; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 57: - /* 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: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 = 117; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 117: - /* 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 = 118; - } 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 118: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ServiceCategory), END_ELEMENT] */ - if ( v2gServiceDiscoveryReqType->ServiceCategory_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 2, v2gServiceDiscoveryReqType->ServiceCategory); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='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 = 119; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 119: - /* 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 = 120; - } 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 120: - /* 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,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 = 121; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 121: - /* 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 = 122; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 122: - /* 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 = 123; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 123: - /* 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='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 = 124; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 124: - /* 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 = 125; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 125: - /* 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 = 126; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 126: - /* 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='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 = 127; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 127: - /* 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 = 128; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 128: - /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 60; - } 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 = 60; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 60: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 60; - } 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 = 60; - } else { - errn = EXI_ERROR_UNKOWN_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 = 129; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 129: - /* 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 = 130; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 130: - /* 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 = 131; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 131: - /* 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: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 = 132; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 132: - /* 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 = 133; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 133: - /* 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 = 134; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 134: - /* 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='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 = 135; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 135: - /* 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 = 136; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 136: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeInteger64(stream, v2gX509IssuerSerialType->X509SerialNumber); - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='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 = 137; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 137: - /* 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,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 = 138; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 138: - /* 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 = 139; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 139: - /* 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 = 140; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 140: - /* 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 = 141; - } 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 141: - /* 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='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 = 142; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 142: - /* 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 = 143; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 143: - /* StartTag[CHARACTERS[BINARY_BASE64]] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gDiffieHellmanPublickeyType->CONTENT.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gDiffieHellmanPublickeyType->CONTENT.bytes, v2gDiffieHellmanPublickeyType->CONTENT.bytesLen); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; + grammarID = 5; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -4716,13 +275,13 @@ static int encode_v2gDiffieHellmanPublickeyType(bitstream_t* stream, struct v2gD /* 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 = 144; + int grammarID = 6; int done = 0; while(!done) { switch(grammarID) { - case 144: + case 6: /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgBody}Id)] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -4733,24 +292,24 @@ static int encode_v2gCertificateUpdateReqType(bitstream_t* stream, struct v2gCer errn = encodeCharacters(stream, v2gCertificateUpdateReqType->Id.characters, v2gCertificateUpdateReqType->Id.charactersLen); } } - grammarID = 145; + grammarID = 7; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 145: + 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 = 146; + grammarID = 8; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 146: + case 8: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}eMAID)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -4767,31 +326,125 @@ static int encode_v2gCertificateUpdateReqType(bitstream_t* stream, struct v2gCer errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 73; + grammarID = 9; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 73: + 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 = 3; + grammarID = 4; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 3: + 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; } @@ -4809,20 +462,20 @@ static int encode_v2gCertificateUpdateReqType(bitstream_t* stream, struct v2gCer /* 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 = 81; + int grammarID = 13; int done = 0; while(!done) { switch(grammarID) { - case 81: + case 13: /* FirstStartTag[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 5; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -4838,974 +491,15 @@ static int encode_v2gBodyBaseType(bitstream_t* stream, struct v2gBodyBaseType* v 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 = 147; +/* 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 147: - /* 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 = 148; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gDC_EVStatusType(stream, &v2gDC_EVChargeParameterType->DC_EVStatus ); - } - grammarID = 149; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 148: - /* 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 = 149; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 149: - /* 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 = 150; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 150: - /* 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 = 151; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVMaximumVoltageLimit ); - } - grammarID = 152; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 151: - /* 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 = 152; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 152: - /* 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 = 153; - } else if ( v2gDC_EVChargeParameterType->EVEnergyRequest_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gDC_EVChargeParameterType->EVEnergyRequest ); - } - grammarID = 154; - } 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 = 155; - } 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 153: - /* 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 = 154; - } 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 = 155; - } 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 154: - /* 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 = 155; - } 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 155: - /* 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: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 = 156; - int done = 0; - - unsigned int v2gSubCertificatesType_Certificate_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 156: - /* 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 = 157; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 157: - /* 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 = 158; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 158: - /* 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 = 159; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 159: - /* 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: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 = 160; - int done = 0; - - unsigned int v2gSupportedEnergyTransferModeType_EnergyTransferMode_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 160: - /* 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 = 161; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 161: - /* 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 = 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}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 = 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}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 = 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}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 = 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}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: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 = 81; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 81: - /* 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_v2gSignaturePropertyType(bitstream_t* stream, struct v2gSignaturePropertyType* v2gSignaturePropertyType) { - int grammarID = 166; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 166: - /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Target)] */ - if ( v2gSignaturePropertyType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignaturePropertyType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gSignaturePropertyType->Id.characters, v2gSignaturePropertyType->Id.charactersLen); - } - } - grammarID = 167; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignaturePropertyType->Target.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gSignaturePropertyType->Target.characters, v2gSignaturePropertyType->Target.charactersLen); - } - } - grammarID = 168; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 167: - /* StartTag[ATTRIBUTE[STRING](Target)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignaturePropertyType->Target.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gSignaturePropertyType->Target.characters, v2gSignaturePropertyType->Target.charactersLen); - } - } - grammarID = 168; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 168: - /* StartTag[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 60; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 169; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 60: - /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 60; - } 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 = 60; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 169: - /* Element[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 60; - } 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: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 = 142; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 142: - /* FirstStartTag[ATTRIBUTE[STRING]({urn:iso:15118:2:2013:MsgDataTypes}Id)] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gContractSignatureEncryptedPrivateKeyType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gContractSignatureEncryptedPrivateKeyType->Id.characters, v2gContractSignatureEncryptedPrivateKeyType->Id.charactersLen); - } - } - grammarID = 143; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 143: - /* StartTag[CHARACTERS[BINARY_BASE64]] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gContractSignatureEncryptedPrivateKeyType->CONTENT.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gContractSignatureEncryptedPrivateKeyType->CONTENT.bytes, v2gContractSignatureEncryptedPrivateKeyType->CONTENT.bytesLen); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='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 = 170; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 170: - /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - if ( v2gReferenceType->Id_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gReferenceType->Id.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gReferenceType->Id.characters, v2gReferenceType->Id.charactersLen); - } - } - grammarID = 171; - } else if ( v2gReferenceType->Type_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gReferenceType->Type.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gReferenceType->Type.characters, v2gReferenceType->Type.charactersLen); - } - } - grammarID = 172; - } else if ( v2gReferenceType->URI_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gReferenceType->URI.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gReferenceType->URI.characters, v2gReferenceType->URI.charactersLen); - } - } - grammarID = 173; - } else if ( v2gReferenceType->Transforms_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - errn = encode_v2gTransformsType(stream, &v2gReferenceType->Transforms ); - } - grammarID = 174; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 3, 4); - if(errn == 0) { - errn = encode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod ); - } - grammarID = 175; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 171: - /* StartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - if ( v2gReferenceType->Type_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gReferenceType->Type.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gReferenceType->Type.characters, v2gReferenceType->Type.charactersLen); - } - } - grammarID = 172; - } else if ( v2gReferenceType->URI_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gReferenceType->URI.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gReferenceType->URI.characters, v2gReferenceType->URI.charactersLen); - } - } - grammarID = 173; - } else if ( v2gReferenceType->Transforms_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - errn = encode_v2gTransformsType(stream, &v2gReferenceType->Transforms ); - } - grammarID = 174; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 3, 3); - if(errn == 0) { - errn = encode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod ); - } - grammarID = 175; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 172: - /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - if ( v2gReferenceType->URI_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* encode string as string table miss (+2 len)*/ - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gReferenceType->URI.charactersLen + 2)); - if (errn == 0) { - errn = encodeCharacters(stream, v2gReferenceType->URI.characters, v2gReferenceType->URI.charactersLen); - } - } - grammarID = 173; - } else if ( v2gReferenceType->Transforms_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gTransformsType(stream, &v2gReferenceType->Transforms ); - } - grammarID = 174; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - errn = encode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod ); - } - grammarID = 175; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 173: - /* 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 = 174; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod ); - } - grammarID = 175; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 174: - /* 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 = 175; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 175: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue)] */ - if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gReferenceType->DigestValue.bytesLen)); - if (errn == 0) { - errn = encodeBytes(stream, v2gReferenceType->DigestValue.bytes, v2gReferenceType->DigestValue.bytesLen); - } - /* valid EE */ - errn = encodeNBitUnsignedInteger(stream, 1, 0); - } - } - grammarID = 3; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 3: - /* Element[END_ELEMENT] */ - if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='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: + case 14: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -5813,310 +507,268 @@ static int encode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrent /* FirstStartTag[CHARACTERS[ENUMERATION]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gCurrentDemandResType->ResponseCode); + errn = encodeNBitUnsignedInteger(stream, 5, v2gWeldingDetectionResType->ResponseCode); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 177; + grammarID = 15; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 177: + 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, &v2gCurrentDemandResType->DC_EVSEStatus ); + errn = encode_v2gDC_EVSEStatusType(stream, &v2gWeldingDetectionResType->DC_EVSEStatus ); } - grammarID = 178; + grammarID = 16; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 178: + 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, &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; + errn = encode_v2gPhysicalValueType(stream, &v2gWeldingDetectionResType->EVSEPresentVoltage ); } 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: + 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; } @@ -6134,13 +786,13 @@ static int encode_v2gCurrentDemandResType(bitstream_t* stream, struct v2gCurrent /* 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 = 127; + int grammarID = 23; int done = 0; while(!done) { switch(grammarID) { - case 127: + case 23: /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -6151,2832 +803,43 @@ static int encode_v2gCanonicalizationMethodType(bitstream_t* stream, struct v2gC errn = encodeCharacters(stream, v2gCanonicalizationMethodType->Algorithm.characters, v2gCanonicalizationMethodType->Algorithm.charactersLen); } } - grammarID = 128; + grammarID = 24; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 128: + case 24: /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 60; + grammarID = 25; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 5; } else if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 60; + grammarID = 25; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 60: + case 25: /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 60; + grammarID = 25; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 5; } else if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 60; - } 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 = 190; - int done = 0; - - unsigned int v2gTransformType_XPath_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 190: - /* 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 = 191; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 191: - /* 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 = 192; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 192; - } 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 = 192; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 192: - /* 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 = 192; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 192; - } 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 = 192; - } else { - errn = EXI_ERROR_UNKOWN_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 = 193; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 193: - /* 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 = 194; - } 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 = 195; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 194: - /* 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 = 195; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 195: - /* 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#,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 = 196; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 196: - /* 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 = 143; - } 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 143: - /* 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: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 = 81; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 81: - /* 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,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 = 197; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 197: - /* 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='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 = 198; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 198: - /* 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 = 199; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 199: - /* 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 = 200; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 200: - /* 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#,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 = 201; - 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 201: - /* 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 = 202; - } 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 = 202; - } 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 = 202; - } 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 = 202; - } 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 = 202; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 202; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 202: - /* 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 = 202; - } 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 = 202; - } 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 = 202; - } 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 = 202; - } 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 = 202; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 202; - } 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#,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 = 203; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 203: - /* 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 = 204; - } 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 = 205; - } 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 = 206; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 204: - /* 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 = 207; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 207: - /* 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 = 205; - } 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 = 206; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 205: - /* 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 = 206; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 206: - /* 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 = 208; - } 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 = 209; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 208: - /* 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 = 209; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 209: - /* 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,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 = 62; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 62: - /* 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 = 63; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 63: - /* 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: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 = 210; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 210: - /* 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 = 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, 3, v2gChargeParameterDiscoveryReqType->RequestedEnergyTransferMode); - /* 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: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 = 212; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 212: - /* 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,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 = 213; - int done = 0; - - unsigned int v2gParameterSetType_Parameter_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 213: - /* 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 = 214; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 214: - /* 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 = 215; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 215: - /* 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 = 215; - } 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 = 216; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 216: - /* 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 = 217; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 217: - /* 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 = 218; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 218: - /* 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 = 219; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 219: - /* 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: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 = 220; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 220: - /* 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 = 221; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 221: - /* 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='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 = 222; - int done = 0; - - unsigned int v2gSignatureType_Object_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 222: - /* 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 = 223; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gSignedInfoType(stream, &v2gSignatureType->SignedInfo ); - } - grammarID = 224; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 223: - /* 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 = 224; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 224: - /* 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 = 225; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 225: - /* 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 = 226; - } 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 = 226; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 2); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 226: - /* 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 = 226; - } 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,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 = 227; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 227: - /* 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 = 228; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 228: - /* 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: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 = 229; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 229: - /* 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 = 230; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 230: - /* 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 = 231; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 231: - /* 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 = 232; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 232: - /* 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 = 233; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 233: - /* 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 = 234; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 234: - /* 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: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 = 235; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 235: - /* 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 = 236; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 236: - /* 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 = 9; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 9: - /* 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,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 = 237; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 237: - /* 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 = 238; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 238: - /* 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 = 239; - } 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 = 240; - } 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 = 241; - } 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 239: - /* 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 = 240; - } 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 = 241; - } 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 240: - /* 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 = 241; - } 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 241: - /* 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: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 = 242; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 242: - /* 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 = 243; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gAC_EVChargeParameterType->EAmount ); - } - grammarID = 244; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 243: - /* 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 = 244; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 244: - /* 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 = 245; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 245: - /* 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 = 246; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 246: - /* 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,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 = 247; - int done = 0; - - unsigned int v2gServiceParameterListType_ParameterSet_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 247: - /* 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 = 248; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 248: - /* 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 = 248; - } 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,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 = 249; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 249: - /* 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 = 250; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 250: - /* 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 = 251; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 251: - /* 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 = 252; - } else if ( v2gCurrentDemandReqType->EVMaximumCurrentLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumCurrentLimit ); - } - grammarID = 253; - } else if ( v2gCurrentDemandReqType->EVMaximumPowerLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 2); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumPowerLimit ); - } - grammarID = 254; - } 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 = 255; - } 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 = 256; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 252: - /* 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 = 253; - } else if ( v2gCurrentDemandReqType->EVMaximumPowerLimit_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 3, 1); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->EVMaximumPowerLimit ); - } - grammarID = 254; - } 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 = 255; - } 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 = 256; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 253: - /* 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 = 254; - } 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 = 255; - } 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 = 256; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 254: - /* 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 = 255; - } 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 = 256; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 255: - /* 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 = 256; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 256: - /* 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 = 257; - } else if ( v2gCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gPhysicalValueType(stream, &v2gCurrentDemandReqType->RemainingTimeToBulkSoC ); - } - grammarID = 258; - } 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 257: - /* 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 = 258; - } 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 258: - /* 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,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 = 81; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 81: - /* 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,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 = 81; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 81: - /* 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,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 = 100; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 100: - /* 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 = 101; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 101: - /* 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 = 102; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 102: - /* 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,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 = 259; - int done = 0; - - unsigned int v2gSalesTariffEntryType_ConsumptionCost_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 259: - /* 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 = 260; - } else if ( v2gSalesTariffEntryType->TimeInterval_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gIntervalType(stream, &v2gSalesTariffEntryType->TimeInterval ); - } - grammarID = 260; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 260: - /* 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 = 261; - } 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 = 262; - } 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({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 = 262; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 262: - /* 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 = 263; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 263: - /* 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,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 = 264; - int done = 0; - - unsigned int v2gPaymentOptionListType_PaymentOption_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 264: - /* 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 = 265; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 265: - /* 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#,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 = 266; - int done = 0; - - unsigned int v2gSignedInfoType_Reference_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 266: - /* 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 = 267; - } else if ( 1 == 1 ) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - errn = encode_v2gCanonicalizationMethodType(stream, &v2gSignedInfoType->CanonicalizationMethod ); - } - grammarID = 268; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 267: - /* 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 = 268; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 268: - /* 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 = 269; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 269: - /* 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 = 84; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 84: - /* 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 = 84; - } 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,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 = 270; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 270: - /* 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; + grammarID = 25; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -8994,14 +857,14 @@ static int encode_v2gSessionSetupReqType(bitstream_t* stream, struct v2gSessionS /* 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 = 271; + int grammarID = 26; int done = 0; unsigned int v2gSignaturePropertiesType_SignatureProperty_currArrayIndex = 0; while(!done) { switch(grammarID) { - case 271: + 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); @@ -9012,43 +875,43 @@ static int encode_v2gSignaturePropertiesType(bitstream_t* stream, struct v2gSign errn = encodeCharacters(stream, v2gSignaturePropertiesType->Id.characters, v2gSignaturePropertiesType->Id.charactersLen); } } - grammarID = 272; + 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 = 273; + grammarID = 28; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 272: + 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 = 273; + grammarID = 28; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 273: + 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 = 273; + grammarID = 28; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 5; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -9064,76 +927,52 @@ static int encode_v2gSignaturePropertiesType(bitstream_t* stream, struct v2gSign 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 = 274; +/* 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 274: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryStart)] */ + case 29: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SelectedPaymentOption)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeUnsignedInteger32(stream, v2gProfileEntryType->ChargingProfileEntryStart); + errn = encodeNBitUnsignedInteger(stream, 1, v2gPaymentServiceSelectionReqType->SelectedPaymentOption); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 275; + grammarID = 30; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 275: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ChargingProfileEntryMaxPower)] */ + 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_v2gPhysicalValueType(stream, &v2gProfileEntryType->ChargingProfileEntryMaxPower ); - } - grammarID = 276; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 276: - /* 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 = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; + errn = encode_v2gSelectedServiceListType(stream, &v2gPaymentServiceSelectionReqType->SelectedServiceList ); } grammarID = 4; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 3: + case 4: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 5; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -9149,346 +988,15 @@ static int encode_v2gProfileEntryType(bitstream_t* stream, struct v2gProfileEntr 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 = 277; +/* 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 277: - /* 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 = 278; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 278: - /* 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 = 279; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 279: - /* 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: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 = 280; - int done = 0; - - unsigned int v2gListOfRootCertificateIDsType_RootCertificateID_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 280: - /* 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 = 281; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 281: - /* 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 = 281; - } 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_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 = 282; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 282: - /* 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 = 283; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 283: - /* 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 = 284; - } 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 284: - /* 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 = 285; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 285: - /* 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 = 286; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 286: - /* 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='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 = 287; - int done = 0; - - unsigned int v2gChargingProfileType_ProfileEntry_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 287: - /* 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 = 288; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 288: - /* 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 = 288; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } - grammarID = 4; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - default: - errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; - break; - } - if(errn) { - done = 1; - } - } - return errn; -} - -/* Complex type name='urn:iso:15118:2:2013:MsgBody,CertificateUpdateResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2013:MsgBody":ResponseCode,"urn:iso:15118:2:2013:MsgBody":SAProvisioningCertificateChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2013:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2013:MsgBody":DHpublickey,"urn:iso:15118:2:2013:MsgBody":eMAID,"urn:iso:15118:2:2013:MsgBody":RetryCounter{0-1})', derivedBy='EXTENSION'. */ -static int encode_v2gCertificateUpdateResType(bitstream_t* stream, struct v2gCertificateUpdateResType* v2gCertificateUpdateResType) { - int grammarID = 289; - int done = 0; - - - while(!done) { - switch(grammarID) { - case 289: + case 31: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -9496,108 +1004,493 @@ static int encode_v2gCertificateUpdateResType(bitstream_t* stream, struct v2gCer /* FirstStartTag[CHARACTERS[ENUMERATION]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 5, v2gCertificateUpdateResType->ResponseCode); + errn = encodeNBitUnsignedInteger(stream, 5, v2gAuthorizationResType->ResponseCode); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 290; + grammarID = 32; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 290: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SAProvisioningCertificateChain)] */ + case 32: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}EVSEProcessing)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encode_v2gCertificateChainType(stream, &v2gCertificateUpdateResType->SAProvisioningCertificateChain ); - } - grammarID = 291; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 291: - /* 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 = 292; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 292: - /* 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 = 293; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 293: - /* 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 = 294; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 294: - /* 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 = 295; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 295: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RetryCounter), END_ELEMENT] */ - if ( v2gCertificateUpdateResType->RetryCounter_isUsed == 1u ) { - errn = encodeNBitUnsignedInteger(stream, 2, 0); - if(errn == 0) { - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeInteger16(stream, v2gCertificateUpdateResType->RetryCounter); + errn = encodeNBitUnsignedInteger(stream, 2, v2gAuthorizationResType->EVSEProcessing); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 3; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); - if(errn == 0) { - done = 1; - } grammarID = 4; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 3: + case 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; } @@ -9615,13 +1508,13 @@ static int encode_v2gCertificateUpdateResType(bitstream_t* stream, struct v2gCer /* 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 = 296; + int grammarID = 52; int done = 0; while(!done) { switch(grammarID) { - case 296: + 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); @@ -9632,7 +1525,7 @@ static int encode_v2gMeteringReceiptReqType(bitstream_t* stream, struct v2gMeter errn = encodeCharacters(stream, v2gMeteringReceiptReqType->Id.characters, v2gMeteringReceiptReqType->Id.charactersLen); } } - grammarID = 297; + grammarID = 53; } else if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { @@ -9647,12 +1540,12 @@ static int encode_v2gMeteringReceiptReqType(bitstream_t* stream, struct v2gMeter errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 298; + grammarID = 54; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 297: + case 53: /* StartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}SessionID)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -9668,12 +1561,12 @@ static int encode_v2gMeteringReceiptReqType(bitstream_t* stream, struct v2gMeter errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 298; + grammarID = 54; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 298: + 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); @@ -9686,37 +1579,37 @@ static int encode_v2gMeteringReceiptReqType(bitstream_t* stream, struct v2gMeter errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 299; + grammarID = 55; } else if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { errn = encode_v2gMeterInfoType(stream, &v2gMeteringReceiptReqType->MeterInfo ); } - grammarID = 3; + grammarID = 4; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 299: + 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 = 3; + grammarID = 4; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 3: + case 4: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 5; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -9732,15 +1625,1871 @@ static int encode_v2gMeteringReceiptReqType(bitstream_t* stream, struct v2gMeter 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 = 300; +/* 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 300: + 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); @@ -9748,128 +3497,1307 @@ static int encode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2g /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeUnsignedInteger16(stream, v2gServiceType->ServiceID); + errn = encodeUnsignedInteger16(stream, v2gSelectedServiceType->ServiceID); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 301; + grammarID = 111; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 301: - /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceName), START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}ServiceCategory)] */ - if ( v2gServiceType->ServiceName_isUsed == 1u ) { + 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) { - /* FirstStartTag[CHARACTERS[STRING]] */ + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ 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); - } + errn = encodeInteger16(stream, v2gSelectedServiceType->ParameterSetID); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 302; - } else if ( 1 == 1 ) { + grammarID = 4; + } 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); - } + done = 1; } - grammarID = 303; + grammarID = 5; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 302: - /* 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 = 303; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 303: - /* 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 = 304; - } 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 304: - /* 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: + 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; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2013:MsgDataTypes,ContractSignatureEncryptedPrivateKeyType', base type name='privateKeyType', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +static int encode_v2gContractSignatureEncryptedPrivateKeyType(bitstream_t* stream, struct v2gContractSignatureEncryptedPrivateKeyType* v2gContractSignatureEncryptedPrivateKeyType) { + int grammarID = 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)(v2gContractSignatureEncryptedPrivateKeyType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gContractSignatureEncryptedPrivateKeyType->Id.characters, v2gContractSignatureEncryptedPrivateKeyType->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)(v2gContractSignatureEncryptedPrivateKeyType->CONTENT.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gContractSignatureEncryptedPrivateKeyType->CONTENT.bytes, v2gContractSignatureEncryptedPrivateKeyType->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,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; + 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); + if(errn == 0) { + errn = encode_v2gPMaxScheduleEntryType(stream, &v2gPMaxScheduleType->PMaxScheduleEntry.array [v2gPMaxScheduleType_PMaxScheduleEntry_currArrayIndex++]); + } + grammarID = 148; + } 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 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_v2gPMaxScheduleEntryType(stream, &v2gPMaxScheduleType->PMaxScheduleEntry.array [v2gPMaxScheduleType_PMaxScheduleEntry_currArrayIndex++]); + } + grammarID = 148; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 5; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -9887,13 +4815,13 @@ static int encode_v2gServiceType(bitstream_t* stream, struct v2gServiceType* v2g /* 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 = 305; + int grammarID = 149; int done = 0; while(!done) { switch(grammarID) { - case 305: + case 149: /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FaultCode)] */ if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 1, 0); @@ -9906,12 +4834,12 @@ static int encode_v2gNotificationType(bitstream_t* stream, struct v2gNotificatio errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 306; + grammarID = 150; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 306: + case 150: /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}FaultMsg), END_ELEMENT] */ if ( v2gNotificationType->FaultMsg_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 0); @@ -9928,25 +4856,25 @@ static int encode_v2gNotificationType(bitstream_t* stream, struct v2gNotificatio errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 3; + grammarID = 4; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 5; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 3: + case 4: /* Element[END_ELEMENT] */ if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 5; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -9962,387 +4890,22 @@ static int encode_v2gNotificationType(bitstream_t* stream, struct v2gNotificatio 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 = 307; +/* 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; - 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 307: - /* 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 = 308; - } 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 = 309; - } 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 = 309; - } 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 = 309; - } 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 = 309; - } 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 = 309; - } 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 = 309; - } 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 = 309; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 309; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 310; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 308: - /* 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 = 309; - } 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 = 309; - } 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 = 309; - } 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 = 309; - } 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 = 309; - } 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 = 309; - } 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 = 309; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 309; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 310; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 309: - /* 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 = 309; - } 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 = 309; - } 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 = 309; - } 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 = 309; - } 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 = 309; - } 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 = 309; - } 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 = 309; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 309; - } 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 = 309; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 310: - /* 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 = 309; - } 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 = 309; - } 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 = 309; - } 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 = 309; - } 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 = 309; - } 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 = 309; - } 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 = 309; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 309; - } else if (1==0) { - errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 310; - } else { - errn = EXI_ERROR_UNKOWN_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 = 311; - int done = 0; - - unsigned int v2gSelectedServiceListType_SelectedService_currArrayIndex = 0; - - while(!done) { - switch(grammarID) { - case 311: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgDataTypes}SelectedService)] */ - if (v2gSelectedServiceListType_SelectedService_currArrayIndex < v2gSelectedServiceListType->SelectedService.arrayLen ) { + case 13: + /* FirstStartTag[END_ELEMENT] */ + if (1==1) { errn = encodeNBitUnsignedInteger(stream, 1, 0); - if(errn == 0) { - errn = encode_v2gSelectedServiceType(stream, &v2gSelectedServiceListType->SelectedService.array [v2gSelectedServiceListType_SelectedService_currArrayIndex++]); - } - grammarID = 312; - } else { - errn = EXI_ERROR_UNKOWN_EVENT; - } - break; - case 312: - /* 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 = 312; - } else if (1==1) { - errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 5; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -10358,33 +4921,1275 @@ static int encode_v2gSelectedServiceListType(bitstream_t* stream, struct v2gSele 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 = 313; +/* 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 313: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ChargeProgress)] */ + 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, v2gPowerDeliveryReqType->ChargeProgress); + errn = encodeNBitUnsignedInteger(stream, 2, v2gChargeServiceType->ServiceCategory); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 314; + grammarID = 154; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 314: + 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: + /* 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; + } + 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 = 157; + 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)] */ + 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 = 171; + } 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); @@ -10392,78 +6197,126 @@ static int encode_v2gPowerDeliveryReqType(bitstream_t* stream, struct v2gPowerDe /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ errn = encodeNBitUnsignedInteger(stream, 1, 0); if(errn == 0) { - errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gPowerDeliveryReqType->SAScheduleTupleID - 1)); + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(v2gChargingStatusResType->SAScheduleTupleID - 1)); /* valid EE */ errn = encodeNBitUnsignedInteger(stream, 1, 0); } } - grammarID = 315; + grammarID = 187; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 315: - /* 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 ) { + 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_v2gChargingProfileType(stream, &v2gPowerDeliveryReqType->ChargingProfile ); + errn = encode_v2gPhysicalValueType(stream, &v2gChargingStatusResType->EVSEMaxCurrent ); } - grammarID = 316; - } else if ( v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed == 1u ) { + grammarID = 188; + } else if ( v2gChargingStatusResType->MeterInfo_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 3, 1); if(errn == 0) { - errn = encode_v2gDC_EVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter ); + errn = encode_v2gMeterInfoType(stream, &v2gChargingStatusResType->MeterInfo ); } - grammarID = 3; - } else if ( v2gPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed == 1u ) { + grammarID = 189; + } else if ( v2gChargingStatusResType->ReceiptRequired_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 3, 2); if(errn == 0) { - errn = encode_v2gEVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->EVPowerDeliveryParameter ); + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gChargingStatusResType->ReceiptRequired); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } } - grammarID = 3; - } else if (1==1) { + grammarID = 190; + } else if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 3, 3); if(errn == 0) { - done = 1; + errn = encode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus ); } grammarID = 4; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 316: - /* 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 ) { + 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_v2gDC_EVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->DC_EVPowerDeliveryParameter ); + errn = encode_v2gMeterInfoType(stream, &v2gChargingStatusResType->MeterInfo ); } - grammarID = 3; - } else if ( v2gPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed == 1u ) { + grammarID = 189; + } else if ( v2gChargingStatusResType->ReceiptRequired_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { - errn = encode_v2gEVPowerDeliveryParameterType(stream, &v2gPowerDeliveryReqType->EVPowerDeliveryParameter ); + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, v2gChargingStatusResType->ReceiptRequired); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } } - grammarID = 3; - } else if (1==1) { + grammarID = 190; + } else if ( 1 == 1 ) { errn = encodeNBitUnsignedInteger(stream, 2, 2); if(errn == 0) { - done = 1; + errn = encode_v2gAC_EVSEStatusType(stream, &v2gChargingStatusResType->AC_EVSEStatus ); } grammarID = 4; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 3: + 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 = 4; + grammarID = 5; } else { errn = EXI_ERROR_UNKOWN_EVENT; } @@ -10481,13 +6334,13 @@ static int encode_v2gPowerDeliveryReqType(bitstream_t* stream, struct v2gPowerDe /* 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 = 317; + int grammarID = 191; int done = 0; while(!done) { switch(grammarID) { - case 317: + 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); @@ -10498,7 +6351,7 @@ static int encode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gOb errn = encodeCharacters(stream, v2gObjectType->Encoding.characters, v2gObjectType->Encoding.charactersLen); } } - grammarID = 318; + grammarID = 192; } else if ( v2gObjectType->Id_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 3, 1); if(errn == 0) { @@ -10508,7 +6361,7 @@ static int encode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gOb errn = encodeCharacters(stream, v2gObjectType->Id.characters, v2gObjectType->Id.charactersLen); } } - grammarID = 319; + grammarID = 193; } else if ( v2gObjectType->MimeType_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 3, 2); if(errn == 0) { @@ -10518,24 +6371,24 @@ static int encode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gOb errn = encodeCharacters(stream, v2gObjectType->MimeType.characters, v2gObjectType->MimeType.charactersLen); } } - grammarID = 128; + grammarID = 24; } else if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 60; + grammarID = 25; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 3, 4); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 5; } else if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 60; + grammarID = 25; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 318: + 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); @@ -10546,7 +6399,7 @@ static int encode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gOb errn = encodeCharacters(stream, v2gObjectType->Id.characters, v2gObjectType->Id.charactersLen); } } - grammarID = 319; + grammarID = 193; } else if ( v2gObjectType->MimeType_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 3, 1); if(errn == 0) { @@ -10556,24 +6409,24 @@ static int encode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gOb errn = encodeCharacters(stream, v2gObjectType->MimeType.characters, v2gObjectType->MimeType.charactersLen); } } - grammarID = 128; + grammarID = 24; } else if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 60; + grammarID = 25; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 3, 3); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 5; } else if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 60; + grammarID = 25; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 319: + case 193: /* StartTag[ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ if ( v2gObjectType->MimeType_isUsed == 1u ) { errn = encodeNBitUnsignedInteger(stream, 3, 0); @@ -10584,55 +6437,4202 @@ static int encode_v2gObjectType(bitstream_t* stream, struct v2gObjectType* v2gOb errn = encodeCharacters(stream, v2gObjectType->MimeType.characters, v2gObjectType->MimeType.charactersLen); } } - grammarID = 128; + grammarID = 24; } else if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 60; + grammarID = 25; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 3, 2); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 5; } else if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 60; + grammarID = 25; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 128: + case 24: /* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 60; + grammarID = 25; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 5; } else if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 60; + grammarID = 25; } else { errn = EXI_ERROR_UNKOWN_EVENT; } break; - case 60: + case 25: /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */ if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 60; + grammarID = 25; } else if (1==1) { errn = encodeNBitUnsignedInteger(stream, 2, 1); if(errn == 0) { done = 1; } - grammarID = 4; + grammarID = 5; } else if (1==0) { errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; - grammarID = 60; + 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)] */ + 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 = 197; + } 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: + /* 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; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +static int encode_v2gSignaturePropertyType(bitstream_t* stream, struct v2gSignaturePropertyType* v2gSignaturePropertyType) { + int grammarID = 231; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 231: + /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Target)] */ + if ( v2gSignaturePropertyType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignaturePropertyType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gSignaturePropertyType->Id.characters, v2gSignaturePropertyType->Id.charactersLen); + } + } + grammarID = 232; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignaturePropertyType->Target.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gSignaturePropertyType->Target.characters, v2gSignaturePropertyType->Target.charactersLen); + } + } + grammarID = 233; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 232: + /* StartTag[ATTRIBUTE[STRING](Target)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gSignaturePropertyType->Target.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gSignaturePropertyType->Target.characters, v2gSignaturePropertyType->Target.charactersLen); + } + } + grammarID = 233; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 233: + /* StartTag[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; + 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 234: + /* 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; + } 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; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ +static int encode_v2gReferenceType(bitstream_t* stream, struct v2gReferenceType* v2gReferenceType) { + int grammarID = 307; + int done = 0; + + + 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)] */ + if ( v2gReferenceType->Id_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gReferenceType->Id.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gReferenceType->Id.characters, v2gReferenceType->Id.charactersLen); + } + } + grammarID = 308; + } else if ( v2gReferenceType->Type_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gReferenceType->Type.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gReferenceType->Type.characters, v2gReferenceType->Type.charactersLen); + } + } + grammarID = 309; + } else if ( v2gReferenceType->URI_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gReferenceType->URI.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gReferenceType->URI.characters, v2gReferenceType->URI.charactersLen); + } + } + grammarID = 310; + } else if ( v2gReferenceType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + errn = encode_v2gTransformsType(stream, &v2gReferenceType->Transforms ); + } + grammarID = 311; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + errn = encode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod ); + } + grammarID = 312; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + 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)] */ + if ( v2gReferenceType->Type_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gReferenceType->Type.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gReferenceType->Type.characters, v2gReferenceType->Type.charactersLen); + } + } + grammarID = 309; + } else if ( v2gReferenceType->URI_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gReferenceType->URI.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gReferenceType->URI.characters, v2gReferenceType->URI.charactersLen); + } + } + grammarID = 310; + } else if ( v2gReferenceType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + errn = encode_v2gTransformsType(stream, &v2gReferenceType->Transforms ); + } + grammarID = 311; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + errn = encode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod ); + } + grammarID = 312; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + 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)] */ + if ( v2gReferenceType->URI_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gReferenceType->URI.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, v2gReferenceType->URI.characters, v2gReferenceType->URI.charactersLen); + } + } + grammarID = 310; + } else if ( v2gReferenceType->Transforms_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gTransformsType(stream, &v2gReferenceType->Transforms ); + } + grammarID = 311; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + errn = encode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod ); + } + grammarID = 312; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 310: + /* 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; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + errn = encode_v2gDigestMethodType(stream, &v2gReferenceType->DigestMethod ); + } + grammarID = 312; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 311: + /* 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; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 312: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(v2gReferenceType->DigestValue.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, v2gReferenceType->DigestValue.bytes, v2gReferenceType->DigestValue.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 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,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 done = 0; + + + while(!done) { + switch(grammarID) { + case 313: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, v2gCertificateUpdateResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 314; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 314: + /* 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; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 315: + /* 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; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 316: + /* 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; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 317: + /* 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; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 318: + /* 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; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 319: + /* Element[START_ELEMENT({urn:iso:15118:2:2013:MsgBody}RetryCounter), END_ELEMENT] */ + if ( v2gCertificateUpdateResType->RetryCounter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, v2gCertificateUpdateResType->RetryCounter); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 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; } diff --git a/src/codec/v2gEXIDatatypesEncoder.h b/src/codec/v2gEXIDatatypesEncoder.h index b3b85f0..4209ba6 100644 --- a/src/codec/v2gEXIDatatypesEncoder.h +++ b/src/codec/v2gEXIDatatypesEncoder.h @@ -18,7 +18,7 @@ /******************************************************************* * * @author Daniel.Peintner.EXT@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

diff --git a/src/din/dinEXIDatatypes.c b/src/din/dinEXIDatatypes.c new file mode 100644 index 0000000..79df238 --- /dev/null +++ b/src/din/dinEXIDatatypes.c @@ -0,0 +1,613 @@ +/* + * Copyright (C) 2007-2014 Siemens AG + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +/******************************************************************* + * + * @author Daniel.Peintner.EXT@siemens.com + * @version 0.9.1 + * @contact Joerg.Heuer@siemens.com + * + *

Code generated by EXIdizer

+ *

Schema: V2G_CI_MsgDef.xsd

+ * + * + ********************************************************************/ + + + +#include + +#include "dinEXIDatatypes.h" +#include "EXITypes.h" + + +#ifndef EXI_din_DATATYPES_C +#define EXI_din_DATATYPES_C + +#if DEPLOY_DIN_CODEC == SUPPORT_YES + +void init_dinEXIDocument(struct dinEXIDocument* exiDoc) { + exiDoc->BodyElement_isUsed = 0u; + exiDoc->V2G_Message_isUsed = 0u; + exiDoc->SignatureProperty_isUsed = 0u; + exiDoc->DSAKeyValue_isUsed = 0u; + exiDoc->SignatureProperties_isUsed = 0u; + exiDoc->KeyValue_isUsed = 0u; + exiDoc->Transforms_isUsed = 0u; + exiDoc->DigestMethod_isUsed = 0u; + exiDoc->Signature_isUsed = 0u; + exiDoc->RetrievalMethod_isUsed = 0u; + exiDoc->Manifest_isUsed = 0u; + exiDoc->Reference_isUsed = 0u; + exiDoc->CanonicalizationMethod_isUsed = 0u; + exiDoc->RSAKeyValue_isUsed = 0u; + exiDoc->Transform_isUsed = 0u; + exiDoc->PGPData_isUsed = 0u; + exiDoc->MgmtData_isUsed = 0u; + exiDoc->SignatureMethod_isUsed = 0u; + exiDoc->KeyInfo_isUsed = 0u; + exiDoc->SPKIData_isUsed = 0u; + exiDoc->X509Data_isUsed = 0u; + exiDoc->SignatureValue_isUsed = 0u; + exiDoc->KeyName_isUsed = 0u; + exiDoc->DigestValue_isUsed = 0u; + exiDoc->SignedInfo_isUsed = 0u; + exiDoc->Object_isUsed = 0u; + exiDoc->DC_EVSEStatus_isUsed = 0u; + exiDoc->RelativeTimeInterval_isUsed = 0u; + exiDoc->SalesTariffEntry_isUsed = 0u; + exiDoc->DC_EVPowerDeliveryParameter_isUsed = 0u; + exiDoc->SASchedules_isUsed = 0u; + exiDoc->AC_EVChargeParameter_isUsed = 0u; + exiDoc->SAScheduleList_isUsed = 0u; + exiDoc->DC_EVStatus_isUsed = 0u; + exiDoc->ServiceCharge_isUsed = 0u; + exiDoc->EVStatus_isUsed = 0u; + exiDoc->DC_EVChargeParameter_isUsed = 0u; + exiDoc->DC_EVSEChargeParameter_isUsed = 0u; + exiDoc->EVSEStatus_isUsed = 0u; + exiDoc->TimeInterval_isUsed = 0u; + exiDoc->EVPowerDeliveryParameter_isUsed = 0u; + exiDoc->EVSEChargeParameter_isUsed = 0u; + exiDoc->AC_EVSEStatus_isUsed = 0u; + exiDoc->Entry_isUsed = 0u; + exiDoc->AC_EVSEChargeParameter_isUsed = 0u; + exiDoc->PMaxScheduleEntry_isUsed = 0u; + exiDoc->EVChargeParameter_isUsed = 0u; + exiDoc->ServiceDiscoveryReq_isUsed = 0u; + exiDoc->ServiceDiscoveryRes_isUsed = 0u; + exiDoc->MeteringReceiptReq_isUsed = 0u; + exiDoc->PaymentDetailsReq_isUsed = 0u; + exiDoc->MeteringReceiptRes_isUsed = 0u; + exiDoc->PaymentDetailsRes_isUsed = 0u; + exiDoc->SessionSetupReq_isUsed = 0u; + exiDoc->SessionSetupRes_isUsed = 0u; + exiDoc->CableCheckReq_isUsed = 0u; + exiDoc->CableCheckRes_isUsed = 0u; + exiDoc->ContractAuthenticationReq_isUsed = 0u; + exiDoc->CertificateInstallationReq_isUsed = 0u; + exiDoc->ContractAuthenticationRes_isUsed = 0u; + exiDoc->CertificateInstallationRes_isUsed = 0u; + exiDoc->WeldingDetectionReq_isUsed = 0u; + exiDoc->WeldingDetectionRes_isUsed = 0u; + exiDoc->CertificateUpdateReq_isUsed = 0u; + exiDoc->CertificateUpdateRes_isUsed = 0u; + exiDoc->PowerDeliveryReq_isUsed = 0u; + exiDoc->PowerDeliveryRes_isUsed = 0u; + exiDoc->ChargingStatusReq_isUsed = 0u; + exiDoc->ChargingStatusRes_isUsed = 0u; + exiDoc->CurrentDemandReq_isUsed = 0u; + exiDoc->PreChargeReq_isUsed = 0u; + exiDoc->CurrentDemandRes_isUsed = 0u; + exiDoc->PreChargeRes_isUsed = 0u; + exiDoc->ServicePaymentSelectionReq_isUsed = 0u; + exiDoc->SessionStopReq_isUsed = 0u; + exiDoc->ServicePaymentSelectionRes_isUsed = 0u; + exiDoc->SessionStopRes_isUsed = 0u; + exiDoc->ChargeParameterDiscoveryReq_isUsed = 0u; + exiDoc->ChargeParameterDiscoveryRes_isUsed = 0u; + exiDoc->ServiceDetailReq_isUsed = 0u; + exiDoc->ServiceDetailRes_isUsed = 0u; +} + +void init_dinPreChargeReqType(struct dinPreChargeReqType* dinPreChargeReqType) { +} + +void init_dinNotificationType(struct dinNotificationType* dinNotificationType) { + dinNotificationType->FaultMsg_isUsed = 0u; +} + +void init_dinServiceTagType(struct dinServiceTagType* dinServiceTagType) { + dinServiceTagType->ServiceName_isUsed = 0u; + dinServiceTagType->ServiceScope_isUsed = 0u; +} + +void init_dinCostType(struct dinCostType* dinCostType) { + dinCostType->amountMultiplier_isUsed = 0u; +} + +void init_dinX509DataType(struct dinX509DataType* dinX509DataType) { + dinX509DataType->X509IssuerSerial.arrayLen = 0u; + dinX509DataType->X509SKI.arrayLen = 0u; + dinX509DataType->X509SubjectName.arrayLen = 0u; + dinX509DataType->X509Certificate.arrayLen = 0u; + dinX509DataType->X509CRL.arrayLen = 0u; +} + +void init_dinBodyType(struct dinBodyType* dinBodyType) { + dinBodyType->BodyElement_isUsed = 0u; + dinBodyType->SessionSetupReq_isUsed = 0u; + dinBodyType->SessionSetupRes_isUsed = 0u; + dinBodyType->ServiceDiscoveryReq_isUsed = 0u; + dinBodyType->ServiceDiscoveryRes_isUsed = 0u; + dinBodyType->ServiceDetailReq_isUsed = 0u; + dinBodyType->ServiceDetailRes_isUsed = 0u; + dinBodyType->ServicePaymentSelectionReq_isUsed = 0u; + dinBodyType->ServicePaymentSelectionRes_isUsed = 0u; + dinBodyType->PaymentDetailsReq_isUsed = 0u; + dinBodyType->PaymentDetailsRes_isUsed = 0u; + dinBodyType->ContractAuthenticationReq_isUsed = 0u; + dinBodyType->ContractAuthenticationRes_isUsed = 0u; + dinBodyType->ChargeParameterDiscoveryReq_isUsed = 0u; + dinBodyType->ChargeParameterDiscoveryRes_isUsed = 0u; + dinBodyType->PowerDeliveryReq_isUsed = 0u; + dinBodyType->PowerDeliveryRes_isUsed = 0u; + dinBodyType->ChargingStatusReq_isUsed = 0u; + dinBodyType->ChargingStatusRes_isUsed = 0u; + dinBodyType->MeteringReceiptReq_isUsed = 0u; + dinBodyType->MeteringReceiptRes_isUsed = 0u; + dinBodyType->SessionStopReq_isUsed = 0u; + dinBodyType->SessionStopRes_isUsed = 0u; + dinBodyType->CertificateUpdateReq_isUsed = 0u; + dinBodyType->CertificateUpdateRes_isUsed = 0u; + dinBodyType->CertificateInstallationReq_isUsed = 0u; + dinBodyType->CertificateInstallationRes_isUsed = 0u; + dinBodyType->CableCheckReq_isUsed = 0u; + dinBodyType->CableCheckRes_isUsed = 0u; + dinBodyType->PreChargeReq_isUsed = 0u; + dinBodyType->PreChargeRes_isUsed = 0u; + dinBodyType->CurrentDemandReq_isUsed = 0u; + dinBodyType->CurrentDemandRes_isUsed = 0u; + dinBodyType->WeldingDetectionReq_isUsed = 0u; + dinBodyType->WeldingDetectionRes_isUsed = 0u; +} + +void init_dinRetrievalMethodType(struct dinRetrievalMethodType* dinRetrievalMethodType) { + dinRetrievalMethodType->URI_isUsed = 0u; + dinRetrievalMethodType->Type_isUsed = 0u; + dinRetrievalMethodType->Transforms_isUsed = 0u; +} + +void init_dinCertificateInstallationReqType(struct dinCertificateInstallationReqType* dinCertificateInstallationReqType) { + dinCertificateInstallationReqType->Id_isUsed = 0u; +} + +void init_dinAC_EVChargeParameterType(struct dinAC_EVChargeParameterType* dinAC_EVChargeParameterType) { +} + +void init_dinObjectType(struct dinObjectType* dinObjectType) { + dinObjectType->Id_isUsed = 0u; + dinObjectType->MimeType_isUsed = 0u; + dinObjectType->Encoding_isUsed = 0u; +} + +void init_dinContractAuthenticationResType(struct dinContractAuthenticationResType* dinContractAuthenticationResType) { +} + +void init_dinChargingProfileType(struct dinChargingProfileType* dinChargingProfileType) { + dinChargingProfileType->ProfileEntry.arrayLen = 0u; +} + +void init_dinCertificateUpdateResType(struct dinCertificateUpdateResType* dinCertificateUpdateResType) { +} + +void init_dinReferenceType(struct dinReferenceType* dinReferenceType) { + dinReferenceType->Id_isUsed = 0u; + dinReferenceType->URI_isUsed = 0u; + dinReferenceType->Type_isUsed = 0u; + dinReferenceType->Transforms_isUsed = 0u; +} + +void init_dinPMaxScheduleEntryType(struct dinPMaxScheduleEntryType* dinPMaxScheduleEntryType) { + dinPMaxScheduleEntryType->TimeInterval_isUsed = 0u; + dinPMaxScheduleEntryType->RelativeTimeInterval_isUsed = 0u; +} + +void init_dinServicePaymentSelectionReqType(struct dinServicePaymentSelectionReqType* dinServicePaymentSelectionReqType) { +} + +void init_dinCertificateInstallationResType(struct dinCertificateInstallationResType* dinCertificateInstallationResType) { +} + +void init_dinSelectedServiceType(struct dinSelectedServiceType* dinSelectedServiceType) { + dinSelectedServiceType->ParameterSetID_isUsed = 0u; +} + +void init_dinDC_EVStatusType(struct dinDC_EVStatusType* dinDC_EVStatusType) { + dinDC_EVStatusType->EVCabinConditioning_isUsed = 0u; + dinDC_EVStatusType->EVRESSConditioning_isUsed = 0u; +} + +void init_dinPGPDataType(struct dinPGPDataType* dinPGPDataType) { + dinPGPDataType->PGPKeyID_isUsed = 0u; + dinPGPDataType->PGPKeyPacket_isUsed = 0u; +} + +void init_dinCurrentDemandResType(struct dinCurrentDemandResType* dinCurrentDemandResType) { + dinCurrentDemandResType->EVSEMaximumVoltageLimit_isUsed = 0u; + dinCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed = 0u; + dinCurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 0u; +} + +void init_dinCableCheckReqType(struct dinCableCheckReqType* dinCableCheckReqType) { +} + +void init_dinChargingStatusResType(struct dinChargingStatusResType* dinChargingStatusResType) { + dinChargingStatusResType->EVSEMaxCurrent_isUsed = 0u; + dinChargingStatusResType->MeterInfo_isUsed = 0u; +} + +void init_dinWeldingDetectionReqType(struct dinWeldingDetectionReqType* dinWeldingDetectionReqType) { +} + +void init_dinServiceParameterListType(struct dinServiceParameterListType* dinServiceParameterListType) { + dinServiceParameterListType->ParameterSet.arrayLen = 0u; +} + +void init_dinCertificateChainType(struct dinCertificateChainType* dinCertificateChainType) { + dinCertificateChainType->SubCertificates_isUsed = 0u; +} + +void init_dinPowerDeliveryResType(struct dinPowerDeliveryResType* dinPowerDeliveryResType) { + dinPowerDeliveryResType->EVSEStatus_isUsed = 0u; + dinPowerDeliveryResType->AC_EVSEStatus_isUsed = 0u; + dinPowerDeliveryResType->DC_EVSEStatus_isUsed = 0u; +} + +void init_dinAC_EVSEChargeParameterType(struct dinAC_EVSEChargeParameterType* dinAC_EVSEChargeParameterType) { +} + +void init_dinAnonType_V2G_Message(struct dinAnonType_V2G_Message* dinAnonType_V2G_Message) { +} + +void init_dinConsumptionCostType(struct dinConsumptionCostType* dinConsumptionCostType) { + dinConsumptionCostType->Cost.arrayLen = 0u; +} + +void init_dinDC_EVSEStatusType(struct dinDC_EVSEStatusType* dinDC_EVSEStatusType) { + dinDC_EVSEStatusType->EVSEIsolationStatus_isUsed = 0u; +} + +void init_dinWeldingDetectionResType(struct dinWeldingDetectionResType* dinWeldingDetectionResType) { +} + +void init_dinSessionSetupReqType(struct dinSessionSetupReqType* dinSessionSetupReqType) { +} + +void init_dinSessionSetupResType(struct dinSessionSetupResType* dinSessionSetupResType) { + dinSessionSetupResType->DateTimeNow_isUsed = 0u; +} + +void init_dinServiceDetailResType(struct dinServiceDetailResType* dinServiceDetailResType) { + dinServiceDetailResType->ServiceParameterList_isUsed = 0u; +} + +void init_dinSPKIDataType(struct dinSPKIDataType* dinSPKIDataType) { + dinSPKIDataType->SPKISexp.arrayLen = 0u; +} + +void init_dinPowerDeliveryReqType(struct dinPowerDeliveryReqType* dinPowerDeliveryReqType) { + dinPowerDeliveryReqType->ChargingProfile_isUsed = 0u; + dinPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed = 0u; + dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed = 0u; +} + +void init_dinPreChargeResType(struct dinPreChargeResType* dinPreChargeResType) { +} + +void init_dinCanonicalizationMethodType(struct dinCanonicalizationMethodType* dinCanonicalizationMethodType) { +} + +void init_dinServiceChargeType(struct dinServiceChargeType* dinServiceChargeType) { +} + +void init_dinEVChargeParameterType(struct dinEVChargeParameterType* dinEVChargeParameterType) { +} + +void init_dinSAScheduleListType(struct dinSAScheduleListType* dinSAScheduleListType) { + dinSAScheduleListType->SAScheduleTuple.arrayLen = 0u; +} + +void init_dinSASchedulesType(struct dinSASchedulesType* dinSASchedulesType) { +} + +void init_dinPhysicalValueType(struct dinPhysicalValueType* dinPhysicalValueType) { + dinPhysicalValueType->Unit_isUsed = 0u; +} + +void init_dinSAScheduleTupleType(struct dinSAScheduleTupleType* dinSAScheduleTupleType) { + dinSAScheduleTupleType->SalesTariff_isUsed = 0u; +} + +void init_dinCertificateUpdateReqType(struct dinCertificateUpdateReqType* dinCertificateUpdateReqType) { + dinCertificateUpdateReqType->Id_isUsed = 0u; +} + +void init_dinSignatureMethodType(struct dinSignatureMethodType* dinSignatureMethodType) { + dinSignatureMethodType->HMACOutputLength_isUsed = 0u; +} + +void init_dinDigestMethodType(struct dinDigestMethodType* dinDigestMethodType) { +} + +void init_dinKeyValueType(struct dinKeyValueType* dinKeyValueType) { + dinKeyValueType->DSAKeyValue_isUsed = 0u; + dinKeyValueType->RSAKeyValue_isUsed = 0u; +} + +void init_dinContractAuthenticationReqType(struct dinContractAuthenticationReqType* dinContractAuthenticationReqType) { + dinContractAuthenticationReqType->Id_isUsed = 0u; + dinContractAuthenticationReqType->GenChallenge_isUsed = 0u; +} + +void init_dinServiceDiscoveryReqType(struct dinServiceDiscoveryReqType* dinServiceDiscoveryReqType) { + dinServiceDiscoveryReqType->ServiceScope_isUsed = 0u; + dinServiceDiscoveryReqType->ServiceCategory_isUsed = 0u; +} + +void init_dinServiceDetailReqType(struct dinServiceDetailReqType* dinServiceDetailReqType) { +} + +void init_dinSignedInfoType(struct dinSignedInfoType* dinSignedInfoType) { + dinSignedInfoType->Id_isUsed = 0u; + dinSignedInfoType->Reference.arrayLen = 0u; +} + +void init_dinMeteringReceiptReqType(struct dinMeteringReceiptReqType* dinMeteringReceiptReqType) { + dinMeteringReceiptReqType->Id_isUsed = 0u; + dinMeteringReceiptReqType->SAScheduleTupleID_isUsed = 0u; +} + +void init_dinX509IssuerSerialType(struct dinX509IssuerSerialType* dinX509IssuerSerialType) { +} + +void init_dinTransformsType(struct dinTransformsType* dinTransformsType) { + dinTransformsType->Transform.arrayLen = 0u; +} + +void init_dinParameterType(struct dinParameterType* dinParameterType) { + dinParameterType->boolValue_isUsed = 0u; + dinParameterType->byteValue_isUsed = 0u; + dinParameterType->shortValue_isUsed = 0u; + dinParameterType->intValue_isUsed = 0u; + dinParameterType->physicalValue_isUsed = 0u; + dinParameterType->stringValue_isUsed = 0u; +} + +void init_dinIntervalType(struct dinIntervalType* dinIntervalType) { +} + +void init_dinRelativeTimeIntervalType(struct dinRelativeTimeIntervalType* dinRelativeTimeIntervalType) { + dinRelativeTimeIntervalType->duration_isUsed = 0u; +} + +void init_dinKeyInfoType(struct dinKeyInfoType* dinKeyInfoType) { + dinKeyInfoType->Id_isUsed = 0u; + dinKeyInfoType->KeyName.arrayLen = 0u; + dinKeyInfoType->KeyValue.arrayLen = 0u; + dinKeyInfoType->RetrievalMethod.arrayLen = 0u; + dinKeyInfoType->X509Data.arrayLen = 0u; + dinKeyInfoType->PGPData.arrayLen = 0u; + dinKeyInfoType->SPKIData.arrayLen = 0u; + dinKeyInfoType->MgmtData.arrayLen = 0u; +} + +void init_dinEntryType(struct dinEntryType* dinEntryType) { + dinEntryType->TimeInterval_isUsed = 0u; + dinEntryType->RelativeTimeInterval_isUsed = 0u; +} + +void init_dinEVStatusType(struct dinEVStatusType* dinEVStatusType) { +} + +void init_dinChargingStatusReqType(struct dinChargingStatusReqType* dinChargingStatusReqType) { +} + +void init_dinChargeParameterDiscoveryResType(struct dinChargeParameterDiscoveryResType* dinChargeParameterDiscoveryResType) { + dinChargeParameterDiscoveryResType->SASchedules_isUsed = 0u; + dinChargeParameterDiscoveryResType->SAScheduleList_isUsed = 0u; + dinChargeParameterDiscoveryResType->EVSEChargeParameter_isUsed = 0u; + dinChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed = 0u; + dinChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed = 0u; +} + +void init_dinPMaxScheduleType(struct dinPMaxScheduleType* dinPMaxScheduleType) { + dinPMaxScheduleType->PMaxScheduleEntry.arrayLen = 0u; +} + +void init_dinDC_EVSEChargeParameterType(struct dinDC_EVSEChargeParameterType* dinDC_EVSEChargeParameterType) { + dinDC_EVSEChargeParameterType->EVSEMaximumPowerLimit_isUsed = 0u; + dinDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance_isUsed = 0u; + dinDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered_isUsed = 0u; +} + +void init_dinCableCheckResType(struct dinCableCheckResType* dinCableCheckResType) { +} + +void init_dinTransformType(struct dinTransformType* dinTransformType) { + dinTransformType->XPath.arrayLen = 0u; +} + +void init_dinParameterSetType(struct dinParameterSetType* dinParameterSetType) { + dinParameterSetType->Parameter.arrayLen = 0u; +} + +void init_dinSubCertificatesType(struct dinSubCertificatesType* dinSubCertificatesType) { + dinSubCertificatesType->Certificate.arrayLen = 0u; +} + +void init_dinDC_EVPowerDeliveryParameterType(struct dinDC_EVPowerDeliveryParameterType* dinDC_EVPowerDeliveryParameterType) { + dinDC_EVPowerDeliveryParameterType->BulkChargingComplete_isUsed = 0u; +} + +void init_dinPaymentDetailsReqType(struct dinPaymentDetailsReqType* dinPaymentDetailsReqType) { +} + +void init_dinDC_EVChargeParameterType(struct dinDC_EVChargeParameterType* dinDC_EVChargeParameterType) { + dinDC_EVChargeParameterType->EVMaximumPowerLimit_isUsed = 0u; + dinDC_EVChargeParameterType->EVEnergyCapacity_isUsed = 0u; + dinDC_EVChargeParameterType->EVEnergyRequest_isUsed = 0u; + dinDC_EVChargeParameterType->FullSOC_isUsed = 0u; + dinDC_EVChargeParameterType->BulkSOC_isUsed = 0u; +} + +void init_dinSelectedServiceListType(struct dinSelectedServiceListType* dinSelectedServiceListType) { + dinSelectedServiceListType->SelectedService.arrayLen = 0u; +} + +void init_dinServiceDiscoveryResType(struct dinServiceDiscoveryResType* dinServiceDiscoveryResType) { + dinServiceDiscoveryResType->ServiceList_isUsed = 0u; +} + +void init_dinPaymentDetailsResType(struct dinPaymentDetailsResType* dinPaymentDetailsResType) { +} + +void init_dinServiceType(struct dinServiceType* dinServiceType) { +} + +void init_dinEVPowerDeliveryParameterType(struct dinEVPowerDeliveryParameterType* dinEVPowerDeliveryParameterType) { +} + +void init_dinBodyBaseType(struct dinBodyBaseType* dinBodyBaseType) { +} + +void init_dinCurrentDemandReqType(struct dinCurrentDemandReqType* dinCurrentDemandReqType) { + dinCurrentDemandReqType->EVMaximumVoltageLimit_isUsed = 0u; + dinCurrentDemandReqType->EVMaximumCurrentLimit_isUsed = 0u; + dinCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 0u; + dinCurrentDemandReqType->BulkChargingComplete_isUsed = 0u; + dinCurrentDemandReqType->RemainingTimeToFullSoC_isUsed = 0u; + dinCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed = 0u; +} + +void init_dinMeteringReceiptResType(struct dinMeteringReceiptResType* dinMeteringReceiptResType) { +} + +void init_dinPaymentOptionsType(struct dinPaymentOptionsType* dinPaymentOptionsType) { + dinPaymentOptionsType->PaymentOption.arrayLen = 0u; +} + +void init_dinMessageHeaderType(struct dinMessageHeaderType* dinMessageHeaderType) { + dinMessageHeaderType->Notification_isUsed = 0u; + dinMessageHeaderType->Signature_isUsed = 0u; +} + +void init_dinAC_EVSEStatusType(struct dinAC_EVSEStatusType* dinAC_EVSEStatusType) { +} + +void init_dinSalesTariffType(struct dinSalesTariffType* dinSalesTariffType) { + dinSalesTariffType->SalesTariffDescription_isUsed = 0u; + dinSalesTariffType->SalesTariffEntry.arrayLen = 0u; +} + +void init_dinChargeParameterDiscoveryReqType(struct dinChargeParameterDiscoveryReqType* dinChargeParameterDiscoveryReqType) { + dinChargeParameterDiscoveryReqType->EVChargeParameter_isUsed = 0u; + dinChargeParameterDiscoveryReqType->AC_EVChargeParameter_isUsed = 0u; + dinChargeParameterDiscoveryReqType->DC_EVChargeParameter_isUsed = 0u; +} + +void init_dinServicePaymentSelectionResType(struct dinServicePaymentSelectionResType* dinServicePaymentSelectionResType) { +} + +void init_dinEVSEStatusType(struct dinEVSEStatusType* dinEVSEStatusType) { +} + +void init_dinManifestType(struct dinManifestType* dinManifestType) { + dinManifestType->Id_isUsed = 0u; + dinManifestType->Reference.arrayLen = 0u; +} + +void init_dinListOfRootCertificateIDsType(struct dinListOfRootCertificateIDsType* dinListOfRootCertificateIDsType) { + dinListOfRootCertificateIDsType->RootCertificateID.arrayLen = 0u; +} + +void init_dinServiceTagListType(struct dinServiceTagListType* dinServiceTagListType) { + dinServiceTagListType->Service.arrayLen = 0u; +} + +void init_dinRSAKeyValueType(struct dinRSAKeyValueType* dinRSAKeyValueType) { +} + +void init_dinEVSEChargeParameterType(struct dinEVSEChargeParameterType* dinEVSEChargeParameterType) { +} + +void init_dinSignaturePropertiesType(struct dinSignaturePropertiesType* dinSignaturePropertiesType) { + dinSignaturePropertiesType->Id_isUsed = 0u; + dinSignaturePropertiesType->SignatureProperty.arrayLen = 0u; +} + +void init_dinDSAKeyValueType(struct dinDSAKeyValueType* dinDSAKeyValueType) { + dinDSAKeyValueType->P_isUsed = 0u; + dinDSAKeyValueType->Q_isUsed = 0u; + dinDSAKeyValueType->G_isUsed = 0u; + dinDSAKeyValueType->J_isUsed = 0u; + dinDSAKeyValueType->Seed_isUsed = 0u; + dinDSAKeyValueType->PgenCounter_isUsed = 0u; +} + +void init_dinProfileEntryType(struct dinProfileEntryType* dinProfileEntryType) { +} + +void init_dinSignatureValueType(struct dinSignatureValueType* dinSignatureValueType) { + dinSignatureValueType->Id_isUsed = 0u; +} + +void init_dinSessionStopResType(struct dinSessionStopResType* dinSessionStopResType) { +} + +void init_dinMeterInfoType(struct dinMeterInfoType* dinMeterInfoType) { + dinMeterInfoType->MeterReading_isUsed = 0u; + dinMeterInfoType->SigMeterReading_isUsed = 0u; + dinMeterInfoType->MeterStatus_isUsed = 0u; + dinMeterInfoType->TMeter_isUsed = 0u; +} + +void init_dinSalesTariffEntryType(struct dinSalesTariffEntryType* dinSalesTariffEntryType) { + dinSalesTariffEntryType->TimeInterval_isUsed = 0u; + dinSalesTariffEntryType->RelativeTimeInterval_isUsed = 0u; + dinSalesTariffEntryType->ConsumptionCost.arrayLen = 0u; +} + +void init_dinSessionStopType(struct dinSessionStopType* dinSessionStopType) { +} + +void init_dinSignaturePropertyType(struct dinSignaturePropertyType* dinSignaturePropertyType) { + dinSignaturePropertyType->Id_isUsed = 0u; +} + +void init_dinSignatureType(struct dinSignatureType* dinSignatureType) { + dinSignatureType->Id_isUsed = 0u; + dinSignatureType->KeyInfo_isUsed = 0u; + dinSignatureType->Object.arrayLen = 0u; +} + + + +#endif /* DEPLOY_DIN_CODEC */ + +#endif + diff --git a/src/din/dinEXIDatatypes.h b/src/din/dinEXIDatatypes.h new file mode 100644 index 0000000..a7bdd9d --- /dev/null +++ b/src/din/dinEXIDatatypes.h @@ -0,0 +1,2181 @@ +/* + * Copyright (C) 2007-2014 Siemens AG + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +/******************************************************************* + * + * @author Daniel.Peintner.EXT@siemens.com + * @version 0.9.1 + * @contact Joerg.Heuer@siemens.com + * + *

Code generated by EXIdizer

+ *

Schema: V2G_CI_MsgDef.xsd

+ * + * + ********************************************************************/ + + + +/** + * \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 + + +#include + +#include "EXITypes.h" + + +/* Datatype definitions and structs for given XML Schema definitions */ + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ +#define dinObjectType_Id_CHARACTERS_SIZE 50 +#define dinObjectType_MimeType_CHARACTERS_SIZE 50 +#define dinObjectType_Encoding_CHARACTERS_SIZE 50 +struct dinObjectType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[dinObjectType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* attribute: MimeType {http://www.w3.org/2001/XMLSchema,string} */ + struct { + exi_string_character_t characters[dinObjectType_MimeType_CHARACTERS_SIZE]; + uint16_t charactersLen; + } MimeType ; + unsigned int MimeType_isUsed:1; + /* attribute: Encoding {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[dinObjectType_Encoding_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Encoding ; + unsigned int Encoding_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SelectedServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceID,"urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID{0-1})', derivedBy='RESTRICTION'. */ +struct dinSelectedServiceType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":ServiceID, urn:iso:15118:2:2010:MsgDataTypes,serviceIDType */ + uint16_t ServiceID ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID, http://www.w3.org/2001/XMLSchema,short */ + int16_t ParameterSetID ; + unsigned int ParameterSetID_isUsed:1; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,PGPDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":PGPKeyID,"http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})|("http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED}))', derivedBy='RESTRICTION'. */ +#define dinPGPDataType_PGPKeyID_BYTES_SIZE 350 +#define dinPGPDataType_PGPKeyPacket_BYTES_SIZE 350 +struct dinPGPDataType { + /* element: "http://www.w3.org/2000/09/xmldsig#":PGPKeyID, http://www.w3.org/2001/XMLSchema,base64Binary */ + struct { + uint8_t bytes[dinPGPDataType_PGPKeyID_BYTES_SIZE]; + uint16_t bytesLen; + } PGPKeyID ; + unsigned int PGPKeyID_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket, http://www.w3.org/2001/XMLSchema,base64Binary */ + struct { + uint8_t bytes[dinPGPDataType_PGPKeyPacket_BYTES_SIZE]; + uint16_t bytesLen; + } PGPKeyPacket ; + unsigned int PGPKeyPacket_isUsed:1; +}; + +typedef enum { + responseCodeType_OK = 0, + responseCodeType_OK_NewSessionEstablished = 1, + responseCodeType_OK_OldSessionJoined = 2, + responseCodeType_OK_CertificateExpiresSoon = 3, + responseCodeType_FAILED = 4, + responseCodeType_FAILED_SequenceError = 5, + responseCodeType_FAILED_ServiceIDInvalid = 6, + responseCodeType_FAILED_UnknownSession = 7, + responseCodeType_FAILED_ServiceSelectionInvalid = 8, + responseCodeType_FAILED_PaymentSelectionInvalid = 9, + responseCodeType_FAILED_CertificateExpired = 10, + responseCodeType_FAILED_SignatureError = 11, + responseCodeType_FAILED_NoCertificateAvailable = 12, + responseCodeType_FAILED_CertChainError = 13, + responseCodeType_FAILED_ChallengeInvalid = 14, + responseCodeType_FAILED_ContractCanceled = 15, + responseCodeType_FAILED_WrongChargeParameter = 16, + responseCodeType_FAILED_PowerDeliveryNotApplied = 17, + responseCodeType_FAILED_TariffSelectionInvalid = 18, + responseCodeType_FAILED_ChargingProfileInvalid = 19, + responseCodeType_FAILED_EVSEPresentVoltageToLow = 20, + responseCodeType_FAILED_MeteringSignatureNotValid = 21, + responseCodeType_FAILED_WrongEnergyTransferType = 22 +} dinresponseCodeType; + +typedef enum { + DC_EVErrorCodeType_NO_ERROR = 0, + DC_EVErrorCodeType_FAILED_RESSTemperatureInhibit = 1, + DC_EVErrorCodeType_FAILED_EVShiftPosition = 2, + DC_EVErrorCodeType_FAILED_ChargerConnectorLockFault = 3, + DC_EVErrorCodeType_FAILED_EVRESSMalfunction = 4, + DC_EVErrorCodeType_FAILED_ChargingCurrentdifferential = 5, + DC_EVErrorCodeType_FAILED_ChargingVoltageOutOfRange = 6, + DC_EVErrorCodeType_Reserved_A = 7, + DC_EVErrorCodeType_Reserved_B = 8, + DC_EVErrorCodeType_Reserved_C = 9, + DC_EVErrorCodeType_FAILED_ChargingSystemIncompatibility = 10, + DC_EVErrorCodeType_NoData = 11 +} dinDC_EVErrorCodeType; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionSetupReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":EVCCID)', derivedBy='EXTENSION'. */ +#define dinSessionSetupReqType_EVCCID_BYTES_SIZE 8 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,evccIDType is 8 */ +struct dinSessionSetupReqType { + /* element: "urn:iso:15118:2:2010:MsgBody":EVCCID, urn:iso:15118:2:2010:MsgDataTypes,evccIDType */ + struct { + uint8_t bytes[dinSessionSetupReqType_EVCCID_BYTES_SIZE]; + uint16_t bytesLen; + } EVCCID ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionSetupResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEID,"urn:iso:15118:2:2010:MsgBody":DateTimeNow{0-1})', derivedBy='EXTENSION'. */ +#define dinSessionSetupResType_EVSEID_BYTES_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,evseIDType is 32 */ +struct dinSessionSetupResType { + /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ + dinresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2010:MsgBody":EVSEID, urn:iso:15118:2:2010:MsgDataTypes,evseIDType */ + struct { + uint8_t bytes[dinSessionSetupResType_EVSEID_BYTES_SIZE]; + uint16_t bytesLen; + } EVSEID ; + /* element: "urn:iso:15118:2:2010:MsgBody":DateTimeNow, http://www.w3.org/2001/XMLSchema,long */ + int64_t DateTimeNow ; + unsigned int DateTimeNow_isUsed:1; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SPKIDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SPKISexp,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-1}){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +#define dinSPKIDataType_SPKISexp_BYTES_SIZE 350 +#define dinSPKIDataType_SPKISexp_ARRAY_SIZE 1 +struct dinSPKIDataType { + /* element: "http://www.w3.org/2000/09/xmldsig#":SPKISexp, http://www.w3.org/2001/XMLSchema,base64Binary */ + struct { + struct { + uint8_t bytes[dinSPKIDataType_SPKISexp_BYTES_SIZE]; + uint16_t bytesLen; + } array[dinSPKIDataType_SPKISexp_ARRAY_SIZE]; + uint16_t arrayLen; + } SPKISexp; +}; + +typedef enum { + costKindType_relativePricePercentage = 0, + costKindType_RenewableGenerationPercentage = 1, + costKindType_CarbonDioxideEmission = 2 +} dincostKindType; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinCanonicalizationMethodType_Algorithm_CHARACTERS_SIZE 50 +struct dinCanonicalizationMethodType { + /* attribute: Algorithm {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[dinCanonicalizationMethodType_Algorithm_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Algorithm ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +struct dinEVChargeParameterType { + int noContent; /* avoid warning */ +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SASchedulesType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +struct dinSASchedulesType { + int noContent; /* avoid warning */ +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinSignatureMethodType_Algorithm_CHARACTERS_SIZE 50 +struct dinSignatureMethodType { + /* attribute: Algorithm {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[dinSignatureMethodType_Algorithm_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Algorithm ; + /* element: "http://www.w3.org/2000/09/xmldsig#":HMACOutputLength, http://www.w3.org/2000/09/xmldsig#,HMACOutputLengthType */ + int64_t HMACOutputLength ; + unsigned int HMACOutputLength_isUsed:1; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DigestMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinDigestMethodType_Algorithm_CHARACTERS_SIZE 50 +struct dinDigestMethodType { + /* attribute: Algorithm {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[dinDigestMethodType_Algorithm_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Algorithm ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ContractAuthenticationReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":GenChallenge{0-1})', derivedBy='EXTENSION'. */ +#define dinContractAuthenticationReqType_Id_CHARACTERS_SIZE 50 +#define dinContractAuthenticationReqType_GenChallenge_CHARACTERS_SIZE 50 +struct dinContractAuthenticationReqType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,IDREF} */ + struct { + exi_string_character_t characters[dinContractAuthenticationReqType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgBody":GenChallenge, urn:iso:15118:2:2010:MsgDataTypes,genChallengeType */ + struct { + exi_string_character_t characters[dinContractAuthenticationReqType_GenChallenge_CHARACTERS_SIZE]; + uint16_t charactersLen; + } GenChallenge ; + unsigned int GenChallenge_isUsed:1; +}; + +typedef enum { + EVSENotificationType_None = 0, + EVSENotificationType_StopCharging = 1, + EVSENotificationType_ReNegotiation = 2 +} dinEVSENotificationType; + +typedef enum { + EVSESupportedEnergyTransferType_AC_single_phase_core = 0, + EVSESupportedEnergyTransferType_AC_three_phase_core = 1, + EVSESupportedEnergyTransferType_DC_core = 2, + EVSESupportedEnergyTransferType_DC_extended = 3, + EVSESupportedEnergyTransferType_DC_combo_core = 4, + EVSESupportedEnergyTransferType_DC_dual = 5, + EVSESupportedEnergyTransferType_AC_core1p_DC_extended = 6, + EVSESupportedEnergyTransferType_AC_single_DC_core = 7, + EVSESupportedEnergyTransferType_AC_single_phase_three_phase_core_DC_extended = 8, + EVSESupportedEnergyTransferType_AC_core3p_DC_extended = 9 +} dinEVSESupportedEnergyTransferType; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDetailReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ServiceID)', derivedBy='EXTENSION'. */ +struct dinServiceDetailReqType { + /* element: "urn:iso:15118:2:2010:MsgBody":ServiceID, urn:iso:15118:2:2010:MsgDataTypes,serviceIDType */ + uint16_t ServiceID ; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ +#define dinX509IssuerSerialType_X509IssuerName_CHARACTERS_SIZE 50 +struct dinX509IssuerSerialType { + /* element: "http://www.w3.org/2000/09/xmldsig#":X509IssuerName, http://www.w3.org/2001/XMLSchema,string */ + struct { + exi_string_character_t characters[dinX509IssuerSerialType_X509IssuerName_CHARACTERS_SIZE]; + uint16_t charactersLen; + } X509IssuerName ; + /* element: "http://www.w3.org/2000/09/xmldsig#":X509SerialNumber, http://www.w3.org/2001/XMLSchema,integer */ + int64_t X509SerialNumber ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +struct dinIntervalType { + int noContent; /* avoid warning */ +}; + +typedef enum { + faultCodeType_ParsingError = 0, + faultCodeType_NoTLSRootCertificatAvailable = 1, + faultCodeType_UnknownError = 2 +} dinfaultCodeType; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":start,"urn:iso:15118:2:2010:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ +struct dinRelativeTimeIntervalType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":start, http://www.w3.org/2001/XMLSchema,unsignedInt */ + uint32_t start ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":duration, http://www.w3.org/2001/XMLSchema,unsignedInt */ + uint32_t duration ; + unsigned int duration_isUsed:1; +}; + +typedef enum { + paymentOptionType_Contract = 0, + paymentOptionType_ExternalPayment = 1 +} dinpaymentOptionType; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EntryType', base type name='anyType', content type='ELEMENT', isAbstract='true', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval)', derivedBy='RESTRICTION'. */ +struct dinEntryType { + union { /* substitutionGroup */ + /* element: "urn:iso:15118:2:2010:MsgDataTypes":TimeInterval, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ + struct dinIntervalType TimeInterval ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":RelativeTimeInterval, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":start,"urn:iso:15118:2:2010:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ + struct dinRelativeTimeIntervalType RelativeTimeInterval ; + }; /* union */ + unsigned int TimeInterval_isUsed:1; + unsigned int RelativeTimeInterval_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargingStatusReqType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +struct dinChargingStatusReqType { + int noContent; /* avoid warning */ +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVStatusType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +struct dinEVStatusType { + int noContent; /* avoid warning */ +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])|"http://www.w3.org/2000/09/xmldsig#":XPath){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ +#define dinTransformType_Algorithm_CHARACTERS_SIZE 50 +#define dinTransformType_XPath_CHARACTERS_SIZE 50 +#define dinTransformType_XPath_ARRAY_SIZE 1 +struct dinTransformType { + /* attribute: Algorithm {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[dinTransformType_Algorithm_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Algorithm ; + /* element: "http://www.w3.org/2000/09/xmldsig#":XPath, http://www.w3.org/2001/XMLSchema,string */ + struct { + struct { + exi_string_character_t characters[dinTransformType_XPath_CHARACTERS_SIZE]; + uint16_t charactersLen; + } array[dinTransformType_XPath_ARRAY_SIZE]; + uint16_t arrayLen; + } XPath; +}; + +typedef enum { + isolationLevelType_Invalid = 0, + isolationLevelType_Valid = 1, + isolationLevelType_Warning = 2, + isolationLevelType_Fault = 3 +} dinisolationLevelType; + +typedef enum { + valueType_bool = 0, + valueType_byte = 1, + valueType_short = 2, + valueType_int = 3, + valueType_physicalValue = 4, + valueType_string = 5 +} dinvalueType; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SubCertificatesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinSubCertificatesType_Certificate_BYTES_SIZE 1200 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,certificateType is 1200 */ +#define dinSubCertificatesType_Certificate_ARRAY_SIZE 5 +struct dinSubCertificatesType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":Certificate, urn:iso:15118:2:2010:MsgDataTypes,certificateType */ + struct { + struct { + uint8_t bytes[dinSubCertificatesType_Certificate_BYTES_SIZE]; + uint16_t bytesLen; + } array[dinSubCertificatesType_Certificate_ARRAY_SIZE]; + uint16_t arrayLen; + } Certificate; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SelectedServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SelectedService{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinSelectedServiceListType_SelectedService_ARRAY_SIZE 5 +struct dinSelectedServiceListType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":SelectedService, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SelectedServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceID,"urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID{0-1})', derivedBy='RESTRICTION'. */ + struct { + struct dinSelectedServiceType array[dinSelectedServiceListType_SelectedService_ARRAY_SIZE]; + uint16_t arrayLen; + } SelectedService; +}; + +typedef enum { + DC_EVSEStatusCodeType_EVSE_NotReady = 0, + DC_EVSEStatusCodeType_EVSE_Ready = 1, + DC_EVSEStatusCodeType_EVSE_Shutdown = 2, + DC_EVSEStatusCodeType_EVSE_UtilityInterruptEvent = 3, + DC_EVSEStatusCodeType_EVSE_IsolationMonitoringActive = 4, + DC_EVSEStatusCodeType_EVSE_EmergencyShutdown = 5, + DC_EVSEStatusCodeType_EVSE_Malfunction = 6, + DC_EVSEStatusCodeType_Reserved_8 = 7, + DC_EVSEStatusCodeType_Reserved_9 = 8, + DC_EVSEStatusCodeType_Reserved_A = 9, + DC_EVSEStatusCodeType_Reserved_B = 10, + DC_EVSEStatusCodeType_Reserved_C = 11 +} dinDC_EVSEStatusCodeType; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,PaymentDetailsResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":GenChallenge,"urn:iso:15118:2:2010:MsgBody":DateTimeNow)', derivedBy='EXTENSION'. */ +#define dinPaymentDetailsResType_GenChallenge_CHARACTERS_SIZE 50 +struct dinPaymentDetailsResType { + /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ + dinresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2010:MsgBody":GenChallenge, urn:iso:15118:2:2010:MsgDataTypes,genChallengeType */ + struct { + exi_string_character_t characters[dinPaymentDetailsResType_GenChallenge_CHARACTERS_SIZE]; + uint16_t charactersLen; + } GenChallenge ; + /* element: "urn:iso:15118:2:2010:MsgBody":DateTimeNow, http://www.w3.org/2001/XMLSchema,long */ + int64_t DateTimeNow ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVPowerDeliveryParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +struct dinEVPowerDeliveryParameterType { + int noContent; /* avoid warning */ +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDef,BodyBaseType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +struct dinBodyBaseType { + int noContent; /* avoid warning */ +}; + +typedef enum { + EVSEProcessingType_Finished = 0, + EVSEProcessingType_Ongoing = 1 +} dinEVSEProcessingType; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PaymentOptionsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PaymentOption{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinPaymentOptionsType_PaymentOption_ARRAY_SIZE 5 +struct dinPaymentOptionsType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":PaymentOption, urn:iso:15118:2:2010:MsgDataTypes,paymentOptionType */ + struct { + dinpaymentOptionType array[dinPaymentOptionsType_PaymentOption_ARRAY_SIZE]; + uint16_t arrayLen; + } PaymentOption; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PowerSwitchClosed,"urn:iso:15118:2:2010:MsgDataTypes":RCD,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ +struct dinAC_EVSEStatusType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":PowerSwitchClosed, http://www.w3.org/2001/XMLSchema,boolean */ + int PowerSwitchClosed ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":RCD, http://www.w3.org/2001/XMLSchema,boolean */ + int RCD ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay, http://www.w3.org/2001/XMLSchema,unsignedInt */ + uint32_t NotificationMaxDelay ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSENotification, urn:iso:15118:2:2010:MsgDataTypes,EVSENotificationType */ + dinEVSENotificationType EVSENotification ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServicePaymentSelectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ +struct dinServicePaymentSelectionResType { + /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ + dinresponseCodeType ResponseCode ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVSEStatusType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +struct dinEVSEStatusType { + int noContent; /* avoid warning */ +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ListOfRootCertificateIDsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":RootCertificateID{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinListOfRootCertificateIDsType_RootCertificateID_CHARACTERS_SIZE 40 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,rootCertificateIDType is 40 */ +#define dinListOfRootCertificateIDsType_RootCertificateID_ARRAY_SIZE 5 +struct dinListOfRootCertificateIDsType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":RootCertificateID, urn:iso:15118:2:2010:MsgDataTypes,rootCertificateIDType */ + struct { + struct { + exi_string_character_t characters[dinListOfRootCertificateIDsType_RootCertificateID_CHARACTERS_SIZE]; + uint16_t charactersLen; + } array[dinListOfRootCertificateIDsType_RootCertificateID_ARRAY_SIZE]; + uint16_t arrayLen; + } RootCertificateID; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ +#define dinRSAKeyValueType_Modulus_BYTES_SIZE 350 +#define dinRSAKeyValueType_Exponent_BYTES_SIZE 350 +struct dinRSAKeyValueType { + /* element: "http://www.w3.org/2000/09/xmldsig#":Modulus, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ + struct { + uint8_t bytes[dinRSAKeyValueType_Modulus_BYTES_SIZE]; + uint16_t bytesLen; + } Modulus ; + /* element: "http://www.w3.org/2000/09/xmldsig#":Exponent, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ + struct { + uint8_t bytes[dinRSAKeyValueType_Exponent_BYTES_SIZE]; + uint16_t bytesLen; + } Exponent ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVSEChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ +struct dinEVSEChargeParameterType { + int noContent; /* avoid warning */ +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ +#define dinDSAKeyValueType_P_BYTES_SIZE 350 +#define dinDSAKeyValueType_Q_BYTES_SIZE 350 +#define dinDSAKeyValueType_G_BYTES_SIZE 350 +#define dinDSAKeyValueType_Y_BYTES_SIZE 350 +#define dinDSAKeyValueType_J_BYTES_SIZE 350 +#define dinDSAKeyValueType_Seed_BYTES_SIZE 350 +#define dinDSAKeyValueType_PgenCounter_BYTES_SIZE 350 +struct dinDSAKeyValueType { + /* element: "http://www.w3.org/2000/09/xmldsig#":P, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ + struct { + uint8_t bytes[dinDSAKeyValueType_P_BYTES_SIZE]; + uint16_t bytesLen; + } P ; + unsigned int P_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":Q, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ + struct { + uint8_t bytes[dinDSAKeyValueType_Q_BYTES_SIZE]; + uint16_t bytesLen; + } Q ; + unsigned int Q_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":G, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ + struct { + uint8_t bytes[dinDSAKeyValueType_G_BYTES_SIZE]; + uint16_t bytesLen; + } G ; + unsigned int G_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":Y, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ + struct { + uint8_t bytes[dinDSAKeyValueType_Y_BYTES_SIZE]; + uint16_t bytesLen; + } Y ; + /* element: "http://www.w3.org/2000/09/xmldsig#":J, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ + struct { + uint8_t bytes[dinDSAKeyValueType_J_BYTES_SIZE]; + uint16_t bytesLen; + } J ; + unsigned int J_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":Seed, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ + struct { + uint8_t bytes[dinDSAKeyValueType_Seed_BYTES_SIZE]; + uint16_t bytesLen; + } Seed ; + unsigned int Seed_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":PgenCounter, http://www.w3.org/2000/09/xmldsig#,CryptoBinary */ + struct { + uint8_t bytes[dinDSAKeyValueType_PgenCounter_BYTES_SIZE]; + uint16_t bytesLen; + } PgenCounter ; + unsigned int PgenCounter_isUsed:1; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +#define dinSignatureValueType_Id_CHARACTERS_SIZE 50 +#define dinSignatureValueType_CONTENT_BYTES_SIZE 350 +struct dinSignatureValueType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[dinSignatureValueType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* simple content: http://www.w3.org/2001/XMLSchema,base64Binary */ + struct { + uint8_t bytes[dinSignatureValueType_CONTENT_BYTES_SIZE]; + uint16_t bytesLen; + } CONTENT ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ProfileEntryType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryStart,"urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryMaxPower)', derivedBy='RESTRICTION'. */ +struct dinProfileEntryType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryStart, http://www.w3.org/2001/XMLSchema,unsignedInt */ + uint32_t ChargingProfileEntryStart ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryMaxPower, urn:iso:15118:2:2010:MsgDataTypes,PMaxType */ + int16_t ChargingProfileEntryMaxPower ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionStopResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ +struct dinSessionStopResType { + /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ + dinresponseCodeType ResponseCode ; +}; + +typedef enum { + serviceCategoryType_EVCharging = 0, + serviceCategoryType_Internet = 1, + serviceCategoryType_ContractCertificate = 2, + serviceCategoryType_OtherCustom = 3 +} dinserviceCategoryType; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +#define dinSignaturePropertyType_Target_CHARACTERS_SIZE 50 +#define dinSignaturePropertyType_Id_CHARACTERS_SIZE 50 +struct dinSignaturePropertyType { + /* attribute: Target {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[dinSignaturePropertyType_Target_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Target ; + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[dinSignaturePropertyType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionStopType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ +struct dinSessionStopType { + int noContent; /* avoid warning */ +}; + +typedef enum { + EVRequestedEnergyTransferType_AC_single_phase_core = 0, + EVRequestedEnergyTransferType_AC_three_phase_core = 1, + EVRequestedEnergyTransferType_DC_core = 2, + EVRequestedEnergyTransferType_DC_extended = 3, + EVRequestedEnergyTransferType_DC_combo_core = 4, + EVRequestedEnergyTransferType_DC_unique = 5 +} dinEVRequestedEnergyTransferType; + +typedef enum { + unitSymbolType_h = 0, + unitSymbolType_m = 1, + unitSymbolType_s = 2, + unitSymbolType_A = 3, + unitSymbolType_Ah = 4, + unitSymbolType_V = 5, + unitSymbolType_VA = 6, + unitSymbolType_W = 7, + unitSymbolType_W_s = 8, + unitSymbolType_Wh = 9 +} dinunitSymbolType; + +/* 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'. */ +#define dinNotificationType_FaultMsg_CHARACTERS_SIZE 64 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,faultMsgType is 64 */ +struct dinNotificationType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":FaultCode, urn:iso:15118:2:2010:MsgDataTypes,faultCodeType */ + dinfaultCodeType FaultCode ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":FaultMsg, urn:iso:15118:2:2010:MsgDataTypes,faultMsgType */ + struct { + exi_string_character_t characters[dinNotificationType_FaultMsg_CHARACTERS_SIZE]; + uint16_t charactersLen; + } FaultMsg ; + unsigned int FaultMsg_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceTagType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceID,"urn:iso:15118:2:2010:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2010:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2010:MsgDataTypes":ServiceScope{0-1})', derivedBy='RESTRICTION'. */ +#define dinServiceTagType_ServiceName_CHARACTERS_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,serviceNameType is 32 */ +#define dinServiceTagType_ServiceScope_CHARACTERS_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,serviceScopeType is 32 */ +struct dinServiceTagType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":ServiceID, urn:iso:15118:2:2010:MsgDataTypes,serviceIDType */ + uint16_t ServiceID ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":ServiceName, urn:iso:15118:2:2010:MsgDataTypes,serviceNameType */ + struct { + exi_string_character_t characters[dinServiceTagType_ServiceName_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ServiceName ; + unsigned int ServiceName_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":ServiceCategory, urn:iso:15118:2:2010:MsgDataTypes,serviceCategoryType */ + dinserviceCategoryType ServiceCategory ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":ServiceScope, urn:iso:15118:2:2010:MsgDataTypes,serviceScopeType */ + struct { + exi_string_character_t characters[dinServiceTagType_ServiceScope_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ServiceScope ; + unsigned int ServiceScope_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":costKind,"urn:iso:15118:2:2010:MsgDataTypes":amount,"urn:iso:15118:2:2010:MsgDataTypes":amountMultiplier{0-1})', derivedBy='RESTRICTION'. */ +struct dinCostType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":costKind, urn:iso:15118:2:2010:MsgDataTypes,costKindType */ + dincostKindType costKind ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":amount, http://www.w3.org/2001/XMLSchema,unsignedInt */ + uint32_t amount ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":amountMultiplier, urn:iso:15118:2:2010:MsgDataTypes,unitMultiplierType */ + int8_t amountMultiplier ; + unsigned int amountMultiplier_isUsed:1; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509DataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial|"http://www.w3.org/2000/09/xmldsig#":X509SKI|"http://www.w3.org/2000/09/xmldsig#":X509SubjectName|"http://www.w3.org/2000/09/xmldsig#":X509Certificate|"http://www.w3.org/2000/09/xmldsig#":X509CRL|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +#define dinX509DataType_X509IssuerSerial_ARRAY_SIZE 1 +#define dinX509DataType_X509SKI_BYTES_SIZE 350 +#define dinX509DataType_X509SKI_ARRAY_SIZE 1 +#define dinX509DataType_X509SubjectName_CHARACTERS_SIZE 50 +#define dinX509DataType_X509SubjectName_ARRAY_SIZE 1 +#define dinX509DataType_X509Certificate_BYTES_SIZE 350 +#define dinX509DataType_X509Certificate_ARRAY_SIZE 1 +#define dinX509DataType_X509CRL_BYTES_SIZE 350 +#define dinX509DataType_X509CRL_ARRAY_SIZE 1 +struct dinX509DataType { + /* element: "http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial, Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)', derivedBy='RESTRICTION'. */ + struct { + struct dinX509IssuerSerialType array[dinX509DataType_X509IssuerSerial_ARRAY_SIZE]; + uint16_t arrayLen; + } X509IssuerSerial; + /* element: "http://www.w3.org/2000/09/xmldsig#":X509SKI, http://www.w3.org/2001/XMLSchema,base64Binary */ + struct { + struct { + uint8_t bytes[dinX509DataType_X509SKI_BYTES_SIZE]; + uint16_t bytesLen; + } array[dinX509DataType_X509SKI_ARRAY_SIZE]; + uint16_t arrayLen; + } X509SKI; + /* element: "http://www.w3.org/2000/09/xmldsig#":X509SubjectName, http://www.w3.org/2001/XMLSchema,string */ + struct { + struct { + exi_string_character_t characters[dinX509DataType_X509SubjectName_CHARACTERS_SIZE]; + uint16_t charactersLen; + } array[dinX509DataType_X509SubjectName_ARRAY_SIZE]; + uint16_t arrayLen; + } X509SubjectName; + /* element: "http://www.w3.org/2000/09/xmldsig#":X509Certificate, http://www.w3.org/2001/XMLSchema,base64Binary */ + struct { + struct { + uint8_t bytes[dinX509DataType_X509Certificate_BYTES_SIZE]; + uint16_t bytesLen; + } array[dinX509DataType_X509Certificate_ARRAY_SIZE]; + uint16_t arrayLen; + } X509Certificate; + /* element: "http://www.w3.org/2000/09/xmldsig#":X509CRL, http://www.w3.org/2001/XMLSchema,base64Binary */ + struct { + struct { + uint8_t bytes[dinX509DataType_X509CRL_BYTES_SIZE]; + uint16_t bytesLen; + } array[dinX509DataType_X509CRL_ARRAY_SIZE]; + uint16_t arrayLen; + } X509CRL; +}; + +/* 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'. */ +#define dinCertificateInstallationReqType_Id_CHARACTERS_SIZE 50 +#define dinCertificateInstallationReqType_OEMProvisioningCert_BYTES_SIZE 1200 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,certificateType is 1200 */ +#define dinCertificateInstallationReqType_DHParams_BYTES_SIZE 256 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,dHParamsType is 256 */ +struct dinCertificateInstallationReqType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,IDREF} */ + struct { + exi_string_character_t characters[dinCertificateInstallationReqType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgBody":OEMProvisioningCert, urn:iso:15118:2:2010:MsgDataTypes,certificateType */ + struct { + uint8_t bytes[dinCertificateInstallationReqType_OEMProvisioningCert_BYTES_SIZE]; + uint16_t bytesLen; + } OEMProvisioningCert ; + /* element: "urn:iso:15118:2:2010:MsgBody":ListOfRootCertificateIDs, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ListOfRootCertificateIDsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":RootCertificateID{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct dinListOfRootCertificateIDsType ListOfRootCertificateIDs ; + /* element: "urn:iso:15118:2:2010:MsgBody":DHParams, urn:iso:15118:2:2010:MsgDataTypes,dHParamsType */ + struct { + uint8_t bytes[dinCertificateInstallationReqType_DHParams_BYTES_SIZE]; + uint16_t bytesLen; + } DHParams ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ContractAuthenticationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ +struct dinContractAuthenticationResType { + /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ + dinresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2010:MsgBody":EVSEProcessing, urn:iso:15118:2:2010:MsgDataTypes,EVSEProcessingType */ + dinEVSEProcessingType EVSEProcessing ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ChargingProfileType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgDataTypes":ProfileEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinChargingProfileType_ProfileEntry_ARRAY_SIZE 5 +struct dinChargingProfileType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTupleID, urn:iso:15118:2:2010:MsgDataTypes,SAIDType */ + int16_t SAScheduleTupleID ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":ProfileEntry, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ProfileEntryType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryStart,"urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryMaxPower)', derivedBy='RESTRICTION'. */ + struct { + struct dinProfileEntryType array[dinChargingProfileType_ProfileEntry_ARRAY_SIZE]; + uint16_t arrayLen; + } ProfileEntry; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PMaxScheduleEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2010:MsgDataTypes":PMax))', derivedBy='EXTENSION'. */ +struct dinPMaxScheduleEntryType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":TimeInterval, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ + struct dinIntervalType TimeInterval ; + unsigned int TimeInterval_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":RelativeTimeInterval, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":start,"urn:iso:15118:2:2010:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ + struct dinRelativeTimeIntervalType RelativeTimeInterval ; + unsigned int RelativeTimeInterval_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":PMax, urn:iso:15118:2:2010:MsgDataTypes,PMaxType */ + int16_t PMax ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServicePaymentSelectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":SelectedPaymentOption,"urn:iso:15118:2:2010:MsgBody":SelectedServiceList)', derivedBy='EXTENSION'. */ +struct dinServicePaymentSelectionReqType { + /* element: "urn:iso:15118:2:2010:MsgBody":SelectedPaymentOption, urn:iso:15118:2:2010:MsgDataTypes,paymentOptionType */ + dinpaymentOptionType SelectedPaymentOption ; + /* element: "urn:iso:15118:2:2010:MsgBody":SelectedServiceList, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SelectedServiceListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SelectedService{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct dinSelectedServiceListType SelectedServiceList ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVReady,"urn:iso:15118:2:2010:MsgDataTypes":EVCabinConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVRESSConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2010:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ +struct dinDC_EVStatusType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVReady, http://www.w3.org/2001/XMLSchema,boolean */ + int EVReady ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVCabinConditioning, http://www.w3.org/2001/XMLSchema,boolean */ + int EVCabinConditioning ; + unsigned int EVCabinConditioning_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVRESSConditioning, http://www.w3.org/2001/XMLSchema,boolean */ + int EVRESSConditioning ; + unsigned int EVRESSConditioning_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVErrorCode, urn:iso:15118:2:2010:MsgDataTypes,DC_EVErrorCodeType */ + dinDC_EVErrorCodeType EVErrorCode ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVRESSSOC, urn:iso:15118:2:2010:MsgDataTypes,percentValueType */ + int8_t EVRESSSOC ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CableCheckReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ +struct dinCableCheckReqType { + /* element: "urn:iso:15118:2:2010:MsgBody":DC_EVStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVReady,"urn:iso:15118:2:2010:MsgDataTypes":EVCabinConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVRESSConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2010:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ + struct dinDC_EVStatusType DC_EVStatus ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,WeldingDetectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ +struct dinWeldingDetectionReqType { + /* element: "urn:iso:15118:2:2010:MsgBody":DC_EVStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVReady,"urn:iso:15118:2:2010:MsgDataTypes":EVCabinConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVRESSConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2010:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ + struct dinDC_EVStatusType DC_EVStatus ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate,"urn:iso:15118:2:2010:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ +#define dinCertificateChainType_Certificate_BYTES_SIZE 1200 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,certificateType is 1200 */ +struct dinCertificateChainType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":Certificate, urn:iso:15118:2:2010:MsgDataTypes,certificateType */ + struct { + uint8_t bytes[dinCertificateChainType_Certificate_BYTES_SIZE]; + uint16_t bytesLen; + } Certificate ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":SubCertificates, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SubCertificatesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct dinSubCertificatesType SubCertificates ; + unsigned int SubCertificates_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ConsumptionCostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":startValue,"urn:iso:15118:2:2010:MsgDataTypes":Cost{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinConsumptionCostType_Cost_ARRAY_SIZE 5 +struct dinConsumptionCostType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":startValue, http://www.w3.org/2001/XMLSchema,unsignedInt */ + uint32_t startValue ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":Cost, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CostType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":costKind,"urn:iso:15118:2:2010:MsgDataTypes":amount,"urn:iso:15118:2:2010:MsgDataTypes":amountMultiplier{0-1})', derivedBy='RESTRICTION'. */ + struct { + struct dinCostType array[dinConsumptionCostType_Cost_ARRAY_SIZE]; + uint16_t arrayLen; + } Cost; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatusCode,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ +struct dinDC_EVSEStatusType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEIsolationStatus, urn:iso:15118:2:2010:MsgDataTypes,isolationLevelType */ + dinisolationLevelType EVSEIsolationStatus ; + unsigned int EVSEIsolationStatus_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEStatusCode, urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEStatusCodeType */ + dinDC_EVSEStatusCodeType EVSEStatusCode ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay, http://www.w3.org/2001/XMLSchema,unsignedInt */ + uint32_t NotificationMaxDelay ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSENotification, urn:iso:15118:2:2010:MsgDataTypes,EVSENotificationType */ + dinEVSENotificationType EVSENotification ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceChargeType', base type name='ServiceType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":ServiceTag,"urn:iso:15118:2:2010:MsgDataTypes":FreeService),("urn:iso:15118:2:2010:MsgDataTypes":EnergyTransferType))', derivedBy='EXTENSION'. */ +struct dinServiceChargeType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":ServiceTag, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceTagType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceID,"urn:iso:15118:2:2010:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2010:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2010:MsgDataTypes":ServiceScope{0-1})', derivedBy='RESTRICTION'. */ + struct dinServiceTagType ServiceTag ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":FreeService, http://www.w3.org/2001/XMLSchema,boolean */ + int FreeService ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EnergyTransferType, urn:iso:15118:2:2010:MsgDataTypes,EVSESupportedEnergyTransferType */ + dinEVSESupportedEnergyTransferType EnergyTransferType ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ +struct dinPhysicalValueType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":Multiplier, urn:iso:15118:2:2010:MsgDataTypes,unitMultiplierType */ + int8_t Multiplier ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":Unit, urn:iso:15118:2:2010:MsgDataTypes,unitSymbolType */ + dinunitSymbolType Unit ; + unsigned int Unit_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":Value, http://www.w3.org/2001/XMLSchema,short */ + int16_t Value ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateUpdateReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":ListOfRootCertificateIDs,"urn:iso:15118:2:2010:MsgBody":DHParams)', derivedBy='EXTENSION'. */ +#define dinCertificateUpdateReqType_Id_CHARACTERS_SIZE 50 +#define dinCertificateUpdateReqType_ContractID_CHARACTERS_SIZE 24 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,contractIDType is 24 */ +#define dinCertificateUpdateReqType_DHParams_BYTES_SIZE 256 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,dHParamsType is 256 */ +struct dinCertificateUpdateReqType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,IDREF} */ + struct { + exi_string_character_t characters[dinCertificateUpdateReqType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate,"urn:iso:15118:2:2010:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ + struct dinCertificateChainType ContractSignatureCertChain ; + /* element: "urn:iso:15118:2:2010:MsgBody":ContractID, urn:iso:15118:2:2010:MsgDataTypes,contractIDType */ + struct { + exi_string_character_t characters[dinCertificateUpdateReqType_ContractID_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ContractID ; + /* element: "urn:iso:15118:2:2010:MsgBody":ListOfRootCertificateIDs, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ListOfRootCertificateIDsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":RootCertificateID{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct dinListOfRootCertificateIDsType ListOfRootCertificateIDs ; + /* element: "urn:iso:15118:2:2010:MsgBody":DHParams, urn:iso:15118:2:2010:MsgDataTypes,dHParamsType */ + struct { + uint8_t bytes[dinCertificateUpdateReqType_DHParams_BYTES_SIZE]; + uint16_t bytesLen; + } DHParams ; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyValueType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":DSAKeyValue|"http://www.w3.org/2000/09/xmldsig#":RSAKeyValue|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))', derivedBy='RESTRICTION'. */ +struct dinKeyValueType { + /* element: "http://www.w3.org/2000/09/xmldsig#":DSAKeyValue, Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})', derivedBy='RESTRICTION'. */ + struct dinDSAKeyValueType DSAKeyValue ; + unsigned int DSAKeyValue_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":RSAKeyValue, Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)', derivedBy='RESTRICTION'. */ + struct dinRSAKeyValueType RSAKeyValue ; + unsigned int RSAKeyValue_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ServiceScope{0-1},"urn:iso:15118:2:2010:MsgBody":ServiceCategory{0-1})', derivedBy='EXTENSION'. */ +#define dinServiceDiscoveryReqType_ServiceScope_CHARACTERS_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,serviceScopeType is 32 */ +struct dinServiceDiscoveryReqType { + /* element: "urn:iso:15118:2:2010:MsgBody":ServiceScope, urn:iso:15118:2:2010:MsgDataTypes,serviceScopeType */ + struct { + exi_string_character_t characters[dinServiceDiscoveryReqType_ServiceScope_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ServiceScope ; + unsigned int ServiceScope_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgBody":ServiceCategory, urn:iso:15118:2:2010:MsgDataTypes,serviceCategoryType */ + dinserviceCategoryType ServiceCategory ; + unsigned int ServiceCategory_isUsed:1; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinTransformsType_Transform_ARRAY_SIZE 1 +struct dinTransformsType { + /* element: "http://www.w3.org/2000/09/xmldsig#":Transform, Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])|"http://www.w3.org/2000/09/xmldsig#":XPath){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ + struct { + struct dinTransformType array[dinTransformsType_Transform_ARRAY_SIZE]; + uint16_t arrayLen; + } Transform; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ParameterType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":boolValue|"urn:iso:15118:2:2010:MsgDataTypes":byteValue|"urn:iso:15118:2:2010:MsgDataTypes":shortValue|"urn:iso:15118:2:2010:MsgDataTypes":intValue|"urn:iso:15118:2:2010:MsgDataTypes":physicalValue|"urn:iso:15118:2:2010:MsgDataTypes":stringValue)', derivedBy='RESTRICTION'. */ +#define dinParameterType_Name_CHARACTERS_SIZE 50 +#define dinParameterType_stringValue_CHARACTERS_SIZE 50 +struct dinParameterType { + /* attribute: Name {http://www.w3.org/2001/XMLSchema,string} */ + struct { + exi_string_character_t characters[dinParameterType_Name_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Name ; + /* attribute: ValueType {urn:iso:15118:2:2010:MsgDataTypes,valueType} */ + dinvalueType ValueType ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":boolValue, http://www.w3.org/2001/XMLSchema,boolean */ + int boolValue ; + unsigned int boolValue_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":byteValue, http://www.w3.org/2001/XMLSchema,byte */ + int8_t byteValue ; + unsigned int byteValue_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":shortValue, http://www.w3.org/2001/XMLSchema,short */ + int16_t shortValue ; + unsigned int shortValue_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":intValue, http://www.w3.org/2001/XMLSchema,int */ + int32_t intValue ; + unsigned int intValue_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":physicalValue, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType physicalValue ; + unsigned int physicalValue_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":stringValue, http://www.w3.org/2001/XMLSchema,string */ + struct { + exi_string_character_t characters[dinParameterType_stringValue_CHARACTERS_SIZE]; + uint16_t charactersLen; + } stringValue ; + unsigned int stringValue_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PMaxScheduleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PMaxScheduleID,"urn:iso:15118:2:2010:MsgDataTypes":PMaxScheduleEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinPMaxScheduleType_PMaxScheduleEntry_ARRAY_SIZE 5 +struct dinPMaxScheduleType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":PMaxScheduleID, urn:iso:15118:2:2010:MsgDataTypes,SAIDType */ + int16_t PMaxScheduleID ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":PMaxScheduleEntry, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PMaxScheduleEntryType', base type name='EntryType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2010:MsgDataTypes":PMax))', derivedBy='EXTENSION'. */ + struct { + struct dinPMaxScheduleEntryType array[dinPMaxScheduleType_PMaxScheduleEntry_ARRAY_SIZE]; + uint16_t arrayLen; + } PMaxScheduleEntry; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinimumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinimumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSECurrentRegulationTolerance{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEPeakCurrentRipple,"urn:iso:15118:2:2010:MsgDataTypes":EVSEEnergyToBeDelivered{0-1})', derivedBy='EXTENSION'. */ +struct dinDC_EVSEChargeParameterType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatusCode,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ + struct dinDC_EVSEStatusType DC_EVSEStatus ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumCurrentLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEMaximumCurrentLimit ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumPowerLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEMaximumPowerLimit ; + unsigned int EVSEMaximumPowerLimit_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumVoltageLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEMaximumVoltageLimit ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEMinimumCurrentLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEMinimumCurrentLimit ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEMinimumVoltageLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEMinimumVoltageLimit ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSECurrentRegulationTolerance, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSECurrentRegulationTolerance ; + unsigned int EVSECurrentRegulationTolerance_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEPeakCurrentRipple, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEPeakCurrentRipple ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEEnergyToBeDelivered, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEEnergyToBeDelivered ; + unsigned int EVSEEnergyToBeDelivered_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CableCheckResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ +struct dinCableCheckResType { + /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ + dinresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatusCode,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ + struct dinDC_EVSEStatusType DC_EVSEStatus ; + /* element: "urn:iso:15118:2:2010:MsgBody":EVSEProcessing, urn:iso:15118:2:2010:MsgDataTypes,EVSEProcessingType */ + dinEVSEProcessingType EVSEProcessing ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ParameterSetType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID,"urn:iso:15118:2:2010:MsgDataTypes":Parameter{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinParameterSetType_Parameter_ARRAY_SIZE 5 +struct dinParameterSetType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID, http://www.w3.org/2001/XMLSchema,short */ + int16_t ParameterSetID ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":Parameter, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ParameterType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":boolValue|"urn:iso:15118:2:2010:MsgDataTypes":byteValue|"urn:iso:15118:2:2010:MsgDataTypes":shortValue|"urn:iso:15118:2:2010:MsgDataTypes":intValue|"urn:iso:15118:2:2010:MsgDataTypes":physicalValue|"urn:iso:15118:2:2010:MsgDataTypes":stringValue)', derivedBy='RESTRICTION'. */ + struct { + struct dinParameterType array[dinParameterSetType_Parameter_ARRAY_SIZE]; + uint16_t arrayLen; + } Parameter; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVPowerDeliveryParameterType', base type name='EVPowerDeliveryParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2010:MsgDataTypes":BulkChargingComplete{0-1},"urn:iso:15118:2:2010:MsgDataTypes":ChargingComplete)', derivedBy='EXTENSION'. */ +struct dinDC_EVPowerDeliveryParameterType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVReady,"urn:iso:15118:2:2010:MsgDataTypes":EVCabinConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVRESSConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2010:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ + struct dinDC_EVStatusType DC_EVStatus ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":BulkChargingComplete, http://www.w3.org/2001/XMLSchema,boolean */ + int BulkChargingComplete ; + unsigned int BulkChargingComplete_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":ChargingComplete, http://www.w3.org/2001/XMLSchema,boolean */ + int ChargingComplete ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,PaymentDetailsReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain)', derivedBy='EXTENSION'. */ +#define dinPaymentDetailsReqType_ContractID_CHARACTERS_SIZE 24 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,contractIDType is 24 */ +struct dinPaymentDetailsReqType { + /* element: "urn:iso:15118:2:2010:MsgBody":ContractID, urn:iso:15118:2:2010:MsgDataTypes,contractIDType */ + struct { + exi_string_character_t characters[dinPaymentDetailsReqType_ContractID_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ContractID ; + /* element: "urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate,"urn:iso:15118:2:2010:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ + struct dinCertificateChainType ContractSignatureCertChain ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVEnergyCapacity{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVEnergyRequest{0-1},"urn:iso:15118:2:2010:MsgDataTypes":FullSOC{0-1},"urn:iso:15118:2:2010:MsgDataTypes":BulkSOC{0-1})', derivedBy='EXTENSION'. */ +struct dinDC_EVChargeParameterType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVReady,"urn:iso:15118:2:2010:MsgDataTypes":EVCabinConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVRESSConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2010:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ + struct dinDC_EVStatusType DC_EVStatus ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVMaximumCurrentLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVMaximumCurrentLimit ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVMaximumPowerLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVMaximumPowerLimit ; + unsigned int EVMaximumPowerLimit_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVMaximumVoltageLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVMaximumVoltageLimit ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVEnergyCapacity, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVEnergyCapacity ; + unsigned int EVEnergyCapacity_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVEnergyRequest, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVEnergyRequest ; + unsigned int EVEnergyRequest_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":FullSOC, urn:iso:15118:2:2010:MsgDataTypes,percentValueType */ + int8_t FullSOC ; + unsigned int FullSOC_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":BulkSOC, urn:iso:15118:2:2010:MsgDataTypes,percentValueType */ + int8_t BulkSOC ; + unsigned int BulkSOC_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceTag,"urn:iso:15118:2:2010:MsgDataTypes":FreeService)', derivedBy='RESTRICTION'. */ +struct dinServiceType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":ServiceTag, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceTagType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceID,"urn:iso:15118:2:2010:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2010:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2010:MsgDataTypes":ServiceScope{0-1})', derivedBy='RESTRICTION'. */ + struct dinServiceTagType ServiceTag ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":FreeService, http://www.w3.org/2001/XMLSchema,boolean */ + int FreeService ; +}; + +/* Complex type name='urn:iso:15118:2:2010: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'. */ +struct dinCurrentDemandReqType { + /* element: "urn:iso:15118:2:2010:MsgBody":DC_EVStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVReady,"urn:iso:15118:2:2010:MsgDataTypes":EVCabinConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVRESSConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2010:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ + struct dinDC_EVStatusType DC_EVStatus ; + /* element: "urn:iso:15118:2:2010:MsgBody":EVTargetCurrent, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVTargetCurrent ; + /* element: "urn:iso:15118:2:2010:MsgBody":EVMaximumVoltageLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVMaximumVoltageLimit ; + unsigned int EVMaximumVoltageLimit_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgBody":EVMaximumCurrentLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVMaximumCurrentLimit ; + unsigned int EVMaximumCurrentLimit_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgBody":EVMaximumPowerLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVMaximumPowerLimit ; + unsigned int EVMaximumPowerLimit_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgBody":BulkChargingComplete, http://www.w3.org/2001/XMLSchema,boolean */ + int BulkChargingComplete ; + unsigned int BulkChargingComplete_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgBody":ChargingComplete, http://www.w3.org/2001/XMLSchema,boolean */ + int ChargingComplete ; + /* element: "urn:iso:15118:2:2010:MsgBody":RemainingTimeToFullSoC, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType RemainingTimeToFullSoC ; + unsigned int RemainingTimeToFullSoC_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgBody":RemainingTimeToBulkSoC, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType RemainingTimeToBulkSoC ; + unsigned int RemainingTimeToBulkSoC_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgBody":EVTargetVoltage, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVTargetVoltage ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,MeteringReceiptResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":AC_EVSEStatus)', derivedBy='EXTENSION'. */ +struct dinMeteringReceiptResType { + /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ + dinresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2010:MsgBody":AC_EVSEStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PowerSwitchClosed,"urn:iso:15118:2:2010:MsgDataTypes":RCD,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ + struct dinAC_EVSEStatusType AC_EVSEStatus ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceTagListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Service{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinServiceTagListType_Service_ARRAY_SIZE 5 +struct dinServiceTagListType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":Service, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceTag,"urn:iso:15118:2:2010:MsgDataTypes":FreeService)', derivedBy='RESTRICTION'. */ + struct { + struct dinServiceType array[dinServiceTagListType_Service_ARRAY_SIZE]; + uint16_t arrayLen; + } Service; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertiesType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignatureProperty{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinSignaturePropertiesType_Id_CHARACTERS_SIZE 50 +#define dinSignaturePropertiesType_SignatureProperty_ARRAY_SIZE 1 +struct dinSignaturePropertiesType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[dinSignaturePropertiesType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":SignatureProperty, Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ + struct { + struct dinSignaturePropertyType array[dinSignaturePropertiesType_SignatureProperty_ARRAY_SIZE]; + uint16_t arrayLen; + } SignatureProperty; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,MeterInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":MeterID,"urn:iso:15118:2:2010:MsgDataTypes":MeterReading{0-1},"urn:iso:15118:2:2010:MsgDataTypes":SigMeterReading{0-1},"urn:iso:15118:2:2010:MsgDataTypes":MeterStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":TMeter{0-1})', derivedBy='RESTRICTION'. */ +#define dinMeterInfoType_MeterID_CHARACTERS_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,meterIDType is 32 */ +#define dinMeterInfoType_SigMeterReading_BYTES_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,sigMeterReadingType is 32 */ +struct dinMeterInfoType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":MeterID, urn:iso:15118:2:2010:MsgDataTypes,meterIDType */ + struct { + exi_string_character_t characters[dinMeterInfoType_MeterID_CHARACTERS_SIZE]; + uint16_t charactersLen; + } MeterID ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":MeterReading, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType MeterReading ; + unsigned int MeterReading_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":SigMeterReading, urn:iso:15118:2:2010:MsgDataTypes,sigMeterReadingType */ + struct { + uint8_t bytes[dinMeterInfoType_SigMeterReading_BYTES_SIZE]; + uint16_t bytesLen; + } SigMeterReading ; + unsigned int SigMeterReading_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":MeterStatus, urn:iso:15118:2:2010:MsgDataTypes,meterStatusType */ + int16_t MeterStatus ; + unsigned int MeterStatus_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":TMeter, http://www.w3.org/2001/XMLSchema,long */ + int64_t TMeter ; + unsigned int TMeter_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010: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'. */ +#define dinSalesTariffEntryType_ConsumptionCost_ARRAY_SIZE 5 +struct dinSalesTariffEntryType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":TimeInterval, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,IntervalType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ + struct dinIntervalType TimeInterval ; + unsigned int TimeInterval_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":RelativeTimeInterval, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,RelativeTimeIntervalType', base type name='IntervalType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":start,"urn:iso:15118:2:2010:MsgDataTypes":duration{0-1})', derivedBy='EXTENSION'. */ + struct dinRelativeTimeIntervalType RelativeTimeInterval ; + unsigned int RelativeTimeInterval_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EPriceLevel, http://www.w3.org/2001/XMLSchema,unsignedByte */ + uint8_t EPriceLevel ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":ConsumptionCost, 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'. */ + struct { + struct dinConsumptionCostType array[dinSalesTariffEntryType_ConsumptionCost_ARRAY_SIZE]; + uint16_t arrayLen; + } ConsumptionCost; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,PreChargeReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus,"urn:iso:15118:2:2010:MsgBody":EVTargetVoltage,"urn:iso:15118:2:2010:MsgBody":EVTargetCurrent)', derivedBy='EXTENSION'. */ +struct dinPreChargeReqType { + /* element: "urn:iso:15118:2:2010:MsgBody":DC_EVStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVStatusType', base type name='EVStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVReady,"urn:iso:15118:2:2010:MsgDataTypes":EVCabinConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVRESSConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2010:MsgDataTypes":EVRESSSOC)', derivedBy='EXTENSION'. */ + struct dinDC_EVStatusType DC_EVStatus ; + /* element: "urn:iso:15118:2:2010:MsgBody":EVTargetVoltage, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVTargetVoltage ; + /* element: "urn:iso:15118:2:2010:MsgBody":EVTargetCurrent, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVTargetCurrent ; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RetrievalMethodType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1})', derivedBy='RESTRICTION'. */ +#define dinRetrievalMethodType_URI_CHARACTERS_SIZE 50 +#define dinRetrievalMethodType_Type_CHARACTERS_SIZE 50 +struct dinRetrievalMethodType { + /* attribute: URI {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[dinRetrievalMethodType_URI_CHARACTERS_SIZE]; + uint16_t charactersLen; + } URI ; + unsigned int URI_isUsed:1; + /* attribute: Type {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[dinRetrievalMethodType_Type_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Type ; + unsigned int Type_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":Transforms, Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct dinTransformsType Transforms ; + unsigned int Transforms_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DepartureTime,"urn:iso:15118:2:2010:MsgDataTypes":EAmount,"urn:iso:15118:2:2010:MsgDataTypes":EVMaxVoltage,"urn:iso:15118:2:2010:MsgDataTypes":EVMaxCurrent,"urn:iso:15118:2:2010:MsgDataTypes":EVMinCurrent)', derivedBy='EXTENSION'. */ +struct dinAC_EVChargeParameterType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":DepartureTime, http://www.w3.org/2001/XMLSchema,unsignedInt */ + uint32_t DepartureTime ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EAmount, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EAmount ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVMaxVoltage, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVMaxVoltage ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVMaxCurrent, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVMaxCurrent ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVMinCurrent, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVMinCurrent ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateUpdateResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2010:MsgBody":DHParams,"urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":RetryCounter)', derivedBy='EXTENSION'. */ +#define dinCertificateUpdateResType_Id_CHARACTERS_SIZE 50 +#define dinCertificateUpdateResType_ContractSignatureEncryptedPrivateKey_BYTES_SIZE 128 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,privateKeyType is 128 */ +#define dinCertificateUpdateResType_DHParams_BYTES_SIZE 256 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,dHParamsType is 256 */ +#define dinCertificateUpdateResType_ContractID_CHARACTERS_SIZE 24 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,contractIDType is 24 */ +struct dinCertificateUpdateResType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,IDREF} */ + struct { + exi_string_character_t characters[dinCertificateUpdateResType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ + dinresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate,"urn:iso:15118:2:2010:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ + struct dinCertificateChainType ContractSignatureCertChain ; + /* element: "urn:iso:15118:2:2010:MsgBody":ContractSignatureEncryptedPrivateKey, urn:iso:15118:2:2010:MsgDataTypes,privateKeyType */ + struct { + uint8_t bytes[dinCertificateUpdateResType_ContractSignatureEncryptedPrivateKey_BYTES_SIZE]; + uint16_t bytesLen; + } ContractSignatureEncryptedPrivateKey ; + /* element: "urn:iso:15118:2:2010:MsgBody":DHParams, urn:iso:15118:2:2010:MsgDataTypes,dHParamsType */ + struct { + uint8_t bytes[dinCertificateUpdateResType_DHParams_BYTES_SIZE]; + uint16_t bytesLen; + } DHParams ; + /* element: "urn:iso:15118:2:2010:MsgBody":ContractID, urn:iso:15118:2:2010:MsgDataTypes,contractIDType */ + struct { + exi_string_character_t characters[dinCertificateUpdateResType_ContractID_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ContractID ; + /* element: "urn:iso:15118:2:2010:MsgBody":RetryCounter, http://www.w3.org/2001/XMLSchema,short */ + int16_t RetryCounter ; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ +#define dinReferenceType_Id_CHARACTERS_SIZE 50 +#define dinReferenceType_URI_CHARACTERS_SIZE 50 +#define dinReferenceType_Type_CHARACTERS_SIZE 50 +#define dinReferenceType_DigestValue_BYTES_SIZE 350 +struct dinReferenceType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[dinReferenceType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* attribute: URI {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[dinReferenceType_URI_CHARACTERS_SIZE]; + uint16_t charactersLen; + } URI ; + unsigned int URI_isUsed:1; + /* attribute: Type {http://www.w3.org/2001/XMLSchema,anyURI} */ + struct { + exi_string_character_t characters[dinReferenceType_Type_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Type ; + unsigned int Type_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":Transforms, Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct dinTransformsType Transforms ; + unsigned int Transforms_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":DigestMethod, Complex type name='http://www.w3.org/2000/09/xmldsig#,DigestMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct dinDigestMethodType DigestMethod ; + /* element: "http://www.w3.org/2000/09/xmldsig#":DigestValue, http://www.w3.org/2000/09/xmldsig#,DigestValueType */ + struct { + uint8_t bytes[dinReferenceType_DigestValue_BYTES_SIZE]; + uint16_t bytesLen; + } DigestValue ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateInstallationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2010:MsgBody":DHParams,"urn:iso:15118:2:2010:MsgBody":ContractID)', derivedBy='EXTENSION'. */ +#define dinCertificateInstallationResType_Id_CHARACTERS_SIZE 50 +#define dinCertificateInstallationResType_ContractSignatureEncryptedPrivateKey_BYTES_SIZE 128 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,privateKeyType is 128 */ +#define dinCertificateInstallationResType_DHParams_BYTES_SIZE 256 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,dHParamsType is 256 */ +#define dinCertificateInstallationResType_ContractID_CHARACTERS_SIZE 24 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,contractIDType is 24 */ +struct dinCertificateInstallationResType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,IDREF} */ + struct { + exi_string_character_t characters[dinCertificateInstallationResType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ + dinresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CertificateChainType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate,"urn:iso:15118:2:2010:MsgDataTypes":SubCertificates{0-1})', derivedBy='RESTRICTION'. */ + struct dinCertificateChainType ContractSignatureCertChain ; + /* element: "urn:iso:15118:2:2010:MsgBody":ContractSignatureEncryptedPrivateKey, urn:iso:15118:2:2010:MsgDataTypes,privateKeyType */ + struct { + uint8_t bytes[dinCertificateInstallationResType_ContractSignatureEncryptedPrivateKey_BYTES_SIZE]; + uint16_t bytesLen; + } ContractSignatureEncryptedPrivateKey ; + /* element: "urn:iso:15118:2:2010:MsgBody":DHParams, urn:iso:15118:2:2010:MsgDataTypes,dHParamsType */ + struct { + uint8_t bytes[dinCertificateInstallationResType_DHParams_BYTES_SIZE]; + uint16_t bytesLen; + } DHParams ; + /* element: "urn:iso:15118:2:2010:MsgBody":ContractID, urn:iso:15118:2:2010:MsgDataTypes,contractIDType */ + struct { + exi_string_character_t characters[dinCertificateInstallationResType_ContractID_CHARACTERS_SIZE]; + uint16_t charactersLen; + } ContractID ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,CurrentDemandResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage,"urn:iso:15118:2:2010:MsgBody":EVSEPresentCurrent,"urn:iso:15118:2:2010:MsgBody":EVSECurrentLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEVoltageLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEPowerLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEMaximumVoltageLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVSEMaximumCurrentLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVSEMaximumPowerLimit{0-1})', derivedBy='EXTENSION'. */ +struct dinCurrentDemandResType { + /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ + dinresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatusCode,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ + struct dinDC_EVSEStatusType DC_EVSEStatus ; + /* element: "urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEPresentVoltage ; + /* element: "urn:iso:15118:2:2010:MsgBody":EVSEPresentCurrent, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEPresentCurrent ; + /* element: "urn:iso:15118:2:2010:MsgBody":EVSECurrentLimitAchieved, http://www.w3.org/2001/XMLSchema,boolean */ + int EVSECurrentLimitAchieved ; + /* element: "urn:iso:15118:2:2010:MsgBody":EVSEVoltageLimitAchieved, http://www.w3.org/2001/XMLSchema,boolean */ + int EVSEVoltageLimitAchieved ; + /* element: "urn:iso:15118:2:2010:MsgBody":EVSEPowerLimitAchieved, http://www.w3.org/2001/XMLSchema,boolean */ + int EVSEPowerLimitAchieved ; + /* element: "urn:iso:15118:2:2010:MsgBody":EVSEMaximumVoltageLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEMaximumVoltageLimit ; + unsigned int EVSEMaximumVoltageLimit_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgBody":EVSEMaximumCurrentLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEMaximumCurrentLimit ; + unsigned int EVSEMaximumCurrentLimit_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgBody":EVSEMaximumPowerLimit, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEMaximumPowerLimit ; + unsigned int EVSEMaximumPowerLimit_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,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'. */ +#define dinChargingStatusResType_EVSEID_BYTES_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,evseIDType is 32 */ +struct dinChargingStatusResType { + /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ + dinresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2010:MsgBody":EVSEID, urn:iso:15118:2:2010:MsgDataTypes,evseIDType */ + struct { + uint8_t bytes[dinChargingStatusResType_EVSEID_BYTES_SIZE]; + uint16_t bytesLen; + } EVSEID ; + /* element: "urn:iso:15118:2:2010:MsgBody":SAScheduleTupleID, urn:iso:15118:2:2010:MsgDataTypes,SAIDType */ + int16_t SAScheduleTupleID ; + /* element: "urn:iso:15118:2:2010:MsgBody":EVSEMaxCurrent, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEMaxCurrent ; + unsigned int EVSEMaxCurrent_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgBody":MeterInfo, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,MeterInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":MeterID,"urn:iso:15118:2:2010:MsgDataTypes":MeterReading{0-1},"urn:iso:15118:2:2010:MsgDataTypes":SigMeterReading{0-1},"urn:iso:15118:2:2010:MsgDataTypes":MeterStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":TMeter{0-1})', derivedBy='RESTRICTION'. */ + struct dinMeterInfoType MeterInfo ; + unsigned int MeterInfo_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgBody":ReceiptRequired, http://www.w3.org/2001/XMLSchema,boolean */ + int ReceiptRequired ; + /* element: "urn:iso:15118:2:2010:MsgBody":AC_EVSEStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PowerSwitchClosed,"urn:iso:15118:2:2010:MsgDataTypes":RCD,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ + struct dinAC_EVSEStatusType AC_EVSEStatus ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceParameterListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ParameterSet{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinServiceParameterListType_ParameterSet_ARRAY_SIZE 5 +struct dinServiceParameterListType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":ParameterSet, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ParameterSetType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID,"urn:iso:15118:2:2010:MsgDataTypes":Parameter{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct { + struct dinParameterSetType array[dinServiceParameterListType_ParameterSet_ARRAY_SIZE]; + uint16_t arrayLen; + } ParameterSet; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,PowerDeliveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ +struct dinPowerDeliveryResType { + /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ + dinresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVSEStatusType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ + struct dinEVSEStatusType EVSEStatus ; + unsigned int EVSEStatus_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":AC_EVSEStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PowerSwitchClosed,"urn:iso:15118:2:2010:MsgDataTypes":RCD,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ + struct dinAC_EVSEStatusType AC_EVSEStatus ; + unsigned int AC_EVSEStatus_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatusCode,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ + struct dinDC_EVSEStatusType DC_EVSEStatus ; + unsigned int DC_EVSEStatus_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":AC_EVSEStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaxVoltage,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaxCurrent,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinCurrent)', derivedBy='EXTENSION'. */ +struct dinAC_EVSEChargeParameterType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":AC_EVSEStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PowerSwitchClosed,"urn:iso:15118:2:2010:MsgDataTypes":RCD,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ + struct dinAC_EVSEStatusType AC_EVSEStatus ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEMaxVoltage, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEMaxVoltage ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEMaxCurrent, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEMaxCurrent ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEMinCurrent, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEMinCurrent ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,WeldingDetectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ +struct dinWeldingDetectionResType { + /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ + dinresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatusCode,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ + struct dinDC_EVSEStatusType DC_EVSEStatus ; + /* element: "urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEPresentVoltage ; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDetailResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ServiceID,"urn:iso:15118:2:2010:MsgBody":ServiceParameterList{0-1})', derivedBy='EXTENSION'. */ +struct dinServiceDetailResType { + /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ + dinresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2010:MsgBody":ServiceID, urn:iso:15118:2:2010:MsgDataTypes,serviceIDType */ + uint16_t ServiceID ; + /* element: "urn:iso:15118:2:2010:MsgBody":ServiceParameterList, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceParameterListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":ParameterSet{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct dinServiceParameterListType ServiceParameterList ; + unsigned int ServiceParameterList_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,PowerDeliveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ReadyToChargeState,"urn:iso:15118:2:2010:MsgBody":ChargingProfile{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVPowerDeliveryParameter{0-1})', derivedBy='EXTENSION'. */ +struct dinPowerDeliveryReqType { + /* element: "urn:iso:15118:2:2010:MsgBody":ReadyToChargeState, http://www.w3.org/2001/XMLSchema,boolean */ + int ReadyToChargeState ; + /* element: "urn:iso:15118:2:2010:MsgBody":ChargingProfile, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ChargingProfileType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgDataTypes":ProfileEntry{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct dinChargingProfileType ChargingProfile ; + unsigned int ChargingProfile_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVPowerDeliveryParameter, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVPowerDeliveryParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ + struct dinEVPowerDeliveryParameterType EVPowerDeliveryParameter ; + unsigned int EVPowerDeliveryParameter_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":DC_EVPowerDeliveryParameter, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVPowerDeliveryParameterType', base type name='EVPowerDeliveryParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2010:MsgDataTypes":BulkChargingComplete{0-1},"urn:iso:15118:2:2010:MsgDataTypes":ChargingComplete)', derivedBy='EXTENSION'. */ + struct dinDC_EVPowerDeliveryParameterType DC_EVPowerDeliveryParameter ; + unsigned int DC_EVPowerDeliveryParameter_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,PreChargeResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ +struct dinPreChargeResType { + /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ + dinresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEStatusType', base type name='EVSEStatusType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatusCode,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)', derivedBy='EXTENSION'. */ + struct dinDC_EVSEStatusType DC_EVSEStatus ; + /* element: "urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)', derivedBy='RESTRICTION'. */ + struct dinPhysicalValueType EVSEPresentVoltage ; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinSignedInfoType_Id_CHARACTERS_SIZE 50 +#define dinSignedInfoType_Reference_ARRAY_SIZE 1 +struct dinSignedInfoType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[dinSignedInfoType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod, Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct dinCanonicalizationMethodType CanonicalizationMethod ; + /* element: "http://www.w3.org/2000/09/xmldsig#":SignatureMethod, Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct dinSignatureMethodType SignatureMethod ; + /* element: "http://www.w3.org/2000/09/xmldsig#":Reference, Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ + struct { + struct dinReferenceType array[dinSignedInfoType_Reference_ARRAY_SIZE]; + uint16_t arrayLen; + } Reference; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,MeteringReceiptReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":SessionID,"urn:iso:15118:2:2010:MsgBody":SAScheduleTupleID{0-1},"urn:iso:15118:2:2010:MsgBody":MeterInfo)', derivedBy='EXTENSION'. */ +#define dinMeteringReceiptReqType_Id_CHARACTERS_SIZE 50 +#define dinMeteringReceiptReqType_SessionID_BYTES_SIZE 8 /* XML schema facet length for urn:iso:15118:2:2010:MsgDataTypes,sessionIDType is 8 */ +struct dinMeteringReceiptReqType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,IDREF} */ + struct { + exi_string_character_t characters[dinMeteringReceiptReqType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgBody":SessionID, urn:iso:15118:2:2010:MsgDataTypes,sessionIDType */ + struct { + uint8_t bytes[dinMeteringReceiptReqType_SessionID_BYTES_SIZE]; + uint16_t bytesLen; + } SessionID ; + /* element: "urn:iso:15118:2:2010:MsgBody":SAScheduleTupleID, urn:iso:15118:2:2010:MsgDataTypes,SAIDType */ + int16_t SAScheduleTupleID ; + unsigned int SAScheduleTupleID_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgBody":MeterInfo, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,MeterInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":MeterID,"urn:iso:15118:2:2010:MsgDataTypes":MeterReading{0-1},"urn:iso:15118:2:2010:MsgDataTypes":SigMeterReading{0-1},"urn:iso:15118:2:2010:MsgDataTypes":MeterStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":TMeter{0-1})', derivedBy='RESTRICTION'. */ + struct dinMeterInfoType MeterInfo ; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyInfoType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":KeyName|"http://www.w3.org/2000/09/xmldsig#":KeyValue|"http://www.w3.org/2000/09/xmldsig#":RetrievalMethod|"http://www.w3.org/2000/09/xmldsig#":X509Data|"http://www.w3.org/2000/09/xmldsig#":PGPData|"http://www.w3.org/2000/09/xmldsig#":SPKIData|"http://www.w3.org/2000/09/xmldsig#":MgmtData|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ +#define dinKeyInfoType_Id_CHARACTERS_SIZE 50 +#define dinKeyInfoType_KeyName_CHARACTERS_SIZE 50 +#define dinKeyInfoType_KeyName_ARRAY_SIZE 1 +#define dinKeyInfoType_KeyValue_ARRAY_SIZE 1 +#define dinKeyInfoType_RetrievalMethod_ARRAY_SIZE 1 +#define dinKeyInfoType_X509Data_ARRAY_SIZE 1 +#define dinKeyInfoType_PGPData_ARRAY_SIZE 1 +#define dinKeyInfoType_SPKIData_ARRAY_SIZE 1 +#define dinKeyInfoType_MgmtData_CHARACTERS_SIZE 50 +#define dinKeyInfoType_MgmtData_ARRAY_SIZE 1 +struct dinKeyInfoType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[dinKeyInfoType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":KeyName, http://www.w3.org/2001/XMLSchema,string */ + struct { + struct { + exi_string_character_t characters[dinKeyInfoType_KeyName_CHARACTERS_SIZE]; + uint16_t charactersLen; + } array[dinKeyInfoType_KeyName_ARRAY_SIZE]; + uint16_t arrayLen; + } KeyName; + /* element: "http://www.w3.org/2000/09/xmldsig#":KeyValue, Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyValueType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":DSAKeyValue|"http://www.w3.org/2000/09/xmldsig#":RSAKeyValue|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))', derivedBy='RESTRICTION'. */ + struct { + struct dinKeyValueType array[dinKeyInfoType_KeyValue_ARRAY_SIZE]; + uint16_t arrayLen; + } KeyValue; + /* element: "http://www.w3.org/2000/09/xmldsig#":RetrievalMethod, Complex type name='http://www.w3.org/2000/09/xmldsig#,RetrievalMethodType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1})', derivedBy='RESTRICTION'. */ + struct { + struct dinRetrievalMethodType array[dinKeyInfoType_RetrievalMethod_ARRAY_SIZE]; + uint16_t arrayLen; + } RetrievalMethod; + /* element: "http://www.w3.org/2000/09/xmldsig#":X509Data, Complex type name='http://www.w3.org/2000/09/xmldsig#,X509DataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial|"http://www.w3.org/2000/09/xmldsig#":X509SKI|"http://www.w3.org/2000/09/xmldsig#":X509SubjectName|"http://www.w3.org/2000/09/xmldsig#":X509Certificate|"http://www.w3.org/2000/09/xmldsig#":X509CRL|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ + struct { + struct dinX509DataType array[dinKeyInfoType_X509Data_ARRAY_SIZE]; + uint16_t arrayLen; + } X509Data; + /* element: "http://www.w3.org/2000/09/xmldsig#":PGPData, Complex type name='http://www.w3.org/2000/09/xmldsig#,PGPDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("http://www.w3.org/2000/09/xmldsig#":PGPKeyID,"http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})|("http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED}))', derivedBy='RESTRICTION'. */ + struct { + struct dinPGPDataType array[dinKeyInfoType_PGPData_ARRAY_SIZE]; + uint16_t arrayLen; + } PGPData; + /* element: "http://www.w3.org/2000/09/xmldsig#":SPKIData, Complex type name='http://www.w3.org/2000/09/xmldsig#,SPKIDataType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SPKISexp,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-1}){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ + struct { + struct dinSPKIDataType array[dinKeyInfoType_SPKIData_ARRAY_SIZE]; + uint16_t arrayLen; + } SPKIData; + /* element: "http://www.w3.org/2000/09/xmldsig#":MgmtData, http://www.w3.org/2001/XMLSchema,string */ + struct { + struct { + exi_string_character_t characters[dinKeyInfoType_MgmtData_CHARACTERS_SIZE]; + uint16_t charactersLen; + } array[dinKeyInfoType_MgmtData_ARRAY_SIZE]; + uint16_t arrayLen; + } MgmtData; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":PaymentOptions,"urn:iso:15118:2:2010:MsgBody":ChargeService,"urn:iso:15118:2:2010:MsgBody":ServiceList{0-1})', derivedBy='EXTENSION'. */ +struct dinServiceDiscoveryResType { + /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ + dinresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2010:MsgBody":PaymentOptions, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PaymentOptionsType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":PaymentOption{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct dinPaymentOptionsType PaymentOptions ; + /* element: "urn:iso:15118:2:2010:MsgBody":ChargeService, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceChargeType', base type name='ServiceType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='(("urn:iso:15118:2:2010:MsgDataTypes":ServiceTag,"urn:iso:15118:2:2010:MsgDataTypes":FreeService),("urn:iso:15118:2:2010:MsgDataTypes":EnergyTransferType))', derivedBy='EXTENSION'. */ + struct dinServiceChargeType ChargeService ; + /* element: "urn:iso:15118:2:2010:MsgBody":ServiceList, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceTagListType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":Service{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct dinServiceTagListType ServiceList ; + unsigned int ServiceList_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,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'. */ +#define dinSalesTariffType_Id_CHARACTERS_SIZE 50 +#define dinSalesTariffType_SalesTariffDescription_CHARACTERS_SIZE 32 /* XML schema facet maxLength for urn:iso:15118:2:2010:MsgDataTypes,tariffDescriptionType is 32 */ +#define dinSalesTariffType_SalesTariffEntry_ARRAY_SIZE 5 +struct dinSalesTariffType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,IDREF} */ + struct { + exi_string_character_t characters[dinSalesTariffType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":SalesTariffID, urn:iso:15118:2:2010:MsgDataTypes,SAIDType */ + int16_t SalesTariffID ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":SalesTariffDescription, urn:iso:15118:2:2010:MsgDataTypes,tariffDescriptionType */ + struct { + exi_string_character_t characters[dinSalesTariffType_SalesTariffDescription_CHARACTERS_SIZE]; + uint16_t charactersLen; + } SalesTariffDescription ; + unsigned int SalesTariffDescription_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":NumEPriceLevels, http://www.w3.org/2001/XMLSchema,unsignedByte */ + uint8_t NumEPriceLevels ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":SalesTariffEntry, 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'. */ + struct { + struct dinSalesTariffEntryType array[dinSalesTariffType_SalesTariffEntry_ARRAY_SIZE]; + uint16_t arrayLen; + } SalesTariffEntry; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargeParameterDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":EVRequestedEnergyTransferType,"urn:iso:15118:2:2010:MsgDataTypes":EVChargeParameter)', derivedBy='EXTENSION'. */ +struct dinChargeParameterDiscoveryReqType { + /* element: "urn:iso:15118:2:2010:MsgBody":EVRequestedEnergyTransferType, urn:iso:15118:2:2010:MsgDataTypes,EVRequestedEnergyTransferType */ + dinEVRequestedEnergyTransferType EVRequestedEnergyTransferType ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVChargeParameter, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ + struct dinEVChargeParameterType EVChargeParameter ; + unsigned int EVChargeParameter_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":AC_EVChargeParameter, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DepartureTime,"urn:iso:15118:2:2010:MsgDataTypes":EAmount,"urn:iso:15118:2:2010:MsgDataTypes":EVMaxVoltage,"urn:iso:15118:2:2010:MsgDataTypes":EVMaxCurrent,"urn:iso:15118:2:2010:MsgDataTypes":EVMinCurrent)', derivedBy='EXTENSION'. */ + struct dinAC_EVChargeParameterType AC_EVChargeParameter ; + unsigned int AC_EVChargeParameter_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":DC_EVChargeParameter, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVChargeParameterType', base type name='EVChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVEnergyCapacity{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVEnergyRequest{0-1},"urn:iso:15118:2:2010:MsgDataTypes":FullSOC{0-1},"urn:iso:15118:2:2010:MsgDataTypes":BulkSOC{0-1})', derivedBy='EXTENSION'. */ + struct dinDC_EVChargeParameterType DC_EVChargeParameter ; + unsigned int DC_EVChargeParameter_isUsed:1; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ManifestType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinManifestType_Id_CHARACTERS_SIZE 50 +#define dinManifestType_Reference_ARRAY_SIZE 1 +struct dinManifestType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[dinManifestType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":Reference, Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)', derivedBy='RESTRICTION'. */ + struct { + struct dinReferenceType array[dinManifestType_Reference_ARRAY_SIZE]; + uint16_t arrayLen; + } Reference; +}; + +/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignedInfo,"http://www.w3.org/2000/09/xmldsig#":SignatureValue,"http://www.w3.org/2000/09/xmldsig#":KeyInfo{0-1},"http://www.w3.org/2000/09/xmldsig#":Object{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ +#define dinSignatureType_Id_CHARACTERS_SIZE 50 +#define dinSignatureType_Object_ARRAY_SIZE 1 +struct dinSignatureType { + /* attribute: Id {http://www.w3.org/2001/XMLSchema,ID} */ + struct { + exi_string_character_t characters[dinSignatureType_Id_CHARACTERS_SIZE]; + uint16_t charactersLen; + } Id ; + unsigned int Id_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":SignedInfo, Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct dinSignedInfoType SignedInfo ; + /* element: "http://www.w3.org/2000/09/xmldsig#":SignatureValue, Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType', base type name='base64Binary', content type='SIMPLE', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ + struct dinSignatureValueType SignatureValue ; + /* element: "http://www.w3.org/2000/09/xmldsig#":KeyInfo, Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyInfoType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":KeyName|"http://www.w3.org/2000/09/xmldsig#":KeyValue|"http://www.w3.org/2000/09/xmldsig#":RetrievalMethod|"http://www.w3.org/2000/09/xmldsig#":X509Data|"http://www.w3.org/2000/09/xmldsig#":PGPData|"http://www.w3.org/2000/09/xmldsig#":SPKIData|"http://www.w3.org/2000/09/xmldsig#":MgmtData|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}', derivedBy='RESTRICTION'. */ + struct dinKeyInfoType KeyInfo ; + unsigned int KeyInfo_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":Object, Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType', base type name='anyType', content type='MIXED', isAbstract='false', hasTypeId='false', final='0', block='0', particle='((WC[##any])){0-UNBOUNDED}', derivedBy='RESTRICTION'. */ + struct { + struct dinObjectType array[dinSignatureType_Object_ARRAY_SIZE]; + uint16_t arrayLen; + } Object; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SAScheduleTupleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgDataTypes":PMaxSchedule,"urn:iso:15118:2:2010:MsgDataTypes":SalesTariff{0-1})', derivedBy='RESTRICTION'. */ +struct dinSAScheduleTupleType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTupleID, urn:iso:15118:2:2010:MsgDataTypes,SAIDType */ + int16_t SAScheduleTupleID ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":PMaxSchedule, 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'. */ + struct dinPMaxScheduleType PMaxSchedule ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":SalesTariff, 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'. */ + struct dinSalesTariffType SalesTariff ; + unsigned int SalesTariff_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgHeader,MessageHeaderType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgHeader":SessionID,"urn:iso:15118:2:2010:MsgHeader":Notification{0-1},"http://www.w3.org/2000/09/xmldsig#":Signature{0-1})', derivedBy='RESTRICTION'. */ +#define dinMessageHeaderType_SessionID_BYTES_SIZE 8 /* XML schema facet length for urn:iso:15118:2:2010:MsgDataTypes,sessionIDType is 8 */ +struct dinMessageHeaderType { + /* element: "urn:iso:15118:2:2010:MsgHeader":SessionID, urn:iso:15118:2:2010:MsgDataTypes,sessionIDType */ + struct { + uint8_t bytes[dinMessageHeaderType_SessionID_BYTES_SIZE]; + uint16_t bytesLen; + } SessionID ; + /* element: "urn:iso:15118:2:2010:MsgHeader":Notification, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,NotificationType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":FaultCode,"urn:iso:15118:2:2010:MsgDataTypes":FaultMsg{0-1})', derivedBy='RESTRICTION'. */ + struct dinNotificationType Notification ; + unsigned int Notification_isUsed:1; + /* element: "http://www.w3.org/2000/09/xmldsig#":Signature, Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("http://www.w3.org/2000/09/xmldsig#":SignedInfo,"http://www.w3.org/2000/09/xmldsig#":SignatureValue,"http://www.w3.org/2000/09/xmldsig#":KeyInfo{0-1},"http://www.w3.org/2000/09/xmldsig#":Object{0-UNBOUNDED})', derivedBy='RESTRICTION'. */ + struct dinSignatureType Signature ; + unsigned int Signature_isUsed:1; +}; + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,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'. */ +#define dinSAScheduleListType_SAScheduleTuple_ARRAY_SIZE 5 +struct dinSAScheduleListType { + /* element: "urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTuple, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SAScheduleTupleType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgDataTypes":PMaxSchedule,"urn:iso:15118:2:2010:MsgDataTypes":SalesTariff{0-1})', derivedBy='RESTRICTION'. */ + struct { + struct dinSAScheduleTupleType array[dinSAScheduleListType_SAScheduleTuple_ARRAY_SIZE]; + uint16_t arrayLen; + } SAScheduleTuple; +}; + +/* 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'. */ +struct dinChargeParameterDiscoveryResType { + /* element: "urn:iso:15118:2:2010:MsgBody":ResponseCode, urn:iso:15118:2:2010:MsgDataTypes,responseCodeType */ + dinresponseCodeType ResponseCode ; + /* element: "urn:iso:15118:2:2010:MsgBody":EVSEProcessing, urn:iso:15118:2:2010:MsgDataTypes,EVSEProcessingType */ + dinEVSEProcessingType EVSEProcessing ; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":SASchedules, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SASchedulesType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ + struct dinSASchedulesType SASchedules ; + unsigned int SASchedules_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":SAScheduleList, 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'. */ + struct dinSAScheduleListType SAScheduleList ; + unsigned int SAScheduleList_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":EVSEChargeParameter, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVSEChargeParameterType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ + struct dinEVSEChargeParameterType EVSEChargeParameter ; + unsigned int EVSEChargeParameter_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":AC_EVSEChargeParameter, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":AC_EVSEStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaxVoltage,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaxCurrent,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinCurrent)', derivedBy='EXTENSION'. */ + struct dinAC_EVSEChargeParameterType AC_EVSEChargeParameter ; + unsigned int AC_EVSEChargeParameter_isUsed:1; + /* element: "urn:iso:15118:2:2010:MsgDataTypes":DC_EVSEChargeParameter, Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEChargeParameterType', base type name='EVSEChargeParameterType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinimumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinimumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSECurrentRegulationTolerance{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEPeakCurrentRipple,"urn:iso:15118:2:2010:MsgDataTypes":EVSEEnergyToBeDelivered{0-1})', derivedBy='EXTENSION'. */ + struct dinDC_EVSEChargeParameterType DC_EVSEChargeParameter ; + unsigned int DC_EVSEChargeParameter_isUsed:1; +}; + +/* 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'. */ +struct dinBodyType { + union { /* substitutionGroup */ + /* element: "urn:iso:15118:2:2010:MsgDef":BodyElement, Complex type name='urn:iso:15118:2:2010:MsgDef,BodyBaseType', base type name='anyType', content type='EMPTY', isAbstract='true', hasTypeId='false', final='0', block='0', derivedBy='RESTRICTION'. */ + struct dinBodyBaseType BodyElement ; + /* element: "urn:iso:15118:2:2010:MsgBody":SessionSetupReq, 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'. */ + struct dinSessionSetupReqType SessionSetupReq ; + /* element: "urn:iso:15118:2:2010:MsgBody":SessionSetupRes, 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'. */ + struct dinSessionSetupResType SessionSetupRes ; + /* element: "urn:iso:15118:2:2010:MsgBody":ServiceDiscoveryReq, 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'. */ + struct dinServiceDiscoveryReqType ServiceDiscoveryReq ; + /* element: "urn:iso:15118:2:2010:MsgBody":ServiceDiscoveryRes, Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDiscoveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":PaymentOptions,"urn:iso:15118:2:2010:MsgBody":ChargeService,"urn:iso:15118:2:2010:MsgBody":ServiceList{0-1})', derivedBy='EXTENSION'. */ + struct dinServiceDiscoveryResType ServiceDiscoveryRes ; + /* element: "urn:iso:15118:2:2010:MsgBody":ServiceDetailReq, Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDetailReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ServiceID)', derivedBy='EXTENSION'. */ + struct dinServiceDetailReqType ServiceDetailReq ; + /* element: "urn:iso:15118:2:2010:MsgBody":ServiceDetailRes, Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDetailResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ServiceID,"urn:iso:15118:2:2010:MsgBody":ServiceParameterList{0-1})', derivedBy='EXTENSION'. */ + struct dinServiceDetailResType ServiceDetailRes ; + /* element: "urn:iso:15118:2:2010:MsgBody":ServicePaymentSelectionReq, Complex type name='urn:iso:15118:2:2010:MsgBody,ServicePaymentSelectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":SelectedPaymentOption,"urn:iso:15118:2:2010:MsgBody":SelectedServiceList)', derivedBy='EXTENSION'. */ + struct dinServicePaymentSelectionReqType ServicePaymentSelectionReq ; + /* element: "urn:iso:15118:2:2010:MsgBody":ServicePaymentSelectionRes, Complex type name='urn:iso:15118:2:2010:MsgBody,ServicePaymentSelectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ + struct dinServicePaymentSelectionResType ServicePaymentSelectionRes ; + /* element: "urn:iso:15118:2:2010:MsgBody":PaymentDetailsReq, 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'. */ + struct dinPaymentDetailsReqType PaymentDetailsReq ; + /* element: "urn:iso:15118:2:2010:MsgBody":PaymentDetailsRes, 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'. */ + struct dinPaymentDetailsResType PaymentDetailsRes ; + /* element: "urn:iso:15118:2:2010:MsgBody":ContractAuthenticationReq, 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'. */ + struct dinContractAuthenticationReqType ContractAuthenticationReq ; + /* element: "urn:iso:15118:2:2010:MsgBody":ContractAuthenticationRes, Complex type name='urn:iso:15118:2:2010:MsgBody,ContractAuthenticationResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ + struct dinContractAuthenticationResType ContractAuthenticationRes ; + /* element: "urn:iso:15118:2:2010:MsgBody":ChargeParameterDiscoveryReq, Complex type name='urn:iso:15118:2:2010:MsgBody,ChargeParameterDiscoveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":EVRequestedEnergyTransferType,"urn:iso:15118:2:2010:MsgDataTypes":EVChargeParameter)', derivedBy='EXTENSION'. */ + struct dinChargeParameterDiscoveryReqType ChargeParameterDiscoveryReq ; + /* element: "urn:iso:15118:2:2010:MsgBody":ChargeParameterDiscoveryRes, 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'. */ + struct dinChargeParameterDiscoveryResType ChargeParameterDiscoveryRes ; + /* element: "urn:iso:15118:2:2010:MsgBody":PowerDeliveryReq, Complex type name='urn:iso:15118:2:2010:MsgBody,PowerDeliveryReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ReadyToChargeState,"urn:iso:15118:2:2010:MsgBody":ChargingProfile{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVPowerDeliveryParameter{0-1})', derivedBy='EXTENSION'. */ + struct dinPowerDeliveryReqType PowerDeliveryReq ; + /* element: "urn:iso:15118:2:2010:MsgBody":PowerDeliveryRes, Complex type name='urn:iso:15118:2:2010:MsgBody,PowerDeliveryResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatus)', derivedBy='EXTENSION'. */ + struct dinPowerDeliveryResType PowerDeliveryRes ; + /* element: "urn:iso:15118:2:2010:MsgBody":ChargingStatusReq, Complex type name='urn:iso:15118:2:2010:MsgBody,ChargingStatusReqType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ + struct dinChargingStatusReqType ChargingStatusReq ; + /* element: "urn:iso:15118:2:2010:MsgBody":ChargingStatusRes, 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'. */ + struct dinChargingStatusResType ChargingStatusRes ; + /* element: "urn:iso:15118:2:2010:MsgBody":MeteringReceiptReq, 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'. */ + struct dinMeteringReceiptReqType MeteringReceiptReq ; + /* element: "urn:iso:15118:2:2010:MsgBody":MeteringReceiptRes, Complex type name='urn:iso:15118:2:2010:MsgBody,MeteringReceiptResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":AC_EVSEStatus)', derivedBy='EXTENSION'. */ + struct dinMeteringReceiptResType MeteringReceiptRes ; + /* element: "urn:iso:15118:2:2010:MsgBody":SessionStopReq, Complex type name='urn:iso:15118:2:2010:MsgBody,SessionStopType', base type name='BodyBaseType', content type='EMPTY', isAbstract='false', hasTypeId='false', final='0', block='0', derivedBy='EXTENSION'. */ + struct dinSessionStopType SessionStopReq ; + /* element: "urn:iso:15118:2:2010:MsgBody":SessionStopRes, Complex type name='urn:iso:15118:2:2010:MsgBody,SessionStopResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode)', derivedBy='EXTENSION'. */ + struct dinSessionStopResType SessionStopRes ; + /* element: "urn:iso:15118:2:2010:MsgBody":CertificateUpdateReq, 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'. */ + struct dinCertificateUpdateReqType CertificateUpdateReq ; + /* element: "urn:iso:15118:2:2010:MsgBody":CertificateUpdateRes, 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'. */ + struct dinCertificateUpdateResType CertificateUpdateRes ; + /* element: "urn:iso:15118:2:2010:MsgBody":CertificateInstallationReq, 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'. */ + struct dinCertificateInstallationReqType CertificateInstallationReq ; + /* element: "urn:iso:15118:2:2010:MsgBody":CertificateInstallationRes, 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'. */ + struct dinCertificateInstallationResType CertificateInstallationRes ; + /* element: "urn:iso:15118:2:2010:MsgBody":CableCheckReq, Complex type name='urn:iso:15118:2:2010:MsgBody,CableCheckReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ + struct dinCableCheckReqType CableCheckReq ; + /* element: "urn:iso:15118:2:2010:MsgBody":CableCheckRes, Complex type name='urn:iso:15118:2:2010:MsgBody,CableCheckResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEProcessing)', derivedBy='EXTENSION'. */ + struct dinCableCheckResType CableCheckRes ; + /* element: "urn:iso:15118:2:2010:MsgBody":PreChargeReq, Complex type name='urn:iso:15118:2:2010:MsgBody,PreChargeReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus,"urn:iso:15118:2:2010:MsgBody":EVTargetVoltage,"urn:iso:15118:2:2010:MsgBody":EVTargetCurrent)', derivedBy='EXTENSION'. */ + struct dinPreChargeReqType PreChargeReq ; + /* element: "urn:iso:15118:2:2010:MsgBody":PreChargeRes, Complex type name='urn:iso:15118:2:2010:MsgBody,PreChargeResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ + struct dinPreChargeResType PreChargeRes ; + /* element: "urn:iso:15118:2:2010:MsgBody":CurrentDemandReq, 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'. */ + struct dinCurrentDemandReqType CurrentDemandReq ; + /* element: "urn:iso:15118:2:2010:MsgBody":CurrentDemandRes, Complex type name='urn:iso:15118:2:2010:MsgBody,CurrentDemandResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage,"urn:iso:15118:2:2010:MsgBody":EVSEPresentCurrent,"urn:iso:15118:2:2010:MsgBody":EVSECurrentLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEVoltageLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEPowerLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEMaximumVoltageLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVSEMaximumCurrentLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVSEMaximumPowerLimit{0-1})', derivedBy='EXTENSION'. */ + struct dinCurrentDemandResType CurrentDemandRes ; + /* element: "urn:iso:15118:2:2010:MsgBody":WeldingDetectionReq, Complex type name='urn:iso:15118:2:2010:MsgBody,WeldingDetectionReqType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus)', derivedBy='EXTENSION'. */ + struct dinWeldingDetectionReqType WeldingDetectionReq ; + /* element: "urn:iso:15118:2:2010:MsgBody":WeldingDetectionRes, Complex type name='urn:iso:15118:2:2010:MsgBody,WeldingDetectionResType', base type name='BodyBaseType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage)', derivedBy='EXTENSION'. */ + struct dinWeldingDetectionResType WeldingDetectionRes ; + }; /* union */ + unsigned int BodyElement_isUsed:1; + unsigned int SessionSetupReq_isUsed:1; + unsigned int SessionSetupRes_isUsed:1; + unsigned int ServiceDiscoveryReq_isUsed:1; + unsigned int ServiceDiscoveryRes_isUsed:1; + unsigned int ServiceDetailReq_isUsed:1; + unsigned int ServiceDetailRes_isUsed:1; + unsigned int ServicePaymentSelectionReq_isUsed:1; + unsigned int ServicePaymentSelectionRes_isUsed:1; + unsigned int PaymentDetailsReq_isUsed:1; + unsigned int PaymentDetailsRes_isUsed:1; + unsigned int ContractAuthenticationReq_isUsed:1; + unsigned int ContractAuthenticationRes_isUsed:1; + unsigned int ChargeParameterDiscoveryReq_isUsed:1; + unsigned int ChargeParameterDiscoveryRes_isUsed:1; + unsigned int PowerDeliveryReq_isUsed:1; + unsigned int PowerDeliveryRes_isUsed:1; + unsigned int ChargingStatusReq_isUsed:1; + unsigned int ChargingStatusRes_isUsed:1; + unsigned int MeteringReceiptReq_isUsed:1; + unsigned int MeteringReceiptRes_isUsed:1; + unsigned int SessionStopReq_isUsed:1; + unsigned int SessionStopRes_isUsed:1; + unsigned int CertificateUpdateReq_isUsed:1; + unsigned int CertificateUpdateRes_isUsed:1; + unsigned int CertificateInstallationReq_isUsed:1; + unsigned int CertificateInstallationRes_isUsed:1; + unsigned int CableCheckReq_isUsed:1; + unsigned int CableCheckRes_isUsed:1; + unsigned int PreChargeReq_isUsed:1; + unsigned int PreChargeRes_isUsed:1; + unsigned int CurrentDemandReq_isUsed:1; + unsigned int CurrentDemandRes_isUsed:1; + unsigned int WeldingDetectionReq_isUsed:1; + unsigned int WeldingDetectionRes_isUsed:1; +}; + +/* 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'. */ +struct dinAnonType_V2G_Message { + /* element: "urn:iso:15118:2:2010:MsgDef":Header, 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'. */ + struct dinMessageHeaderType Header ; + /* element: "urn:iso:15118:2:2010:MsgDef":Body, 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'. */ + struct dinBodyType Body ; +}; + + + +#define EXIDocument_MgmtData_CHARACTERS_SIZE 50 +#define EXIDocument_KeyName_CHARACTERS_SIZE 50 +#define EXIDocument_DigestValue_BYTES_SIZE 350 + + +/* Possible root elements of EXI Document */ +struct dinEXIDocument { +#define USE_UNION_FOR_GLOBAL_ELEMENTS 1 +#ifdef USE_UNION_FOR_GLOBAL_ELEMENTS + union { +#endif + struct dinBodyBaseType BodyElement ; + struct dinAnonType_V2G_Message V2G_Message ; + struct dinSignaturePropertyType SignatureProperty ; + struct dinDSAKeyValueType DSAKeyValue ; + struct dinSignaturePropertiesType SignatureProperties ; + struct dinKeyValueType KeyValue ; + struct dinTransformsType Transforms ; + struct dinDigestMethodType DigestMethod ; + struct dinSignatureType Signature ; + struct dinRetrievalMethodType RetrievalMethod ; + struct dinManifestType Manifest ; + struct dinReferenceType Reference ; + struct dinCanonicalizationMethodType CanonicalizationMethod ; + struct dinRSAKeyValueType RSAKeyValue ; + struct dinTransformType Transform ; + struct dinPGPDataType PGPData ; + struct { + exi_string_character_t characters[EXIDocument_MgmtData_CHARACTERS_SIZE]; + uint16_t charactersLen; + } MgmtData ; + struct dinSignatureMethodType SignatureMethod ; + struct dinKeyInfoType KeyInfo ; + struct dinSPKIDataType SPKIData ; + struct dinX509DataType X509Data ; + struct dinSignatureValueType SignatureValue ; + struct { + exi_string_character_t characters[EXIDocument_KeyName_CHARACTERS_SIZE]; + uint16_t charactersLen; + } KeyName ; + struct { + uint8_t bytes[EXIDocument_DigestValue_BYTES_SIZE]; + uint16_t bytesLen; + } DigestValue ; + struct dinSignedInfoType SignedInfo ; + struct dinObjectType Object ; + struct dinDC_EVSEStatusType DC_EVSEStatus ; + struct dinRelativeTimeIntervalType RelativeTimeInterval ; + struct dinSalesTariffEntryType SalesTariffEntry ; + struct dinDC_EVPowerDeliveryParameterType DC_EVPowerDeliveryParameter ; + struct dinSASchedulesType SASchedules ; + struct dinAC_EVChargeParameterType AC_EVChargeParameter ; + struct dinSAScheduleListType SAScheduleList ; + struct dinDC_EVStatusType DC_EVStatus ; + struct dinServiceChargeType ServiceCharge ; + struct dinEVStatusType EVStatus ; + struct dinDC_EVChargeParameterType DC_EVChargeParameter ; + struct dinDC_EVSEChargeParameterType DC_EVSEChargeParameter ; + struct dinEVSEStatusType EVSEStatus ; + struct dinIntervalType TimeInterval ; + struct dinEVPowerDeliveryParameterType EVPowerDeliveryParameter ; + struct dinEVSEChargeParameterType EVSEChargeParameter ; + struct dinAC_EVSEStatusType AC_EVSEStatus ; + struct dinEntryType Entry ; + struct dinAC_EVSEChargeParameterType AC_EVSEChargeParameter ; + struct dinPMaxScheduleEntryType PMaxScheduleEntry ; + struct dinEVChargeParameterType EVChargeParameter ; + struct dinServiceDiscoveryReqType ServiceDiscoveryReq ; + struct dinServiceDiscoveryResType ServiceDiscoveryRes ; + struct dinMeteringReceiptReqType MeteringReceiptReq ; + struct dinPaymentDetailsReqType PaymentDetailsReq ; + struct dinMeteringReceiptResType MeteringReceiptRes ; + struct dinPaymentDetailsResType PaymentDetailsRes ; + struct dinSessionSetupReqType SessionSetupReq ; + struct dinSessionSetupResType SessionSetupRes ; + struct dinCableCheckReqType CableCheckReq ; + struct dinCableCheckResType CableCheckRes ; + struct dinContractAuthenticationReqType ContractAuthenticationReq ; + struct dinCertificateInstallationReqType CertificateInstallationReq ; + struct dinContractAuthenticationResType ContractAuthenticationRes ; + struct dinCertificateInstallationResType CertificateInstallationRes ; + struct dinWeldingDetectionReqType WeldingDetectionReq ; + struct dinWeldingDetectionResType WeldingDetectionRes ; + struct dinCertificateUpdateReqType CertificateUpdateReq ; + struct dinCertificateUpdateResType CertificateUpdateRes ; + struct dinPowerDeliveryReqType PowerDeliveryReq ; + struct dinPowerDeliveryResType PowerDeliveryRes ; + struct dinChargingStatusReqType ChargingStatusReq ; + struct dinChargingStatusResType ChargingStatusRes ; + struct dinCurrentDemandReqType CurrentDemandReq ; + struct dinPreChargeReqType PreChargeReq ; + struct dinCurrentDemandResType CurrentDemandRes ; + struct dinPreChargeResType PreChargeRes ; + struct dinServicePaymentSelectionReqType ServicePaymentSelectionReq ; + struct dinSessionStopType SessionStopReq ; + struct dinServicePaymentSelectionResType ServicePaymentSelectionRes ; + struct dinSessionStopResType SessionStopRes ; + struct dinChargeParameterDiscoveryReqType ChargeParameterDiscoveryReq ; + struct dinChargeParameterDiscoveryResType ChargeParameterDiscoveryRes ; + struct dinServiceDetailReqType ServiceDetailReq ; + struct dinServiceDetailResType ServiceDetailRes ; +#ifdef USE_UNION_FOR_GLOBAL_ELEMENTS + }; +#endif + unsigned int BodyElement_isUsed:1; + unsigned int V2G_Message_isUsed:1; + unsigned int SignatureProperty_isUsed:1; + unsigned int DSAKeyValue_isUsed:1; + unsigned int SignatureProperties_isUsed:1; + unsigned int KeyValue_isUsed:1; + unsigned int Transforms_isUsed:1; + unsigned int DigestMethod_isUsed:1; + unsigned int Signature_isUsed:1; + unsigned int RetrievalMethod_isUsed:1; + unsigned int Manifest_isUsed:1; + unsigned int Reference_isUsed:1; + unsigned int CanonicalizationMethod_isUsed:1; + unsigned int RSAKeyValue_isUsed:1; + unsigned int Transform_isUsed:1; + unsigned int PGPData_isUsed:1; + unsigned int MgmtData_isUsed:1; + unsigned int SignatureMethod_isUsed:1; + unsigned int KeyInfo_isUsed:1; + unsigned int SPKIData_isUsed:1; + unsigned int X509Data_isUsed:1; + unsigned int SignatureValue_isUsed:1; + unsigned int KeyName_isUsed:1; + unsigned int DigestValue_isUsed:1; + unsigned int SignedInfo_isUsed:1; + unsigned int Object_isUsed:1; + unsigned int DC_EVSEStatus_isUsed:1; + unsigned int RelativeTimeInterval_isUsed:1; + unsigned int SalesTariffEntry_isUsed:1; + unsigned int DC_EVPowerDeliveryParameter_isUsed:1; + unsigned int SASchedules_isUsed:1; + unsigned int AC_EVChargeParameter_isUsed:1; + unsigned int SAScheduleList_isUsed:1; + unsigned int DC_EVStatus_isUsed:1; + unsigned int ServiceCharge_isUsed:1; + unsigned int EVStatus_isUsed:1; + unsigned int DC_EVChargeParameter_isUsed:1; + unsigned int DC_EVSEChargeParameter_isUsed:1; + unsigned int EVSEStatus_isUsed:1; + unsigned int TimeInterval_isUsed:1; + unsigned int EVPowerDeliveryParameter_isUsed:1; + unsigned int EVSEChargeParameter_isUsed:1; + unsigned int AC_EVSEStatus_isUsed:1; + unsigned int Entry_isUsed:1; + unsigned int AC_EVSEChargeParameter_isUsed:1; + unsigned int PMaxScheduleEntry_isUsed:1; + unsigned int EVChargeParameter_isUsed:1; + unsigned int ServiceDiscoveryReq_isUsed:1; + unsigned int ServiceDiscoveryRes_isUsed:1; + unsigned int MeteringReceiptReq_isUsed:1; + unsigned int PaymentDetailsReq_isUsed:1; + unsigned int MeteringReceiptRes_isUsed:1; + unsigned int PaymentDetailsRes_isUsed:1; + unsigned int SessionSetupReq_isUsed:1; + unsigned int SessionSetupRes_isUsed:1; + unsigned int CableCheckReq_isUsed:1; + unsigned int CableCheckRes_isUsed:1; + unsigned int ContractAuthenticationReq_isUsed:1; + unsigned int CertificateInstallationReq_isUsed:1; + unsigned int ContractAuthenticationRes_isUsed:1; + unsigned int CertificateInstallationRes_isUsed:1; + unsigned int WeldingDetectionReq_isUsed:1; + unsigned int WeldingDetectionRes_isUsed:1; + unsigned int CertificateUpdateReq_isUsed:1; + unsigned int CertificateUpdateRes_isUsed:1; + unsigned int PowerDeliveryReq_isUsed:1; + unsigned int PowerDeliveryRes_isUsed:1; + unsigned int ChargingStatusReq_isUsed:1; + unsigned int ChargingStatusRes_isUsed:1; + unsigned int CurrentDemandReq_isUsed:1; + unsigned int PreChargeReq_isUsed:1; + unsigned int CurrentDemandRes_isUsed:1; + unsigned int PreChargeRes_isUsed:1; + unsigned int ServicePaymentSelectionReq_isUsed:1; + unsigned int SessionStopReq_isUsed:1; + unsigned int ServicePaymentSelectionRes_isUsed:1; + unsigned int SessionStopRes_isUsed:1; + unsigned int ChargeParameterDiscoveryReq_isUsed:1; + unsigned int ChargeParameterDiscoveryRes_isUsed:1; + unsigned int ServiceDetailReq_isUsed:1; + unsigned int ServiceDetailRes_isUsed:1; + + + int _warning_; +}; + +/* Initialization methods for structs */ + +void init_dinEXIDocument(struct dinEXIDocument* exiDoc); +void init_dinPreChargeReqType(struct dinPreChargeReqType* dinPreChargeReqType); +void init_dinNotificationType(struct dinNotificationType* dinNotificationType); +void init_dinServiceTagType(struct dinServiceTagType* dinServiceTagType); +void init_dinCostType(struct dinCostType* dinCostType); +void init_dinX509DataType(struct dinX509DataType* dinX509DataType); +void init_dinBodyType(struct dinBodyType* dinBodyType); +void init_dinRetrievalMethodType(struct dinRetrievalMethodType* dinRetrievalMethodType); +void init_dinCertificateInstallationReqType(struct dinCertificateInstallationReqType* dinCertificateInstallationReqType); +void init_dinAC_EVChargeParameterType(struct dinAC_EVChargeParameterType* dinAC_EVChargeParameterType); +void init_dinObjectType(struct dinObjectType* dinObjectType); +void init_dinContractAuthenticationResType(struct dinContractAuthenticationResType* dinContractAuthenticationResType); +void init_dinChargingProfileType(struct dinChargingProfileType* dinChargingProfileType); +void init_dinCertificateUpdateResType(struct dinCertificateUpdateResType* dinCertificateUpdateResType); +void init_dinReferenceType(struct dinReferenceType* dinReferenceType); +void init_dinPMaxScheduleEntryType(struct dinPMaxScheduleEntryType* dinPMaxScheduleEntryType); +void init_dinServicePaymentSelectionReqType(struct dinServicePaymentSelectionReqType* dinServicePaymentSelectionReqType); +void init_dinCertificateInstallationResType(struct dinCertificateInstallationResType* dinCertificateInstallationResType); +void init_dinSelectedServiceType(struct dinSelectedServiceType* dinSelectedServiceType); +void init_dinDC_EVStatusType(struct dinDC_EVStatusType* dinDC_EVStatusType); +void init_dinPGPDataType(struct dinPGPDataType* dinPGPDataType); +void init_dinCurrentDemandResType(struct dinCurrentDemandResType* dinCurrentDemandResType); +void init_dinCableCheckReqType(struct dinCableCheckReqType* dinCableCheckReqType); +void init_dinChargingStatusResType(struct dinChargingStatusResType* dinChargingStatusResType); +void init_dinWeldingDetectionReqType(struct dinWeldingDetectionReqType* dinWeldingDetectionReqType); +void init_dinServiceParameterListType(struct dinServiceParameterListType* dinServiceParameterListType); +void init_dinCertificateChainType(struct dinCertificateChainType* dinCertificateChainType); +void init_dinPowerDeliveryResType(struct dinPowerDeliveryResType* dinPowerDeliveryResType); +void init_dinAC_EVSEChargeParameterType(struct dinAC_EVSEChargeParameterType* dinAC_EVSEChargeParameterType); +void init_dinAnonType_V2G_Message(struct dinAnonType_V2G_Message* dinAnonType_V2G_Message); +void init_dinConsumptionCostType(struct dinConsumptionCostType* dinConsumptionCostType); +void init_dinDC_EVSEStatusType(struct dinDC_EVSEStatusType* dinDC_EVSEStatusType); +void init_dinWeldingDetectionResType(struct dinWeldingDetectionResType* dinWeldingDetectionResType); +void init_dinSessionSetupReqType(struct dinSessionSetupReqType* dinSessionSetupReqType); +void init_dinSessionSetupResType(struct dinSessionSetupResType* dinSessionSetupResType); +void init_dinServiceDetailResType(struct dinServiceDetailResType* dinServiceDetailResType); +void init_dinSPKIDataType(struct dinSPKIDataType* dinSPKIDataType); +void init_dinPowerDeliveryReqType(struct dinPowerDeliveryReqType* dinPowerDeliveryReqType); +void init_dinPreChargeResType(struct dinPreChargeResType* dinPreChargeResType); +void init_dinCanonicalizationMethodType(struct dinCanonicalizationMethodType* dinCanonicalizationMethodType); +void init_dinServiceChargeType(struct dinServiceChargeType* dinServiceChargeType); +void init_dinEVChargeParameterType(struct dinEVChargeParameterType* dinEVChargeParameterType); +void init_dinSAScheduleListType(struct dinSAScheduleListType* dinSAScheduleListType); +void init_dinSASchedulesType(struct dinSASchedulesType* dinSASchedulesType); +void init_dinPhysicalValueType(struct dinPhysicalValueType* dinPhysicalValueType); +void init_dinSAScheduleTupleType(struct dinSAScheduleTupleType* dinSAScheduleTupleType); +void init_dinCertificateUpdateReqType(struct dinCertificateUpdateReqType* dinCertificateUpdateReqType); +void init_dinSignatureMethodType(struct dinSignatureMethodType* dinSignatureMethodType); +void init_dinDigestMethodType(struct dinDigestMethodType* dinDigestMethodType); +void init_dinKeyValueType(struct dinKeyValueType* dinKeyValueType); +void init_dinContractAuthenticationReqType(struct dinContractAuthenticationReqType* dinContractAuthenticationReqType); +void init_dinServiceDiscoveryReqType(struct dinServiceDiscoveryReqType* dinServiceDiscoveryReqType); +void init_dinServiceDetailReqType(struct dinServiceDetailReqType* dinServiceDetailReqType); +void init_dinSignedInfoType(struct dinSignedInfoType* dinSignedInfoType); +void init_dinMeteringReceiptReqType(struct dinMeteringReceiptReqType* dinMeteringReceiptReqType); +void init_dinX509IssuerSerialType(struct dinX509IssuerSerialType* dinX509IssuerSerialType); +void init_dinTransformsType(struct dinTransformsType* dinTransformsType); +void init_dinParameterType(struct dinParameterType* dinParameterType); +void init_dinIntervalType(struct dinIntervalType* dinIntervalType); +void init_dinRelativeTimeIntervalType(struct dinRelativeTimeIntervalType* dinRelativeTimeIntervalType); +void init_dinKeyInfoType(struct dinKeyInfoType* dinKeyInfoType); +void init_dinEntryType(struct dinEntryType* dinEntryType); +void init_dinEVStatusType(struct dinEVStatusType* dinEVStatusType); +void init_dinChargingStatusReqType(struct dinChargingStatusReqType* dinChargingStatusReqType); +void init_dinChargeParameterDiscoveryResType(struct dinChargeParameterDiscoveryResType* dinChargeParameterDiscoveryResType); +void init_dinPMaxScheduleType(struct dinPMaxScheduleType* dinPMaxScheduleType); +void init_dinDC_EVSEChargeParameterType(struct dinDC_EVSEChargeParameterType* dinDC_EVSEChargeParameterType); +void init_dinCableCheckResType(struct dinCableCheckResType* dinCableCheckResType); +void init_dinTransformType(struct dinTransformType* dinTransformType); +void init_dinParameterSetType(struct dinParameterSetType* dinParameterSetType); +void init_dinSubCertificatesType(struct dinSubCertificatesType* dinSubCertificatesType); +void init_dinDC_EVPowerDeliveryParameterType(struct dinDC_EVPowerDeliveryParameterType* dinDC_EVPowerDeliveryParameterType); +void init_dinPaymentDetailsReqType(struct dinPaymentDetailsReqType* dinPaymentDetailsReqType); +void init_dinDC_EVChargeParameterType(struct dinDC_EVChargeParameterType* dinDC_EVChargeParameterType); +void init_dinSelectedServiceListType(struct dinSelectedServiceListType* dinSelectedServiceListType); +void init_dinServiceDiscoveryResType(struct dinServiceDiscoveryResType* dinServiceDiscoveryResType); +void init_dinPaymentDetailsResType(struct dinPaymentDetailsResType* dinPaymentDetailsResType); +void init_dinServiceType(struct dinServiceType* dinServiceType); +void init_dinEVPowerDeliveryParameterType(struct dinEVPowerDeliveryParameterType* dinEVPowerDeliveryParameterType); +void init_dinBodyBaseType(struct dinBodyBaseType* dinBodyBaseType); +void init_dinCurrentDemandReqType(struct dinCurrentDemandReqType* dinCurrentDemandReqType); +void init_dinMeteringReceiptResType(struct dinMeteringReceiptResType* dinMeteringReceiptResType); +void init_dinPaymentOptionsType(struct dinPaymentOptionsType* dinPaymentOptionsType); +void init_dinMessageHeaderType(struct dinMessageHeaderType* dinMessageHeaderType); +void init_dinAC_EVSEStatusType(struct dinAC_EVSEStatusType* dinAC_EVSEStatusType); +void init_dinSalesTariffType(struct dinSalesTariffType* dinSalesTariffType); +void init_dinChargeParameterDiscoveryReqType(struct dinChargeParameterDiscoveryReqType* dinChargeParameterDiscoveryReqType); +void init_dinServicePaymentSelectionResType(struct dinServicePaymentSelectionResType* dinServicePaymentSelectionResType); +void init_dinEVSEStatusType(struct dinEVSEStatusType* dinEVSEStatusType); +void init_dinManifestType(struct dinManifestType* dinManifestType); +void init_dinListOfRootCertificateIDsType(struct dinListOfRootCertificateIDsType* dinListOfRootCertificateIDsType); +void init_dinServiceTagListType(struct dinServiceTagListType* dinServiceTagListType); +void init_dinRSAKeyValueType(struct dinRSAKeyValueType* dinRSAKeyValueType); +void init_dinEVSEChargeParameterType(struct dinEVSEChargeParameterType* dinEVSEChargeParameterType); +void init_dinSignaturePropertiesType(struct dinSignaturePropertiesType* dinSignaturePropertiesType); +void init_dinDSAKeyValueType(struct dinDSAKeyValueType* dinDSAKeyValueType); +void init_dinProfileEntryType(struct dinProfileEntryType* dinProfileEntryType); +void init_dinSignatureValueType(struct dinSignatureValueType* dinSignatureValueType); +void init_dinSessionStopResType(struct dinSessionStopResType* dinSessionStopResType); +void init_dinMeterInfoType(struct dinMeterInfoType* dinMeterInfoType); +void init_dinSalesTariffEntryType(struct dinSalesTariffEntryType* dinSalesTariffEntryType); +void init_dinSessionStopType(struct dinSessionStopType* dinSessionStopType); +void init_dinSignaturePropertyType(struct dinSignaturePropertyType* dinSignaturePropertyType); +void init_dinSignatureType(struct dinSignatureType* dinSignatureType); + + +#endif /* DEPLOY_DIN_CODEC */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/din/dinEXIDatatypesDecoder.c b/src/din/dinEXIDatatypesDecoder.c new file mode 100644 index 0000000..77b00a3 --- /dev/null +++ b/src/din/dinEXIDatatypesDecoder.c @@ -0,0 +1,14513 @@ +/* + * Copyright (C) 2007-2014 Siemens AG + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +/******************************************************************* + * + * @author Daniel.Peintner.EXT@siemens.com + * @version 0.9.1 + * @contact Joerg.Heuer@siemens.com + * + *

Code generated by EXIdizer

+ *

Schema: V2G_CI_MsgDef.xsd

+ * + * + ********************************************************************/ + + + + +#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_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_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_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_dinCableCheckResType(bitstream_t* stream, struct dinCableCheckResType* dinCableCheckResType); +static int decode_dinTransformType(bitstream_t* stream, struct dinTransformType* dinTransformType); +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_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_dinSignatureType(bitstream_t* stream, struct dinSignatureType* dinSignatureType); + +/* Deviant data decoding (skip functions) */ +static int decodeDeviationsCH(bitstream_t* stream) { + int i=0; + uint16_t uint16; + errn = 0; + + errn = decodeUnsignedInteger16(stream, &uint16); + if (errn == 0) { + for(i=0; iDC_EVStatus); + grammarID = 1; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 1: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinPreChargeReqType->EVTargetVoltage); + grammarID = 2; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 2: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetCurrent)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinPreChargeReqType->EVTargetCurrent); + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='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 = 5; + int done = 0; + + init_dinNotificationType(dinNotificationType); + + while(!done) { + switch(grammarID) { + case 5: + /* 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 = 6; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 6: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultMsg), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinNotificationType->FaultMsg.charactersLen); + if (errn == 0) { + errn = (dinNotificationType->FaultMsg.charactersLen - 2) <= dinNotificationType_FaultMsg_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinNotificationType->FaultMsg.charactersLen >= 2) { + dinNotificationType->FaultMsg.charactersLen = (uint16_t)(dinNotificationType->FaultMsg.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinNotificationType->FaultMsg.charactersLen, dinNotificationType->FaultMsg.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinNotificationType->FaultMsg_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultMsg) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 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,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; + int done = 0; + + init_dinServiceTagType(dinServiceTagType); + + while(!done) { + switch(grammarID) { + case 7: + /* 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 = 8; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 8: + /* Element[START_ELEMENT({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 = 9; + } 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); + 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 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] */ + 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->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; + } else { + /* Second level event (e.g., xsi: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) ? */ + 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,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 done = 0; + + init_dinCostType(dinCostType); + + while(!done) { + switch(grammarID) { + case 11: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}costKind)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + dinCostType->costKind = (dincostKindType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}costKind) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 12; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 12: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amount)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger32(stream, &dinCostType->amount); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amount) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 13; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 13: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amountMultiplier), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 3, &(uint32)); + dinCostType->amountMultiplier = (int8_t)(uint32 -3); + dinCostType->amountMultiplier_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amountMultiplier) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='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; + int done = 0; + + init_dinX509DataType(dinX509DataType); + + 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); + 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; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + 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] */ + 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; + 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; + break; + case 6: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2: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 done = 0; + + init_dinBodyType(dinBodyType); + + while(!done) { + switch(grammarID) { + case 16: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDef}BodyElement), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionRes), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 6, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinBodyBaseType(stream, &dinBodyType->BodyElement); + dinBodyType->BodyElement_isUsed = 1u; + grammarID = 3; + break; + case 1: + errn = decode_dinCableCheckReqType(stream, &dinBodyType->CableCheckReq); + dinBodyType->CableCheckReq_isUsed = 1u; + grammarID = 3; + break; + case 2: + errn = decode_dinCableCheckResType(stream, &dinBodyType->CableCheckRes); + dinBodyType->CableCheckRes_isUsed = 1u; + grammarID = 3; + break; + case 3: + errn = decode_dinCertificateInstallationReqType(stream, &dinBodyType->CertificateInstallationReq); + dinBodyType->CertificateInstallationReq_isUsed = 1u; + grammarID = 3; + break; + case 4: + errn = decode_dinCertificateInstallationResType(stream, &dinBodyType->CertificateInstallationRes); + dinBodyType->CertificateInstallationRes_isUsed = 1u; + grammarID = 3; + break; + case 5: + errn = decode_dinCertificateUpdateReqType(stream, &dinBodyType->CertificateUpdateReq); + dinBodyType->CertificateUpdateReq_isUsed = 1u; + grammarID = 3; + break; + case 6: + errn = decode_dinCertificateUpdateResType(stream, &dinBodyType->CertificateUpdateRes); + dinBodyType->CertificateUpdateRes_isUsed = 1u; + grammarID = 3; + break; + case 7: + errn = decode_dinChargeParameterDiscoveryReqType(stream, &dinBodyType->ChargeParameterDiscoveryReq); + dinBodyType->ChargeParameterDiscoveryReq_isUsed = 1u; + grammarID = 3; + break; + case 8: + errn = decode_dinChargeParameterDiscoveryResType(stream, &dinBodyType->ChargeParameterDiscoveryRes); + dinBodyType->ChargeParameterDiscoveryRes_isUsed = 1u; + grammarID = 3; + break; + case 9: + errn = decode_dinChargingStatusReqType(stream, &dinBodyType->ChargingStatusReq); + dinBodyType->ChargingStatusReq_isUsed = 1u; + grammarID = 3; + break; + case 10: + errn = decode_dinChargingStatusResType(stream, &dinBodyType->ChargingStatusRes); + dinBodyType->ChargingStatusRes_isUsed = 1u; + grammarID = 3; + break; + case 11: + errn = decode_dinContractAuthenticationReqType(stream, &dinBodyType->ContractAuthenticationReq); + dinBodyType->ContractAuthenticationReq_isUsed = 1u; + grammarID = 3; + break; + case 12: + errn = decode_dinContractAuthenticationResType(stream, &dinBodyType->ContractAuthenticationRes); + dinBodyType->ContractAuthenticationRes_isUsed = 1u; + grammarID = 3; + break; + case 13: + errn = decode_dinCurrentDemandReqType(stream, &dinBodyType->CurrentDemandReq); + dinBodyType->CurrentDemandReq_isUsed = 1u; + grammarID = 3; + break; + case 14: + errn = decode_dinCurrentDemandResType(stream, &dinBodyType->CurrentDemandRes); + dinBodyType->CurrentDemandRes_isUsed = 1u; + grammarID = 3; + break; + case 15: + errn = decode_dinMeteringReceiptReqType(stream, &dinBodyType->MeteringReceiptReq); + dinBodyType->MeteringReceiptReq_isUsed = 1u; + grammarID = 3; + break; + case 16: + errn = decode_dinMeteringReceiptResType(stream, &dinBodyType->MeteringReceiptRes); + dinBodyType->MeteringReceiptRes_isUsed = 1u; + grammarID = 3; + break; + case 17: + errn = decode_dinPaymentDetailsReqType(stream, &dinBodyType->PaymentDetailsReq); + dinBodyType->PaymentDetailsReq_isUsed = 1u; + grammarID = 3; + break; + case 18: + errn = decode_dinPaymentDetailsResType(stream, &dinBodyType->PaymentDetailsRes); + dinBodyType->PaymentDetailsRes_isUsed = 1u; + grammarID = 3; + break; + case 19: + errn = decode_dinPowerDeliveryReqType(stream, &dinBodyType->PowerDeliveryReq); + dinBodyType->PowerDeliveryReq_isUsed = 1u; + grammarID = 3; + break; + case 20: + errn = decode_dinPowerDeliveryResType(stream, &dinBodyType->PowerDeliveryRes); + dinBodyType->PowerDeliveryRes_isUsed = 1u; + grammarID = 3; + break; + case 21: + errn = decode_dinPreChargeReqType(stream, &dinBodyType->PreChargeReq); + dinBodyType->PreChargeReq_isUsed = 1u; + grammarID = 3; + break; + case 22: + errn = decode_dinPreChargeResType(stream, &dinBodyType->PreChargeRes); + dinBodyType->PreChargeRes_isUsed = 1u; + grammarID = 3; + break; + case 23: + errn = decode_dinServiceDetailReqType(stream, &dinBodyType->ServiceDetailReq); + dinBodyType->ServiceDetailReq_isUsed = 1u; + grammarID = 3; + break; + case 24: + errn = decode_dinServiceDetailResType(stream, &dinBodyType->ServiceDetailRes); + dinBodyType->ServiceDetailRes_isUsed = 1u; + grammarID = 3; + break; + case 25: + errn = decode_dinServiceDiscoveryReqType(stream, &dinBodyType->ServiceDiscoveryReq); + dinBodyType->ServiceDiscoveryReq_isUsed = 1u; + grammarID = 3; + break; + case 26: + errn = decode_dinServiceDiscoveryResType(stream, &dinBodyType->ServiceDiscoveryRes); + dinBodyType->ServiceDiscoveryRes_isUsed = 1u; + grammarID = 3; + break; + case 27: + errn = decode_dinServicePaymentSelectionReqType(stream, &dinBodyType->ServicePaymentSelectionReq); + dinBodyType->ServicePaymentSelectionReq_isUsed = 1u; + grammarID = 3; + break; + case 28: + errn = decode_dinServicePaymentSelectionResType(stream, &dinBodyType->ServicePaymentSelectionRes); + dinBodyType->ServicePaymentSelectionRes_isUsed = 1u; + grammarID = 3; + break; + case 29: + errn = decode_dinSessionSetupReqType(stream, &dinBodyType->SessionSetupReq); + dinBodyType->SessionSetupReq_isUsed = 1u; + grammarID = 3; + break; + case 30: + errn = decode_dinSessionSetupResType(stream, &dinBodyType->SessionSetupRes); + dinBodyType->SessionSetupRes_isUsed = 1u; + grammarID = 3; + break; + case 31: + errn = decode_dinSessionStopType(stream, &dinBodyType->SessionStopReq); + dinBodyType->SessionStopReq_isUsed = 1u; + grammarID = 3; + break; + case 32: + errn = decode_dinSessionStopResType(stream, &dinBodyType->SessionStopRes); + dinBodyType->SessionStopRes_isUsed = 1u; + grammarID = 3; + break; + case 33: + errn = decode_dinWeldingDetectionReqType(stream, &dinBodyType->WeldingDetectionReq); + dinBodyType->WeldingDetectionReq_isUsed = 1u; + grammarID = 3; + break; + case 34: + errn = decode_dinWeldingDetectionResType(stream, &dinBodyType->WeldingDetectionRes); + dinBodyType->WeldingDetectionRes_isUsed = 1u; + grammarID = 3; + break; + case 35: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = 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 = 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 done = 0; + + init_dinAC_EVChargeParameterType(dinAC_EVChargeParameterType); + + while(!done) { + switch(grammarID) { + case 24: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DepartureTime)] */ + 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_EVChargeParameterType->DepartureTime); + } else { + /* Second level event (e.g., xsi: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}DepartureTime) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 25; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 25: + /* 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; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 26: + /* 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; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 27: + /* 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; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 28: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMinCurrent)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinPhysicalValueType(stream, &dinAC_EVChargeParameterType->EVMinCurrent); + grammarID = 3; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = 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 = 29; + int done = 0; + + init_dinObjectType(dinObjectType); + + 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); + 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 = 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); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + 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; + break; + } + } + break; + case 30: + /* 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 = 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; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 31: + /* 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 = 32; + 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: + /* 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: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 done = 0; + + init_dinContractAuthenticationResType(dinContractAuthenticationResType); + + while(!done) { + switch(grammarID) { + case 34: + /* 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); + dinContractAuthenticationResType->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 = 35; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + 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); + dinContractAuthenticationResType->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,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; + int done = 0; + + init_dinChargingProfileType(dinChargingProfileType); + + while(!done) { + switch(grammarID) { + case 36: + /* 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 = 37; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 37: + /* Element[START_ELEMENT({urn:iso:15118:2: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)] */ + 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 = 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) ? */ + 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#,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 done = 0; + + init_dinReferenceType(dinReferenceType); + + 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)] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &dinReferenceType->Id.charactersLen); + if (errn == 0) { + errn = (dinReferenceType->Id.charactersLen - 2) <= dinReferenceType_Id_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinReferenceType->Id.charactersLen >= 2) { + dinReferenceType->Id.charactersLen = (uint16_t)(dinReferenceType->Id.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinReferenceType->Id.charactersLen, dinReferenceType->Id.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinReferenceType->Id_isUsed = 1u; + grammarID = 47; + break; + case 1: + errn = decodeUnsignedInteger16(stream, &dinReferenceType->Type.charactersLen); + if (errn == 0) { + errn = (dinReferenceType->Type.charactersLen - 2) <= dinReferenceType_Type_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinReferenceType->Type.charactersLen >= 2) { + dinReferenceType->Type.charactersLen = (uint16_t)(dinReferenceType->Type.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinReferenceType->Type.charactersLen, dinReferenceType->Type.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinReferenceType->Type_isUsed = 1u; + grammarID = 48; + break; + case 2: + errn = decodeUnsignedInteger16(stream, &dinReferenceType->URI.charactersLen); + if (errn == 0) { + errn = (dinReferenceType->URI.charactersLen - 2) <= dinReferenceType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinReferenceType->URI.charactersLen >= 2) { + dinReferenceType->URI.charactersLen = (uint16_t)(dinReferenceType->URI.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinReferenceType->URI.charactersLen, dinReferenceType->URI.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinReferenceType->URI_isUsed = 1u; + grammarID = 49; + break; + case 3: + errn = decode_dinTransformsType(stream, &dinReferenceType->Transforms); + dinReferenceType->Transforms_isUsed = 1u; + grammarID = 50; + break; + case 4: + errn = decode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod); + grammarID = 51; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + 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)] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &dinReferenceType->Type.charactersLen); + if (errn == 0) { + errn = (dinReferenceType->Type.charactersLen - 2) <= dinReferenceType_Type_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinReferenceType->Type.charactersLen >= 2) { + dinReferenceType->Type.charactersLen = (uint16_t)(dinReferenceType->Type.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinReferenceType->Type.charactersLen, dinReferenceType->Type.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinReferenceType->Type_isUsed = 1u; + grammarID = 48; + break; + case 1: + errn = decodeUnsignedInteger16(stream, &dinReferenceType->URI.charactersLen); + if (errn == 0) { + errn = (dinReferenceType->URI.charactersLen - 2) <= dinReferenceType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinReferenceType->URI.charactersLen >= 2) { + dinReferenceType->URI.charactersLen = (uint16_t)(dinReferenceType->URI.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinReferenceType->URI.charactersLen, dinReferenceType->URI.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinReferenceType->URI_isUsed = 1u; + grammarID = 49; + break; + case 2: + errn = decode_dinTransformsType(stream, &dinReferenceType->Transforms); + dinReferenceType->Transforms_isUsed = 1u; + grammarID = 50; + break; + case 3: + errn = decode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod); + grammarID = 51; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + 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)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &dinReferenceType->URI.charactersLen); + if (errn == 0) { + errn = (dinReferenceType->URI.charactersLen - 2) <= dinReferenceType_URI_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinReferenceType->URI.charactersLen >= 2) { + dinReferenceType->URI.charactersLen = (uint16_t)(dinReferenceType->URI.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinReferenceType->URI.charactersLen, dinReferenceType->URI.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinReferenceType->URI_isUsed = 1u; + grammarID = 49; + break; + case 1: + errn = decode_dinTransformsType(stream, &dinReferenceType->Transforms); + dinReferenceType->Transforms_isUsed = 1u; + grammarID = 50; + break; + case 2: + errn = decode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod); + grammarID = 51; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 49: + /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decode_dinTransformsType(stream, &dinReferenceType->Transforms); + dinReferenceType->Transforms_isUsed = 1u; + grammarID = 50; + break; + case 1: + errn = decode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod); + grammarID = 51; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 50: + /* 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; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 51: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinReferenceType->DigestValue.bytesLen); + if (errn == 0) { + errn = (dinReferenceType->DigestValue.bytesLen) <= dinReferenceType_DigestValue_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinReferenceType->DigestValue.bytesLen, dinReferenceType->DigestValue.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,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; + int done = 0; + + init_dinPMaxScheduleEntryType(dinPMaxScheduleEntryType); + + 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); + 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; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 53: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMax)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &dinPMaxScheduleEntryType->PMax); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMax) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010: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 done = 0; + + init_dinDC_EVSEStatusType(dinDC_EVSEStatusType); + + 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)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + dinDC_EVSEStatusType->EVSEIsolationStatus = (dinisolationLevelType) uint32; + dinDC_EVSEStatusType->EVSEIsolationStatus_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEIsolationStatus) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 105; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 4, &uint32); + dinDC_EVSEStatusType->EVSEStatusCode = (dinDC_EVSEStatusCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 106; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 105: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 4, &uint32); + dinDC_EVSEStatusType->EVSEStatusCode = (dinDC_EVSEStatusCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 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, &dinDC_EVSEStatusType->NotificationMaxDelay); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 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)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 2, &uint32); + dinDC_EVSEStatusType->EVSENotification = (dinEVSENotificationType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSENotification) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgBody,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; + int done = 0; + + init_dinWeldingDetectionResType(dinWeldingDetectionResType); + + 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); + 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 */ + } + } + 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, &dinWeldingDetectionResType->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, &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: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 done = 0; + + init_dinTransformsType(dinTransformsType); + + while(!done) { + switch(grammarID) { + case 162: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinTransformsType->Transform.arrayLen < dinTransformsType_Transform_ARRAY_SIZE) { + errn = decode_dinTransformType(stream, &dinTransformsType->Transform.array[dinTransformsType->Transform.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 163; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 163: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinTransformsType->Transform.arrayLen < dinTransformsType_Transform_ARRAY_SIZE) { + errn = decode_dinTransformType(stream, &dinTransformsType->Transform.array[dinTransformsType->Transform.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 163; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ParameterType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":boolValue|"urn:iso:15118:2:2010:MsgDataTypes":byteValue|"urn:iso:15118:2:2010:MsgDataTypes":shortValue|"urn:iso:15118:2:2010:MsgDataTypes":intValue|"urn:iso:15118:2:2010:MsgDataTypes":physicalValue|"urn:iso:15118:2:2010:MsgDataTypes":stringValue)', derivedBy='RESTRICTION'. */ +static int decode_dinParameterType(bitstream_t* stream, struct dinParameterType* dinParameterType) { + int grammarID = 164; + int done = 0; + + init_dinParameterType(dinParameterType); + + while(!done) { + switch(grammarID) { + case 164: + /* FirstStartTag[ATTRIBUTE[STRING](Name)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeUnsignedInteger16(stream, &dinParameterType->Name.charactersLen); + if (errn == 0) { + errn = (dinParameterType->Name.charactersLen - 2) <= dinParameterType_Name_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinParameterType->Name.charactersLen >= 2) { + dinParameterType->Name.charactersLen = (uint16_t)(dinParameterType->Name.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinParameterType->Name.charactersLen, dinParameterType->Name.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + grammarID = 165; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 165: + /* StartTag[ATTRIBUTE[ENUMERATION](ValueType)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + errn = decodeNBitUnsignedInteger(stream, 3, &uint32); + dinParameterType->ValueType = (dinvalueType) uint32; + grammarID = 166; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 166: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}boolValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}byteValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}shortValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}intValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}physicalValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}stringValue)] */ + errn = decodeNBitUnsignedInteger(stream, 3, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinParameterType->boolValue); + dinParameterType->boolValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}boolValue) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 8, &(uint32)); + dinParameterType->byteValue = (int8_t)(uint32 -128); + dinParameterType->byteValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}byteValue) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger16(stream, &dinParameterType->shortValue); + dinParameterType->shortValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}shortValue) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 3: + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeInteger32(stream, &dinParameterType->intValue); + dinParameterType->intValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}intValue) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 4: + errn = decode_dinPhysicalValueType(stream, &dinParameterType->physicalValue); + dinParameterType->physicalValue_isUsed = 1u; + grammarID = 3; + break; + case 5: + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinParameterType->stringValue.charactersLen); + if (errn == 0) { + errn = (dinParameterType->stringValue.charactersLen - 2) <= dinParameterType_stringValue_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinParameterType->stringValue.charactersLen >= 2) { + dinParameterType->stringValue.charactersLen = (uint16_t)(dinParameterType->stringValue.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinParameterType->stringValue.charactersLen, dinParameterType->stringValue.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + dinParameterType->stringValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}stringValue) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_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 = 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 done = 0; + + init_dinPaymentDetailsResType(dinPaymentDetailsResType); + + while(!done) { + switch(grammarID) { + case 219: + /* 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); + dinPaymentDetailsResType->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 = 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:2010:MsgBody}GenChallenge)] */ + 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, &dinPaymentDetailsResType->GenChallenge.charactersLen); + if (errn == 0) { + errn = (dinPaymentDetailsResType->GenChallenge.charactersLen - 2) <= dinPaymentDetailsResType_GenChallenge_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (dinPaymentDetailsResType->GenChallenge.charactersLen >= 2) { + dinPaymentDetailsResType->GenChallenge.charactersLen = (uint16_t)(dinPaymentDetailsResType->GenChallenge.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, dinPaymentDetailsResType->GenChallenge.charactersLen, dinPaymentDetailsResType->GenChallenge.characters); + } 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}GenChallenge) ? */ + 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({urn:iso:15118:2:2010:MsgBody}DateTimeNow)] */ + 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, &dinPaymentDetailsResType->DateTimeNow); + } else { + /* Second level event (e.g., xsi: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; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_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 = 222; + int done = 0; + + init_dinServiceType(dinServiceType); + + while(!done) { + switch(grammarID) { + case 222: + /* 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 = 223; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 223: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeBoolean(stream, &dinServiceType->FreeService); + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010: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; + int done = 0; + + init_dinEVPowerDeliveryParameterType(dinEVPowerDeliveryParameterType); + + 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: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); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_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 = 234; + int done = 0; + + init_dinMeteringReceiptResType(dinMeteringReceiptResType); + + while(!done) { + switch(grammarID) { + case 234: + /* 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 = 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, &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)] */ + 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,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)] */ + 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 = 245; + } 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; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_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 = 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); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_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 = 250; + int done = 0; + + init_dinServicePaymentSelectionResType(dinServicePaymentSelectionResType); + + while(!done) { + switch(grammarID) { + case 250: + /* 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: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; + int done = 0; + + init_dinEVSEStatusType(dinEVSEStatusType); + + 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#,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 done = 0; + + init_dinServiceTagListType(dinServiceTagListType); + + while(!done) { + switch(grammarID) { + case 255: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Service)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinServiceTagListType->Service.arrayLen < dinServiceTagListType_Service_ARRAY_SIZE) { + errn = decode_dinServiceType(stream, &dinServiceTagListType->Service.array[dinServiceTagListType->Service.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 256; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 256: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Service), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + if (dinServiceTagListType->Service.arrayLen < dinServiceTagListType_Service_ARRAY_SIZE) { + errn = decode_dinServiceType(stream, &dinServiceTagListType->Service.array[dinServiceTagListType->Service.arrayLen++]); + } else { + errn = EXI_ERROR_OUT_OF_BOUNDS; + } + grammarID = 256; + 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#,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; + int done = 0; + + init_dinRSAKeyValueType(dinRSAKeyValueType); + + 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, &dinRSAKeyValueType->Modulus.bytesLen); + if (errn == 0) { + errn = (dinRSAKeyValueType->Modulus.bytesLen) <= dinRSAKeyValueType_Modulus_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinRSAKeyValueType->Modulus.bytesLen, dinRSAKeyValueType->Modulus.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 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, &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: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; + int done = 0; + + init_dinEVSEChargeParameterType(dinEVSEChargeParameterType); + + 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#,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; + int done = 0; + + init_dinSignaturePropertiesType(dinSignaturePropertiesType); + + while(!done) { + switch(grammarID) { + case 259: + /* 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 = 260; + 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 = 261; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 260: + /* 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 = 261; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 261: + /* 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 = 261; + break; + case 1: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='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 done = 0; + + init_dinDSAKeyValueType(dinDSAKeyValueType); + + while(!done) { + switch(grammarID) { + case 262: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->P.bytesLen); + if (errn == 0) { + errn = (dinDSAKeyValueType->P.bytesLen) <= dinDSAKeyValueType_P_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinDSAKeyValueType->P.bytesLen, dinDSAKeyValueType->P.bytes); + } + dinDSAKeyValueType->P_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 263; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->G.bytesLen); + if (errn == 0) { + errn = (dinDSAKeyValueType->G.bytesLen) <= dinDSAKeyValueType_G_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinDSAKeyValueType->G.bytesLen, dinDSAKeyValueType->G.bytes); + } + dinDSAKeyValueType->G_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 264; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 2: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->Y.bytesLen); + if (errn == 0) { + errn = (dinDSAKeyValueType->Y.bytesLen) <= dinDSAKeyValueType_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinDSAKeyValueType->Y.bytesLen, dinDSAKeyValueType->Y.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 265; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 263: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->Q.bytesLen); + if (errn == 0) { + errn = (dinDSAKeyValueType->Q.bytesLen) <= dinDSAKeyValueType_Q_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinDSAKeyValueType->Q.bytesLen, dinDSAKeyValueType->Q.bytes); + } + dinDSAKeyValueType->Q_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 266; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 266: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->G.bytesLen); + if (errn == 0) { + errn = (dinDSAKeyValueType->G.bytesLen) <= dinDSAKeyValueType_G_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinDSAKeyValueType->G.bytesLen, dinDSAKeyValueType->G.bytes); + } + dinDSAKeyValueType->G_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 264; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->Y.bytesLen); + if (errn == 0) { + errn = (dinDSAKeyValueType->Y.bytesLen) <= dinDSAKeyValueType_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinDSAKeyValueType->Y.bytesLen, dinDSAKeyValueType->Y.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 265; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 264: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->Y.bytesLen); + if (errn == 0) { + errn = (dinDSAKeyValueType->Y.bytesLen) <= dinDSAKeyValueType_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinDSAKeyValueType->Y.bytesLen, dinDSAKeyValueType->Y.bytes); + } + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 265; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 265: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->J.bytesLen); + if (errn == 0) { + errn = (dinDSAKeyValueType->J.bytesLen) <= dinDSAKeyValueType_J_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinDSAKeyValueType->J.bytesLen, dinDSAKeyValueType->J.bytes); + } + dinDSAKeyValueType->J_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 267; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + case 1: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->Seed.bytesLen); + if (errn == 0) { + errn = (dinDSAKeyValueType->Seed.bytesLen) <= dinDSAKeyValueType_Seed_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinDSAKeyValueType->Seed.bytesLen, dinDSAKeyValueType->Seed.bytes); + } + dinDSAKeyValueType->Seed_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 268; + } 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 267: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 2, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->Seed.bytesLen); + if (errn == 0) { + errn = (dinDSAKeyValueType->Seed.bytesLen) <= dinDSAKeyValueType_Seed_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinDSAKeyValueType->Seed.bytesLen, dinDSAKeyValueType->Seed.bytes); + } + dinDSAKeyValueType->Seed_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 268; + } 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 268: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->PgenCounter.bytesLen); + if (errn == 0) { + errn = (dinDSAKeyValueType->PgenCounter.bytesLen) <= dinDSAKeyValueType_PgenCounter_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, dinDSAKeyValueType->PgenCounter.bytesLen, dinDSAKeyValueType->PgenCounter.bytes); + } + dinDSAKeyValueType->PgenCounter_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,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; + int done = 0; + + init_dinProfileEntryType(dinProfileEntryType); + + while(!done) { + switch(grammarID) { + case 269: + /* 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 = 270; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 270: + /* Element[START_ELEMENT({urn:iso:15118:2: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='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; + int done = 0; + + init_dinSignatureValueType(dinSignatureValueType); + + while(!done) { + switch(grammarID) { + case 271: + /* 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 = 272; + 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 272: + /* 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: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 done = 0; + + init_dinSessionStopResType(dinSessionStopResType); + + while(!done) { + switch(grammarID) { + case 250: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeNBitUnsignedInteger(stream, 5, &uint32); + dinSessionStopResType->ResponseCode = (dinresponseCodeType) uint32; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + if(errn == 0) { + /* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(eventCode == 0) { + grammarID = 3; + } else { + errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */ + } + } + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_CODE; + break; + } + } + break; + case 3: + /* Element[END_ELEMENT] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if (errn == 0) { + switch(eventCode) { + case 0: + done = 1; + grammarID = 4; + break; + default: + errn = EXI_ERROR_UNKOWN_EVENT_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 = 273; + int done = 0; + + init_dinMeterInfoType(dinMeterInfoType); + + while(!done) { + switch(grammarID) { + case 273: + /* 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 = 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) ? */ + 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,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) { + /* 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); + if(errn == 0) { + switch(eventCode) { + case 0: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVChargeParameter) */ + errn = decode_dinAC_EVChargeParameterType(stream, &exiDoc->AC_EVChargeParameter); + exiDoc->AC_EVChargeParameter_isUsed = 1u; + break; + case 1: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEChargeParameter) */ + errn = decode_dinAC_EVSEChargeParameterType(stream, &exiDoc->AC_EVSEChargeParameter); + exiDoc->AC_EVSEChargeParameter_isUsed = 1u; + break; + case 2: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatus) */ + errn = decode_dinAC_EVSEStatusType(stream, &exiDoc->AC_EVSEStatus); + exiDoc->AC_EVSEStatus_isUsed = 1u; + break; + case 3: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDef}BodyElement) */ + errn = decode_dinBodyBaseType(stream, &exiDoc->BodyElement); + exiDoc->BodyElement_isUsed = 1u; + break; + case 4: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckReq) */ + errn = decode_dinCableCheckReqType(stream, &exiDoc->CableCheckReq); + exiDoc->CableCheckReq_isUsed = 1u; + break; + case 5: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckRes) */ + errn = decode_dinCableCheckResType(stream, &exiDoc->CableCheckRes); + exiDoc->CableCheckRes_isUsed = 1u; + break; + case 6: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod) */ + errn = decode_dinCanonicalizationMethodType(stream, &exiDoc->CanonicalizationMethod); + exiDoc->CanonicalizationMethod_isUsed = 1u; + break; + case 7: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationReq) */ + errn = decode_dinCertificateInstallationReqType(stream, &exiDoc->CertificateInstallationReq); + exiDoc->CertificateInstallationReq_isUsed = 1u; + break; + case 8: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationRes) */ + errn = decode_dinCertificateInstallationResType(stream, &exiDoc->CertificateInstallationRes); + exiDoc->CertificateInstallationRes_isUsed = 1u; + break; + case 9: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateReq) */ + errn = decode_dinCertificateUpdateReqType(stream, &exiDoc->CertificateUpdateReq); + exiDoc->CertificateUpdateReq_isUsed = 1u; + break; + case 10: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateRes) */ + errn = decode_dinCertificateUpdateResType(stream, &exiDoc->CertificateUpdateRes); + exiDoc->CertificateUpdateRes_isUsed = 1u; + break; + case 11: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryReq) */ + errn = decode_dinChargeParameterDiscoveryReqType(stream, &exiDoc->ChargeParameterDiscoveryReq); + exiDoc->ChargeParameterDiscoveryReq_isUsed = 1u; + break; + case 12: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryRes) */ + errn = decode_dinChargeParameterDiscoveryResType(stream, &exiDoc->ChargeParameterDiscoveryRes); + exiDoc->ChargeParameterDiscoveryRes_isUsed = 1u; + break; + case 13: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusReq) */ + errn = decode_dinChargingStatusReqType(stream, &exiDoc->ChargingStatusReq); + exiDoc->ChargingStatusReq_isUsed = 1u; + break; + case 14: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusRes) */ + errn = decode_dinChargingStatusResType(stream, &exiDoc->ChargingStatusRes); + exiDoc->ChargingStatusRes_isUsed = 1u; + break; + case 15: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationReq) */ + errn = decode_dinContractAuthenticationReqType(stream, &exiDoc->ContractAuthenticationReq); + exiDoc->ContractAuthenticationReq_isUsed = 1u; + break; + case 16: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationRes) */ + errn = decode_dinContractAuthenticationResType(stream, &exiDoc->ContractAuthenticationRes); + exiDoc->ContractAuthenticationRes_isUsed = 1u; + break; + case 17: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandReq) */ + errn = decode_dinCurrentDemandReqType(stream, &exiDoc->CurrentDemandReq); + exiDoc->CurrentDemandReq_isUsed = 1u; + break; + case 18: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandRes) */ + errn = decode_dinCurrentDemandResType(stream, &exiDoc->CurrentDemandRes); + exiDoc->CurrentDemandRes_isUsed = 1u; + break; + case 19: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVChargeParameter) */ + errn = decode_dinDC_EVChargeParameterType(stream, &exiDoc->DC_EVChargeParameter); + exiDoc->DC_EVChargeParameter_isUsed = 1u; + break; + case 20: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVPowerDeliveryParameter) */ + errn = decode_dinDC_EVPowerDeliveryParameterType(stream, &exiDoc->DC_EVPowerDeliveryParameter); + exiDoc->DC_EVPowerDeliveryParameter_isUsed = 1u; + break; + case 21: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEChargeParameter) */ + errn = decode_dinDC_EVSEChargeParameterType(stream, &exiDoc->DC_EVSEChargeParameter); + exiDoc->DC_EVSEChargeParameter_isUsed = 1u; + break; + case 22: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatus) */ + errn = decode_dinDC_EVSEStatusType(stream, &exiDoc->DC_EVSEStatus); + exiDoc->DC_EVSEStatus_isUsed = 1u; + break; + case 23: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVStatus) */ + errn = decode_dinDC_EVStatusType(stream, &exiDoc->DC_EVStatus); + exiDoc->DC_EVStatus_isUsed = 1u; + break; + case 24: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue) */ + errn = decode_dinDSAKeyValueType(stream, &exiDoc->DSAKeyValue); + exiDoc->DSAKeyValue_isUsed = 1u; + break; + case 25: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod) */ + errn = decode_dinDigestMethodType(stream, &exiDoc->DigestMethod); + exiDoc->DigestMethod_isUsed = 1u; + break; + case 26: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue) */ + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiDoc->DigestValue.bytesLen); + if (errn == 0) { + errn = (exiDoc->DigestValue.bytesLen) <= EXIDocument_DigestValue_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER; + } + if (errn == 0) { + errn = decodeBytes(stream, exiDoc->DigestValue.bytesLen, exiDoc->DigestValue.bytes); + } + exiDoc->DigestValue_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 27: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVChargeParameter) */ + errn = decode_dinEVChargeParameterType(stream, &exiDoc->EVChargeParameter); + exiDoc->EVChargeParameter_isUsed = 1u; + break; + case 28: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVPowerDeliveryParameter) */ + errn = decode_dinEVPowerDeliveryParameterType(stream, &exiDoc->EVPowerDeliveryParameter); + exiDoc->EVPowerDeliveryParameter_isUsed = 1u; + break; + case 29: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEChargeParameter) */ + errn = decode_dinEVSEChargeParameterType(stream, &exiDoc->EVSEChargeParameter); + exiDoc->EVSEChargeParameter_isUsed = 1u; + break; + case 30: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatus) */ + errn = decode_dinEVSEStatusType(stream, &exiDoc->EVSEStatus); + exiDoc->EVSEStatus_isUsed = 1u; + break; + case 31: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVStatus) */ + errn = decode_dinEVStatusType(stream, &exiDoc->EVStatus); + exiDoc->EVStatus_isUsed = 1u; + break; + case 32: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Entry) */ + errn = decode_dinEntryType(stream, &exiDoc->Entry); + exiDoc->Entry_isUsed = 1u; + break; + case 33: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo) */ + errn = decode_dinKeyInfoType(stream, &exiDoc->KeyInfo); + exiDoc->KeyInfo_isUsed = 1u; + break; + case 34: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) */ + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiDoc->KeyName.charactersLen); + if (errn == 0) { + errn = (exiDoc->KeyName.charactersLen - 2) <= EXIDocument_KeyName_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (exiDoc->KeyName.charactersLen >= 2) { + exiDoc->KeyName.charactersLen = (uint16_t)(exiDoc->KeyName.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, exiDoc->KeyName.charactersLen, exiDoc->KeyName.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + exiDoc->KeyName_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 35: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue) */ + errn = decode_dinKeyValueType(stream, &exiDoc->KeyValue); + exiDoc->KeyValue_isUsed = 1u; + break; + case 36: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Manifest) */ + errn = decode_dinManifestType(stream, &exiDoc->Manifest); + exiDoc->Manifest_isUsed = 1u; + break; + case 37: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptReq) */ + errn = decode_dinMeteringReceiptReqType(stream, &exiDoc->MeteringReceiptReq); + exiDoc->MeteringReceiptReq_isUsed = 1u; + break; + case 38: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptRes) */ + errn = decode_dinMeteringReceiptResType(stream, &exiDoc->MeteringReceiptRes); + exiDoc->MeteringReceiptRes_isUsed = 1u; + break; + case 39: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) */ + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = decodeNBitUnsignedInteger(stream, 1, &eventCode); + if(errn == 0) { + if(eventCode == 0) { + errn = decodeUnsignedInteger16(stream, &exiDoc->MgmtData.charactersLen); + if (errn == 0) { + errn = (exiDoc->MgmtData.charactersLen - 2) <= EXIDocument_MgmtData_CHARACTERS_SIZE ? 0 : EXI_ERROR_STRINGVALUES_OUT_OF_BOUND; + } + if (errn == 0) { + if (exiDoc->MgmtData.charactersLen >= 2) { + exiDoc->MgmtData.charactersLen = (uint16_t)(exiDoc->MgmtData.charactersLen - 2); /* string table miss */ + errn = decodeCharacters(stream, exiDoc->MgmtData.charactersLen, exiDoc->MgmtData.characters); + } else { + /* string table hit */ + errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED; + } + } + exiDoc->MgmtData_isUsed = 1u; + } else { + /* Second level event (e.g., xsi:type, xsi:nil, ...) */ + errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS; + } + } + break; + case 40: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object) */ + errn = decode_dinObjectType(stream, &exiDoc->Object); + exiDoc->Object_isUsed = 1u; + break; + case 41: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData) */ + errn = decode_dinPGPDataType(stream, &exiDoc->PGPData); + exiDoc->PGPData_isUsed = 1u; + break; + case 42: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleEntry) */ + errn = decode_dinPMaxScheduleEntryType(stream, &exiDoc->PMaxScheduleEntry); + exiDoc->PMaxScheduleEntry_isUsed = 1u; + break; + case 43: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsReq) */ + errn = decode_dinPaymentDetailsReqType(stream, &exiDoc->PaymentDetailsReq); + exiDoc->PaymentDetailsReq_isUsed = 1u; + break; + case 44: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsRes) */ + errn = decode_dinPaymentDetailsResType(stream, &exiDoc->PaymentDetailsRes); + exiDoc->PaymentDetailsRes_isUsed = 1u; + break; + case 45: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryReq) */ + errn = decode_dinPowerDeliveryReqType(stream, &exiDoc->PowerDeliveryReq); + exiDoc->PowerDeliveryReq_isUsed = 1u; + break; + case 46: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryRes) */ + errn = decode_dinPowerDeliveryResType(stream, &exiDoc->PowerDeliveryRes); + exiDoc->PowerDeliveryRes_isUsed = 1u; + break; + case 47: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeReq) */ + errn = decode_dinPreChargeReqType(stream, &exiDoc->PreChargeReq); + exiDoc->PreChargeReq_isUsed = 1u; + break; + case 48: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeRes) */ + errn = decode_dinPreChargeResType(stream, &exiDoc->PreChargeRes); + exiDoc->PreChargeRes_isUsed = 1u; + break; + case 49: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue) */ + errn = decode_dinRSAKeyValueType(stream, &exiDoc->RSAKeyValue); + exiDoc->RSAKeyValue_isUsed = 1u; + break; + case 50: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference) */ + errn = decode_dinReferenceType(stream, &exiDoc->Reference); + exiDoc->Reference_isUsed = 1u; + break; + case 51: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval) */ + errn = decode_dinRelativeTimeIntervalType(stream, &exiDoc->RelativeTimeInterval); + exiDoc->RelativeTimeInterval_isUsed = 1u; + break; + case 52: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod) */ + errn = decode_dinRetrievalMethodType(stream, &exiDoc->RetrievalMethod); + exiDoc->RetrievalMethod_isUsed = 1u; + break; + case 53: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleList) */ + errn = decode_dinSAScheduleListType(stream, &exiDoc->SAScheduleList); + exiDoc->SAScheduleList_isUsed = 1u; + break; + case 54: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SASchedules) */ + errn = decode_dinSASchedulesType(stream, &exiDoc->SASchedules); + exiDoc->SASchedules_isUsed = 1u; + break; + case 55: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData) */ + errn = decode_dinSPKIDataType(stream, &exiDoc->SPKIData); + exiDoc->SPKIData_isUsed = 1u; + break; + case 56: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffEntry) */ + errn = decode_dinSalesTariffEntryType(stream, &exiDoc->SalesTariffEntry); + exiDoc->SalesTariffEntry_isUsed = 1u; + break; + case 57: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCharge) */ + errn = decode_dinServiceChargeType(stream, &exiDoc->ServiceCharge); + exiDoc->ServiceCharge_isUsed = 1u; + break; + case 58: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailReq) */ + errn = decode_dinServiceDetailReqType(stream, &exiDoc->ServiceDetailReq); + exiDoc->ServiceDetailReq_isUsed = 1u; + break; + case 59: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailRes) */ + errn = decode_dinServiceDetailResType(stream, &exiDoc->ServiceDetailRes); + exiDoc->ServiceDetailRes_isUsed = 1u; + break; + case 60: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryReq) */ + errn = decode_dinServiceDiscoveryReqType(stream, &exiDoc->ServiceDiscoveryReq); + exiDoc->ServiceDiscoveryReq_isUsed = 1u; + break; + case 61: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryRes) */ + errn = decode_dinServiceDiscoveryResType(stream, &exiDoc->ServiceDiscoveryRes); + exiDoc->ServiceDiscoveryRes_isUsed = 1u; + break; + case 62: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionReq) */ + errn = decode_dinServicePaymentSelectionReqType(stream, &exiDoc->ServicePaymentSelectionReq); + exiDoc->ServicePaymentSelectionReq_isUsed = 1u; + break; + case 63: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionRes) */ + errn = decode_dinServicePaymentSelectionResType(stream, &exiDoc->ServicePaymentSelectionRes); + exiDoc->ServicePaymentSelectionRes_isUsed = 1u; + break; + case 64: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupReq) */ + errn = decode_dinSessionSetupReqType(stream, &exiDoc->SessionSetupReq); + exiDoc->SessionSetupReq_isUsed = 1u; + break; + case 65: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupRes) */ + errn = decode_dinSessionSetupResType(stream, &exiDoc->SessionSetupRes); + exiDoc->SessionSetupRes_isUsed = 1u; + break; + case 66: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopReq) */ + errn = decode_dinSessionStopType(stream, &exiDoc->SessionStopReq); + exiDoc->SessionStopReq_isUsed = 1u; + break; + case 67: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopRes) */ + errn = decode_dinSessionStopResType(stream, &exiDoc->SessionStopRes); + exiDoc->SessionStopRes_isUsed = 1u; + break; + case 68: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature) */ + errn = decode_dinSignatureType(stream, &exiDoc->Signature); + exiDoc->Signature_isUsed = 1u; + break; + case 69: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod) */ + errn = decode_dinSignatureMethodType(stream, &exiDoc->SignatureMethod); + exiDoc->SignatureMethod_isUsed = 1u; + break; + case 70: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperties) */ + errn = decode_dinSignaturePropertiesType(stream, &exiDoc->SignatureProperties); + exiDoc->SignatureProperties_isUsed = 1u; + break; + case 71: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty) */ + errn = decode_dinSignaturePropertyType(stream, &exiDoc->SignatureProperty); + exiDoc->SignatureProperty_isUsed = 1u; + break; + case 72: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue) */ + errn = decode_dinSignatureValueType(stream, &exiDoc->SignatureValue); + exiDoc->SignatureValue_isUsed = 1u; + break; + case 73: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo) */ + errn = decode_dinSignedInfoType(stream, &exiDoc->SignedInfo); + exiDoc->SignedInfo_isUsed = 1u; + break; + case 74: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval) */ + errn = decode_dinIntervalType(stream, &exiDoc->TimeInterval); + exiDoc->TimeInterval_isUsed = 1u; + break; + case 75: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform) */ + errn = decode_dinTransformType(stream, &exiDoc->Transform); + exiDoc->Transform_isUsed = 1u; + break; + case 76: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms) */ + errn = decode_dinTransformsType(stream, &exiDoc->Transforms); + exiDoc->Transforms_isUsed = 1u; + break; + case 77: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDef}V2G_Message) */ + errn = decode_dinAnonType_V2G_Message(stream, &exiDoc->V2G_Message); + exiDoc->V2G_Message_isUsed = 1u; + break; + case 78: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionReq) */ + errn = decode_dinWeldingDetectionReqType(stream, &exiDoc->WeldingDetectionReq); + exiDoc->WeldingDetectionReq_isUsed = 1u; + break; + case 79: + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionRes) */ + errn = decode_dinWeldingDetectionResType(stream, &exiDoc->WeldingDetectionRes); + exiDoc->WeldingDetectionRes_isUsed = 1u; + break; + case 80: + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data) */ + errn = decode_dinX509DataType(stream, &exiDoc->X509Data); + exiDoc->X509Data_isUsed = 1u; + break; + default: + errn = EXI_ERROR_UNEXPECTED_EVENT_LEVEL1; + break; + } + } + + } + + return errn; +} + +#endif /* DEPLOY_DIN_CODEC */ + +#endif + diff --git a/src/din/dinEXIDatatypesDecoder.h b/src/din/dinEXIDatatypesDecoder.h new file mode 100644 index 0000000..fccc613 --- /dev/null +++ b/src/din/dinEXIDatatypesDecoder.h @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2007-2014 Siemens AG + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +/******************************************************************* + * + * @author Daniel.Peintner.EXT@siemens.com + * @version 0.9.1 + * @contact Joerg.Heuer@siemens.com + * + *

Code generated by EXIdizer

+ *

Schema: V2G_CI_MsgDef.xsd

+ * + * + ********************************************************************/ + + + +/** + * \file EXIDatatypesDecoder.h + * \brief Decoder for datatype definitions + * + */ + +#ifndef EXI_din_DATATYPES_DECODER_H +#define EXI_din_DATATYPES_DECODER_H + +#ifdef __cplusplus +extern "C" { +#endif + + +#include "dinEXIDatatypes.h" + +#if DEPLOY_DIN_CODEC == SUPPORT_YES + +#include + +#include "EXITypes.h" + +int decode_dinExiDocument(bitstream_t* stream, struct dinEXIDocument* exiDoc); + +#endif /* DEPLOY_DIN_CODEC */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/din/dinEXIDatatypesEncoder.c b/src/din/dinEXIDatatypesEncoder.c new file mode 100644 index 0000000..c2dadb2 --- /dev/null +++ b/src/din/dinEXIDatatypesEncoder.c @@ -0,0 +1,10370 @@ +/* + * Copyright (C) 2007-2014 Siemens AG + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +/******************************************************************* + * + * @author Daniel.Peintner.EXT@siemens.com + * @version 0.9.1 + * @contact Joerg.Heuer@siemens.com + * + *

Code generated by EXIdizer

+ *

Schema: V2G_CI_MsgDef.xsd

+ * + * + ********************************************************************/ + + + + +#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_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_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_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_dinCableCheckResType(bitstream_t* stream, struct dinCableCheckResType* dinCableCheckResType); +static int encode_dinTransformType(bitstream_t* stream, struct dinTransformType* dinTransformType); +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_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_dinSignatureType(bitstream_t* stream, struct dinSignatureType* dinSignatureType); + + + +/* 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 = 0; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 0: + /* 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 = 1; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 1: + /* 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 = 2; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 2: + /* 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='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 = 5; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 5: + /* 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 = 6; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 6: + /* 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)(dinNotificationType->FaultMsg.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinNotificationType->FaultMsg.characters, dinNotificationType->FaultMsg.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2: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; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 7: + /* 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 = 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)); + if (errn == 0) { + errn = encodeCharacters(stream, dinServiceTagType->ServiceName.characters, dinServiceTagType->ServiceName.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 9; + } 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 = 10; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 9: + /* 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 = 10; + } 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); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinServiceTagType->ServiceScope.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinServiceTagType->ServiceScope.characters, dinServiceTagType->ServiceScope.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010: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 done = 0; + + + while(!done) { + switch(grammarID) { + case 11: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}costKind)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 2, dinCostType->costKind); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 12; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 12: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amount)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, dinCostType->amount); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 13; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 13: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amountMultiplier), END_ELEMENT] */ + if ( dinCostType->amountMultiplier_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, (uint32_t)(dinCostType->amountMultiplier + 3)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='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; + 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); + if(errn == 0) { + errn = encode_dinX509IssuerSerialType(stream, &dinX509DataType->X509IssuerSerial.array [dinX509DataType_X509IssuerSerial_currArrayIndex++]); + } + 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; + } 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); + if(errn == 0) { + errn = encode_dinX509IssuerSerialType(stream, &dinX509DataType->X509IssuerSerial.array [dinX509DataType_X509IssuerSerial_currArrayIndex++]); + } + 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; + } 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: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 done = 0; + + + while(!done) { + switch(grammarID) { + case 16: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDef}BodyElement), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionRes), END_ELEMENT] */ + if ( dinBodyType->BodyElement_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 0); + if(errn == 0) { + errn = encode_dinBodyBaseType(stream, &dinBodyType->BodyElement ); + } + grammarID = 3; + } else if ( dinBodyType->CableCheckReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 1); + if(errn == 0) { + errn = encode_dinCableCheckReqType(stream, &dinBodyType->CableCheckReq ); + } + grammarID = 3; + } else if ( dinBodyType->CableCheckRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 2); + if(errn == 0) { + errn = encode_dinCableCheckResType(stream, &dinBodyType->CableCheckRes ); + } + grammarID = 3; + } else if ( dinBodyType->CertificateInstallationReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 3); + if(errn == 0) { + errn = encode_dinCertificateInstallationReqType(stream, &dinBodyType->CertificateInstallationReq ); + } + grammarID = 3; + } else if ( dinBodyType->CertificateInstallationRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 4); + if(errn == 0) { + errn = encode_dinCertificateInstallationResType(stream, &dinBodyType->CertificateInstallationRes ); + } + grammarID = 3; + } else if ( dinBodyType->CertificateUpdateReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 5); + if(errn == 0) { + errn = encode_dinCertificateUpdateReqType(stream, &dinBodyType->CertificateUpdateReq ); + } + grammarID = 3; + } else if ( dinBodyType->CertificateUpdateRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 6); + if(errn == 0) { + errn = encode_dinCertificateUpdateResType(stream, &dinBodyType->CertificateUpdateRes ); + } + grammarID = 3; + } else if ( dinBodyType->ChargeParameterDiscoveryReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 7); + if(errn == 0) { + errn = encode_dinChargeParameterDiscoveryReqType(stream, &dinBodyType->ChargeParameterDiscoveryReq ); + } + grammarID = 3; + } else if ( dinBodyType->ChargeParameterDiscoveryRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 8); + if(errn == 0) { + errn = encode_dinChargeParameterDiscoveryResType(stream, &dinBodyType->ChargeParameterDiscoveryRes ); + } + grammarID = 3; + } else if ( dinBodyType->ChargingStatusReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 9); + if(errn == 0) { + errn = encode_dinChargingStatusReqType(stream, &dinBodyType->ChargingStatusReq ); + } + grammarID = 3; + } else if ( dinBodyType->ChargingStatusRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 10); + if(errn == 0) { + errn = encode_dinChargingStatusResType(stream, &dinBodyType->ChargingStatusRes ); + } + grammarID = 3; + } else if ( dinBodyType->ContractAuthenticationReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 11); + if(errn == 0) { + errn = encode_dinContractAuthenticationReqType(stream, &dinBodyType->ContractAuthenticationReq ); + } + grammarID = 3; + } else if ( dinBodyType->ContractAuthenticationRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 12); + if(errn == 0) { + errn = encode_dinContractAuthenticationResType(stream, &dinBodyType->ContractAuthenticationRes ); + } + grammarID = 3; + } else if ( dinBodyType->CurrentDemandReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 13); + if(errn == 0) { + errn = encode_dinCurrentDemandReqType(stream, &dinBodyType->CurrentDemandReq ); + } + grammarID = 3; + } else if ( dinBodyType->CurrentDemandRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 14); + if(errn == 0) { + errn = encode_dinCurrentDemandResType(stream, &dinBodyType->CurrentDemandRes ); + } + grammarID = 3; + } else if ( dinBodyType->MeteringReceiptReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 15); + if(errn == 0) { + errn = encode_dinMeteringReceiptReqType(stream, &dinBodyType->MeteringReceiptReq ); + } + grammarID = 3; + } else if ( dinBodyType->MeteringReceiptRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 16); + if(errn == 0) { + errn = encode_dinMeteringReceiptResType(stream, &dinBodyType->MeteringReceiptRes ); + } + grammarID = 3; + } else if ( dinBodyType->PaymentDetailsReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 17); + if(errn == 0) { + errn = encode_dinPaymentDetailsReqType(stream, &dinBodyType->PaymentDetailsReq ); + } + grammarID = 3; + } else if ( dinBodyType->PaymentDetailsRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 18); + if(errn == 0) { + errn = encode_dinPaymentDetailsResType(stream, &dinBodyType->PaymentDetailsRes ); + } + grammarID = 3; + } else if ( dinBodyType->PowerDeliveryReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 19); + if(errn == 0) { + errn = encode_dinPowerDeliveryReqType(stream, &dinBodyType->PowerDeliveryReq ); + } + grammarID = 3; + } else if ( dinBodyType->PowerDeliveryRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 20); + if(errn == 0) { + errn = encode_dinPowerDeliveryResType(stream, &dinBodyType->PowerDeliveryRes ); + } + grammarID = 3; + } else if ( dinBodyType->PreChargeReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 21); + if(errn == 0) { + errn = encode_dinPreChargeReqType(stream, &dinBodyType->PreChargeReq ); + } + grammarID = 3; + } else if ( dinBodyType->PreChargeRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 22); + if(errn == 0) { + errn = encode_dinPreChargeResType(stream, &dinBodyType->PreChargeRes ); + } + grammarID = 3; + } else if ( dinBodyType->ServiceDetailReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 23); + if(errn == 0) { + errn = encode_dinServiceDetailReqType(stream, &dinBodyType->ServiceDetailReq ); + } + grammarID = 3; + } else if ( dinBodyType->ServiceDetailRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 24); + if(errn == 0) { + errn = encode_dinServiceDetailResType(stream, &dinBodyType->ServiceDetailRes ); + } + grammarID = 3; + } else if ( dinBodyType->ServiceDiscoveryReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 25); + if(errn == 0) { + errn = encode_dinServiceDiscoveryReqType(stream, &dinBodyType->ServiceDiscoveryReq ); + } + grammarID = 3; + } else if ( dinBodyType->ServiceDiscoveryRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 26); + if(errn == 0) { + errn = encode_dinServiceDiscoveryResType(stream, &dinBodyType->ServiceDiscoveryRes ); + } + grammarID = 3; + } else if ( dinBodyType->ServicePaymentSelectionReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 27); + if(errn == 0) { + errn = encode_dinServicePaymentSelectionReqType(stream, &dinBodyType->ServicePaymentSelectionReq ); + } + grammarID = 3; + } else if ( dinBodyType->ServicePaymentSelectionRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 28); + if(errn == 0) { + errn = encode_dinServicePaymentSelectionResType(stream, &dinBodyType->ServicePaymentSelectionRes ); + } + grammarID = 3; + } else if ( dinBodyType->SessionSetupReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 29); + if(errn == 0) { + errn = encode_dinSessionSetupReqType(stream, &dinBodyType->SessionSetupReq ); + } + grammarID = 3; + } else if ( dinBodyType->SessionSetupRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 30); + if(errn == 0) { + errn = encode_dinSessionSetupResType(stream, &dinBodyType->SessionSetupRes ); + } + grammarID = 3; + } else if ( dinBodyType->SessionStopReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 31); + if(errn == 0) { + errn = encode_dinSessionStopType(stream, &dinBodyType->SessionStopReq ); + } + grammarID = 3; + } else if ( dinBodyType->SessionStopRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 32); + if(errn == 0) { + errn = encode_dinSessionStopResType(stream, &dinBodyType->SessionStopRes ); + } + grammarID = 3; + } else if ( dinBodyType->WeldingDetectionReq_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 33); + if(errn == 0) { + errn = encode_dinWeldingDetectionReqType(stream, &dinBodyType->WeldingDetectionReq ); + } + grammarID = 3; + } else if ( dinBodyType->WeldingDetectionRes_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 6, 34); + if(errn == 0) { + errn = encode_dinWeldingDetectionResType(stream, &dinBodyType->WeldingDetectionRes ); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 6, 35); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='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 done = 0; + + + while(!done) { + switch(grammarID) { + case 24: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DepartureTime)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger32(stream, dinAC_EVChargeParameterType->DepartureTime); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 25; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 25: + /* 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; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 26: + /* 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; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 27: + /* 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; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 28: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMinCurrent)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinAC_EVChargeParameterType->EVMinCurrent ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='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; + 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: + /* 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 = 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); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 127; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 127: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}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,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] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SAScheduleListType', base type name='SASchedulesType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTuple{1-UNBOUNDED})', derivedBy='EXTENSION'. */ +static int encode_dinSAScheduleListType(bitstream_t* stream, struct dinSAScheduleListType* dinSAScheduleListType) { + int grammarID = 129; + int done = 0; + + unsigned int dinSAScheduleListType_SAScheduleTuple_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 129: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTuple)] */ + if (dinSAScheduleListType_SAScheduleTuple_currArrayIndex < dinSAScheduleListType->SAScheduleTuple.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinSAScheduleTupleType(stream, &dinSAScheduleListType->SAScheduleTuple.array [dinSAScheduleListType_SAScheduleTuple_currArrayIndex++]); + } + grammarID = 130; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 130: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTuple), END_ELEMENT] */ + if (dinSAScheduleListType_SAScheduleTuple_currArrayIndex < dinSAScheduleListType->SAScheduleTuple.arrayLen ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinSAScheduleTupleType(stream, &dinSAScheduleListType->SAScheduleTuple.array [dinSAScheduleListType_SAScheduleTuple_currArrayIndex++]); + } + grammarID = 130; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010: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; + 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,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 done = 0; + + + while(!done) { + switch(grammarID) { + case 131: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Multiplier)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, (uint32_t)(dinPhysicalValueType->Multiplier + 3)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 132; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 132: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Unit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value)] */ + if ( dinPhysicalValueType->Unit_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 4, dinPhysicalValueType->Unit); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 133; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, dinPhysicalValueType->Value); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 133: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, dinPhysicalValueType->Value); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,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; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 134: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, dinSAScheduleTupleType->SAScheduleTupleID); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 135; + } 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 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + errn = encode_dinSalesTariffType(stream, &dinSAScheduleTupleType->SalesTariff ); + } + grammarID = 3; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010: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; + int done = 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); + 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 = 138; + } 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]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateUpdateReqType->ContractID.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinCertificateUpdateReqType->ContractID.characters, dinCertificateUpdateReqType->ContractID.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 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, &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]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinCertificateUpdateReqType->DHParams.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinCertificateUpdateReqType->DHParams.bytes, dinCertificateUpdateReqType->DHParams.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='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; + 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] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_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 = 148; + 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); + 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 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)] */ + 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 = 158; + } 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); + 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 = 159; + } 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 159: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encode_dinMeterInfoType(stream, &dinMeteringReceiptReqType->MeterInfo ); + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='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; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 160: + /* 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 = 161; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 161: + /* 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='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 done = 0; + + unsigned int dinTransformsType_Transform_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 162: + /* 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; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 163: + /* 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; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ParameterType', base type name='anyType', content type='ELEMENT', isAbstract='false', hasTypeId='false', final='0', block='0', particle='("urn:iso:15118:2:2010:MsgDataTypes":boolValue|"urn:iso:15118:2:2010:MsgDataTypes":byteValue|"urn:iso:15118:2:2010:MsgDataTypes":shortValue|"urn:iso:15118:2:2010:MsgDataTypes":intValue|"urn:iso:15118:2:2010:MsgDataTypes":physicalValue|"urn:iso:15118:2:2010:MsgDataTypes":stringValue)', derivedBy='RESTRICTION'. */ +static int encode_dinParameterType(bitstream_t* stream, struct dinParameterType* dinParameterType) { + int grammarID = 164; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 164: + /* FirstStartTag[ATTRIBUTE[STRING](Name)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinParameterType->Name.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinParameterType->Name.characters, dinParameterType->Name.charactersLen); + } + } + grammarID = 165; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 165: + /* StartTag[ATTRIBUTE[ENUMERATION](ValueType)] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 3, dinParameterType->ValueType); + } + grammarID = 166; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 166: + /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}boolValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}byteValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}shortValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}intValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}physicalValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}stringValue)] */ + if ( dinParameterType->boolValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinParameterType->boolValue); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if ( dinParameterType->byteValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 1); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 8, (uint32_t)(dinParameterType->byteValue + 128)); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if ( dinParameterType->shortValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 2); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger16(stream, dinParameterType->shortValue); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if ( dinParameterType->intValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 3); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger32(stream, dinParameterType->intValue); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else if ( dinParameterType->physicalValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 4); + if(errn == 0) { + errn = encode_dinPhysicalValueType(stream, &dinParameterType->physicalValue ); + } + grammarID = 3; + } else if ( dinParameterType->stringValue_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 3, 5); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinParameterType->stringValue.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinParameterType->stringValue.characters, dinParameterType->stringValue.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010: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 done = 0; + + + while(!done) { + switch(grammarID) { + case 219: + /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[ENUMERATION]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeNBitUnsignedInteger(stream, 5, dinPaymentDetailsResType->ResponseCode); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 220; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 220: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinPaymentDetailsResType->GenChallenge.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, dinPaymentDetailsResType->GenChallenge.characters, dinPaymentDetailsResType->GenChallenge.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 221; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 221: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DateTimeNow)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeInteger64(stream, dinPaymentDetailsResType->DateTimeNow); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010: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; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 222: + /* 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 = 223; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 223: + /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BOOLEAN]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeBoolean(stream, dinServiceType->FreeService); + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010: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; + 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: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; + 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,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 = 224; + int done = 0; + + + 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); + if(errn == 0) { + errn = encode_dinDC_EVStatusType(stream, &dinCurrentDemandReqType->DC_EVStatus ); + } + grammarID = 225; + } 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 ) { + 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 = 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); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_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; + 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: + /* 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#,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 done = 0; + + unsigned int dinServiceTagListType_Service_currArrayIndex = 0; + + while(!done) { + switch(grammarID) { + case 255: + /* 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; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 256: + /* 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; + } 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#,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; + 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)(dinRSAKeyValueType->Modulus.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinRSAKeyValueType->Modulus.bytes, dinRSAKeyValueType->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)(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: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; + 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#,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; + 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 ) { + 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 = 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; + } 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#,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 done = 0; + + + while(!done) { + switch(grammarID) { + case 262: + /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ + if ( dinDSAKeyValueType->P_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDSAKeyValueType->P.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinDSAKeyValueType->P.bytes, dinDSAKeyValueType->P.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 263; + } else if ( dinDSAKeyValueType->G_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDSAKeyValueType->G.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinDSAKeyValueType->G.bytes, dinDSAKeyValueType->G.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 264; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDSAKeyValueType->Y.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinDSAKeyValueType->Y.bytes, dinDSAKeyValueType->Y.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 265; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 263: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q)] */ + if ( dinDSAKeyValueType->Q_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDSAKeyValueType->Q.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinDSAKeyValueType->Q.bytes, dinDSAKeyValueType->Q.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 266; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 266: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ + if ( dinDSAKeyValueType->G_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDSAKeyValueType->G.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinDSAKeyValueType->G.bytes, dinDSAKeyValueType->G.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 264; + } else if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDSAKeyValueType->Y.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinDSAKeyValueType->Y.bytes, dinDSAKeyValueType->Y.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 265; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 264: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ + if ( 1 == 1 ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDSAKeyValueType->Y.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinDSAKeyValueType->Y.bytes, dinDSAKeyValueType->Y.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 265; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 265: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ + if ( dinDSAKeyValueType->J_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDSAKeyValueType->J.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinDSAKeyValueType->J.bytes, dinDSAKeyValueType->J.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 267; + } else if ( dinDSAKeyValueType->Seed_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDSAKeyValueType->Seed.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinDSAKeyValueType->Seed.bytes, dinDSAKeyValueType->Seed.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 268; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 2); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 267: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */ + if ( dinDSAKeyValueType->Seed_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 2, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDSAKeyValueType->Seed.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinDSAKeyValueType->Seed.bytes, dinDSAKeyValueType->Seed.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 268; + } else if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 2, 1); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 268: + /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter)] */ + if ( dinDSAKeyValueType->PgenCounter_isUsed == 1u ) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinDSAKeyValueType->PgenCounter.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinDSAKeyValueType->PgenCounter.bytes, dinDSAKeyValueType->PgenCounter.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,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; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 269: + /* 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 = 270; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 270: + /* 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='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; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 271: + /* 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 = 272; + } 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 272: + /* StartTag[CHARACTERS[BINARY_BASE64]] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(dinSignatureValueType->CONTENT.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, dinSignatureValueType->CONTENT.bytes, dinSignatureValueType->CONTENT.bytesLen); + } + } + grammarID = 3; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + case 3: + /* Element[END_ELEMENT] */ + if (1==1) { + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + done = 1; + } + grammarID = 4; + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + break; + default: + errn = EXI_ERROR_UNKOWN_GRAMMAR_ID; + break; + } + if(errn) { + done = 1; + } + } + return errn; +} + +/* Complex type name='urn:iso:15118:2:2010: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 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, dinSessionStopResType->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,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; + int done = 0; + + + while(!done) { + switch(grammarID) { + case 273: + /* 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 = 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); + 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 = 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) { + /* 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) */ + errn = encodeNBitUnsignedInteger(stream, 7, 0); + if(errn == 0) { + errn = encode_dinAC_EVChargeParameterType(stream, &exiDoc->AC_EVChargeParameter ); + } + } else if ( exiDoc->AC_EVSEChargeParameter_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEChargeParameter) */ + errn = encodeNBitUnsignedInteger(stream, 7, 1); + if(errn == 0) { + errn = encode_dinAC_EVSEChargeParameterType(stream, &exiDoc->AC_EVSEChargeParameter ); + } + } else if ( exiDoc->AC_EVSEStatus_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatus) */ + errn = encodeNBitUnsignedInteger(stream, 7, 2); + if(errn == 0) { + errn = encode_dinAC_EVSEStatusType(stream, &exiDoc->AC_EVSEStatus ); + } + } else if ( exiDoc->BodyElement_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDef}BodyElement) */ + errn = encodeNBitUnsignedInteger(stream, 7, 3); + if(errn == 0) { + errn = encode_dinBodyBaseType(stream, &exiDoc->BodyElement ); + } + } else if ( exiDoc->CableCheckReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckReq) */ + errn = encodeNBitUnsignedInteger(stream, 7, 4); + if(errn == 0) { + errn = encode_dinCableCheckReqType(stream, &exiDoc->CableCheckReq ); + } + } else if ( exiDoc->CableCheckRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckRes) */ + errn = encodeNBitUnsignedInteger(stream, 7, 5); + if(errn == 0) { + errn = encode_dinCableCheckResType(stream, &exiDoc->CableCheckRes ); + } + } else if ( exiDoc->CanonicalizationMethod_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod) */ + errn = encodeNBitUnsignedInteger(stream, 7, 6); + if(errn == 0) { + errn = encode_dinCanonicalizationMethodType(stream, &exiDoc->CanonicalizationMethod ); + } + } else if ( exiDoc->CertificateInstallationReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationReq) */ + errn = encodeNBitUnsignedInteger(stream, 7, 7); + if(errn == 0) { + errn = encode_dinCertificateInstallationReqType(stream, &exiDoc->CertificateInstallationReq ); + } + } else if ( exiDoc->CertificateInstallationRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationRes) */ + errn = encodeNBitUnsignedInteger(stream, 7, 8); + if(errn == 0) { + errn = encode_dinCertificateInstallationResType(stream, &exiDoc->CertificateInstallationRes ); + } + } else if ( exiDoc->CertificateUpdateReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateReq) */ + errn = encodeNBitUnsignedInteger(stream, 7, 9); + if(errn == 0) { + errn = encode_dinCertificateUpdateReqType(stream, &exiDoc->CertificateUpdateReq ); + } + } else if ( exiDoc->CertificateUpdateRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateRes) */ + errn = encodeNBitUnsignedInteger(stream, 7, 10); + if(errn == 0) { + errn = encode_dinCertificateUpdateResType(stream, &exiDoc->CertificateUpdateRes ); + } + } else if ( exiDoc->ChargeParameterDiscoveryReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryReq) */ + errn = encodeNBitUnsignedInteger(stream, 7, 11); + if(errn == 0) { + errn = encode_dinChargeParameterDiscoveryReqType(stream, &exiDoc->ChargeParameterDiscoveryReq ); + } + } else if ( exiDoc->ChargeParameterDiscoveryRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryRes) */ + errn = encodeNBitUnsignedInteger(stream, 7, 12); + if(errn == 0) { + errn = encode_dinChargeParameterDiscoveryResType(stream, &exiDoc->ChargeParameterDiscoveryRes ); + } + } else if ( exiDoc->ChargingStatusReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusReq) */ + errn = encodeNBitUnsignedInteger(stream, 7, 13); + if(errn == 0) { + errn = encode_dinChargingStatusReqType(stream, &exiDoc->ChargingStatusReq ); + } + } else if ( exiDoc->ChargingStatusRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusRes) */ + errn = encodeNBitUnsignedInteger(stream, 7, 14); + if(errn == 0) { + errn = encode_dinChargingStatusResType(stream, &exiDoc->ChargingStatusRes ); + } + } else if ( exiDoc->ContractAuthenticationReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationReq) */ + errn = encodeNBitUnsignedInteger(stream, 7, 15); + if(errn == 0) { + errn = encode_dinContractAuthenticationReqType(stream, &exiDoc->ContractAuthenticationReq ); + } + } else if ( exiDoc->ContractAuthenticationRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationRes) */ + errn = encodeNBitUnsignedInteger(stream, 7, 16); + if(errn == 0) { + errn = encode_dinContractAuthenticationResType(stream, &exiDoc->ContractAuthenticationRes ); + } + } else if ( exiDoc->CurrentDemandReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandReq) */ + errn = encodeNBitUnsignedInteger(stream, 7, 17); + if(errn == 0) { + errn = encode_dinCurrentDemandReqType(stream, &exiDoc->CurrentDemandReq ); + } + } else if ( exiDoc->CurrentDemandRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandRes) */ + errn = encodeNBitUnsignedInteger(stream, 7, 18); + if(errn == 0) { + errn = encode_dinCurrentDemandResType(stream, &exiDoc->CurrentDemandRes ); + } + } else if ( exiDoc->DC_EVChargeParameter_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVChargeParameter) */ + errn = encodeNBitUnsignedInteger(stream, 7, 19); + if(errn == 0) { + errn = encode_dinDC_EVChargeParameterType(stream, &exiDoc->DC_EVChargeParameter ); + } + } else if ( exiDoc->DC_EVPowerDeliveryParameter_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVPowerDeliveryParameter) */ + errn = encodeNBitUnsignedInteger(stream, 7, 20); + if(errn == 0) { + errn = encode_dinDC_EVPowerDeliveryParameterType(stream, &exiDoc->DC_EVPowerDeliveryParameter ); + } + } else if ( exiDoc->DC_EVSEChargeParameter_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEChargeParameter) */ + errn = encodeNBitUnsignedInteger(stream, 7, 21); + if(errn == 0) { + errn = encode_dinDC_EVSEChargeParameterType(stream, &exiDoc->DC_EVSEChargeParameter ); + } + } else if ( exiDoc->DC_EVSEStatus_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatus) */ + errn = encodeNBitUnsignedInteger(stream, 7, 22); + if(errn == 0) { + errn = encode_dinDC_EVSEStatusType(stream, &exiDoc->DC_EVSEStatus ); + } + } else if ( exiDoc->DC_EVStatus_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVStatus) */ + errn = encodeNBitUnsignedInteger(stream, 7, 23); + if(errn == 0) { + errn = encode_dinDC_EVStatusType(stream, &exiDoc->DC_EVStatus ); + } + } else if ( exiDoc->DSAKeyValue_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue) */ + errn = encodeNBitUnsignedInteger(stream, 7, 24); + if(errn == 0) { + errn = encode_dinDSAKeyValueType(stream, &exiDoc->DSAKeyValue ); + } + } else if ( exiDoc->DigestMethod_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod) */ + errn = encodeNBitUnsignedInteger(stream, 7, 25); + if(errn == 0) { + errn = encode_dinDigestMethodType(stream, &exiDoc->DigestMethod ); + } + } else if ( exiDoc->DigestValue_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue) */ + errn = encodeNBitUnsignedInteger(stream, 7, 26); + if(errn == 0) { + /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiDoc->DigestValue.bytesLen)); + if (errn == 0) { + errn = encodeBytes(stream, exiDoc->DigestValue.bytes, exiDoc->DigestValue.bytesLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiDoc->EVChargeParameter_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVChargeParameter) */ + errn = encodeNBitUnsignedInteger(stream, 7, 27); + if(errn == 0) { + errn = encode_dinEVChargeParameterType(stream, &exiDoc->EVChargeParameter ); + } + } else if ( exiDoc->EVPowerDeliveryParameter_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVPowerDeliveryParameter) */ + errn = encodeNBitUnsignedInteger(stream, 7, 28); + if(errn == 0) { + errn = encode_dinEVPowerDeliveryParameterType(stream, &exiDoc->EVPowerDeliveryParameter ); + } + } else if ( exiDoc->EVSEChargeParameter_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEChargeParameter) */ + errn = encodeNBitUnsignedInteger(stream, 7, 29); + if(errn == 0) { + errn = encode_dinEVSEChargeParameterType(stream, &exiDoc->EVSEChargeParameter ); + } + } else if ( exiDoc->EVSEStatus_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatus) */ + errn = encodeNBitUnsignedInteger(stream, 7, 30); + if(errn == 0) { + errn = encode_dinEVSEStatusType(stream, &exiDoc->EVSEStatus ); + } + } else if ( exiDoc->EVStatus_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVStatus) */ + errn = encodeNBitUnsignedInteger(stream, 7, 31); + if(errn == 0) { + errn = encode_dinEVStatusType(stream, &exiDoc->EVStatus ); + } + } else if ( exiDoc->Entry_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Entry) */ + errn = encodeNBitUnsignedInteger(stream, 7, 32); + if(errn == 0) { + errn = encode_dinEntryType(stream, &exiDoc->Entry ); + } + } else if ( exiDoc->KeyInfo_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo) */ + errn = encodeNBitUnsignedInteger(stream, 7, 33); + if(errn == 0) { + errn = encode_dinKeyInfoType(stream, &exiDoc->KeyInfo ); + } + } else if ( exiDoc->KeyName_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) */ + errn = encodeNBitUnsignedInteger(stream, 7, 34); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiDoc->KeyName.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, exiDoc->KeyName.characters, exiDoc->KeyName.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiDoc->KeyValue_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue) */ + errn = encodeNBitUnsignedInteger(stream, 7, 35); + if(errn == 0) { + errn = encode_dinKeyValueType(stream, &exiDoc->KeyValue ); + } + } else if ( exiDoc->Manifest_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Manifest) */ + errn = encodeNBitUnsignedInteger(stream, 7, 36); + if(errn == 0) { + errn = encode_dinManifestType(stream, &exiDoc->Manifest ); + } + } else if ( exiDoc->MeteringReceiptReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptReq) */ + errn = encodeNBitUnsignedInteger(stream, 7, 37); + if(errn == 0) { + errn = encode_dinMeteringReceiptReqType(stream, &exiDoc->MeteringReceiptReq ); + } + } else if ( exiDoc->MeteringReceiptRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptRes) */ + errn = encodeNBitUnsignedInteger(stream, 7, 38); + if(errn == 0) { + errn = encode_dinMeteringReceiptResType(stream, &exiDoc->MeteringReceiptRes ); + } + } else if ( exiDoc->MgmtData_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) */ + errn = encodeNBitUnsignedInteger(stream, 7, 39); + if(errn == 0) { + /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + if(errn == 0) { + /* encode string as string table miss (+2 len)*/ + errn = encodeUnsignedInteger16(stream, (uint16_t)(exiDoc->MgmtData.charactersLen + 2)); + if (errn == 0) { + errn = encodeCharacters(stream, exiDoc->MgmtData.characters, exiDoc->MgmtData.charactersLen); + } + /* valid EE */ + errn = encodeNBitUnsignedInteger(stream, 1, 0); + } + } + } else if ( exiDoc->Object_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object) */ + errn = encodeNBitUnsignedInteger(stream, 7, 40); + if(errn == 0) { + errn = encode_dinObjectType(stream, &exiDoc->Object ); + } + } else if ( exiDoc->PGPData_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData) */ + errn = encodeNBitUnsignedInteger(stream, 7, 41); + if(errn == 0) { + errn = encode_dinPGPDataType(stream, &exiDoc->PGPData ); + } + } else if ( exiDoc->PMaxScheduleEntry_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleEntry) */ + errn = encodeNBitUnsignedInteger(stream, 7, 42); + if(errn == 0) { + errn = encode_dinPMaxScheduleEntryType(stream, &exiDoc->PMaxScheduleEntry ); + } + } else if ( exiDoc->PaymentDetailsReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsReq) */ + errn = encodeNBitUnsignedInteger(stream, 7, 43); + if(errn == 0) { + errn = encode_dinPaymentDetailsReqType(stream, &exiDoc->PaymentDetailsReq ); + } + } else if ( exiDoc->PaymentDetailsRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsRes) */ + errn = encodeNBitUnsignedInteger(stream, 7, 44); + if(errn == 0) { + errn = encode_dinPaymentDetailsResType(stream, &exiDoc->PaymentDetailsRes ); + } + } else if ( exiDoc->PowerDeliveryReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryReq) */ + errn = encodeNBitUnsignedInteger(stream, 7, 45); + if(errn == 0) { + errn = encode_dinPowerDeliveryReqType(stream, &exiDoc->PowerDeliveryReq ); + } + } else if ( exiDoc->PowerDeliveryRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryRes) */ + errn = encodeNBitUnsignedInteger(stream, 7, 46); + if(errn == 0) { + errn = encode_dinPowerDeliveryResType(stream, &exiDoc->PowerDeliveryRes ); + } + } else if ( exiDoc->PreChargeReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeReq) */ + errn = encodeNBitUnsignedInteger(stream, 7, 47); + if(errn == 0) { + errn = encode_dinPreChargeReqType(stream, &exiDoc->PreChargeReq ); + } + } else if ( exiDoc->PreChargeRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeRes) */ + errn = encodeNBitUnsignedInteger(stream, 7, 48); + if(errn == 0) { + errn = encode_dinPreChargeResType(stream, &exiDoc->PreChargeRes ); + } + } else if ( exiDoc->RSAKeyValue_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue) */ + errn = encodeNBitUnsignedInteger(stream, 7, 49); + if(errn == 0) { + errn = encode_dinRSAKeyValueType(stream, &exiDoc->RSAKeyValue ); + } + } else if ( exiDoc->Reference_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference) */ + errn = encodeNBitUnsignedInteger(stream, 7, 50); + if(errn == 0) { + errn = encode_dinReferenceType(stream, &exiDoc->Reference ); + } + } else if ( exiDoc->RelativeTimeInterval_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval) */ + errn = encodeNBitUnsignedInteger(stream, 7, 51); + if(errn == 0) { + errn = encode_dinRelativeTimeIntervalType(stream, &exiDoc->RelativeTimeInterval ); + } + } else if ( exiDoc->RetrievalMethod_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod) */ + errn = encodeNBitUnsignedInteger(stream, 7, 52); + if(errn == 0) { + errn = encode_dinRetrievalMethodType(stream, &exiDoc->RetrievalMethod ); + } + } else if ( exiDoc->SAScheduleList_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleList) */ + errn = encodeNBitUnsignedInteger(stream, 7, 53); + if(errn == 0) { + errn = encode_dinSAScheduleListType(stream, &exiDoc->SAScheduleList ); + } + } else if ( exiDoc->SASchedules_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SASchedules) */ + errn = encodeNBitUnsignedInteger(stream, 7, 54); + if(errn == 0) { + errn = encode_dinSASchedulesType(stream, &exiDoc->SASchedules ); + } + } else if ( exiDoc->SPKIData_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData) */ + errn = encodeNBitUnsignedInteger(stream, 7, 55); + if(errn == 0) { + errn = encode_dinSPKIDataType(stream, &exiDoc->SPKIData ); + } + } else if ( exiDoc->SalesTariffEntry_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffEntry) */ + errn = encodeNBitUnsignedInteger(stream, 7, 56); + if(errn == 0) { + errn = encode_dinSalesTariffEntryType(stream, &exiDoc->SalesTariffEntry ); + } + } else if ( exiDoc->ServiceCharge_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCharge) */ + errn = encodeNBitUnsignedInteger(stream, 7, 57); + if(errn == 0) { + errn = encode_dinServiceChargeType(stream, &exiDoc->ServiceCharge ); + } + } else if ( exiDoc->ServiceDetailReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailReq) */ + errn = encodeNBitUnsignedInteger(stream, 7, 58); + if(errn == 0) { + errn = encode_dinServiceDetailReqType(stream, &exiDoc->ServiceDetailReq ); + } + } else if ( exiDoc->ServiceDetailRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailRes) */ + errn = encodeNBitUnsignedInteger(stream, 7, 59); + if(errn == 0) { + errn = encode_dinServiceDetailResType(stream, &exiDoc->ServiceDetailRes ); + } + } else if ( exiDoc->ServiceDiscoveryReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryReq) */ + errn = encodeNBitUnsignedInteger(stream, 7, 60); + if(errn == 0) { + errn = encode_dinServiceDiscoveryReqType(stream, &exiDoc->ServiceDiscoveryReq ); + } + } else if ( exiDoc->ServiceDiscoveryRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryRes) */ + errn = encodeNBitUnsignedInteger(stream, 7, 61); + if(errn == 0) { + errn = encode_dinServiceDiscoveryResType(stream, &exiDoc->ServiceDiscoveryRes ); + } + } else if ( exiDoc->ServicePaymentSelectionReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionReq) */ + errn = encodeNBitUnsignedInteger(stream, 7, 62); + if(errn == 0) { + errn = encode_dinServicePaymentSelectionReqType(stream, &exiDoc->ServicePaymentSelectionReq ); + } + } else if ( exiDoc->ServicePaymentSelectionRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionRes) */ + errn = encodeNBitUnsignedInteger(stream, 7, 63); + if(errn == 0) { + errn = encode_dinServicePaymentSelectionResType(stream, &exiDoc->ServicePaymentSelectionRes ); + } + } else if ( exiDoc->SessionSetupReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupReq) */ + errn = encodeNBitUnsignedInteger(stream, 7, 64); + if(errn == 0) { + errn = encode_dinSessionSetupReqType(stream, &exiDoc->SessionSetupReq ); + } + } else if ( exiDoc->SessionSetupRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupRes) */ + errn = encodeNBitUnsignedInteger(stream, 7, 65); + if(errn == 0) { + errn = encode_dinSessionSetupResType(stream, &exiDoc->SessionSetupRes ); + } + } else if ( exiDoc->SessionStopReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopReq) */ + errn = encodeNBitUnsignedInteger(stream, 7, 66); + if(errn == 0) { + errn = encode_dinSessionStopType(stream, &exiDoc->SessionStopReq ); + } + } else if ( exiDoc->SessionStopRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopRes) */ + errn = encodeNBitUnsignedInteger(stream, 7, 67); + if(errn == 0) { + errn = encode_dinSessionStopResType(stream, &exiDoc->SessionStopRes ); + } + } else if ( exiDoc->Signature_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature) */ + errn = encodeNBitUnsignedInteger(stream, 7, 68); + if(errn == 0) { + errn = encode_dinSignatureType(stream, &exiDoc->Signature ); + } + } else if ( exiDoc->SignatureMethod_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod) */ + errn = encodeNBitUnsignedInteger(stream, 7, 69); + if(errn == 0) { + errn = encode_dinSignatureMethodType(stream, &exiDoc->SignatureMethod ); + } + } else if ( exiDoc->SignatureProperties_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperties) */ + errn = encodeNBitUnsignedInteger(stream, 7, 70); + if(errn == 0) { + errn = encode_dinSignaturePropertiesType(stream, &exiDoc->SignatureProperties ); + } + } else if ( exiDoc->SignatureProperty_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty) */ + errn = encodeNBitUnsignedInteger(stream, 7, 71); + if(errn == 0) { + errn = encode_dinSignaturePropertyType(stream, &exiDoc->SignatureProperty ); + } + } else if ( exiDoc->SignatureValue_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue) */ + errn = encodeNBitUnsignedInteger(stream, 7, 72); + if(errn == 0) { + errn = encode_dinSignatureValueType(stream, &exiDoc->SignatureValue ); + } + } else if ( exiDoc->SignedInfo_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo) */ + errn = encodeNBitUnsignedInteger(stream, 7, 73); + if(errn == 0) { + errn = encode_dinSignedInfoType(stream, &exiDoc->SignedInfo ); + } + } else if ( exiDoc->TimeInterval_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval) */ + errn = encodeNBitUnsignedInteger(stream, 7, 74); + if(errn == 0) { + errn = encode_dinIntervalType(stream, &exiDoc->TimeInterval ); + } + } else if ( exiDoc->Transform_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform) */ + errn = encodeNBitUnsignedInteger(stream, 7, 75); + if(errn == 0) { + errn = encode_dinTransformType(stream, &exiDoc->Transform ); + } + } else if ( exiDoc->Transforms_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms) */ + errn = encodeNBitUnsignedInteger(stream, 7, 76); + if(errn == 0) { + errn = encode_dinTransformsType(stream, &exiDoc->Transforms ); + } + } else if ( exiDoc->V2G_Message_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgDef}V2G_Message) */ + errn = encodeNBitUnsignedInteger(stream, 7, 77); + if(errn == 0) { + errn = encode_dinAnonType_V2G_Message(stream, &exiDoc->V2G_Message ); + } + } else if ( exiDoc->WeldingDetectionReq_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionReq) */ + errn = encodeNBitUnsignedInteger(stream, 7, 78); + if(errn == 0) { + errn = encode_dinWeldingDetectionReqType(stream, &exiDoc->WeldingDetectionReq ); + } + } else if ( exiDoc->WeldingDetectionRes_isUsed == 1u ) { + /* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionRes) */ + errn = encodeNBitUnsignedInteger(stream, 7, 79); + if(errn == 0) { + errn = encode_dinWeldingDetectionResType(stream, &exiDoc->WeldingDetectionRes ); + } + } else if ( exiDoc->X509Data_isUsed == 1u ) { + /* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data) */ + errn = encodeNBitUnsignedInteger(stream, 7, 80); + if(errn == 0) { + errn = encode_dinX509DataType(stream, &exiDoc->X509Data ); + } + } else { + errn = EXI_ERROR_UNKOWN_EVENT; + } + + } + + 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 new file mode 100644 index 0000000..ae2cb35 --- /dev/null +++ b/src/din/dinEXIDatatypesEncoder.h @@ -0,0 +1,63 @@ +/* + * Copyright (C) 2007-2014 Siemens AG + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published + * by the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +/******************************************************************* + * + * @author Daniel.Peintner.EXT@siemens.com + * @version 0.9.1 + * @contact Joerg.Heuer@siemens.com + * + *

Code generated by EXIdizer

+ *

Schema: V2G_CI_MsgDef.xsd

+ * + * + ********************************************************************/ + + + +/** + * \file EXIDatatypesEncoder.h + * \brief Encoder for datatype definitions + * + */ + +#ifndef EXI_din_DATATYPES_ENCODER_H +#define EXI_din_DATATYPES_ENCODER_H + +#ifdef __cplusplus +extern "C" { +#endif + + +#include "dinEXIDatatypes.h" + +#if DEPLOY_DIN_CODEC == SUPPORT_YES + +#include + +#include "EXITypes.h" + + +int encode_dinExiDocument(bitstream_t* stream, struct dinEXIDocument* exiDoc); + +#endif /* DEPLOY_DIN_CODEC */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/src/test/main.c b/src/test/main.c index 930ed5b..5179135 100644 --- a/src/test/main.c +++ b/src/test/main.c @@ -19,7 +19,7 @@ * * @author Daniel.Peintner.EXT@siemens.com * @author Sebastian.Kaebisch@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Switch for sample programs: EXI codec only or for entire V2G example

diff --git a/src/test/main.h b/src/test/main.h index 039a20b..4912dc2 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 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * * diff --git a/src/test/main_databinder.c b/src/test/main_databinder.c index 8d98e85..8e0fa3a 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 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * *

Code generated by EXIdizer

@@ -69,7 +69,7 @@ int main_databinder(int argc, char *argv[]) { struct v2gEXIDocument exiDoc; int errn = 0; - bitstream_t iStream, oStream; + bitstream_t iStream, oStream; #if EXI_STREAM == BYTE_ARRAY uint16_t posDecode; diff --git a/src/test/main_example.c b/src/test/main_example.c index c591670..3e3e407 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 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * * @@ -147,9 +147,8 @@ static int deserializeStream2EXI(bitstream_t* streamIn, struct v2gEXIDocument* e return errn; } - /** Example implementation of the app handshake protocol for the EVSE side */ -static int appHandshakeHandler(bitstream_t iStream, bitstream_t oStream) { +static int appHandshakeHandler(bitstream_t* iStream, bitstream_t* oStream) { struct appHandEXIDocument appHandResp; int i; struct appHandEXIDocument exiDoc; @@ -157,9 +156,9 @@ static int appHandshakeHandler(bitstream_t iStream, bitstream_t oStream) { uint16_t payloadLengthDec; - if ( (errn = read_v2gtpHeader(iStream.data, &payloadLengthDec)) == 0) { - *iStream.pos = V2GTP_HEADER_LENGTH; - if( (errn = decode_appHandExiDocument(&iStream, &exiDoc)) ) { + if ( (errn = read_v2gtpHeader(iStream->data, &payloadLengthDec)) == 0) { + *iStream->pos = V2GTP_HEADER_LENGTH; + if( (errn = decode_appHandExiDocument(iStream, &exiDoc)) ) { /* an error occured */ return errn; } @@ -188,9 +187,9 @@ static int appHandshakeHandler(bitstream_t iStream, bitstream_t oStream) { appHandResp.supportedAppProtocolRes.SchemaID = exiDoc.supportedAppProtocolReq.AppProtocol.array[0].SchemaID; /* signal the protocol by the provided schema id*/ appHandResp.supportedAppProtocolRes.SchemaID_isUsed = 1u; - *oStream.pos = V2GTP_HEADER_LENGTH; - if( (errn = encode_appHandExiDocument(&oStream, &appHandResp)) == 0) { - errn = write_v2gtpHeader(oStream.data, (*oStream.pos)-V2GTP_HEADER_LENGTH, V2GTP_EXI_TYPE); + *oStream->pos = V2GTP_HEADER_LENGTH; + if( (errn = encode_appHandExiDocument(oStream, &appHandResp)) == 0) { + errn = write_v2gtpHeader(oStream->data, (*oStream->pos)-V2GTP_HEADER_LENGTH, V2GTP_EXI_TYPE); } @@ -205,7 +204,7 @@ static int appHandshake() uint16_t payloadLengthDec; uint16_t pos1 = V2GTP_HEADER_LENGTH; /* v2gtp header */ - uint16_t pos2; + uint16_t pos2 = 0; struct appHandEXIDocument handshake; struct appHandEXIDocument handshakeResp; @@ -254,7 +253,7 @@ static int appHandshake() if (errn == 0) { /* read app handshake request & generate response */ - errn = appHandshakeHandler(stream1, stream2); + errn = appHandshakeHandler(&stream1, &stream2); } if (errn == 0) { diff --git a/src/transport/v2gtp.c b/src/transport/v2gtp.c index e35e148..ac24b55 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 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * ********************************************************************/ @@ -57,8 +57,8 @@ int write_v2gtpHeader(uint8_t* outStream, uint16_t outStreamLength, uint16_t pay /* write payload length */ outStream[7] = (uint8_t)(outStreamLength & 0xFF); outStream[6] = (uint8_t)(outStreamLength>>8 & 0xFF); - outStream[5] = (uint8_t)(outStreamLength>>16 & 0xFF); - outStream[4] = (uint8_t)(outStreamLength>>24 & 0xFF); + outStream[5] = (uint8_t) 0; /* uint16 only, no need for (outStreamLength>>16 & 0xFF); */ + outStream[4] = (uint8_t) 0; /* uint16 only, no need for (outStreamLength>>24 & 0xFF); */ /* here, the outStream length have to be resized by the v2gtp offset*/ /**outStreamLength += V2GTP_HEADER_LENGTH;*/ diff --git a/src/transport/v2gtp.h b/src/transport/v2gtp.h index 8f40bc7..728a701 100644 --- a/src/transport/v2gtp.h +++ b/src/transport/v2gtp.h @@ -19,7 +19,7 @@ /******************************************************************* * * @author Sebastian.Kaebisch@siemens.com - * @version 0.9 + * @version 0.9.1 * @contact Joerg.Heuer@siemens.com * ********************************************************************/