diff --git a/src/codec/EXIEncoder.c b/src/codec/EXIEncoder.c index 3873f5a..9e9efa0 100644 --- a/src/codec/EXIEncoder.c +++ b/src/codec/EXIEncoder.c @@ -50,105 +50,6 @@ static int errn; /* ==================================== */ -/* <0 ... Error, 1 .. Not-Found, 0.. Success */ -static int _exiGet1stLevelEventCode(exi_state_t* state, exi_event_t eventType, uint16_t* resGrammarID) { - /* retrieve current grammar-rule ID */ - uint16_t grammarID = state->grammarStack[ state->stackIndex ]; - - switch(grammarID) { - case DOCUMENT: - switch(eventType) { - case START_DOCUMENT: - *resGrammarID = 0; - return 0; - default: - return 1; /* not found */ - } - break; - case DOC_CONTENT: - switch(eventType) { - /* TODO other IDs */ - case START_ELEMENT_GENERIC: - *resGrammarID = 0; - return 0; - default: - return 1; /* not found */ - } - break; - case DOC_END: - switch(eventType) { - case END_DOCUMENT: - *resGrammarID = 0; - return 0; - default: - return 1; /* not found */ - } - break; - case UR_TYPE_GRAMMAR_0: - switch(eventType) { - case ATTRIBUTE_GENERIC: - *resGrammarID = 0; - return 0; - case START_ELEMENT_GENERIC: - *resGrammarID = 1; - return 0; - case END_ELEMENT: - *resGrammarID = 2; - return 0; - case CHARACTERS_GENERIC: - *resGrammarID = 3; - return 0; - default: - return 1; /* not found */ - } - break; - case UR_TYPE_GRAMMAR_1: - switch(eventType) { - case START_ELEMENT_GENERIC: - *resGrammarID = 0; - return 0; - case END_ELEMENT: - *resGrammarID = 1; - return 0; - case CHARACTERS_GENERIC: - *resGrammarID = 2; - return 0; - default: - return 1; /* not found */ - } - break; - } - - return 1; /* not found */ -} - - -static int _exiGetEventCodeLength(exi_state_t* state, uint16_t* eventCodeLength) { - /* retrieve current grammar-rule ID */ - uint16_t grammarID = state->grammarStack[ state->stackIndex ]; - - switch(grammarID) { - /* TODO OTHER IDs */ - case DOCUMENT: - *eventCodeLength = 0; - return 0; - case DOC_CONTENT: - /* TODO other root elements */ - *eventCodeLength = IS_STRICT ? 0 : 1; - return 0; - case DOC_END: - *eventCodeLength = IS_STRICT ? 0 : 1; - return 0; - case UR_TYPE_GRAMMAR_0: - *eventCodeLength = IS_STRICT ? 4 : 5; - return 0; - case UR_TYPE_GRAMMAR_1: - *eventCodeLength = IS_STRICT ? 3 : 4; - return 0; - } - - return EXI_ERROR_UNEXPECTED_GRAMMAR_ID; -} static int _encodeNBitIntegerValue(bitstream_t* stream, integer_t* iv, uint16_t nbits, int32_t lowerBound) { int errn; @@ -180,12 +81,16 @@ static int _encodeNBitIntegerValue(bitstream_t* stream, integer_t* iv, uint16_t case INTEGER_64: val = iv->val.uint64 - lowerBound; break; + default: + return -1; } errn = encodeNBitUnsignedInteger(stream, nbits, val); return errn; } + + #define MAX_NUMBER_CHARACTERS 50 char nameCharacters [MAX_NUMBER_CHARACTERS]; @@ -249,53 +154,6 @@ static int _exiEncodeNamespaceUriID(bitstream_t* stream, exi_name_table_prepopul } -#if EXI_DEBUG == EXI_DEBUG_ON -static int _exiEncodeNamespaceUri(bitstream_t* stream, exi_name_table_prepopulated_t* nameTable, exi_name_table_runtime_t* runtimeTable, - char** uri, uint16_t* uriID) { - int errn; - uint16_t uriCodingLength; - uint16_t uriSize; - - errn = exiGetUriSize(nameTable, runtimeTable, &uriSize); - if (errn) { - return errn; - } - /* URI Entries + 1 */ - errn = exiGetCodingLength(uriSize + 1, &uriCodingLength); - if (errn) { - return errn; - } - - errn = exiGetUriID(nameTable, runtimeTable, *uri, uriID); - if (errn < 0) { - return errn; - } else if (errn == 1) { - /* uri string value was not found */ - /* ==> zero (0) as an n-nit unsigned integer */ - /* followed by uri encoded as string */ - errn = encodeNBitUnsignedInteger(stream, uriCodingLength, 0); - if (errn) { - return errn; - } - /* ASCII String */ - errn = encodeASCII(stream, *uri); - if (errn) { - return errn; - } - /* after encoding string value is added to table */ - /* in UCD Profile NOT */ - *uriID = uriSize; - } else { - /* uri string value found */ - /* ==> value(i+1) is encoded as n-bit unsigned integer */ - errn = encodeNBitUnsignedInteger(stream, uriCodingLength, *uriID + 1); - } - - return errn; -} -#endif /*EXI_DEBUG*/ - - static int _exiEncodeLocalNameID(bitstream_t* stream, exi_name_table_prepopulated_t* nameTable, exi_name_table_runtime_t* runtimeTable, uint16_t uriID, uint16_t localNameID) { int errn; @@ -324,78 +182,6 @@ static int _exiEncodeLocalNameID(bitstream_t* stream, exi_name_table_prepopulate } - -#if EXI_DEBUG == EXI_DEBUG_ON -static int _exiEncodeLocalName(bitstream_t* stream, exi_name_table_prepopulated_t* nameTable, exi_name_table_runtime_t* runtimeTable, - char** localName, - uint16_t uriID) { - int errn; - uint16_t localNameID; - uint16_t localNameSize; - uint16_t localNameCodingLength; - uint32_t slen; - - /* look for localNameID */ - errn = exiGetLocalNameID(nameTable, runtimeTable, uriID, *localName, &localNameID); - if (errn < 0) { - return errn; - } - - if (errn == 1) { - /* string value was not found in local partition */ - /* ==> string literal is encoded as a String */ - /* with the length of the string incremented by one */ - slen = (uint32_t)strlen(*localName); - errn = encodeUnsignedInteger32(stream, slen + 1 ); - if (errn >= 0) { - errn = encodeASCIICharacters(stream, *localName, slen); - } - } else { - /* string value found in local partition */ - /* ==> string value is represented as zero (0) encoded as an */ - errn = encodeUnsignedInteger32(stream, 0 ); - if (errn < 0) { - return errn; - } - /* Unsigned Integer followed by an the compact identifier of the */ - /* string value as an n-bit unsigned integer n is log2 m and m is */ - /* the number of entries in the string table partition */ - errn = exiGetLocalNameSize(nameTable, runtimeTable, uriID, &localNameSize); - if (errn < 0) { - return errn; - } - errn = exiGetCodingLength(localNameSize, &localNameCodingLength); - if (errn) { - return errn; - } - errn = encodeNBitUnsignedInteger(stream, localNameCodingLength, localNameID); - } - - return errn; -} -#endif /*EXI_DEBUG*/ - - -#if EXI_DEBUG == EXI_DEBUG_ON -static int _exiEncodeQName(bitstream_t* stream, exi_name_table_prepopulated_t* nameTable, exi_name_table_runtime_t* runtimeTable, - char** uri, char** localName) { - uint16_t uriID; - /* uri */ - int errn =_exiEncodeNamespaceUri(stream, nameTable, runtimeTable, uri, &uriID); - if (errn) { - return errn; - } - /* localName */ - errn = _exiEncodeLocalName(stream, nameTable, runtimeTable, localName, uriID); - if (errn) { - return errn; - } - - return 0 ; -} -#endif /*EXI_DEBUG*/ - - static int _exiEncodeStartElement(bitstream_t* stream, uint16_t nbits, uint32_t val, exi_state_t* state, eqname_t* se, uint16_t stackId, uint16_t newState) { @@ -410,35 +196,6 @@ static int _exiEncodeStartElement(bitstream_t* stream, uint16_t nbits, return exiPushStack(state, newState, se); } -#if EXI_DEBUG == EXI_DEBUG_ON - -static eqname_t eqnGeneric = {65535, 65535}; /* UNSIGNED_INT16_MAX */ - -static int _exiEncodeStartElementGeneric(bitstream_t* stream, uint16_t nbits, - uint32_t val, exi_state_t* state, char** uri, char** localName, uint16_t stackId, - uint16_t newState) { - uint16_t uriID; - /* event-code */ - int errn = encodeNBitUnsignedInteger(stream, nbits, val); - if (errn) { - return errn; - } - /* qualified name */ - errn = _exiEncodeNamespaceUri(stream, &(state->nameTablePrepopulated), &(state->nameTableRuntime), uri, &uriID); - if (errn) { - return errn; - } - errn = _exiEncodeLocalName(stream, &(state->nameTablePrepopulated), &(state->nameTableRuntime), localName, uriID); - if (errn) { - return errn; - } - - /* move on */ - state->grammarStack[state->stackIndex] = stackId; - /* push element on stack */ - return exiPushStack(state, newState, &eqnGeneric); -} -#endif /*EXI_DEBUG*/ int exiEncodeStartElement(bitstream_t* stream, exi_state_t* state, eqname_t* se) { switch (state->grammarStack[state->stackIndex]) { @@ -4404,90 +4161,6 @@ int exiEncodeStartElement(bitstream_t* stream, exi_state_t* state, eqname_t* se) return EXI_ERROR_UNEXPECTED_START_ELEMENT; } -/* Qualified Name unknown!! */ -#if EXI_DEBUG == EXI_DEBUG_ON -static int exiEncodeStartElementGenericUnknown(bitstream_t* stream, exi_state_t* state, - char** uri, char** localName) { - uint16_t grammarID; - uint16_t eventCodeLength; - - int errn = _exiGet1stLevelEventCode(state, START_ELEMENT_GENERIC, &grammarID); - if (errn < 0) { - return errn; - } else if (errn == 1) { - /* not found --> try undeclared SE */ - errn = _exiGet1stLevelEventCode(state, START_ELEMENT_GENERIC_UNDECLARED, &grammarID); - if (errn < 0) { - return errn; - } else if (errn == 1) { - /* Should never happen except in STRICT mode */ - return EXI_ERROR_UNEXPECTED_EVENT_LEVEL1; - } else { - /* found START_ELEMENT_GENERIC_UNDECLARED */ - errn = _exiGetEventCodeLength(state, &eventCodeLength); - if (errn < 0) { - return errn; - } else { - /* encode event code*/ - errn = encodeNBitUnsignedInteger(stream, eventCodeLength, grammarID); - if (errn) { - return errn; - } - } - } - } else { - /* found START_ELEMENT_GENERIC */ - errn = _exiGetEventCodeLength(state, &eventCodeLength); - if (errn < 0) { - return errn; - } else { - /* encode event code*/ - errn = encodeNBitUnsignedInteger(stream, eventCodeLength, grammarID); - if (errn) { - return errn; - } - } - } - - /* encode qualified name */ - errn = _exiEncodeQName(stream, &(state->nameTablePrepopulated), &(state->nameTableRuntime), uri, localName); - if (errn) { - return errn; - } - - /* learn event, not in UCD Profile */ - - /* move on */ - /* push element on stack */ - - switch (state->grammarStack[state->stackIndex]) { - /* $EXI_ENCODE_START_ELEMENT_GENERIC$ */ - case DOC_CONTENT: - /* move on to DocEnd */ - state->grammarStack[state->stackIndex] = DOC_END; - /* push new ur-type grammar on stack */ - return exiPushStack(state, UR_TYPE_GRAMMAR_0, NULL); - break; - case UR_TYPE_GRAMMAR_0: - /* move on to UR_TYPE_GRAMMAR_1 */ - state->grammarStack[state->stackIndex] = UR_TYPE_GRAMMAR_1; - /* push new ur-type grammar on stack */ - return exiPushStack(state, UR_TYPE_GRAMMAR_0, NULL); - break; - case UR_TYPE_GRAMMAR_1: - /* remain in UR_TYPE_GRAMMAR_1 */ - /* push new ur-type grammar on stack */ - return exiPushStack(state, UR_TYPE_GRAMMAR_0, NULL); - break; - default: - return EXI_ERROR_UNEXPECTED_START_ELEMENT_GENERIC; - } - - - - return 0; -} -#endif /*EXI_DEBUG*/ /* Look first for qualified name */ @@ -4495,1117 +4168,9 @@ int exiEncodeStartElementGeneric(bitstream_t* stream, exi_state_t* state, string_ascii_t* namespaceURI , string_ascii_t* localName) { int errn = -1; -#if EXI_DEBUG == EXI_DEBUG_ON - eqname_t se; - /* uri */ - errn = exiGetUriID(&(state->nameTablePrepopulated), &(state->nameTableRuntime), namespaceURI->chars, &se.namespaceURI); - if (errn == -1) { - return errn; - } else if (errn == 1) { - /* No URI (and localNameID) found */ - exiEncodeStartElementGenericUnknown(stream, state, &(namespaceURI->chars), &(localName->chars)); - } else { - /* localName */ - errn = exiGetLocalNameID(&(state->nameTablePrepopulated), &(state->nameTableRuntime), se.namespaceURI, localName->chars, &se.localPart); - if (errn == -1) { - return errn; - } else if (errn == 1) { - /* No localName found, use generic StartElement(*) method */ - exiEncodeStartElementGenericUnknown(stream, state, &(namespaceURI->chars), &(localName->chars)); - } else { - /* Uri&LocalName found, use "efficient" StartElement method */ - return exiEncodeStartElement(stream, state, &se); - } - } -#endif /*EXI_DEBUG*/ - return errn; } -static int _exiEncodeEndElementUndeclared(bitstream_t* stream, exi_state_t* state) { - int16_t currentID = state->grammarStack[state->stackIndex]; - switch (currentID) { - case 7: - /* Element[] */ - /* 1st level and 2nd level event code */ - encodeNBitUnsignedInteger(stream, 0, 0); - encodeNBitUnsignedInteger(stream, 2, 0); - return 0; - case 176: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffDescription), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels)] */ - case 228: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired)] */ - case 282: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete)] */ - case 572: - /* Element[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - case 134: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumVoltageLimit)] */ - case 11: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Unit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value)] */ - case 199: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */ - case 206: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumVoltageLimit)] */ - case 312: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */ - case 265: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ - case 46: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode)] */ - case 262: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ - case 362: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket)] */ - case 290: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ - case 68: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEIsolationStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode)] */ - case 171: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */ - case 381: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - case 210: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSECurrentRegulationTolerance), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEPeakCurrentRipple)] */ - case 571: - /* Element[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - /* 1st level and 2nd level event code */ - encodeNBitUnsignedInteger(stream, 2, 2); - encodeNBitUnsignedInteger(stream, 2, 0); - return 0; - case 376: - /* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - case 286: - /* 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)] */ - /* 1st level and 2nd level event code */ - encodeNBitUnsignedInteger(stream, 2, 3); - encodeNBitUnsignedInteger(stream, 3, 0); - return 0; - case 340: - /* 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] */ - case 476: - /* 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)] */ - /* 1st level and 2nd level event code */ - encodeNBitUnsignedInteger(stream, 3, 6); - encodeNBitUnsignedInteger(stream, 3, 0); - return 0; - case 569: - /* StartTag[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */ - case 371: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ - case 544: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ - case 355: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket)] */ - case 688: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */ - case 76: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert)] */ - case 558: - /* FirstStartTag[ATTRIBUTE[STRING](Id), CHARACTERS[BINARY_BASE64]] */ - case 377: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - case 541: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ - case 110: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ - case 567: - /* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Target)] */ - case 184: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */ - case 158: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */ - case 564: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ - case 383: - /* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID)] */ - case 61: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEIsolationStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode)] */ - case 310: - /* First(xsi:type)StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */ - /* 1st level and 2nd level event code */ - encodeNBitUnsignedInteger(stream, 2, 2); - encodeNBitUnsignedInteger(stream, 3, 0); - return 0; - case 384: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID)] */ - case 181: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - case 66: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - case 631: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - case 363: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp)] */ - case 657: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - case 204: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatus)] */ - case 548: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ - case 232: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 513: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SelectedService)] */ - case 344: - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - case 167: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - case 538: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 254: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 662: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - case 49: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - case 603: - /* FirstStartTag[CHARACTERS[LIST]] */ - case 518: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - case 42: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ - case 691: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceTag)] */ - case 89: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 349: - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - case 545: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ - case 160: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}start)] */ - case 621: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 653: - /* FirstStartTag[CHARACTERS[DATETIME]] */ - case 316: - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - case 666: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - case 464: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 175: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffID)] */ - case 320: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus)] */ - case 502: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Service)] */ - case 619: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 510: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedPaymentOption)] */ - case 474: - /* FirstStartTag[ATTRIBUTE[STRING](Name)] */ - case 475: - /* StartTag[ATTRIBUTE[ENUMERATION](ValueType)] */ - case 527: - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - case 534: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - case 629: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 678: - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - case 52: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - case 104: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - case 116: - /* FirstStartTag[ATTRIBUTE[STRING](Id)] */ - case 595: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 225: - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - case 639: - /* FirstStartTag[CHARACTERS[FLOAT]] */ - case 607: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 551: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - case 192: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - case 386: - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - case 522: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 391: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 236: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - case 420: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - case 56: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 426: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 605: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 478: - /* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - case 29: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - case 625: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 410: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - case 330: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform)] */ - case 481: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - case 637: - /* FirstStartTag[CHARACTERS[DECIMAL]] */ - case 661: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - case 692: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - case 257: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ - case 672: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - case 645: - /* FirstStartTag[CHARACTERS[DATETIME]] */ - case 584: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 615: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 560: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - case 10: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Multiplier)] */ - case 58: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - case 117: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 415: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID)] */ - case 95: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate)] */ - case 18: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - case 649: - /* FirstStartTag[CHARACTERS[DATETIME]] */ - case 658: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - case 492: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 145: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 359: - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - case 483: - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - case 281: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVStatus)] */ - case 525: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVCCID)] */ - case 676: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 129: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - case 515: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID)] */ - case 63: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - case 111: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ - case 248: - /* FirstStartTag[ATTRIBUTE[STRING](Id)] */ - case 633: - /* FirstStartTag[CHARACTERS[DATETIME]] */ - case 440: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceTag)] */ - case 15: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - case 353: - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - case 430: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ - case 368: - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - case 480: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - case 92: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate)] */ - case 651: - /* FirstStartTag[CHARACTERS[DATETIME]] */ - case 342: - /* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName)] */ - case 44: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVReady)] */ - case 632: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - case 655: - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - case 611: - /* FirstStartTag[CHARACTERS[LIST]] */ - case 418: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryStart)] */ - case 581: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - case 568: - /* StartTag[ATTRIBUTE[STRING](Target)] */ - case 33: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - case 302: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - case 195: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - case 12: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - case 174: - /* FirstStartTag[ATTRIBUTE[STRING](Id)] */ - case 673: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 100: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - case 635: - /* FirstStartTag[CHARACTERS[DATETIME]] */ - case 332: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ - case 664: - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - case 351: - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - case 178: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 402: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ - case 155: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleID)] */ - case 468: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSet)] */ - case 659: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 27: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PowerSwitchClosed)] */ - case 574: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDef}Header)] */ - case 613: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 372: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ - case 497: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - case 70: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ - case 152: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - case 25: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatus)] */ - case 79: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - case 412: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReadyToChargeState)] */ - case 668: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 132: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVStatus)] */ - case 249: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge)] */ - case 453: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 189: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - case 495: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption)] */ - case 251: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 679: - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - case 470: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID)] */ - case 504: - /* First(xsi:type)StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceTag)] */ - case 84: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 565: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ - case 576: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}SessionID)] */ - case 77: - /* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert)] */ - case 162: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - case 288: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - case 617: - /* FirstStartTag[CHARACTERS[LIST]] */ - case 559: - /* StartTag[CHARACTERS[BINARY_BASE64]] */ - case 674: - /* FirstStartTag[CHARACTERS[DATETIME]] */ - case 365: - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - case 641: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 164: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - case 530: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 3: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DepartureTime)] */ - case 461: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID)] */ - case 670: - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - case 150: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID)] */ - case 442: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID)] */ - case 230: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterID)] */ - case 82: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID)] */ - case 623: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 435: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 5: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - case 269: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 609: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 643: - /* FirstStartTag[CHARACTERS[FLOAT]] */ - case 187: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}startValue)] */ - case 447: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 190: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}costKind)] */ - case 125: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - case 647: - /* FirstStartTag[CHARACTERS[DATETIME]] */ - case 88: - /* FirstStartTag[ATTRIBUTE[STRING](Id)] */ - case 242: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - case 107: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 542: - /* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ - case 450: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - case 681: - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - case 472: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - case 444: - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - case 458: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - case 297: - /* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */ - case 346: - /* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */ - case 406: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 222: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 127: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVRequestedEnergyTransferType)] */ - case 335: - /* First(xsi:type)StartTag[CHARACTERS[STRING]] */ - case 592: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ - case 239: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - case 352: - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - case 579: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultCode)] */ - case 148: - /* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTuple)] */ - case 357: - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - case 361: - /* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */ - /* 1st level and 2nd level event code */ - encodeNBitUnsignedInteger(stream, 1, 1); - encodeNBitUnsignedInteger(stream, 3, 0); - return 0; - case 370: - /* 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]] */ - case 369: - /* 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]] */ - /* 1st level and 2nd level event code */ - encodeNBitUnsignedInteger(stream, 4, 9); - encodeNBitUnsignedInteger(stream, 2, 0); - return 0; - case 314: - /* 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]] */ - /* 1st level and 2nd level event code */ - encodeNBitUnsignedInteger(stream, 4, 9); - encodeNBitUnsignedInteger(stream, 3, 0); - return 0; - case 484: - /* Element[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)] */ - case 354: - /* 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] */ - /* 1st level and 2nd level event code */ - encodeNBitUnsignedInteger(stream, 3, 6); - encodeNBitUnsignedInteger(stream, 2, 0); - return 0; - case 324: - /* 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]] */ - case 325: - /* 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]] */ - case 260: - /* 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)] */ - /* 1st level and 2nd level event code */ - encodeNBitUnsignedInteger(stream, 3, 4); - encodeNBitUnsignedInteger(stream, 2, 0); - return 0; - case 374: - /* 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)] */ - /* 1st level and 2nd level event code */ - encodeNBitUnsignedInteger(stream, 3, 5); - encodeNBitUnsignedInteger(stream, 3, 0); - return 0; - case 313: - /* 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]] */ - /* 1st level and 2nd level event code */ - encodeNBitUnsignedInteger(stream, 4, 10); - encodeNBitUnsignedInteger(stream, 3, 0); - return 0; - case 318: - /* 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]] */ - case 375: - /* 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)] */ - /* 1st level and 2nd level event code */ - encodeNBitUnsignedInteger(stream, 3, 4); - encodeNBitUnsignedInteger(stream, 3, 0); - return 0; - case 599: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 91: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey)] */ - case 62: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode)] */ - case 451: - /* Element[CHARACTERS[ENUMERATION]] */ - case 253: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge)] */ - case 390: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID)] */ - case 601: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDef}Header)] */ - case 638: - /* Element[CHARACTERS[DECIMAL]] */ - case 200: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffID)] */ - case 441: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService)] */ - case 586: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultCode)] */ - case 271: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentVoltage)] */ - case 669: - /* Element[CHARACTERS[STRING]] */ - case 425: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReadyToChargeState)] */ - case 543: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue)] */ - case 219: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 445: - /* Element[CHARACTERS[UNSIGNED_INTEGER]] */ - case 630: - /* Element[CHARACTERS[STRING]] */ - case 55: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ - case 31: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ShutDownTime)] */ - case 283: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete)] */ - case 209: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumVoltageLimit)] */ - case 448: - /* Element[CHARACTERS[STRING]] */ - case 693: - /* Element[CHARACTERS[ENUMERATION]] */ - case 291: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */ - case 122: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ - case 634: - /* Element[CHARACTERS[DATETIME]] */ - case 511: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedServiceList)] */ - case 387: - /* Element[CHARACTERS[BINARY_HEX]] */ - case 135: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumVoltageLimit)] */ - case 263: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */ - case 123: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RetryCounter)] */ - case 486: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSet)] */ - case 606: - /* Element[CHARACTERS[STRING]] */ - case 211: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEPeakCurrentRipple)] */ - case 205: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumCurrentLimit)] */ - case 86: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID)] */ - case 622: - /* Element[CHARACTERS[STRING]] */ - case 498: - /* Element[CHARACTERS[ENUMERATION]] */ - case 350: - /* Element[CHARACTERS[BINARY_BASE64]] */ - case 436: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */ - case 588: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}SessionID)] */ - case 610: - /* Element[CHARACTERS[STRING]] */ - case 35: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PowerSwitchClosed)] */ - case 78: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ListOfRootCertificateIDs)] */ - case 644: - /* Element[CHARACTERS[FLOAT]] */ - case 102: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */ - case 121: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */ - case 115: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ - case 191: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amount)] */ - case 113: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ListOfRootCertificateIDs)] */ - case 280: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 185: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EPriceLevel)] */ - case 482: - /* Element[CHARACTERS[INTEGER]] */ - case 671: - /* Element[CHARACTERS[UNSIGNED_INTEGER]] */ - case 521: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedPaymentOption)] */ - case 459: - /* Element[CHARACTERS[ENUMERATION]] */ - case 654: - /* Element[CHARACTERS[DATETIME]] */ - case 126: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 172: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleID)] */ - case 36: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxCurrent)] */ - case 405: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ - case 379: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue)] */ - case 80: - /* Element[CHARACTERS[BINARY_BASE64]] */ - case 552: - /* Element[CHARACTERS[INTEGER]] */ - case 385: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID)] */ - case 87: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert)] */ - case 547: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ - case 245: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}AC_EVSEStatus)] */ - case 614: - /* Element[CHARACTERS[STRING]] */ - case 348: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName)] */ - case 85: - /* Element[CHARACTERS[STRING]] */ - case 130: - /* Element[CHARACTERS[ENUMERATION]] */ - case 168: - /* Element[CHARACTERS[INTEGER]] */ - case 285: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVStatus)] */ - case 105: - /* Element[CHARACTERS[BINARY_BASE64]] */ - case 529: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVCCID)] */ - case 422: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryStart)] */ - case 112: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ - case 13: - /* Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - case 343: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber)] */ - case 575: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDef}Body)] */ - case 53: - /* Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - case 597: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentVoltage)] */ - case 432: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetCurrent)] */ - case 431: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ - case 108: - /* Element[CHARACTERS[STRING]] */ - case 620: - /* Element[CHARACTERS[STRING]] */ - case 103: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */ - case 50: - /* Element[CHARACTERS[ENUMERATION]] */ - case 585: - /* Element[CHARACTERS[STRING]] */ - case 182: - /* Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - case 582: - /* Element[CHARACTERS[ENUMERATION]] */ - case 141: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVStatus)] */ - case 224: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID)] */ - case 546: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod)] */ - case 455: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID)] */ - case 20: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Multiplier)] */ - case 596: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */ - case 423: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID)] */ - case 407: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge)] */ - case 258: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetCurrent)] */ - case 208: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumCurrentLimit)] */ - case 323: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus)] */ - case 636: - /* Element[CHARACTERS[DATETIME]] */ - case 434: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ - case 37: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinCurrent)] */ - case 214: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatus)] */ - case 90: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ - case 294: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter)] */ - case 177: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels)] */ - case 608: - /* Element[CHARACTERS[STRING]] */ - case 556: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */ - case 287: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q)] */ - case 101: - /* Element[CHARACTERS[BINARY_BASE64]] */ - case 460: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceTag)] */ - case 8: - /* Element[CHARACTERS[UNSIGNED_INTEGER]] */ - case 663: - /* Element[CHARACTERS[INTEGER]] */ - case 626: - /* Element[CHARACTERS[STRING]] */ - case 682: - /* Element[CHARACTERS[UNSIGNED_INTEGER]] */ - case 240: - /* Element[CHARACTERS[INTEGER]] */ - case 439: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 561: - /* Element[CHARACTERS[BINARY_BASE64]] */ - case 624: - /* Element[CHARACTERS[STRING]] */ - case 419: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryMaxPower)] */ - case 531: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID)] */ - case 321: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent)] */ - case 226: - /* Element[CHARACTERS[BINARY_HEX]] */ - case 99: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractEncryptionEncryptedPrivateKey)] */ - case 197: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}costKind)] */ - case 520: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SelectedService)] */ - case 479: - /* Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - case 618: - /* Element[CHARACTERS[LIST]] */ - case 223: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID)] */ - case 252: - /* Element[CHARACTERS[STRING]] */ - case 201: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID)] */ - case 4: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EAmount)] */ - case 32: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}StopCharging)] */ - case 507: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceTag)] */ - case 494: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeService)] */ - case 640: - /* Element[CHARACTERS[FLOAT]] */ - case 274: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEVoltageLimitAchieved)] */ - case 247: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 463: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID)] */ - case 535: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 411: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 233: - /* Element[CHARACTERS[STRING]] */ - case 656: - /* Element[CHARACTERS[BINARY_HEX]] */ - case 487: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 243: - /* Element[CHARACTERS[INTEGER]] */ - case 540: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 273: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSECurrentLimitAchieved)] */ - case 207: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumVoltageLimit)] */ - case 650: - /* Element[CHARACTERS[DATETIME]] */ - case 9: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaxVoltage)] */ - case 403: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ - case 54: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVReady)] */ - case 677: - /* Element[CHARACTERS[STRING]] */ - case 675: - /* Element[CHARACTERS[DATETIME]] */ - case 159: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMax)] */ - case 156: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleEntry)] */ - case 338: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform)] */ - case 237: - /* Element[CHARACTERS[BINARY_BASE64]] */ - case 347: - /* Element[CHARACTERS[INTEGER]] */ - case 119: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey)] */ - case 229: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired)] */ - case 388: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo)] */ - case 524: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 133: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumCurrentLimit)] */ - case 109: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 612: - /* Element[CHARACTERS[LIST]] */ - case 19: - /* Element[CHARACTERS[INTEGER]] */ - case 39: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatus)] */ - case 471: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Parameter)] */ - case 180: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffEntry)] */ - case 270: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */ - case 98: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate)] */ - case 499: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption)] */ - case 437: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentVoltage)] */ - case 454: - /* Element[CHARACTERS[STRING]] */ - case 392: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}AC_EVSEStatus)] */ - case 266: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */ - case 367: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp)] */ - case 660: - /* Element[CHARACTERS[STRING]] */ - case 24: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DepartureTime)] */ - case 508: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Service)] */ - case 429: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 268: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ - case 317: - /* Element[CHARACTERS[STRING]] */ - case 48: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSSOC)] */ - case 289: - /* Element[CHARACTERS[BINARY_BASE64]] */ - case 642: - /* Element[CHARACTERS[STRING]] */ - case 47: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode)] */ - case 28: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RCD)] */ - case 563: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */ - case 16: - /* Element[CHARACTERS[ENUMERATION]] */ - case 408: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DateTimeNow)] */ - case 67: - /* Element[CHARACTERS[ENUMERATION]] */ - case 667: - /* Element[CHARACTERS[INTEGER]] */ - case 382: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */ - case 573: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */ - case 616: - /* Element[CHARACTERS[STRING]] */ - case 256: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 519: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID)] */ - case 64: - /* Element[CHARACTERS[ENUMERATION]] */ - case 120: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractEncryptionEncryptedPrivateKey)] */ - case 394: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 193: - /* Element[CHARACTERS[ENUMERATION]] */ - case 59: - /* Element[CHARACTERS[ENUMERATION]] */ - case 57: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */ - case 244: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterID)] */ - case 465: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID)] */ - case 505: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService)] */ - case 509: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 144: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVRequestedEnergyTransferType)] */ - case 594: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */ - case 153: - /* Element[CHARACTERS[INTEGER]] */ - case 151: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxSchedule)] */ - case 680: - /* Element[CHARACTERS[UNSIGNED_INTEGER]] */ - case 378: - /* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */ - case 198: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}startValue)] */ - case 26: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxVoltage)] */ - case 165: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}start)] */ - case 69: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */ - case 22: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMinCurrent)] */ - case 416: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ProfileEntry)] */ - case 275: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPowerLimitAchieved)] */ - case 14: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value)] */ - case 272: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentCurrent)] */ - case 179: - /* Element[CHARACTERS[STRING]] */ - case 97: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate)] */ - case 303: - /* Element[CHARACTERS[BINARY_BASE64]] */ - case 493: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentOptions)] */ - case 648: - /* Element[CHARACTERS[DATETIME]] */ - case 485: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID)] */ - case 665: - /* Element[CHARACTERS[UNSIGNED_INTEGER]] */ - case 118: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */ - case 202: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTuple)] */ - case 456: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EnergyTransferType)] */ - case 646: - /* Element[CHARACTERS[DATETIME]] */ - case 528: - /* Element[CHARACTERS[BINARY_HEX]] */ - case 21: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaxCurrent)] */ - case 652: - /* Element[CHARACTERS[DATETIME]] */ - case 604: - /* Element[CHARACTERS[LIST]] */ - case 30: - /* Element[CHARACTERS[BOOLEAN]] */ - /* 1st level and 2nd level event code */ - encodeNBitUnsignedInteger(stream, 1, 1); - encodeNBitUnsignedInteger(stream, 2, 0); - return 0; - case 259: - /* 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)] */ - case 146: - /* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleList), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SASchedules), 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)] */ - /* 1st level and 2nd level event code */ - encodeNBitUnsignedInteger(stream, 3, 5); - encodeNBitUnsignedInteger(stream, 2, 0); - return 0; - case 227: - /* 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)] */ - case 45: - /* 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)] */ - case 147: - /* 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)] */ - case 128: - /* 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)] */ - case 296: - /* Element[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)] */ - case 261: - /* 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)] */ - case 427: - /* 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)] */ - case 264: - /* 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)] */ - /* 1st level and 2nd level event code */ - encodeNBitUnsignedInteger(stream, 2, 3); - encodeNBitUnsignedInteger(stream, 2, 0); - return 0; - - } - return EXI_ERROR_UNEXPECTED_END_ELEMENT; -} - int exiEncodeEndElement(bitstream_t* stream, exi_state_t* state) { int errn = 0; int16_t currentID = state->grammarStack[state->stackIndex]; @@ -6004,16 +4569,7 @@ int exiEncodeEndElement(bitstream_t* stream, exi_state_t* state) { break; default: - if (currentID < 0) { - /* runtime grammars */ - return -1; - } else { - errn = _exiEncodeEndElementUndeclared(stream, state); - if (errn < 0) { - return errn; - } - } - /* return EXI_ERROR_UNEXPECTED_END_ELEMENT; */ + return EXI_ERROR_UNEXPECTED_END_ELEMENT; } if (errn < 0) { @@ -8087,63 +6643,6 @@ int exiEncodeAttribute(bitstream_t* stream, exi_state_t* state, eqname_t* at, /* return EXI_ERROR_UNEXPECTED_ATTRIBUTE; */ } -#if EXI_DEBUG == EXI_DEBUG_ON -static int exiEncodeAttribute2(bitstream_t* stream, exi_state_t* state, qname_t* at, - exi_value_t* val) { - int errn; - eqname_t eat; - - /* attribute generic undeclared */ - uint16_t codeLength1, codeLength2; - uint32_t ec1, ec2; - - errn = exiGetUriID(&state->nameTablePrepopulated, &state->nameTableRuntime, at->namespaceURI.chars, &eat.namespaceURI); - if (errn < 0) { - return errn; - } else if (errn > 0) { - /* uri not found*/ - } else { - /* uri found, try to find localname id */ - errn = exiGetLocalNameID(&state->nameTablePrepopulated, &state->nameTableRuntime, eat.namespaceURI, - at->localName.chars, &eat.localPart); - if (errn < 0) { - return errn; - } else if (errn > 0) { - /* local-name not found*/ - } else { - /* found uri and local-name */ - errn = exiEncodeAttribute(stream, state, &eat, val); - if (errn < 0) { - return errn; - } - if (errn == 0) { - return errn; - } - - } - } - - - /* event codes */ - encodeNBitUnsignedInteger(stream, codeLength1, ec1); - encodeNBitUnsignedInteger(stream, codeLength2, ec2); - - /* qname */ - /* - errn = _exiEncodeQName(stream, state->nameTablePrepopulated, state->nameTableRuntime, - char** uri, char** localName); - QName qname = qnameDatatype.encodeQName(uri, localName, null, channel); - */ - /* content as string */ - /* - typeEncoder.isValid(BuiltIn.DEFAULT_DATATYPE, value); - typeEncoder.writeValue(qname, channel); - */ - return -1; - -} -#endif /*EXI_DEBUG*/ - int exiEncodeAttributeXsiNil(bitstream_t* stream, exi_state_t* state, exi_value_t* val) { diff --git a/src/codec/NameTableEntries.c b/src/codec/NameTableEntries.c index 62c19e8..b06dbee 100644 --- a/src/codec/NameTableEntries.c +++ b/src/codec/NameTableEntries.c @@ -37,146 +37,6 @@ /* ==================================== */ /* String Table Population */ -#if EXI_DEBUG == EXI_DEBUG_ON -/* localName entries for URI id = 0 */ -char * localNames0[] = { - "Algorithm", "Encoding", "Id", "MimeType", "Name", - "Target", "Type", "URI", "ValueType" -}; -/* localName entries for URI id = 1 */ -char * localNames1[] = { - "base", "id", "lang", "space" -}; -/* localName entries for URI id = 2 */ -char * localNames2[] = { - "nil", "type" -}; -/* localName entries for URI id = 3 */ -char * localNames3[] = { - "ENTITIES", "ENTITY", "ID", "IDREF", "IDREFS", - "NCName", "NMTOKEN", "NMTOKENS", "NOTATION", "Name", - "QName", "anySimpleType", "anyType", "anyURI", "base64Binary", - "boolean", "byte", "date", "dateTime", "decimal", - "double", "duration", "float", "gDay", "gMonth", - "gMonthDay", "gYear", "gYearMonth", "hexBinary", "int", - "integer", "language", "long", "negativeInteger", "nonNegativeInteger", - "nonPositiveInteger", "normalizedString", "positiveInteger", "short", "string", - "time", "token", "unsignedByte", "unsignedInt", "unsignedLong", - "unsignedShort" -}; -/* localName entries for URI id = 4 */ -char * localNames4[] = { - "CanonicalizationMethod", "CanonicalizationMethodType", "CryptoBinary", "DSAKeyValue", "DSAKeyValueType", - "DigestMethod", "DigestMethodType", "DigestValue", "DigestValueType", "Exponent", - "G", "HMACOutputLength", "HMACOutputLengthType", "J", "KeyInfo", - "KeyInfoType", "KeyName", "KeyValue", "KeyValueType", "Manifest", - "ManifestType", "MgmtData", "Modulus", "Object", "ObjectType", - "P", "PGPData", "PGPDataType", "PGPKeyID", "PGPKeyPacket", - "PgenCounter", "Q", "RSAKeyValue", "RSAKeyValueType", "Reference", - "ReferenceType", "RetrievalMethod", "RetrievalMethodType", "SPKIData", "SPKIDataType", - "SPKISexp", "Seed", "Signature", "SignatureMethod", "SignatureMethodType", - "SignatureProperties", "SignaturePropertiesType", "SignatureProperty", "SignaturePropertyType", "SignatureType", - "SignatureValue", "SignatureValueType", "SignedInfo", "SignedInfoType", "Transform", - "TransformType", "Transforms", "TransformsType", "X509CRL", "X509Certificate", - "X509Data", "X509DataType", "X509IssuerName", "X509IssuerSerial", "X509IssuerSerialType", - "X509SKI", "X509SerialNumber", "X509SubjectName", "XPath", "Y" - -}; -/* localName entries for URI id = 5 */ -char * localNames5[] = { - "AC_EVSEStatus", "BulkChargingComplete", "CableCheckReq", "CableCheckReqType", "CableCheckRes", - "CableCheckResType", "CertificateInstallationReq", "CertificateInstallationReqType", "CertificateInstallationRes", "CertificateInstallationResType", - "CertificateUpdateReq", "CertificateUpdateReqType", "CertificateUpdateRes", "CertificateUpdateResType", "ChargeParameterDiscoveryReq", - "ChargeParameterDiscoveryReqType", "ChargeParameterDiscoveryRes", "ChargeParameterDiscoveryResType", "ChargeService", "ChargingComplete", - "ChargingProfile", "ChargingStatusReq", "ChargingStatusReqType", "ChargingStatusRes", "ChargingStatusResType", - "ContractAuthenticationReq", "ContractAuthenticationReqType", "ContractAuthenticationRes", "ContractAuthenticationResType", "ContractEncryptionEncryptedPrivateKey", - "ContractID", "ContractSignatureCertChain", "ContractSignatureEncryptedPrivateKey", "CurrentDemandReq", "CurrentDemandReqType", - "CurrentDemandRes", "CurrentDemandResType", "DC_EVSEStatus", "DC_EVStatus", "DHParams", - "DateTimeNow", "EVCCID", "EVMaximumCurrentLimit", "EVMaximumPowerLimit", "EVMaximumVoltageLimit", - "EVRequestedEnergyTransferType", "EVSECurrentLimitAchieved", "EVSEID", "EVSEMaxCurrent", "EVSEMaximumCurrentLimit", - "EVSEMaximumPowerLimit", "EVSEMaximumVoltageLimit", "EVSEPowerLimitAchieved", "EVSEPresentCurrent", "EVSEPresentVoltage", - "EVSEVoltageLimitAchieved", "EVTargetCurrent", "EVTargetVoltage", "GenChallenge", "ListOfRootCertificateIDs", - "MeterInfo", "MeteringReceiptReq", "MeteringReceiptReqType", "MeteringReceiptRes", "MeteringReceiptResType", - "OEMProvisioningCert", "PaymentDetailsReq", "PaymentDetailsReqType", "PaymentDetailsRes", "PaymentDetailsResType", - "PaymentOptions", "PowerDeliveryReq", "PowerDeliveryReqType", "PowerDeliveryRes", "PowerDeliveryResType", - "PreChargeReq", "PreChargeReqType", "PreChargeRes", "PreChargeResType", "ReadyToChargeState", - "ReceiptRequired", "RemainingTimeToBulkSoC", "RemainingTimeToFullSoC", "ResponseCode", "RetryCounter", - "SAScheduleTupleID", "SelectedPaymentOption", "SelectedServiceList", "ServiceCategory", "ServiceDetailReq", - "ServiceDetailReqType", "ServiceDetailRes", "ServiceDetailResType", "ServiceDiscoveryReq", "ServiceDiscoveryReqType", - "ServiceDiscoveryRes", "ServiceDiscoveryResType", "ServiceID", "ServiceList", "ServiceParameterList", - "ServicePaymentSelectionReq", "ServicePaymentSelectionReqType", "ServicePaymentSelectionRes", "ServicePaymentSelectionResType", "ServiceScope", - "SessionID", "SessionSetupReq", "SessionSetupReqType", "SessionSetupRes", "SessionSetupResType", - "SessionStopReq", "SessionStopRes", "SessionStopResType", "SessionStopType", "WeldingDetectionReq", - "WeldingDetectionReqType", "WeldingDetectionRes", "WeldingDetectionResType" -}; -/* localName entries for URI id = 6 */ -char * localNames6[] = { - "AC_EVChargeParameter", "AC_EVChargeParameterType", "AC_EVSEChargeParameter", "AC_EVSEChargeParameterType", "AC_EVSEStatus", - "AC_EVSEStatusType", "BulkChargingComplete", "BulkSOC", "Certificate", "CertificateChainType", - "ChargingComplete", "ChargingProfileEntryMaxPower", "ChargingProfileEntryStart", "ChargingProfileType", "ConsumptionCost", - "ConsumptionCostType", "Cost", "CostType", "DC_EVChargeParameter", "DC_EVChargeParameterType", - "DC_EVErrorCodeType", "DC_EVPowerDeliveryParameter", "DC_EVPowerDeliveryParameterType", "DC_EVSEChargeParameter", "DC_EVSEChargeParameterType", - "DC_EVSEStatus", "DC_EVSEStatusCodeType", "DC_EVSEStatusType", "DC_EVStatus", "DC_EVStatusType", - "DepartureTime", "EAmount", "EPriceLevel", "EVCabinConditioning", "EVChargeParameter", - "EVChargeParameterType", "EVEnergyCapacity", "EVEnergyRequest", "EVErrorCode", "EVMaxCurrent", - "EVMaxVoltage", "EVMaximumCurrentLimit", "EVMaximumPowerLimit", "EVMaximumVoltageLimit", "EVMinCurrent", - "EVPowerDeliveryParameter", "EVPowerDeliveryParameterType", "EVRESSConditioning", "EVRESSSOC", "EVReady", - "EVRequestedEnergyTransferType", "EVSEChargeParameter", "EVSEChargeParameterType", "EVSECurrentRegulationTolerance", "EVSEEnergyToBeDelivered", - "EVSEIsolationStatus", "EVSEMaxCurrent", "EVSEMaxVoltage", "EVSEMaximumCurrentLimit", "EVSEMaximumPowerLimit", - "EVSEMaximumVoltageLimit", "EVSEMinCurrent", "EVSEMinimumCurrentLimit", "EVSEMinimumVoltageLimit", "EVSEPeakCurrentRipple", - "EVSEStatus", "EVSEStatusCode", "EVSEStatusType", "EVSESupportedEnergyTransferType", "EVStatus", - "EVStatusType", "EnergyTransferType", "Entry", "EntryType", "FaultCode", - "FaultMsg", "FreeService", "FullSOC", "IntervalType", "ListOfRootCertificateIDsType", - "MeterID", "MeterInfoType", "MeterReading", "MeterStatus", "Multiplier", - "NotificationType", "NumEPriceLevels", "PMax", "PMaxSchedule", "PMaxScheduleEntry", - "PMaxScheduleEntryType", "PMaxScheduleID", "PMaxScheduleType", "PMaxType", "Parameter", - "ParameterSet", "ParameterSetID", "ParameterSetType", "ParameterType", "PaymentOption", - "PaymentOptionsType", "PhysicalValueType", "PowerSwitchClosed", "ProfileEntry", "ProfileEntryType", - "RCD", "RelativeTimeInterval", "RelativeTimeIntervalType", "RootCertificateID", "SAIDType", - "SAScheduleList", "SAScheduleListType", "SAScheduleTuple", "SAScheduleTupleID", "SAScheduleTupleType", - "SASchedules", "SASchedulesType", "SalesTariff", "SalesTariffDescription", "SalesTariffEntry", - "SalesTariffEntryType", "SalesTariffID", "SalesTariffType", "SelectedService", "SelectedServiceListType", - "SelectedServiceType", "Service", "ServiceCategory", "ServiceCharge", "ServiceChargeType", - "ServiceID", "ServiceName", "ServiceParameterListType", "ServiceScope", "ServiceTag", - "ServiceTagListType", "ServiceTagType", "ServiceType", "ShutDownTime", "SigMeterReading", - "StopCharging", "SubCertificates", "SubCertificatesType", "TMeter", "TimeInterval", - "Unit", "Value", "amount", "amountMultiplier", "boolValue", - "byteValue", "certificateType", "contractIDType", "costKind", "costKindType", - "dHParamsType", "duration", "evccIDType", "evseIDType", "faultCodeType", - "faultMsgType", "genChallengeType", "intValue", "isolationLevelType", "meterIDType", - "meterStatusType", "paymentOptionType", "percentValueType", "physicalValue", "privateKeyType", - "responseCodeType", "rootCertificateIDType", "serviceCategoryType", "serviceIDType", "serviceNameType", - "serviceScopeType", "sessionIDType", "shortValue", "sigMeterReadingType", "start", - "startValue", "stringValue", "tariffDescriptionType", "unitMultiplierType", "unitSymbolType", - "valueType" -}; -/* localName entries for URI id = 7 */ -char * localNames7[] = { - "Body", "BodyBaseType", "BodyElement", "BodyType", "Header", - "V2G_Message" -}; -/* localName entries for URI id = 8 */ -char * localNames8[] = { - "MessageHeaderType", "Notification", "SessionID" -}; -char * uris[] = { - "", "http://www.w3.org/XML/1998/namespace", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/2001/XMLSchema", "http://www.w3.org/2000/09/xmldsig#", "urn:iso:15118:2:2010:MsgBody", "urn:iso:15118:2:2010:MsgDataTypes", "urn:iso:15118:2:2010:MsgDef", "urn:iso:15118:2:2010:MsgHeader" -}; -#endif /*EXI_DEBUG*/ - -#if EXI_DEBUG == EXI_DEBUG_ON -struct exiNamePartition localNamePartitions[9] = { - { 9, localNames0 }, - { 4, localNames1 }, - { 2, localNames2 }, - { 46, localNames3 }, - { 70, localNames4 }, - { 118, localNames5 }, - { 186, localNames6 }, - { 6, localNames7 }, - { 3, localNames8 } -}; -#endif /*EXI_DEBUG*/ #if EXI_DEBUG == EXI_DEBUG_OFF static struct exiNamePartition localNamePartitions[9] = { @@ -192,10 +52,6 @@ static struct exiNamePartition localNamePartitions[9] = { }; #endif /*EXI_DEBUG*/ - -#if EXI_DEBUG == EXI_DEBUG_ON -exi_name_table_prepopulated_t exiNameTablePrepopulated = { 9, uris, localNamePartitions }; -#endif /*EXI_DEBUG*/ #if EXI_DEBUG == EXI_DEBUG_OFF exi_name_table_prepopulated_t exiNameTablePrepopulated = { 9, localNamePartitions }; #endif /*EXI_DEBUG*/ diff --git a/src/codec/StringTable.c b/src/codec/StringTable.c index fe13355..f88cc7f 100644 --- a/src/codec/StringTable.c +++ b/src/codec/StringTable.c @@ -35,129 +35,11 @@ #include "StringTable.h" #include "NameTableEntries.h" -#if EXI_DEBUG == EXI_DEBUG_ON - -int exiGetUri(exi_name_table_prepopulated_t* prepopulatedTable, exi_name_table_runtime_t* runtimeTable, uint16_t uriID, - const char** uri) { - if (uriID < prepopulatedTable->len) { - *uri = prepopulatedTable->uris[uriID]; - } else { - int i = 0; - uriID -= prepopulatedTable->len; - for(i=0; i<(runtimeTable->addedUriEntries+runtimeTable->addedLocalNameEntries); i++) { - if ( runtimeTable->namePartitionsEntries[i].namePartitionType == URI_PARTITION ) { - if (uriID == 0) { - *uri = runtimeTable->namePartitionsEntries[i].entry.uriPartition.uri; - return 0; - } - uriID--; - } - } - - return EXI_ERROR_OUT_OF_BOUNDS; - } - - return 0; -} - - -/* 0 ... Success, 1 ... Miss, -1 ... Error */ -int exiGetUriID(exi_name_table_prepopulated_t* prepopulatedTable, exi_name_table_runtime_t* runtimeTable, const char* uri, - uint16_t* uriID) { - unsigned int i; - for (i = 0; i < prepopulatedTable->len; i++) { - if (strcmp(uri, prepopulatedTable->uris[i]) == 0) { - *uriID = i; - return 0; - } - } - if (runtimeTable->addedUriEntries > 0) { - *uriID = prepopulatedTable->len - 1; - for(i=0; i< (runtimeTable->addedUriEntries + runtimeTable->addedLocalNameEntries); i++) { - if ( runtimeTable->namePartitionsEntries[i].namePartitionType == URI_PARTITION ) { - *uriID = *uriID + 1; - if (strcmp(uri, runtimeTable->namePartitionsEntries[i].entry.uriPartition.uri) == 0) { - return 0; - } - } - } - } - /* no URI ID found */ - return +1; -} - -#endif /*EXI_DEBUG*/ - int exiGetUriSize(exi_name_table_prepopulated_t* prepopulatedTable, exi_name_table_runtime_t* runtimeTable, uint16_t* uriLength) { *uriLength = prepopulatedTable->len; return 0; } -#if EXI_DEBUG == EXI_DEBUG_ON - -int exiGetLocalName(exi_name_table_prepopulated_t* prepopulatedTable, exi_name_table_runtime_t* runtimeTable, uint16_t uriID, - uint16_t localNameID, const char** localName) { - int i; - if (uriID < prepopulatedTable->len) { - if (localNameID < prepopulatedTable->localNames[uriID].len) { - *localName = prepopulatedTable->localNames[uriID].names[localNameID]; - return 0; - } else { - localNameID -= prepopulatedTable->localNames[uriID].len; - } - } - - /* runtime tables */ - for(i=0; i<(runtimeTable->addedLocalNameEntries+runtimeTable->addedUriEntries); i++) { - if ( runtimeTable->namePartitionsEntries[i].namePartitionType == LOCALNAME_PARTITION && - runtimeTable->namePartitionsEntries[i].entry.localNamePartition.uriID == uriID ) { - if (localNameID == 0) { - *localName = runtimeTable->namePartitionsEntries[i].entry.localNamePartition.localName; - return 0; - } - localNameID--; - } - } - - return EXI_ERROR_OUT_OF_BOUNDS; -} - - -/* 0 ... Success, 1 ... Miss, -1 ... Error */ -int exiGetLocalNameID(exi_name_table_prepopulated_t* prepopulatedTable, exi_name_table_runtime_t* runtimeTable, uint16_t uriID, - const char* localName, uint16_t* localNameID) { - unsigned int i; - if (uriID < prepopulatedTable->len) { - /* pre-populated names */ - /* TODO binary search */ - for (i = 0; i < prepopulatedTable->localNames[uriID].len; i++) { - if (strcmp(localName, prepopulatedTable->localNames[uriID].names[i]) == 0) { - *localNameID = i; - return 0; - } - } - /* runtime names */ - for (i = 0; i < (runtimeTable->addedUriEntries + runtimeTable->addedLocalNameEntries); i++) { - if (runtimeTable->namePartitionsEntries[i].namePartitionType == LOCALNAME_PARTITION && - strcmp(localName, runtimeTable->namePartitionsEntries[i].entry.localNamePartition.localName ) == 0) { - *localNameID = runtimeTable->namePartitionsEntries[i].entry.localNamePartition.localNameID; - return 0; - } - } - - /* no localName ID found */ - return +1; - } else if (uriID == prepopulatedTable->len) { - /* UCD profile */ - /* no localName ID found */ - return +1; - } else { - return EXI_ERROR_OUT_OF_BOUNDS; - } -} - -#endif /*EXI_DEBUG*/ - int exiGetLocalNameSize(exi_name_table_prepopulated_t* prepopulatedTable, exi_name_table_runtime_t* runtimeTable, uint16_t uriID, uint16_t* localNameLength) { *localNameLength = 0; diff --git a/src/codec/StringTable.h b/src/codec/StringTable.h index 995236e..3cb357f 100644 --- a/src/codec/StringTable.h +++ b/src/codec/StringTable.h @@ -36,20 +36,9 @@ extern "C" { #include "EXITypes.h" -#if EXI_DEBUG == EXI_DEBUG_ON -int exiGetUri(exi_name_table_prepopulated_t* prepopulatedTable, exi_name_table_runtime_t* runtimeTable, uint16_t uriID, const char** uri); -/* 0 ... Success, 1 ... Miss, -1 ... Error */ -int exiGetUriID(exi_name_table_prepopulated_t* prepopulatedTable, exi_name_table_runtime_t* runtimeTable, const char* uri, uint16_t* uriID); -#endif /*EXI_DEBUG*/ int exiGetUriSize(exi_name_table_prepopulated_t* prepopulatedTable, exi_name_table_runtime_t* runtimeTable, uint16_t* uriLength); -#if EXI_DEBUG == EXI_DEBUG_ON -int exiGetLocalName(exi_name_table_prepopulated_t* prepopulatedTable, exi_name_table_runtime_t* runtimeTable, uint16_t uriID, uint16_t localNameID, const char** localName); -/* 0 ... Success, 1 ... Miss, -1 ... Error */ -int exiGetLocalNameID(exi_name_table_prepopulated_t* prepopulatedTable, exi_name_table_runtime_t* runtimeTable, uint16_t uriID, const char* localName, uint16_t* localNameID); -#endif /*EXI_DEBUG*/ - int exiGetLocalNameSize(exi_name_table_prepopulated_t* prepopulatedTable, exi_name_table_runtime_t* runtimeTable, uint16_t uriID, uint16_t* localNameLength); /* inits counter et cetera */ diff --git a/src/codec/appHandCodec/appHand_EXIEncoder.c b/src/codec/appHandCodec/appHand_EXIEncoder.c index 813272d..69eedce 100644 --- a/src/codec/appHandCodec/appHand_EXIEncoder.c +++ b/src/codec/appHandCodec/appHand_EXIEncoder.c @@ -249,53 +249,6 @@ static int _exiEncodeNamespaceUriID(bitstream_t* stream, exi_name_table_prepopul } -#if EXI_DEBUG == EXI_DEBUG_ON -static int _exiEncodeNamespaceUri(bitstream_t* stream, exi_name_table_prepopulated_t* nameTable, exi_name_table_runtime_t* runtimeTable, - char** uri, uint16_t* uriID) { - int errn; - uint16_t uriCodingLength; - uint16_t uriSize; - - errn = exiGetUriSize(nameTable, runtimeTable, &uriSize); - if (errn) { - return errn; - } - /* URI Entries + 1 */ - errn = exiGetCodingLength(uriSize + 1, &uriCodingLength); - if (errn) { - return errn; - } - - errn = exiGetUriID(nameTable, runtimeTable, *uri, uriID); - if (errn < 0) { - return errn; - } else if (errn == 1) { - /* uri string value was not found */ - /* ==> zero (0) as an n-nit unsigned integer */ - /* followed by uri encoded as string */ - errn = encodeNBitUnsignedInteger(stream, uriCodingLength, 0); - if (errn) { - return errn; - } - /* ASCII String */ - errn = encodeASCII(stream, *uri); - if (errn) { - return errn; - } - /* after encoding string value is added to table */ - /* in UCD Profile NOT */ - *uriID = uriSize; - } else { - /* uri string value found */ - /* ==> value(i+1) is encoded as n-bit unsigned integer */ - errn = encodeNBitUnsignedInteger(stream, uriCodingLength, *uriID + 1); - } - - return errn; -} -#endif /*EXI_DEBUG*/ - - static int _exiEncodeLocalNameID(bitstream_t* stream, exi_name_table_prepopulated_t* nameTable, exi_name_table_runtime_t* runtimeTable, uint16_t uriID, uint16_t localNameID) { int errn; @@ -325,76 +278,6 @@ static int _exiEncodeLocalNameID(bitstream_t* stream, exi_name_table_prepopulate } -#if EXI_DEBUG == EXI_DEBUG_ON -static int _exiEncodeLocalName(bitstream_t* stream, exi_name_table_prepopulated_t* nameTable, exi_name_table_runtime_t* runtimeTable, - char** localName, - uint16_t uriID) { - int errn; - uint16_t localNameID; - uint16_t localNameSize; - uint16_t localNameCodingLength; - uint32_t slen; - - /* look for localNameID */ - errn = exiGetLocalNameID(nameTable, runtimeTable, uriID, *localName, &localNameID); - if (errn < 0) { - return errn; - } - - if (errn == 1) { - /* string value was not found in local partition */ - /* ==> string literal is encoded as a String */ - /* with the length of the string incremented by one */ - slen = (uint32_t)strlen(*localName); - errn = encodeUnsignedInteger32(stream, slen + 1 ); - if (errn >= 0) { - errn = encodeASCIICharacters(stream, *localName, slen); - } - } else { - /* string value found in local partition */ - /* ==> string value is represented as zero (0) encoded as an */ - errn = encodeUnsignedInteger32(stream, 0 ); - if (errn < 0) { - return errn; - } - /* Unsigned Integer followed by an the compact identifier of the */ - /* string value as an n-bit unsigned integer n is log2 m and m is */ - /* the number of entries in the string table partition */ - errn = exiGetLocalNameSize(nameTable, runtimeTable, uriID, &localNameSize); - if (errn < 0) { - return errn; - } - errn = exiGetCodingLength(localNameSize, &localNameCodingLength); - if (errn) { - return errn; - } - errn = encodeNBitUnsignedInteger(stream, localNameCodingLength, localNameID); - } - - return errn; -} -#endif /*EXI_DEBUG*/ - - -#if EXI_DEBUG == EXI_DEBUG_ON -static int _exiEncodeQName(bitstream_t* stream, exi_name_table_prepopulated_t* nameTable, exi_name_table_runtime_t* runtimeTable, - char** uri, char** localName) { - uint16_t uriID; - /* uri */ - int errn =_exiEncodeNamespaceUri(stream, nameTable, runtimeTable, uri, &uriID); - if (errn) { - return errn; - } - /* localName */ - errn = _exiEncodeLocalName(stream, nameTable, runtimeTable, localName, uriID); - if (errn) { - return errn; - } - - return 0 ; -} -#endif /*EXI_DEBUG*/ - static int _exiEncodeStartElement(bitstream_t* stream, uint16_t nbits, uint32_t val, exi_state_t* state, eqname_t* se, uint16_t stackId, @@ -410,36 +293,6 @@ static int _exiEncodeStartElement(bitstream_t* stream, uint16_t nbits, return exiPushStack(state, newState, se); } -#if EXI_DEBUG == EXI_DEBUG_ON - -static eqname_t eqnGeneric = {65535, 65535}; /* UNSIGNED_INT16_MAX */ - -static int _exiEncodeStartElementGeneric(bitstream_t* stream, uint16_t nbits, - uint32_t val, exi_state_t* state, char** uri, char** localName, uint16_t stackId, - uint16_t newState) { - uint16_t uriID; - /* event-code */ - int errn = encodeNBitUnsignedInteger(stream, nbits, val); - if (errn) { - return errn; - } - /* qualified name */ - errn = _exiEncodeNamespaceUri(stream, &(state->nameTablePrepopulated), &(state->nameTableRuntime), uri, &uriID); - if (errn) { - return errn; - } - errn = _exiEncodeLocalName(stream, &(state->nameTablePrepopulated), &(state->nameTableRuntime), localName, uriID); - if (errn) { - return errn; - } - - /* move on */ - state->grammarStack[state->stackIndex] = stackId; - /* push element on stack */ - return exiPushStack(state, newState, &eqnGeneric); -} -#endif /*EXI_DEBUG*/ - int exiappHandEncodeStartElement(bitstream_t* stream, exi_state_t* state, eqname_t* se) { switch (state->grammarStack[state->stackIndex]) { case 1: @@ -703,369 +556,15 @@ int exiappHandEncodeStartElement(bitstream_t* stream, exi_state_t* state, eqname return EXI_ERROR_UNEXPECTED_START_ELEMENT; } -/* Qualified Name unknown!! */ -#if EXI_DEBUG == EXI_DEBUG_ON -static int exiEncodeStartElementGenericUnknown(bitstream_t* stream, exi_state_t* state, - char** uri, char** localName) { - uint16_t grammarID; - uint16_t eventCodeLength; - - int errn = _exiGet1stLevelEventCode(state, START_ELEMENT_GENERIC, &grammarID); - if (errn < 0) { - return errn; - } else if (errn == 1) { - /* not found --> try undeclared SE */ - errn = _exiGet1stLevelEventCode(state, START_ELEMENT_GENERIC_UNDECLARED, &grammarID); - if (errn < 0) { - return errn; - } else if (errn == 1) { - /* Should never happen except in STRICT mode */ - return EXI_ERROR_UNEXPECTED_EVENT_LEVEL1; - } else { - /* found START_ELEMENT_GENERIC_UNDECLARED */ - errn = _exiGetEventCodeLength(state, &eventCodeLength); - if (errn < 0) { - return errn; - } else { - /* encode event code*/ - errn = encodeNBitUnsignedInteger(stream, eventCodeLength, grammarID); - if (errn) { - return errn; - } - } - } - } else { - /* found START_ELEMENT_GENERIC */ - errn = _exiGetEventCodeLength(state, &eventCodeLength); - if (errn < 0) { - return errn; - } else { - /* encode event code*/ - errn = encodeNBitUnsignedInteger(stream, eventCodeLength, grammarID); - if (errn) { - return errn; - } - } - } - - /* encode qualified name */ - errn = _exiEncodeQName(stream, &(state->nameTablePrepopulated), &(state->nameTableRuntime), uri, localName); - if (errn) { - return errn; - } - - /* learn event, not in UCD Profile */ - - /* move on */ - /* push element on stack */ - - switch (state->grammarStack[state->stackIndex]) { - /* $EXI_ENCODE_START_ELEMENT_GENERIC$ */ - case DOC_CONTENT: - /* move on to DocEnd */ - state->grammarStack[state->stackIndex] = DOC_END; - /* push new ur-type grammar on stack */ - return exiPushStack(state, UR_TYPE_GRAMMAR_0, NULL); - break; - case UR_TYPE_GRAMMAR_0: - /* move on to UR_TYPE_GRAMMAR_1 */ - state->grammarStack[state->stackIndex] = UR_TYPE_GRAMMAR_1; - /* push new ur-type grammar on stack */ - return exiPushStack(state, UR_TYPE_GRAMMAR_0, NULL); - break; - case UR_TYPE_GRAMMAR_1: - /* remain in UR_TYPE_GRAMMAR_1 */ - /* push new ur-type grammar on stack */ - return exiPushStack(state, UR_TYPE_GRAMMAR_0, NULL); - break; - default: - return EXI_ERROR_UNEXPECTED_START_ELEMENT_GENERIC; - } - - - - return 0; -} -#endif /*EXI_DEBUG*/ - /* Look first for qualified name */ int exiappHandEncodeStartElementGeneric(bitstream_t* stream, exi_state_t* state, string_ascii_t* namespaceURI , string_ascii_t* localName) { int errn = -1; -#if EXI_DEBUG == EXI_DEBUG_ON - eqname_t se; - /* uri */ - errn = exiGetUriID(&(state->nameTablePrepopulated), &(state->nameTableRuntime), namespaceURI->chars, &se.namespaceURI); - if (errn == -1) { - return errn; - } else if (errn == 1) { - /* No URI (and localNameID) found */ - exiEncodeStartElementGenericUnknown(stream, state, &(namespaceURI->chars), &(localName->chars)); - } else { - /* localName */ - errn = exiGetLocalNameID(&(state->nameTablePrepopulated), &(state->nameTableRuntime), se.namespaceURI, localName->chars, &se.localPart); - if (errn == -1) { - return errn; - } else if (errn == 1) { - /* No localName found, use generic StartElement(*) method */ - exiEncodeStartElementGenericUnknown(stream, state, &(namespaceURI->chars), &(localName->chars)); - } else { - /* Uri&LocalName found, use "efficient" StartElement method */ - return exiappHandEncodeStartElement(stream, state, &se); - } - } -#endif /*EXI_DEBUG*/ - return errn; } -static int _exiEncodeEndElementUndeclared(bitstream_t* stream, exi_state_t* state) { - int16_t currentID = state->grammarStack[state->stackIndex]; - switch (currentID) { - case 9: - /* Element[] */ - /* 1st level and 2nd level event code */ - encodeNBitUnsignedInteger(stream, 0, 0); - encodeNBitUnsignedInteger(stream, 2, 0); - return 0; - case 70: - /* Element[CHARACTERS[STRING]] */ - case 124: - /* Element[CHARACTERS[STRING]] */ - case 139: - /* Element[CHARACTERS[UNSIGNED_INTEGER]] */ - case 46: - /* Element[CHARACTERS[ENUMERATION]] */ - case 22: - /* Element[START_ELEMENT(ProtocolNamespace)] */ - case 86: - /* Element[CHARACTERS[DATETIME]] */ - case 92: - /* Element[CHARACTERS[FLOAT]] */ - case 134: - /* Element[CHARACTERS[STRING]] */ - case 120: - /* Element[CHARACTERS[UNSIGNED_INTEGER]] */ - case 100: - /* Element[CHARACTERS[DATETIME]] */ - case 54: - /* Element[CHARACTERS[STRING]] */ - case 68: - /* Element[CHARACTERS[STRING]] */ - case 72: - /* Element[CHARACTERS[STRING]] */ - case 21: - /* Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - case 78: - /* Element[CHARACTERS[STRING]] */ - case 141: - /* Element[CHARACTERS[UNSIGNED_INTEGER]] */ - case 52: - /* Element[CHARACTERS[LIST]] */ - case 102: - /* Element[CHARACTERS[DATETIME]] */ - case 96: - /* Element[CHARACTERS[FLOAT]] */ - case 60: - /* Element[CHARACTERS[LIST]] */ - case 82: - /* Element[CHARACTERS[BOOLEAN]] */ - case 88: - /* Element[CHARACTERS[DATETIME]] */ - case 116: - /* Element[CHARACTERS[INTEGER]] */ - case 98: - /* Element[CHARACTERS[DATETIME]] */ - case 128: - /* Element[CHARACTERS[INTEGER]] */ - case 13: - /* Element[CHARACTERS[UNSIGNED_INTEGER]] */ - case 90: - /* Element[CHARACTERS[DECIMAL]] */ - case 42: - /* Element[START_ELEMENT(AppProtocol)] */ - case 143: - /* Element[CHARACTERS[STRING]] */ - case 110: - /* Element[CHARACTERS[INTEGER]] */ - case 66: - /* Element[CHARACTERS[LIST]] */ - case 94: - /* Element[CHARACTERS[STRING]] */ - case 112: - /* Element[CHARACTERS[INTEGER]] */ - case 58: - /* Element[CHARACTERS[STRING]] */ - case 14: - /* Element[START_ELEMENT(SchemaID)] */ - case 122: - /* Element[CHARACTERS[INTEGER]] */ - case 16: - /* Element[START_ELEMENT(Priority)] */ - case 104: - /* Element[CHARACTERS[DATETIME]] */ - case 114: - /* Element[CHARACTERS[STRING]] */ - case 108: - /* Element[CHARACTERS[BINARY_HEX]] */ - case 84: - /* Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - case 106: - /* Element[CHARACTERS[DATETIME]] */ - case 11: - /* Element[START_ELEMENT(VersionNumberMinor)] */ - case 74: - /* Element[CHARACTERS[STRING]] */ - case 6: - /* Element[START_ELEMENT(VersionNumberMajor)] */ - case 64: - /* Element[CHARACTERS[STRING]] */ - case 62: - /* Element[CHARACTERS[STRING]] */ - case 130: - /* Element[CHARACTERS[STRING]] */ - case 126: - /* Element[CHARACTERS[UNSIGNED_INTEGER]] */ - case 118: - /* Element[CHARACTERS[INTEGER]] */ - case 48: - /* Element[START_ELEMENT(ResponseCode)] */ - case 10: - /* Element[CHARACTERS[STRING]] */ - case 136: - /* Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - case 80: - /* Element[CHARACTERS[BINARY_BASE64]] */ - case 56: - /* Element[CHARACTERS[STRING]] */ - case 132: - /* Element[CHARACTERS[DATETIME]] */ - case 18: - /* Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - /* 1st level and 2nd level event code */ - encodeNBitUnsignedInteger(stream, 1, 1); - encodeNBitUnsignedInteger(stream, 2, 0); - return 0; - case 109: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - case 113: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 12: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - case 140: - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - case 57: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 97: - /* FirstStartTag[CHARACTERS[DATETIME]] */ - case 135: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - case 5: - /* FirstStartTag[START_ELEMENT(ProtocolNamespace)] */ - case 91: - /* FirstStartTag[CHARACTERS[FLOAT]] */ - case 111: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - case 7: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 123: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 61: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 99: - /* FirstStartTag[CHARACTERS[DATETIME]] */ - case 73: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 53: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 93: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 59: - /* FirstStartTag[CHARACTERS[LIST]] */ - case 63: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 115: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - case 101: - /* FirstStartTag[CHARACTERS[DATETIME]] */ - case 71: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 77: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 142: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 121: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - case 17: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - case 83: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - case 117: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - case 3: - /* FirstStartTag[START_ELEMENT(AppProtocol)] */ - case 87: - /* FirstStartTag[CHARACTERS[DATETIME]] */ - case 79: - /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */ - case 67: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 137: - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - case 81: - /* FirstStartTag[CHARACTERS[BOOLEAN]] */ - case 119: - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - case 51: - /* FirstStartTag[CHARACTERS[LIST]] */ - case 105: - /* FirstStartTag[CHARACTERS[DATETIME]] */ - case 69: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 45: - /* FirstStartTag[CHARACTERS[ENUMERATION]] */ - case 65: - /* FirstStartTag[CHARACTERS[LIST]] */ - case 129: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 55: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 43: - /* FirstStartTag[START_ELEMENT(ResponseCode)] */ - case 20: - /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */ - case 85: - /* FirstStartTag[CHARACTERS[DATETIME]] */ - case 125: - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - case 103: - /* FirstStartTag[CHARACTERS[DATETIME]] */ - case 138: - /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - case 15: - /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */ - case 133: - /* FirstStartTag[CHARACTERS[STRING]] */ - case 131: - /* FirstStartTag[CHARACTERS[DATETIME]] */ - case 89: - /* FirstStartTag[CHARACTERS[DECIMAL]] */ - case 107: - /* FirstStartTag[CHARACTERS[BINARY_HEX]] */ - case 127: - /* FirstStartTag[CHARACTERS[INTEGER]] */ - case 95: - /* FirstStartTag[CHARACTERS[FLOAT]] */ - /* 1st level and 2nd level event code */ - encodeNBitUnsignedInteger(stream, 1, 1); - encodeNBitUnsignedInteger(stream, 3, 0); - return 0; - - } - return EXI_ERROR_UNEXPECTED_END_ELEMENT; -} int exiappHandEncodeEndElement(bitstream_t* stream, exi_state_t* state) { int errn = 0; @@ -1135,16 +634,7 @@ int exiappHandEncodeEndElement(bitstream_t* stream, exi_state_t* state) { break; default: - if (currentID < 0) { - /* runtime grammars */ - return -1; - } else { - errn = _exiEncodeEndElementUndeclared(stream, state); - if (errn < 0) { - return errn; - } - } - /* return EXI_ERROR_UNEXPECTED_END_ELEMENT; */ + return EXI_ERROR_UNEXPECTED_END_ELEMENT; } if (errn < 0) { @@ -1852,63 +1342,6 @@ int exiappHandEncodeAttribute(bitstream_t* stream, exi_state_t* state, eqname_t* /* return EXI_ERROR_UNEXPECTED_ATTRIBUTE; */ } -#if EXI_DEBUG == EXI_DEBUG_ON -static int exiEncodeAttribute2(bitstream_t* stream, exi_state_t* state, qname_t* at, - exi_value_t* val) { - int errn; - eqname_t eat; - - /* attribute generic undeclared */ - uint16_t codeLength1, codeLength2; - uint32_t ec1, ec2; - - errn = exiGetUriID(&state->nameTablePrepopulated, &state->nameTableRuntime, at->namespaceURI.chars, &eat.namespaceURI); - if (errn < 0) { - return errn; - } else if (errn > 0) { - /* uri not found*/ - } else { - /* uri found, try to find localname id */ - errn = exiGetLocalNameID(&state->nameTablePrepopulated, &state->nameTableRuntime, eat.namespaceURI, - at->localName.chars, &eat.localPart); - if (errn < 0) { - return errn; - } else if (errn > 0) { - /* local-name not found*/ - } else { - /* found uri and local-name */ - errn = exiappHandEncodeAttribute(stream, state, &eat, val); - if (errn < 0) { - return errn; - } - if (errn == 0) { - return errn; - } - - } - } - - - /* event codes */ - encodeNBitUnsignedInteger(stream, codeLength1, ec1); - encodeNBitUnsignedInteger(stream, codeLength2, ec2); - - /* qname */ - /* - errn = _exiEncodeQName(stream, state->nameTablePrepopulated, state->nameTableRuntime, - char** uri, char** localName); - QName qname = qnameDatatype.encodeQName(uri, localName, null, channel); - */ - /* content as string */ - /* - typeEncoder.isValid(BuiltIn.DEFAULT_DATATYPE, value); - typeEncoder.writeValue(qname, channel); - */ - return -1; - -} -#endif /*EXI_DEBUG*/ - int exiappHandEncodeAttributeXsiNil(bitstream_t* stream, exi_state_t* state, exi_value_t* val) { diff --git a/src/codec/appHandCodec/appHand_NameTableEntries.c b/src/codec/appHandCodec/appHand_NameTableEntries.c index dde58b7..4b633cb 100644 --- a/src/codec/appHandCodec/appHand_NameTableEntries.c +++ b/src/codec/appHandCodec/appHand_NameTableEntries.c @@ -37,53 +37,6 @@ /* ==================================== */ /* String Table Population */ -#if EXI_DEBUG == EXI_DEBUG_ON -/* localName entries for URI id = 0 */ -char * localNames0[] = { - "AppProtocol", "Priority", "ProtocolNamespace", "ResponseCode", "SchemaID", - "VersionNumberMajor", "VersionNumberMinor" -}; -/* localName entries for URI id = 1 */ -char * localNames1[] = { - "base", "id", "lang", "space" -}; -/* localName entries for URI id = 2 */ -char * localNames2[] = { - "nil", "type" -}; -/* localName entries for URI id = 3 */ -char * localNames3[] = { - "ENTITIES", "ENTITY", "ID", "IDREF", "IDREFS", - "NCName", "NMTOKEN", "NMTOKENS", "NOTATION", "Name", - "QName", "anySimpleType", "anyType", "anyURI", "base64Binary", - "boolean", "byte", "date", "dateTime", "decimal", - "double", "duration", "float", "gDay", "gMonth", - "gMonthDay", "gYear", "gYearMonth", "hexBinary", "int", - "integer", "language", "long", "negativeInteger", "nonNegativeInteger", - "nonPositiveInteger", "normalizedString", "positiveInteger", "short", "string", - "time", "token", "unsignedByte", "unsignedInt", "unsignedLong", - "unsignedShort" -}; -/* localName entries for URI id = 4 */ -char * localNames4[] = { - "AppProtocolType", "idType", "priorityType", "protocolNameType", "protocolNamespaceType", - "responseCodeType", "supportedAppProtocolReq", "supportedAppProtocolRes" -}; -char * uris[] = { - "", "http://www.w3.org/XML/1998/namespace", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/2001/XMLSchema", "urn:iso:15118:2:2010:AppProtocol" -}; -#endif /*EXI_DEBUG*/ - -#if EXI_DEBUG == EXI_DEBUG_ON -static struct exiNamePartition localNamePartitions[5] = { - { 7, localNames0 }, - { 4, localNames1 }, - { 2, localNames2 }, - { 46, localNames3 }, - { 8, localNames4 } -}; -#endif /*EXI_DEBUG*/ - #if EXI_DEBUG == EXI_DEBUG_OFF struct exiNamePartition localNamePartitions[5] = { { 7 }, @@ -94,10 +47,6 @@ struct exiNamePartition localNamePartitions[5] = { }; #endif /*EXI_DEBUG*/ - -#if EXI_DEBUG == EXI_DEBUG_ON -exi_name_table_prepopulated_t exiappHandNameTablePrepopulated = { 5, uris, localNamePartitions }; -#endif /*EXI_DEBUG*/ #if EXI_DEBUG == EXI_DEBUG_OFF exi_name_table_prepopulated_t exiappHandNameTablePrepopulated = { 5, localNamePartitions }; #endif /*EXI_DEBUG*/ diff --git a/src/test/main_codec.c b/src/test/main_codec.c index 2739688..be13314 100644 --- a/src/test/main_codec.c +++ b/src/test/main_codec.c @@ -61,9 +61,6 @@ uint32_t codepoints[ARRAY_SIZE_STRINGS]; char charsNamespaceURI[ARRAY_SIZE_STRINGS_ASCII]; char charsLocalName[ARRAY_SIZE_STRINGS_ASCII]; -#if EXI_DEBUG == EXI_DEBUG_ON -static void debugValue(exi_value_t* val); -#endif /*EXI_DEBUG*/ int main_codec(int argc, char *argv[]) { @@ -87,10 +84,6 @@ int main_codec(int argc, char *argv[]) { /* BINARY memory setup */ bytes_t bytes = { ARRAY_SIZE_BYTES, bytesData, 0 }; -#if EXI_DEBUG == EXI_DEBUG_ON - const char * localName; - const char * namespaceURI; -#endif /*EXI_DEBUG*/ int noEndOfDocument = 1; /* true */ /* STRING memory setup */ @@ -157,24 +150,14 @@ int main_codec(int argc, char *argv[]) { errn = exiInitNameTableRuntime(&runtimeTableEncode); exiInitEncoder(&oStream, &stateEncode, runtimeTableEncode); -#if EXI_DEBUG == EXI_DEBUG_ON - printf("[DECODE] >>> EXI >>> [ENCODE] \n"); -#endif /*EXI_DEBUG*/ - do { if (errn < 0) { -#if EXI_DEBUG == EXI_DEBUG_ON - printf("[Encode-ERROR] %d \n", errn); -#endif /*EXI_DEBUG*/ return errn; } errn = exiDecodeNextEvent(&iStream, &stateDecode, &event); if (errn < 0) { -#if EXI_DEBUG == EXI_DEBUG_ON - printf("[Decode-ERROR] %d \n", errn); -#endif /*EXI_DEBUG*/ return errn; } @@ -184,14 +167,8 @@ int main_codec(int argc, char *argv[]) { errn = exiDecodeStartDocument(&iStream, &stateDecode); if (errn < 0) { -#if EXI_DEBUG == EXI_DEBUG_ON - printf("[Decode-ERROR-SD] %d \n", errn); -#endif /*EXI_DEBUG*/ return errn; } -#if EXI_DEBUG == EXI_DEBUG_ON - printf(">> START_DOCUMENT \n"); -#endif /*EXI_DEBUG*/ /* encode */ errn = exiEncodeStartDocument(&oStream, &stateEncode); @@ -201,14 +178,8 @@ int main_codec(int argc, char *argv[]) { errn = exiDecodeEndDocument(&iStream, &stateDecode); if (errn < 0) { -#if EXI_DEBUG == EXI_DEBUG_ON - printf("[Decode-ERROR-ED] %d \n", errn); -#endif /*EXI_DEBUG*/ return errn; } -#if EXI_DEBUG == EXI_DEBUG_ON - printf(">> END_DOCUMENT \n"); -#endif /*EXI_DEBUG*/ /* encode */ errn = exiEncodeEndDocument(&oStream, &stateEncode); @@ -220,19 +191,8 @@ int main_codec(int argc, char *argv[]) { errn = exiDecodeStartElement(&iStream, &stateDecode, &eqn); if (errn < 0) { -#if EXI_DEBUG == EXI_DEBUG_ON - printf("[Decode-ERROR-SE] %d \n", errn); -#endif /*EXI_DEBUG*/ return errn; } -#if EXI_DEBUG == EXI_DEBUG_ON - exiGetLocalName(&(stateDecode.nameTablePrepopulated), - &(stateDecode.nameTableRuntime), eqn.namespaceURI, - eqn.localPart, &localName); - exiGetUri(&(stateDecode.nameTablePrepopulated), - &(stateDecode.nameTableRuntime), eqn.namespaceURI, - &namespaceURI); -#endif /*EXI_DEBUG*/ /* encode */ errn = exiEncodeStartElement(&oStream, &stateEncode, &eqn); @@ -242,15 +202,8 @@ int main_codec(int argc, char *argv[]) { errn = exiDecodeStartElementGeneric(&iStream, &stateDecode, &qn); if (errn < 0) { -#if EXI_DEBUG == EXI_DEBUG_ON - printf("[Decode-ERROR-SEgen] %d \n", errn); -#endif /*EXI_DEBUG*/ return errn; } -#if EXI_DEBUG == EXI_DEBUG_ON - printf(">> SE_Gen {%s}%s \n", stringNamespaceURI.chars, - stringLocalName.chars); -#endif /*EXI_DEBUG*/ /* encode */ errn = exiEncodeStartElementGeneric(&oStream, &stateEncode, &stringNamespaceURI, &stringLocalName); @@ -260,14 +213,8 @@ int main_codec(int argc, char *argv[]) { errn = exiDecodeEndElement(&iStream, &stateDecode, &eqn); if (errn < 0) { -#if EXI_DEBUG == EXI_DEBUG_ON - printf("[Decode-ERROR-EE] %d \n", errn); -#endif /*EXI_DEBUG*/ return errn; } -#if EXI_DEBUG == EXI_DEBUG_ON - printf("<< EE \n"); -#endif /*EXI_DEBUG*/ /* encode */ errn = exiEncodeEndElement(&oStream, @@ -278,14 +225,8 @@ int main_codec(int argc, char *argv[]) { errn = exiDecodeEndElementUndeclared(&iStream, &stateDecode, &eqn); if (errn < 0) { -#if EXI_DEBUG == EXI_DEBUG_ON - printf("[Decode-ERROR-EE-Undecl] %d \n", errn); -#endif /*EXI_DEBUG*/ return errn; } -#if EXI_DEBUG == EXI_DEBUG_ON - printf("<< EEundecl \n"); -#endif /*EXI_DEBUG*/ /* encode */ errn = exiEncodeEndElement(&oStream, @@ -296,14 +237,8 @@ int main_codec(int argc, char *argv[]) { errn = exiDecodeCharacters(&iStream, &stateDecode, &val); if (errn < 0) { -#if EXI_DEBUG == EXI_DEBUG_ON - printf("[Decode-ERROR-CH] %d \n", errn); -#endif /*EXI_DEBUG*/ return errn; } -#if EXI_DEBUG == EXI_DEBUG_ON - debugValue(&val); -#endif /*EXI_DEBUG*/ /* encode */ errn = exiEncodeCharacters(&oStream, &stateEncode, &val); @@ -313,14 +248,8 @@ int main_codec(int argc, char *argv[]) { errn = exiDecodeCharactersGeneric(&iStream, &stateDecode, &val); if (errn < 0) { -#if EXI_DEBUG == EXI_DEBUG_ON - printf("[Decode-ERROR-CHgen] %d \n", errn); -#endif /*EXI_DEBUG*/ return errn; } -#if EXI_DEBUG == EXI_DEBUG_ON - debugValue(&val); -#endif /*EXI_DEBUG*/ /* encode */ errn = exiEncodeCharacters(&oStream, &stateEncode, &val); @@ -330,14 +259,8 @@ int main_codec(int argc, char *argv[]) { errn = exiDecodeCharactersGenericUndeclared( &iStream, &stateDecode, &val); if (errn < 0) { -#if EXI_DEBUG == EXI_DEBUG_ON - printf("[Decode-ERROR-CHgenUndecl] %d \n", errn); -#endif /*EXI_DEBUG*/ return errn; } -#if EXI_DEBUG == EXI_DEBUG_ON - debugValue(&val); -#endif /*EXI_DEBUG*/ /* encode */ errn = exiEncodeCharacters(&oStream, &stateEncode, &val); @@ -347,21 +270,8 @@ int main_codec(int argc, char *argv[]) { errn = exiDecodeAttribute(&iStream, &stateDecode, &eqn, &val); if (errn < 0) { -#if EXI_DEBUG == EXI_DEBUG_ON - printf("[Decode-ERROR-AT] %d \n", errn); -#endif /*EXI_DEBUG*/ return errn; } -#if EXI_DEBUG == EXI_DEBUG_ON - exiGetLocalName(&(stateDecode.nameTablePrepopulated), - &(stateDecode.nameTableRuntime), eqn.namespaceURI, - eqn.localPart, &localName); - exiGetUri(&(stateDecode.nameTablePrepopulated), - &(stateDecode.nameTableRuntime), eqn.namespaceURI, - &namespaceURI); - printf(" AT {%s}%s \n", namespaceURI, localName); - debugValue(&val); -#endif /*EXI_DEBUG*/ /* encode */ errn = exiEncodeAttribute(&oStream, &stateEncode, &eqn, &val); @@ -371,14 +281,8 @@ int main_codec(int argc, char *argv[]) { errn = exiDecodeAttributeXsiNil(&iStream, &stateDecode, &val); if (errn < 0) { -#if EXI_DEBUG == EXI_DEBUG_ON - printf("[Decode-ERROR-AT-NIL] %d \n", errn); -#endif /*EXI_DEBUG*/ return errn; } -#if EXI_DEBUG == EXI_DEBUG_ON - printf(" AT {xsi}nil == %i \n", val.boolean); -#endif /*EXI_DEBUG*/ /* encode */ errn = exiEncodeAttributeXsiNil(&oStream, &stateEncode, &val); @@ -388,20 +292,8 @@ int main_codec(int argc, char *argv[]) { errn = exiDecodeAttributeXsiType(&iStream, &stateDecode, &val); if (errn < 0) { -#if EXI_DEBUG == EXI_DEBUG_ON - printf("[Decode-ERROR-AT-TYPE] %d \n", errn); -#endif /*EXI_DEBUG*/ return errn; } -#if EXI_DEBUG == EXI_DEBUG_ON - exiGetLocalName(&(stateDecode.nameTablePrepopulated), - &(stateDecode.nameTableRuntime), val.eqname.namespaceURI, - val.eqname.localPart, &localName); - exiGetUri(&(stateDecode.nameTablePrepopulated), - &(stateDecode.nameTableRuntime), val.eqname.namespaceURI, - &namespaceURI); - printf(" AT {type}type == {%s}%s \n", namespaceURI, localName); -#endif /*EXI_DEBUG*/ /* encode */ errn = exiEncodeAttributeXsiType(&oStream, &stateEncode, &val); @@ -411,26 +303,14 @@ int main_codec(int argc, char *argv[]) { errn = exiDecodeAttributeGenericUndeclared( &iStream, &stateDecode, &qn, &val); if (errn < 0) { -#if EXI_DEBUG == EXI_DEBUG_ON - printf("[Decode-ERROR-ATgenUnd] %d \n", errn); -#endif /*EXI_DEBUG*/ return errn; } -#if EXI_DEBUG == EXI_DEBUG_ON - /* exiGetLocalName(&(stateDecode.nameTablePrepopulated), &(stateDecode.nameTableRuntime), eqn.namespaceURI, eqn.localPart, &localName); - exiGetUri(&(stateDecode.nameTablePrepopulated), &(stateDecode.nameTableRuntime), eqn.namespaceURI, &namespaceURI); */ - printf(" AT {%s}%s \n", qn.namespaceURI.chars, qn.localName.chars); - debugValue(&val); -#endif /*EXI_DEBUG*/ /* encode */ errn = exiEncodeAttribute(&oStream, &stateEncode, &eqn, &val); break; default: /* ERROR */ -#if EXI_DEBUG == EXI_DEBUG_ON - printf("[Unknown-Event] %d \n", event); -#endif /*EXI_DEBUG*/ return EXI_ERROR_UNKOWN_EVENT; } @@ -448,98 +328,3 @@ int main_codec(int argc, char *argv[]) { return 0; } -static int _setInt32Value(integer_t* iv, int32_t* int32) { - int errn = 0; - switch (iv->type) { - /* Unsigned Integer */ - case UNSIGNED_INTEGER_8: - *int32 = iv->val.uint8; - break; - case UNSIGNED_INTEGER_16: - *int32 = iv->val.uint16; - break; - case UNSIGNED_INTEGER_32: - if (iv->val.uint32 <= 2147483647) { - *int32 = iv->val.uint32; - } else { - errn = EXI_UNSUPPORTED_INTEGER_VALUE; - } - break; - case UNSIGNED_INTEGER_64: - errn = EXI_UNSUPPORTED_INTEGER_VALUE; - break; - /* (Signed) Integer */ - case INTEGER_8: - *int32 = iv->val.int8; - break; - case INTEGER_16: - *int32 = iv->val.int16; - break; - case INTEGER_32: - *int32 = iv->val.int32; - break; - case INTEGER_64: - errn = EXI_UNSUPPORTED_INTEGER_VALUE; - } - return errn; -} - -#if EXI_DEBUG == EXI_DEBUG_ON -static void debugValue(exi_value_t* val) { - int i; - switch (val->type) { - case INTEGER: - switch (val->integer.type) { - /* Unsigned Integer */ - case UNSIGNED_INTEGER_8: - printf(" Value uint8 : %d \n", val->integer.val.uint8); - break; - case UNSIGNED_INTEGER_16: - printf(" Value uint16 : %d \n", val->integer.val.uint16); - break; - case UNSIGNED_INTEGER_32: - printf(" Value uint32 : %d \n", val->integer.val.uint32); - break; - case UNSIGNED_INTEGER_64: - printf(" Value uint64 : %ld \n", - (long unsigned int) val->integer.val.uint64); - break; - /* (Signed) Integer */ - case INTEGER_8: - printf(" Value int8 : %d \n", val->integer.val.int8); - break; - case INTEGER_16: - printf(" Value int16 : %d \n", val->integer.val.int16); - break; - case INTEGER_32: - printf(" Value int32 : %d \n", val->integer.val.int32); - break; - case INTEGER_64: - printf(" Value int64 : %ld \n", (long int) val->integer.val.int64); - break; - } - break; - case BINARY_BASE64: - case BINARY_HEX: - printf(" Value Binary (len == %d) : ", val->binary.len); - for (i = 0; i < val->binary.len; i++) { - printf(" [%d]", val->binary.data[i]); - } - printf("\n"); - break; - case BOOLEAN: - printf(" Value Boolean : %d \n", val->boolean); - break; - case STRING: - printf(" Value String (len==%d) : '", val->string.len); - for (i = 0; i < val->string.len; i++) { - printf("%c", (char) val->string.codepoints[i]); - } - printf("'\n"); - break; - default: - printf(" Value ?? \n"); - } -} -#endif /*EXI_DEBUG*/ -