@@ -32,12 +32,16 @@
#include "appHand_service.h"
#include "appHand_dataTypes.h"
#include "EXITypes.h"
- #include "appHand_EXIDecoder.h"
+ #include "appHandEXIDecoder.h"
+ #include "appHandEXIEncoder.h"
#include "StringTable.h"
+ #include "appHandQNameDefines.h"
#include
-
-static int _setUnsignedInt32Value(integer_t* iv, uint32_t* int32) {
+uint16_t numberOfLocalStringsDecode[EXI_appHandMAX_NUMBER_OF_QNAMES];
+
+
+ static int _setUnsignedInt32Value(exi_integer_t* iv, uint32_t* int32) {
int errn = 0;
switch(iv->type) {
/* Unsigned Integer */
@@ -69,15 +73,12 @@ static int _setUnsignedInt32Value(integer_t* iv, uint32_t* int32) {
break;
case EXI_INTEGER_64:
errn = -1;
+ break;
}
return errn;
}
-
-
-
-
/**
* Deserialize an element or attribute value of the EXI stream and assign it to the
* service data structure
@@ -85,106 +86,119 @@ static int _setUnsignedInt32Value(integer_t* iv, uint32_t* int32) {
static int deserializeElementAttributeCharacter(struct EXIDatabinder* service)
{
- switch(service->eqn.namespaceURI) {
- case 0:
- switch(service->eqn.localPart) {
- case 2: /*ProtocolNamespace*/
+ switch(service->qnameID) {
+ case 2: /* ProtocolNamespace */
- if(service->val.type == EXI_DATATYPE_STRING)
+ if(service->val.type == EXI_DATATYPE_STRING)
{
- memcpy(service->exiMsg.supportedAppProtocolReq->AppProtocol[service->exiMsg.supportedAppProtocolReq->arraylen.AppProtocol].ProtocolNamespace.data, service->val.string.codepoints,service->val.string.len*sizeof(uint32_t));
- service->exiMsg.supportedAppProtocolReq->AppProtocol[service->exiMsg.supportedAppProtocolReq->arraylen.AppProtocol].ProtocolNamespace.arraylen.data = service->val.string.len;
+ memcpy(service->exiMsg.supportedAppProtocolReq->AppProtocol[service->exiMsg.supportedAppProtocolReq->arraylen.AppProtocol].ProtocolNamespace.data, service->val.str.miss.codepoints,service->val.str.miss.len*sizeof(uint32_t));
+ service->exiMsg.supportedAppProtocolReq->AppProtocol[service->exiMsg.supportedAppProtocolReq->arraylen.AppProtocol].ProtocolNamespace.arraylen.data = service->val.str.miss.len;
}
else
{
+ service->errorCode=EXI_DATATYPE_FAILED;
return -1; /* wrong data type */
}
break;
- case 5: /*VersionNumberMajor*/
- if(service->val.type == EXI_DATATYPE_UNSIGNED_INTEGER)
+ case 5: /* VersionNumberMajor */
+
+ if(service->val.type == EXI_DATATYPE_UNSIGNED_INTEGER)
{
- _setUnsignedInt32Value( &(service->val.integer),&(service->exiMsg.supportedAppProtocolReq->AppProtocol[service->exiMsg.supportedAppProtocolReq->arraylen.AppProtocol].VersionNumberMajor));
-
- }
- else
- {
- return -1; /* wrong data type */
- }
-
-
- break;
- case 6: /*VersionNumberMinor*/
-
- if(service->val.type == EXI_DATATYPE_UNSIGNED_INTEGER)
- {
- _setUnsignedInt32Value( &(service->val.integer),&(service->exiMsg.supportedAppProtocolReq->AppProtocol[service->exiMsg.supportedAppProtocolReq->arraylen.AppProtocol].VersionNumberMinor));
-
- }
- else
- {
- return -1; /* wrong data type */
- }
-
-
- break;
- case 4: /*SchemaID*/
-
- if(service->val.type == EXI_DATATYPE_NBIT_UNSIGNED_INTEGER)
- {
- if( service->idPath.id[0] == 7)
+ if(_setUnsignedInt32Value(&(service->val.integer),&(service->val.integer.val.uint32)))
{
- service->exiMsg.supportedAppProtocolRes->SchemaID = service->val.integer.val.uint8;
- service->exiMsg.supportedAppProtocolRes->isused.SchemaID=1;
-
- } else if(service->idPath.id[0] == 6)
- {
- service->exiMsg.supportedAppProtocolReq->AppProtocol[service->exiMsg.supportedAppProtocolReq->arraylen.AppProtocol].SchemaID = service->val.integer.val.uint8;
+ service->errorCode=EXI_VALUE_RANGE_FAILED;
+ return -1;
}
-
+ service->exiMsg.supportedAppProtocolReq->AppProtocol[service->exiMsg.supportedAppProtocolReq->arraylen.AppProtocol].VersionNumberMajor=service->val.integer.val.uint32;
}
else
{
+ service->errorCode=EXI_DATATYPE_FAILED;
return -1; /* wrong data type */
}
break;
- case 1: /*Priority*/
- if(service->val.type == EXI_DATATYPE_NBIT_UNSIGNED_INTEGER)
+ case 6: /* VersionNumberMinor */
+
+ if(service->val.type == EXI_DATATYPE_UNSIGNED_INTEGER)
{
- service->exiMsg.supportedAppProtocolReq->AppProtocol[service->exiMsg.supportedAppProtocolReq->arraylen.AppProtocol].Priority = service->val.integer.val.uint8;
-
+ if(_setUnsignedInt32Value(&(service->val.integer),&(service->val.integer.val.uint32)))
+ {
+ service->errorCode=EXI_VALUE_RANGE_FAILED;
+ return -1;
+ }
+ service->exiMsg.supportedAppProtocolReq->AppProtocol[service->exiMsg.supportedAppProtocolReq->arraylen.AppProtocol].VersionNumberMinor=service->val.integer.val.uint32;
}
else
{
+ service->errorCode=EXI_DATATYPE_FAILED;
return -1; /* wrong data type */
}
break;
- case 3: /*ResponseCode*/
- if(service->val.type == EXI_DATATYPE_ENUMERATION)
+ case 4: /* SchemaID */
+
+ if(service->val.type == EXI_DATATYPE_NBIT_UNSIGNED_INTEGER)
{
- service->exiMsg.supportedAppProtocolRes->ResponseCode = service->val.enumeration;
+ if( service->idPath.id[0] == 66)
+ {
+ service->exiMsg.supportedAppProtocolRes->SchemaID=service->val.integer.val.uint8;
+ service->exiMsg.supportedAppProtocolRes->isused.SchemaID=1;
+
+ } else if(service->idPath.id[0] == 65)
+ {
+ service->exiMsg.supportedAppProtocolReq->AppProtocol[service->exiMsg.supportedAppProtocolReq->arraylen.AppProtocol].SchemaID=service->val.integer.val.uint8; }
}
else
{
+ service->errorCode=EXI_DATATYPE_FAILED;
return -1; /* wrong data type */
}
- break;
- } /* close switch(service->eqn.localPart) */
- break;
+ break;
+
+ case 1: /* Priority */
+
+ if(service->val.type == EXI_DATATYPE_NBIT_UNSIGNED_INTEGER)
+ {
+ service->exiMsg.supportedAppProtocolReq->AppProtocol[service->exiMsg.supportedAppProtocolReq->arraylen.AppProtocol].Priority=service->val.integer.val.uint8;
+ }
+ else
+ {
+ service->errorCode=EXI_DATATYPE_FAILED;
+ return -1; /* wrong data type */
+ }
+
+
+ break;
+
+ case 3: /* ResponseCode */
+
+ if(service->val.type == EXI_DATATYPE_ENUMERATION)
+ {
+ service->exiMsg.supportedAppProtocolRes->ResponseCode=service->val.enumeration;
+ }
+ else
+ {
+ service->errorCode=EXI_DATATYPE_FAILED;
+ return -1; /* wrong data type */
+ }
+
+
+ break;
+
- } /* close switch(service->eqn.namespaceURI) */
+ }
return 0;
}
@@ -194,34 +208,20 @@ static int deserializeElementAttributeCharacter(struct EXIDatabinder* service)
*/
static int deserializeElement(struct EXIDatabinder* service)
{
- switch(service->eqn.namespaceURI) {
- case 0:
- switch(service->eqn.localPart) {
- case 0:/* AppProtocol */
-
- service->exiMsg.supportedAppProtocolReq->arraylen.AppProtocol++;
-
- break;
-
- }
- break;
- case 4:
- switch(service->eqn.localPart) {
- case 6:/* supportedAppProtocolReq */
-
- service->exiMsg.isused.supportedAppProtocolReq=1;
-
- break;
- case 7:/* supportedAppProtocolRes */
-
- service->exiMsg.isused.supportedAppProtocolRes=1;
-
- break;
-
- }
- break;
-
-
+ switch(service->qnameID) {
+ case 0: /* AppProtocol */
+ service->exiMsg.supportedAppProtocolReq->arraylen.AppProtocol++;
+
+ break;
+ case 65: /* supportedAppProtocolReq */
+ service->exiMsg.isused.supportedAppProtocolReq=1;
+
+ break;
+ case 66: /* supportedAppProtocolRes */
+ service->exiMsg.isused.supportedAppProtocolRes=1;
+
+ break;
+
}
return 0;
}
@@ -230,13 +230,14 @@ static int deserializeElement(struct EXIDatabinder* service)
/**
-* Deserialize the EXI stream
+* Deserialize the appHand EXI stream
* @return 0 = 0K; -1 = ERROR
*/
int deserialize_appHand(struct EXIDatabinder* service, uint8_t* inStream, uint16_t sizeInStream, struct EXIDocumentType_appHand* exiDoc)
{
exi_name_table_runtime_t runtimeTableDecode;
uint32_t inPos;
+ exi_string_table_t stringTableDecode = { 0, EXI_appHandMAX_NUMBER_OF_QNAMES, numberOfLocalStringsDecode};
int noEndOfDocument = 1; /* true */
int returnCode=0;
@@ -253,12 +254,11 @@ int deserialize_appHand(struct EXIDatabinder* service, uint8_t* inStream, uint16
service->exiMsg=*exiDoc;
exiInitNameTableRuntime(&runtimeTableDecode);
- exiappHandInitDecoder(&(service->inStream), &(service->stateDecode), runtimeTableDecode);
+ exiappHandInitDecoder(&(service->inStream), &(service->stateDecode), runtimeTableDecode,stringTableDecode);
do {
exiappHandDecodeNextEvent(&(service->inStream), &(service->stateDecode), &(service->event));
if (returnCode < 0) {
- printf("[ERROR] %d \n", returnCode);
return returnCode;
}
@@ -274,13 +274,13 @@ int deserialize_appHand(struct EXIDatabinder* service, uint8_t* inStream, uint16
noEndOfDocument = 0; /* false */
break;
case EXI_EVENT_START_ELEMENT:
- returnCode = exiappHandDecodeStartElement(&(service->inStream), &(service->stateDecode), &(service->eqn));
- service->idPath.id[service->idPath.pos++]=service->eqn.localPart;
+ returnCode = exiappHandDecodeStartElement(&(service->inStream), &(service->stateDecode), &(service->qnameID));
+ service->idPath.id[service->idPath.pos++]=service->qnameID;
break;
case EXI_EVENT_END_ELEMENT:
- returnCode = exiappHandDecodeEndElement(&(service->inStream), &(service->stateDecode), &(service->eqn));
+ returnCode = exiappHandDecodeEndElement(&(service->inStream), &(service->stateDecode), &(service->qnameID));
service->idPath.pos--;
returnCode = deserializeElement(service);
@@ -294,7 +294,7 @@ int deserialize_appHand(struct EXIDatabinder* service, uint8_t* inStream, uint16
break;
case EXI_EVENT_ATTRIBUTE:
/* decode */
- returnCode = exiappHandDecodeAttribute(&(service->inStream), &(service->stateDecode), &(service->eqn), &(service->val));
+ returnCode = exiappHandDecodeAttribute(&(service->inStream), &(service->stateDecode), &(service->qnameID), &(service->val));
returnCode = deserializeElementAttributeCharacter(service);
break;
default:
@@ -309,15 +309,23 @@ int deserialize_appHand(struct EXIDatabinder* service, uint8_t* inStream, uint16
-/* Initialize the deserializer */
-int init_appHandDeserializer(struct EXIDatabinder* service, bytes_t bytes, string_ucs_t string, uint16_t transportHeaderOffset)
+
+
+/**
+ * \brief Initialize the appHand deserializer
+ * \param service struct EXIDatabinder* Basic databinder structure
+ * \param service_bytes bytes_t Reserved byte structure buffer
+ * \param service_string string_ucs_t* Reserved string structure buffer
+ * \param transportHeaderOffset uint16_t Offset of the used transport header (E.g., V2GTP needs 8 bytes)
+ * \return 0 = 0K; -1 = ERROR */
+int init_appHandDeserializer(struct EXIDatabinder* service, exi_bytes_t service_bytes, exi_string_ucs_t service_string, uint16_t transportHeaderOffset)
{
/* init byte array */
- service->val.binary = bytes;
+ service->val.binary = service_bytes;
/* init string array */
- service->val.string = string;
+ service->val.str.miss = service_string;
service->idPath.pos=0;
@@ -328,5 +336,3 @@ int init_appHandDeserializer(struct EXIDatabinder* service, bytes_t bytes, strin
return 0;
}
-
-
diff --git a/src/appHandshake/appHand_dataSerialization.c b/src/appHandshake/appHand_dataSerialization.c
new file mode 100644
index 0000000..e04b13e
--- /dev/null
+++ b/src/appHandshake/appHand_dataSerialization.c
@@ -0,0 +1,415 @@
+
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Sebastian.Kaebisch.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXISeGen
+ *
+ ********************************************************************/
+
+
+#include "appHand_service.h"
+#include "appHand_dataTypes.h"
+#include "EXITypes.h"
+#include "StringTable.h"
+#include "appHandEXIEncoder.h"
+#include "appHandQNameDefines.h"
+#include
+
+ uint16_t numberOfLocalStringsEncode[EXI_appHandMAX_NUMBER_OF_QNAMES];
+
+
+
+
+static int serialize_AppProtocolType(struct AppProtocolType* type, struct EXIDatabinder* service)
+{
+
+
+
+ /* encode start element ProtocolNamespace */
+ if (exiappHandEncodeStartElement(&(service->outStream), &(service->stateEncode), 2))
+ {
+ return -1;
+ }
+
+ service->val.type = EXI_DATATYPE_STRING;
+ service->val.str.type = EXI_STRING_VALUE_MISS;
+ service->val.str.miss.len = type->ProtocolNamespace.arraylen.data;
+ memcpy(service->val.str.miss.codepoints, type->ProtocolNamespace.data,type->ProtocolNamespace.arraylen.data*sizeof(uint32_t));
+
+
+
+ /* encode character ProtocolNamespace */
+ if (exiappHandEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
+ {
+
+ return -1;
+ }
+
+
+ /* encode end element of ProtocolNamespace */
+ exiappHandEncodeEndElement(&(service->outStream), &(service->stateEncode));
+
+
+
+
+ /* encode start element VersionNumberMajor */
+ if (exiappHandEncodeStartElement(&(service->outStream), &(service->stateEncode), 5))
+ {
+ return -1;
+ }
+
+ service->val.type = EXI_DATATYPE_UNSIGNED_INTEGER;
+ service->val.integer.val.uint32=type->VersionNumberMajor;
+
+ service->val.integer.type = EXI_UNSIGNED_INTEGER_32;
+
+ /* encode character VersionNumberMajor */
+ if (exiappHandEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
+ {
+
+ return -1;
+ }
+
+
+ /* encode end element of VersionNumberMajor */
+ exiappHandEncodeEndElement(&(service->outStream), &(service->stateEncode));
+
+
+
+
+ /* encode start element VersionNumberMinor */
+ if (exiappHandEncodeStartElement(&(service->outStream), &(service->stateEncode), 6))
+ {
+ return -1;
+ }
+
+ service->val.type = EXI_DATATYPE_UNSIGNED_INTEGER;
+ service->val.integer.val.uint32=type->VersionNumberMinor;
+
+ service->val.integer.type = EXI_UNSIGNED_INTEGER_32;
+
+ /* encode character VersionNumberMinor */
+ if (exiappHandEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
+ {
+
+ return -1;
+ }
+
+
+ /* encode end element of VersionNumberMinor */
+ exiappHandEncodeEndElement(&(service->outStream), &(service->stateEncode));
+
+
+
+
+ /* encode start element SchemaID */
+ if (exiappHandEncodeStartElement(&(service->outStream), &(service->stateEncode), 4))
+ {
+ return -1;
+ }
+
+ service->val.type = EXI_DATATYPE_NBIT_UNSIGNED_INTEGER;
+ service->val.integer.val.uint8=type->SchemaID;
+
+ service->val.integer.type = EXI_UNSIGNED_INTEGER_8;
+
+ /* encode character SchemaID */
+ if (exiappHandEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
+ {
+
+ return -1;
+ }
+
+
+ /* encode end element of SchemaID */
+ exiappHandEncodeEndElement(&(service->outStream), &(service->stateEncode));
+
+
+
+
+ /* encode start element Priority */
+ if (exiappHandEncodeStartElement(&(service->outStream), &(service->stateEncode), 1))
+ {
+ return -1;
+ }
+
+ service->val.type = EXI_DATATYPE_NBIT_UNSIGNED_INTEGER;
+ service->val.integer.val.uint8=type->Priority;
+
+ service->val.integer.type = EXI_UNSIGNED_INTEGER_8;
+
+ /* encode character Priority */
+ if (exiappHandEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
+ {
+
+ return -1;
+ }
+
+
+ /* encode end element of Priority */
+ exiappHandEncodeEndElement(&(service->outStream), &(service->stateEncode));
+
+
+
+ return 0;
+}
+
+
+static int serialize_AnonType_supportedAppProtocolReq(struct AnonType_supportedAppProtocolReq* type, struct EXIDatabinder* service)
+{
+
+ size_t i_loop;
+
+ for(i_loop=0;i_loop < type->arraylen.AppProtocol;i_loop++)
+ {
+
+
+
+ /* encode start element AppProtocol */
+ if (exiappHandEncodeStartElement(&(service->outStream), &(service->stateEncode), 0))
+ {
+ return -1;
+ }
+
+ /* encode children of AppProtocol */
+ if(serialize_AppProtocolType(&(type->AppProtocol[i_loop]),service))
+ {
+ return -1;
+ }
+
+
+ /* encode end element of AppProtocol */
+ exiappHandEncodeEndElement(&(service->outStream), &(service->stateEncode));
+
+ }
+
+
+ return 0;
+}
+
+
+static int serialize_AnonType_supportedAppProtocolRes(struct AnonType_supportedAppProtocolRes* type, struct EXIDatabinder* service)
+{
+
+
+
+ /* encode start element ResponseCode */
+ if (exiappHandEncodeStartElement(&(service->outStream), &(service->stateEncode), 3))
+ {
+ return -1;
+ }
+
+ service->val.type = EXI_DATATYPE_ENUMERATION;
+ service->val.enumeration=type->ResponseCode;
+
+
+ /* encode character ResponseCode */
+ if (exiappHandEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
+ {
+
+ return -1;
+ }
+
+
+ /* encode end element of ResponseCode */
+ exiappHandEncodeEndElement(&(service->outStream), &(service->stateEncode));
+
+
+ if(type->isused.SchemaID)
+ {
+
+
+
+ /* encode start element SchemaID */
+ if (exiappHandEncodeStartElement(&(service->outStream), &(service->stateEncode), 4))
+ {
+ return -1;
+ }
+
+ service->val.type = EXI_DATATYPE_NBIT_UNSIGNED_INTEGER;
+ service->val.integer.val.uint8=type->SchemaID;
+
+ service->val.integer.type = EXI_UNSIGNED_INTEGER_8;
+
+ /* encode character SchemaID */
+ if (exiappHandEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
+ {
+
+ return -1;
+ }
+
+
+ /* encode end element of SchemaID */
+ exiappHandEncodeEndElement(&(service->outStream), &(service->stateEncode));
+
+ }
+
+
+ return 0;
+}
+
+
+static int serialize_EXIDocumentType_appHand(struct EXIDocumentType_appHand* type, struct EXIDatabinder* service)
+{
+
+ if(type->isused.supportedAppProtocolReq)
+ {
+
+
+
+ /* encode start element supportedAppProtocolReq */
+ if (exiappHandEncodeStartElement(&(service->outStream), &(service->stateEncode), 65))
+ {
+ return -1;
+ }
+
+ /* encode children of supportedAppProtocolReq */
+ if(serialize_AnonType_supportedAppProtocolReq( (type->supportedAppProtocolReq),service))
+ {
+ return -1;
+ }
+
+
+
+ /* encode end element of supportedAppProtocolReq */
+ exiappHandEncodeEndElement(&(service->outStream), &(service->stateEncode));
+
+ }
+
+ if(type->isused.supportedAppProtocolRes)
+ {
+
+
+
+ /* encode start element supportedAppProtocolRes */
+ if (exiappHandEncodeStartElement(&(service->outStream), &(service->stateEncode), 66))
+ {
+ return -1;
+ }
+
+ /* encode children of supportedAppProtocolRes */
+ if(serialize_AnonType_supportedAppProtocolRes( (type->supportedAppProtocolRes),service))
+ {
+ return -1;
+ }
+
+
+
+ /* encode end element of supportedAppProtocolRes */
+ exiappHandEncodeEndElement(&(service->outStream), &(service->stateEncode));
+
+ }
+
+
+ return 0;
+}
+
+
+
+
+
+ /* serialize data to EXI stream */
+static int serialize_message(struct EXIDatabinder* service)
+ {
+
+ /* encode start document */
+ if (exiappHandEncodeStartDocument(&(service->outStream), &(service->stateEncode)) )
+ {
+
+ return -1;
+ }
+
+
+ if (serialize_EXIDocumentType_appHand(&(service->exiMsg), service))
+
+
+ {
+
+ return -1;
+ }
+
+
+ /* encode end document */
+ if (exiappHandEncodeEndDocument(&(service->outStream), &(service->stateEncode))) {
+
+ return -1;
+ }
+
+ return 0;
+
+ }
+
+
+
+int serialize_appHand(struct EXIDatabinder* service, uint8_t* outStream, size_t* payloadLength, struct EXIDocumentType_appHand* exiDoc)
+{
+ exi_name_table_runtime_t runtimeTableEncode;
+ exi_string_table_t stringTableEncode = { 0, EXI_appHandMAX_NUMBER_OF_QNAMES, numberOfLocalStringsEncode};
+
+ uint32_t outPos =service->transportHeaderOffset;
+
+ /* assign outStream data to service EXI structure */
+ service->outStream.data = outStream;
+ service->outStream.pos = &outPos;
+ service->outStream.buffer=0;
+ service->outStream.capacity=8;
+
+ service->exiMsg = *exiDoc;
+
+ /* init encoder (write header, set initial state) */
+ exiInitNameTableRuntime(&runtimeTableEncode);
+ exiappHandInitEncoder(&(service->outStream), &(service->stateEncode), runtimeTableEncode,stringTableEncode);
+
+
+ if(serialize_message(service))
+ {
+ return -1;
+ }
+
+ outPos -= service->transportHeaderOffset;
+ *payloadLength = outPos;
+
+
+ return 0;
+ }
+
+/* Initialize serializer */
+int init_appHandSerializer(struct EXIDatabinder* service, exi_bytes_t service_bytes, exi_string_ucs_t service_string, size_t max_outStream_size, uint16_t transportHeaderOffset)
+{
+
+ /* init byte array */
+ service->val.binary = service_bytes;
+
+ /* init string array */
+ service->val.str.miss = service_string;
+
+ /* init output stream */
+
+ service->outStream.size=max_outStream_size;
+
+ service->transportHeaderOffset=transportHeaderOffset;
+
+
+ return 0;
+}
+
diff --git a/src/appHandshake/appHand_dataTypes.c b/src/appHandshake/appHand_dataTypes.c
new file mode 100644
index 0000000..b2b6c8e
--- /dev/null
+++ b/src/appHandshake/appHand_dataTypes.c
@@ -0,0 +1,70 @@
+
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Sebastian.Kaebisch.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXISeGen
+ *
+ ********************************************************************/
+
+
+#include "EXITypes.h"
+#include "appHand_dataTypes.h"
+
+
+static void init_protocolNamespaceType(struct protocolNamespaceType* type)
+{
+ type->arraylen.data=0;
+
+}
+
+static void init_AppProtocolType(struct AppProtocolType* type)
+{
+ init_protocolNamespaceType(&(type->ProtocolNamespace));
+
+}
+
+void init_AnonType_supportedAppProtocolReq(struct AnonType_supportedAppProtocolReq* type)
+{
+ int i_loop;
+
+ for(i_loop=0; i_loop<20;i_loop++)
+ {
+ init_AppProtocolType(&(type->AppProtocol[i_loop]));
+ }
+
+ type->arraylen.AppProtocol=0;
+
+}
+
+void init_AnonType_supportedAppProtocolRes(struct AnonType_supportedAppProtocolRes* type)
+{
+ type->isused.SchemaID=0;
+
+}
+
+void init_EXIDocumentType_appHand(struct EXIDocumentType_appHand* type)
+{
+ type->isused.supportedAppProtocolReq=0;
+ type->isused.supportedAppProtocolRes=0;
+
+}
diff --git a/src/appHandshake/appHand_dataTypes.h b/src/appHandshake/appHand_dataTypes.h
new file mode 100644
index 0000000..a66fedb
--- /dev/null
+++ b/src/appHandshake/appHand_dataTypes.h
@@ -0,0 +1,133 @@
+
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Sebastian.Kaebisch.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXISeGen
+ *
+ ********************************************************************/
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef APPHANDDATATYPES_H
+#define APPHANDDATATYPES_H
+
+#include "EXITypes.h"
+
+
+
+
+enum responseCodeType_appHand
+{
+ OK_SuccessfulNegotiation_responseCodeType=0,
+ OK_SuccessfulNegotiationWithMinorDeviation_responseCodeType=1,
+ Failed_NoNegotiation_responseCodeType=2
+
+};
+
+
+
+
+struct arraylen_protocolNamespaceType
+{
+ size_t data;
+
+
+};
+
+struct protocolNamespaceType
+{
+ uint32_t data[100];
+ struct arraylen_protocolNamespaceType arraylen;
+
+};
+
+struct AppProtocolType
+{
+ struct protocolNamespaceType ProtocolNamespace;
+ uint32_t VersionNumberMajor;
+ uint32_t VersionNumberMinor;
+ uint8_t SchemaID;
+ uint8_t Priority;
+
+
+};
+
+struct arraylen_AnonType_supportedAppProtocolReq
+{
+ size_t AppProtocol;
+
+
+};
+
+struct AnonType_supportedAppProtocolReq
+{
+ struct AppProtocolType AppProtocol[20];
+ struct arraylen_AnonType_supportedAppProtocolReq arraylen;
+
+};
+
+struct selection_EXIDocumentType_appHand
+{
+ unsigned int supportedAppProtocolReq:1;
+ unsigned int supportedAppProtocolRes:1;
+
+
+};
+
+struct selection_AnonType_supportedAppProtocolRes
+{
+ unsigned int SchemaID:1;
+
+
+};
+
+struct AnonType_supportedAppProtocolRes
+{
+ enum responseCodeType_appHand ResponseCode;
+ uint8_t SchemaID;
+ struct selection_AnonType_supportedAppProtocolRes isused;
+
+};
+
+struct EXIDocumentType_appHand
+{
+ struct AnonType_supportedAppProtocolReq* supportedAppProtocolReq;
+ struct AnonType_supportedAppProtocolRes* supportedAppProtocolRes;
+ struct selection_EXIDocumentType_appHand isused;
+
+};
+
+
+void init_EXIDocumentType_appHand(struct EXIDocumentType_appHand* type);
+void init_AnonType_supportedAppProtocolRes(struct AnonType_supportedAppProtocolRes* type);
+void init_AnonType_supportedAppProtocolReq(struct AnonType_supportedAppProtocolReq* type);
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/src/service/v2g_service.h b/src/appHandshake/appHand_service.h
similarity index 60%
rename from src/service/v2g_service.h
rename to src/appHandshake/appHand_service.h
index 3d9c033..454a131 100644
--- a/src/service/v2g_service.h
+++ b/src/appHandshake/appHand_service.h
@@ -18,7 +18,7 @@
/*******************************************************************
*
* @author Sebastian.Kaebisch.EXT@siemens.com
- * @version 0.6
+ * @version 0.7
* @contact Joerg.Heuer@siemens.com
*
********************************************************************/
@@ -27,20 +27,19 @@
extern "C" {
#endif
-#ifndef EXI_SERVICE_H_
-#define EXI_SERVICE_H_
+#ifndef EXI_DATABINDER_H_
+#define EXI_DATABINDER_H_
-#include "v2g_serviceDataTypes.h"
-#include "EXITypes.h"
+#include "appHand_dataTypes.h"
-struct uniqueIDPath
+struct uniqueIDPath2
{
int id[10];
size_t pos;
};
-struct EXIService
+struct EXIDatabinder
{
/* in-/ out-stream */
bitstream_t inStream;
@@ -50,30 +49,38 @@ struct EXIService
exi_state_t stateDecode;
exi_state_t stateEncode;
exi_event_t event;
- eqname_t eqn;
exi_value_t val;
+ uint16_t qnameID;
- /* v2g message data structure */
- struct EXIDocumentType exiMsg;
+ /* main message data structure */
+ struct EXIDocumentType_appHand exiMsg;
/* unique id for ambiguous elements */
- struct uniqueIDPath idPath;
+ struct uniqueIDPath2 idPath;
+
+ uint16_t transportHeaderOffset;
/* error code */
uint8_t errorCode;
-
- /* offset for transported header data */
- uint16_t transportHeaderOffset;
};
-/* define error codes (TODO: define precise error codes) */
+int serialize_appHand(struct EXIDatabinder* service, uint8_t* outStream, size_t* payloadLength, struct EXIDocumentType_appHand* exiDoc);
+int deserialize_appHand(struct EXIDatabinder* service, uint8_t* inStream, uint16_t sizeInStream, struct EXIDocumentType_appHand* exiDoc);
+int init_appHandSerializer(struct EXIDatabinder* service, exi_bytes_t service_bytes, exi_string_ucs_t service_string, size_t max_outStream_size, uint16_t transportHeaderOffset);
+int init_appHandDeserializer(struct EXIDatabinder* service, exi_bytes_t bytes, exi_string_ucs_t string, uint16_t transportHeaderOffset);
+
+
+
+/* define error codes */
#define EXI_NON_VALID_MESSAGE 0x01
#define EXI_SERIALIZATION_FAILED 0x02
#define EXI_DESERIALIZATION_FAILED 0x03
+#define EXI_DATATYPE_FAILED 0x04
+#define EXI_VALUE_RANGE_FAILED 0x05
#define EXI_UNKNOWN_ERROR 0xFF
-#endif /* EXI_SERVICE_H_ */
+#endif /* EXI_DATABINDER_H_ */
#ifdef __cplusplus
}
diff --git a/src/codec/AbstractDecoderChannel.c b/src/codec/AbstractDecoderChannel.c
new file mode 100644
index 0000000..75d9a62
--- /dev/null
+++ b/src/codec/AbstractDecoderChannel.c
@@ -0,0 +1,699 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXIdizer.com
+ ********************************************************************/
+
+
+
+#include "DecoderChannel.h"
+#include "CoderChannel.h"
+#include "BitInputStream.h"
+#include "EXIOptions.h"
+#include "EXITypes.h"
+#include "MethodsBag.h"
+#include "EXICoder.h"
+#include "ErrorCodes.h"
+
+
+#ifndef ABSTRACT_DECODER_CHANNEL_C
+#define ABSTRACT_DECODER_CHANNEL_C
+
+/* unsigned long == 64 bits, 10 * 7bits = 70 bits */
+#define MAX_OCTETS_FOR_UNSIGNED_INTEGER_64 10
+/* unsigned int == 32 bits, 5 * 7bits = 35 bits */
+#define MAX_OCTETS_FOR_UNSIGNED_INTEGER_32 5
+
+/* buffer for reading (arbitrary) large integer values */
+static uint8_t maskedOctets[MAX_OCTETS_FOR_UNSIGNED_INTEGER_64];
+
+
+static int _decodeUnsignedInteger(bitstream_t* stream, exi_integer_t* iv, int negative) {
+ int errn = 0;
+ int i, k;
+ uint8_t b;
+
+ for (i = 0; i < MAX_OCTETS_FOR_UNSIGNED_INTEGER_64; i++) {
+ /* Read the next octet */
+ errn = decode(stream, &b);
+ /* If the most significant bit of the octet was 1,
+ another octet is going to come */
+ if (b < 128) {
+ /* no more octets */
+
+ /* For negative values, the Unsigned Integer holds the
+ * magnitude of the value minus 1 */
+
+ switch(i) {
+ case 0: /* 7 bits */
+ if (negative) {
+ iv->val.int8 = - ( b + 1);
+ iv->type = EXI_INTEGER_8;
+ } else {
+ iv->val.uint8 = b;
+ iv->type = EXI_UNSIGNED_INTEGER_8;
+ }
+ return 0;
+ case 1: /* 14 bits */
+ maskedOctets[i] = b;
+ iv->val.uint16 = 0;
+ for (k = i; k >= 0 ; k--) {
+ iv->val.uint16 = (iv->val.uint16 << 7) | maskedOctets[k];
+ }
+ if (negative) {
+ iv->val.int16 = - ( iv->val.uint16 + 1 );
+ iv->type = EXI_INTEGER_16;
+ } else {
+ iv->type = EXI_UNSIGNED_INTEGER_16;
+ }
+ return 0;
+ case 2: /* 21 bits */
+ case 3: /* 28 bits */
+ maskedOctets[i] = b;
+ iv->val.uint32 = 0;
+ for (k = i; k >= 0 ; k--) {
+ iv->val.uint32 = (iv->val.uint32 << 7) | maskedOctets[k];
+ }
+ if (negative) {
+ iv->val.int32 = (-1) * ( iv->val.uint32 + 1 );
+ if (iv->val.int32 <= INT16_MAX && iv->val.int32 >= INT16_MIN ) {
+ iv->type = EXI_INTEGER_16;
+ } else {
+ iv->type = EXI_INTEGER_32;
+ }
+ } else {
+ if (iv->val.uint32 <= UINT16_MAX) {
+ iv->type = EXI_UNSIGNED_INTEGER_16;
+ } else {
+ iv->type = EXI_UNSIGNED_INTEGER_32;
+ }
+ }
+ return 0;
+ case 4: /* 35 bits */
+ case 5: /* 42 bits */
+ case 6: /* 49 bits */
+ case 7: /* 56 bits */
+ case 8: /* 63 bits */
+ case 9: /* 70 bits */
+ maskedOctets[i] = b;
+ iv->val.uint64 = 0;
+ for (k = i; k >= 0 ; k--) {
+ iv->val.uint64 = (iv->val.uint64 << 7) | maskedOctets[k];
+ }
+ if (negative) {
+ if (i > 8) {
+ /* too large */
+ return EXI_UNSUPPORTED_INTEGER_VALUE;
+ }
+ iv->val.int64 = (-1) * ( iv->val.uint64 + 1 );
+ if (iv->val.int64 <= INT32_MAX && iv->val.int64 >= INT32_MIN ) {
+ iv->type = EXI_INTEGER_32;
+ } else {
+ iv->type = EXI_INTEGER_64;
+ }
+ } else {
+ if (iv->val.uint64 <= UINT32_MAX) {
+ iv->type = EXI_UNSIGNED_INTEGER_32;
+ /* iv->val.uint32 = iv->val.uint64;*/
+ } else {
+ iv->type = EXI_UNSIGNED_INTEGER_64;
+ }
+ }
+ return 0;
+ default:
+ return EXI_UNSUPPORTED_INTEGER_VALUE;
+ }
+ } else {
+ /* the 7 least significant bits hold the actual value */
+ maskedOctets[i] = (b & 127);
+ }
+ }
+
+
+ return EXI_UNSUPPORTED_INTEGER_VALUE;
+}
+
+int decodeUnsignedInteger(bitstream_t* stream, exi_integer_t* iv) {
+ return _decodeUnsignedInteger(stream, iv, 0);
+}
+
+int decodeUnsignedInteger16(bitstream_t* stream, uint16_t* uint16) {
+ unsigned int mShift = 0;
+ int errn = 0;
+ uint8_t b;
+ *uint16 = 0;
+
+ do {
+ /* 1. Read the next octet */
+ errn = decode(stream, &b);
+ /* 2. Multiply the value of the unsigned number represented by the 7
+ * least significant
+ * bits of the octet by the current multiplier and add the result to
+ * the current value */
+ *uint16 += (b & 127) << mShift;
+ /* 3. Multiply the multiplier by 128 */
+ mShift += 7;
+ /* 4. If the most significant bit of the octet was 1, go back to step 1 */
+ } while (errn >= 0 && (b >> 7) == 1);
+
+ return errn;
+}
+
+int decodeUnsignedInteger32(bitstream_t* stream, uint32_t* uint32) {
+ /* 0XXXXXXX ... 1XXXXXXX 1XXXXXXX */
+ unsigned int mShift = 0;
+ int errn = 0;
+ uint8_t b;
+ *uint32 = 0;
+
+ do {
+ /* 1. Read the next octet */
+ errn = decode(stream, &b);
+ /* 2. Multiply the value of the unsigned number represented by the 7
+ * least significant
+ * bits of the octet by the current multiplier and add the result to
+ * the current value */
+ *uint32 += (b & 127) << mShift;
+ /* 3. Multiply the multiplier by 128 */
+ mShift += 7;
+ /* 4. If the most significant bit of the octet was 1, go back to step 1 */
+ } while (errn >= 0 && (b >> 7) == 1);
+
+ return errn;
+}
+
+/**
+ * Decode an arbitrary precision non negative integer using a sequence of
+ * octets. The most significant bit of the last octet is set to zero to
+ * indicate sequence termination. Only seven bits per octet are used to
+ * store the integer's value.
+ */
+int decodeUnsignedInteger64(bitstream_t* stream, uint64_t* uint64) {
+ unsigned int mShift = 0;
+ int errn = 0;
+ uint8_t b;
+ *uint64 = 0L;
+
+ do {
+ errn = decode(stream, &b);
+ *uint64 += ((uint64_t) (b & 127)) << mShift;
+ mShift += 7;
+ } while (errn >= 0 && (b >> 7) == 1);
+
+ return errn;
+}
+
+
+int decodeInteger(bitstream_t* stream, exi_integer_t* iv) {
+ int b;
+ int errn = decodeBoolean(stream, &b);
+ if (errn < 0) {
+ return errn;
+ }
+
+ return _decodeUnsignedInteger(stream, iv, b);
+}
+
+
+/**
+ * Decode an arbitrary precision integer using a sign bit followed by a
+ * sequence of octets. The most significant bit of the last octet is set to
+ * zero to indicate sequence termination. Only seven bits per octet are used
+ * to store the integer's value.
+ */
+int decodeInteger16(bitstream_t* stream, int16_t* int16) {
+ int b;
+ uint16_t uint16;
+ int errn = decodeBoolean(stream, &b);
+
+ if (errn < 0) {
+ return errn;
+ }
+
+ if (b) {
+ /* For negative values, the Unsigned Integer holds the
+ * magnitude of the value minus 1 */
+ errn = decodeUnsignedInteger16(stream, &uint16);
+ *int16 = -(uint16 + 1);
+ } else {
+ /* positive */
+ errn = decodeUnsignedInteger16(stream, &uint16);
+ *int16 = (int16_t)(uint16);
+ }
+
+ return errn;
+}
+
+/**
+ * Decode an arbitrary precision integer using a sign bit followed by a
+ * sequence of octets. The most significant bit of the last octet is set to
+ * zero to indicate sequence termination. Only seven bits per octet are used
+ * to store the integer's value.
+ */
+int decodeInteger32(bitstream_t* stream, int32_t* int32) {
+ int b;
+ uint32_t uint32;
+ int errn = decodeBoolean(stream, &b);
+
+ if (errn < 0) {
+ return errn;
+ }
+
+ if (b) {
+ /* For negative values, the Unsigned Integer holds the
+ * magnitude of the value minus 1 */
+ errn = decodeUnsignedInteger32(stream, &uint32);
+ *int32 = (-1) * (uint32 + 1);
+ } else {
+ /* positive */
+ errn = decodeUnsignedInteger32(stream, &uint32);
+ *int32 = (int32_t)(uint32);
+ }
+
+ return errn;
+}
+
+/**
+ * Decode an arbitrary precision integer using a sign bit followed by a
+ * sequence of octets. The most significant bit of the last octet is set to
+ * zero to indicate sequence termination. Only seven bits per octet are used
+ * to store the integer's value.
+ */
+int decodeInteger64(bitstream_t* stream, int64_t* int64) {
+ int b;
+ uint64_t uint64;
+ int errn = decodeBoolean(stream, &b);
+
+ if (errn < 0) {
+ return errn;
+ }
+
+ if (b) {
+ /* For negative values, the Unsigned Integer holds the
+ * magnitude of the value minus 1 */
+ errn = decodeUnsignedInteger64(stream, &uint64);
+ *int64 = (-1) * (uint64 + 1);
+ } else {
+ /* positive */
+ errn = decodeUnsignedInteger64(stream, &uint64);
+ *int64 = (int64_t)(uint64);
+ }
+
+ return errn;
+}
+
+/**
+ * Decode a Float datatype as two consecutive Integers.
+ * The first Integer represents the mantissa of the floating point
+ * number and the second Integer represents the base-10 exponent
+ * of the floating point number.
+ */
+int decodeFloat(bitstream_t* stream, exi_float_me_t* f) {
+ int errn = decodeInteger64(stream, &f->mantissa);
+ if (errn < 0) {
+ return errn;
+ }
+ return decodeInteger16(stream, &f->exponent);
+}
+
+/**
+ * Decode a decimal represented as a Boolean sign followed by two Unsigned
+ * Integers. A sign value of zero (0) is used to represent positive Decimal
+ * values and a sign value of one (1) is used to represent negative Decimal
+ * values The first Integer represents the integral portion of the Decimal
+ * value. The second positive integer represents the fractional portion of
+ * the decimal with the digits in reverse order to preserve leading zeros.
+ */
+int decodeDecimal(bitstream_t* stream, exi_decimal_t* d) {
+ int errn = decodeBoolean(stream, &d->negative);
+ if (errn < 0) {
+ return errn;
+ }
+ errn = decodeUnsignedInteger(stream, &d->integral);
+ if (errn < 0) {
+ return errn;
+ }
+ errn = decodeUnsignedInteger(stream, &d->reverseFraction);
+
+ return errn;
+}
+
+/**
+ * Decode a sequence of characters for a given length.
+ */
+int decodeStringOnly(bitstream_t* stream, uint16_t len, exi_string_ucs_t* s) {
+ int errn;
+ if (len > s->size) {
+ /* not enough space */
+ return EXI_ERROR_OUT_OF_STRING_BUFFER;
+ }
+ errn = decodeCharacters(stream, len, s->codepoints);
+ s->len = len;
+ return errn;
+}
+
+/**
+ * Decode a length prefixed sequence of characters.
+ */
+int decodeString(bitstream_t* stream, exi_string_ucs_t* s) {
+ int errn = decodeUnsignedInteger16(stream, &s->len);
+ if (errn < 0) {
+ return errn;
+ }
+ return decodeStringOnly(stream, s->len, s);
+}
+
+/*
+int decodeStringASCII(bitstream_t* stream, exi_string_ascii_t* s) {
+ uint16_t slen;
+ int errn = decodeUnsignedInteger16(stream, &slen);
+ if (errn < 0) {
+ return errn;
+ }
+ if (s->size < slen) {
+ return EXI_ERROR_OUT_OF_ASCII_BUFFER;
+ }
+
+ return decodeCharactersASCII(stream, slen, s->chars);
+}
+*/
+
+
+
+static int _readStringValueLocalHit(bitstream_t* stream, exi_state_t* state, uint16_t qnameID, uint32_t* localID) {
+ int errn;
+ uint16_t codingLength;
+
+ if(!(state->stringTable.sizeLocalStrings > qnameID)) {
+ return EXI_ERROR_OUT_OF_BOUNDS;
+ }
+
+ errn = exiGetCodingLength(state->stringTable.numberOfLocalStrings[qnameID], &codingLength);
+ if(errn) {
+ return errn;
+ }
+ errn = decodeNBitUnsignedInteger(stream, codingLength, localID);
+
+ return errn;
+}
+
+
+static int _readStringValueGlobalHit(bitstream_t* stream, exi_state_t* state, uint32_t* globalID) {
+ int errn;
+ uint16_t codingLength;
+
+ errn = exiGetCodingLength(state->stringTable.numberOfGlobalStrings, &codingLength);
+ if(errn) {
+ return errn;
+ }
+ errn = decodeNBitUnsignedInteger(stream, codingLength, globalID);
+
+ return errn;
+}
+
+int decodeStringValue(bitstream_t* stream, exi_state_t* state, uint16_t qnameID, exi_string_value_t* s) {
+ uint16_t L;
+ int errn = decodeUnsignedInteger16(stream, &L);
+ if (errn < 0) {
+ return errn;
+ }
+
+ switch (L) {
+ case 0:
+ /* local value partition */
+ s->type = EXI_STRING_VALUE_LOCAL_HIT;
+ errn = _readStringValueLocalHit(stream, state, qnameID, &s->localID);
+ break;
+ case 1:
+ /* found in global value partition */
+ s->type = EXI_STRING_VALUE_GLOBAL_HIT;
+ errn = _readStringValueGlobalHit(stream, state, &s->globalID);
+ break;
+ default:
+ /* not found in global value (and local value) partition
+ * ==> string literal is encoded as a String with the length
+ * incremented by two */
+ s->type = EXI_STRING_VALUE_MISS;
+ s->miss.len = L = L - 2;
+ errn = decodeStringOnly(stream, L, &(s->miss));
+ if(errn) {
+ return errn;
+ }
+#if EXI_VALUE_PARTITION_CAPACITY != 0
+#if EXI_VALUE_MAX_LENGTH != 0
+ /* If length L is greater than zero the string S is added */
+ if(L > 0) {
+ /* After encoding the string value, it is added to both the
+ * associated "local" value string table partition and the global
+ * value string table partition */
+#if EXI_VALUE_MAX_LENGTH < 0
+ errn = exi__IncrementStringValueCount(state, qnameID);
+# else /* EXI_VALUE_MAX_LENGTH < 0 */
+ if (L <= EXI_VALUE_MAX_LENGTH) {
+ errn = exi__IncrementStringValueCount(state, qnameID);
+ }
+#endif /* EXI_VALUE_MAX_LENGTH < 0 */
+ }
+#endif /* EXI_VALUE_MAX_LENGTH != 0 */
+#endif /* EXI_VALUE_PARTITION_CAPACITY != 0 */
+ break;
+ }
+
+ return errn;
+}
+
+int decodeRCSStringValue(bitstream_t* stream, exi_state_t* state, uint16_t qnameID, exi_rcs_t* rcs, exi_string_value_t* s) {
+ unsigned int i;
+ uint32_t cp;
+ uint16_t L;
+ int errn = decodeUnsignedInteger16(stream, &L);
+ if (errn < 0) {
+ return errn;
+ }
+
+ switch (L) {
+ case 0:
+ /* local value partition */
+ s->type = EXI_STRING_VALUE_LOCAL_HIT;
+ errn = _readStringValueLocalHit(stream, state, qnameID, &s->localID);
+ break;
+ case 1:
+ /* found in global value partition */
+ s->type = EXI_STRING_VALUE_GLOBAL_HIT;
+ errn = _readStringValueGlobalHit(stream, state, &s->globalID);
+ break;
+ default:
+ /* not found in global value (and local value) partition
+ * ==> string literal is encoded as a String with the length
+ * incremented by two */
+ s->type = EXI_STRING_VALUE_MISS;
+ s->miss.len = L = L - 2;
+
+ if (L > s->miss.size) {
+ /* not enough space */
+ return EXI_ERROR_OUT_OF_STRING_BUFFER;
+ }
+
+ for (i = 0; i < L && errn >= 0; i++) {
+ errn = decodeNBitUnsignedInteger(stream, rcs->codingLength, &cp);
+ if (errn) {
+ return errn;
+ }
+ s->miss.codepoints[i] = rcs->codepoints[cp];
+ }
+#if EXI_VALUE_PARTITION_CAPACITY != 0
+#if EXI_VALUE_MAX_LENGTH != 0
+ /* If length L is greater than zero the string S is added */
+ if(L > 0) {
+ /* After encoding the string value, it is added to both the
+ * associated "local" value string table partition and the global
+ * value string table partition */
+#if EXI_VALUE_MAX_LENGTH < 0
+ errn = exi__IncrementStringValueCount(state, qnameID);
+# else /* EXI_VALUE_MAX_LENGTH < 0 */
+ if (L <= EXI_VALUE_MAX_LENGTH) {
+ errn = exi__IncrementStringValueCount(state, qnameID);
+ }
+#endif /* EXI_VALUE_MAX_LENGTH < 0 */
+ }
+#endif /* EXI_VALUE_MAX_LENGTH != 0 */
+#endif /* EXI_VALUE_PARTITION_CAPACITY != 0 */
+ break;
+ }
+
+ return errn;
+}
+
+/**
+ * Decode a sequence of characters according to a given length.
+ * Each character is represented by its UCS [ISO/IEC 10646]
+ * code point encoded as an Unsigned Integer
+ */
+int decodeCharacters(bitstream_t* stream, uint16_t len, uint32_t* chars) {
+ unsigned int i;
+ int errn = 0;
+ for (i = 0; i < len && errn >= 0; i++) {
+ errn = decodeUnsignedInteger32(stream, &chars[i]);
+ if (errn < 0) {
+ return errn;
+ }
+ }
+
+ return errn;
+}
+
+/*
+int decodeCharactersASCII(bitstream_t* stream, uint16_t len, char* chars) {
+ unsigned int i;
+ uint32_t c;
+ int errn = 0;
+ for (i = 0; i < len && errn >= 0; i++) {
+ errn = decodeUnsignedInteger32(stream, &c);
+ if (errn < 0) {
+ return errn;
+ }
+ if (c > 127) {
+ return EXI_ERROR_CONVERSION_NO_ASCII_CHARACTERS;
+ }
+ chars[i] = c;
+ }
+ chars[i] = '\0';
+
+ return errn;
+}
+*/
+
+
+/**
+ * Decode a binary value as a length-prefixed sequence of octets.
+ */
+int decodeBinary(bitstream_t* stream, exi_bytes_t* bytes) {
+ unsigned int i;
+ uint8_t b;
+ int errn = decodeUnsignedInteger16(stream, &bytes->len);
+ if (errn < 0) {
+ return errn;
+ }
+ if (bytes->len > bytes->size) {
+ /* not enough space */
+ return EXI_ERROR_OUT_OF_BYTE_BUFFER;
+ }
+
+ for (i = 0; i < bytes->len && errn >= 0; i++) {
+ errn = decode(stream, &b);
+ if (errn < 0) {
+ return errn;
+ }
+ bytes->data[i] = (uint8_t)b;
+ }
+
+ return errn;
+}
+
+/**
+ * Decode Date-Time as sequence of values representing the individual
+ * components of the Date-Time.
+ */
+int decodeDateTime(bitstream_t* stream, exi_datetime_type_t type, exi_datetime_t* datetime) {
+ int errn;
+
+ datetime->type = type;
+
+ datetime->year = 0;
+ datetime->monthDay = 0;
+ datetime->time = 0;
+ datetime->presenceFractionalSecs = 0;
+ datetime->fractionalSecs = 0;
+ datetime->presenceTimezone = 0;
+ datetime->timezone = 0;
+
+ switch (type) {
+ case EXI_DATETIME_GYEAR: /* Year, [Time-Zone] */
+ errn = decodeInteger32(stream, &datetime->year);
+ if (errn < 0) {
+ return errn;
+ }
+ datetime->year += DATETIME_YEAR_OFFSET;
+ break;
+ case EXI_DATETIME_GYEARMONTH: /* Year, MonthDay, [TimeZone] */
+ case EXI_DATETIME_DATE:
+ errn = decodeInteger32(stream, &datetime->year);
+ if (errn < 0) {
+ return errn;
+ }
+ datetime->year += DATETIME_YEAR_OFFSET;
+ errn = decodeNBitUnsignedInteger(stream, DATETIME_NUMBER_BITS_MONTHDAY, &datetime->monthDay);
+ break;
+ case EXI_DATETIME_DATETIME: /* Year, MonthDay, Time, [FractionalSecs], [TimeZone] */
+ /* e.g. "0001-01-01T00:00:00.111+00:33" */
+ errn = decodeInteger32(stream, &datetime->year);
+ if (errn < 0) {
+ return errn;
+ }
+ datetime->year += DATETIME_YEAR_OFFSET;
+ errn = decodeNBitUnsignedInteger(stream, DATETIME_NUMBER_BITS_MONTHDAY, &datetime->monthDay);
+ if (errn < 0) {
+ return errn;
+ }
+ /* no break */
+ case EXI_DATETIME_TIME: /* Time, [FractionalSecs], [TimeZone] */
+ /* e.g. "12:34:56.135" */
+ errn = decodeNBitUnsignedInteger(stream, DATETIME_NUMBER_BITS_TIME, &datetime->time);
+ if (errn < 0) {
+ return errn;
+ }
+ errn = decodeBoolean(stream, &datetime->presenceFractionalSecs);
+ if (errn < 0) {
+ return errn;
+ }
+ if (datetime->presenceFractionalSecs) {
+ errn = decodeUnsignedInteger32(stream, &datetime->fractionalSecs);
+ }
+ break;
+ case EXI_DATETIME_GMONTH: /* MonthDay, [TimeZone] */
+ /* e.g. "--12" */
+ case EXI_DATETIME_GMONTHDAY: /* MonthDay, [TimeZone] */
+ /* e.g. "--01-28" */
+ case EXI_DATETIME_GDAY: /* MonthDay, [TimeZone] */
+ /* "---16" */
+ errn = decodeNBitUnsignedInteger(stream, DATETIME_NUMBER_BITS_MONTHDAY, &datetime->monthDay );
+ break;
+ default:
+ return -1;
+ }
+
+ errn = decodeBoolean(stream, &datetime->presenceTimezone );
+ if (errn < 0) {
+ return errn;
+ }
+ if (datetime->presenceTimezone) {
+ errn = decodeNBitUnsignedInteger(stream, DATETIME_NUMBER_BITS_TIMEZONE, &datetime->timezone);
+ datetime->timezone -= DATETIME_TIMEZONE_OFFSET_IN_MINUTES;
+ }
+
+ return errn;
+}
+
+#endif
+
diff --git a/src/codec/AbstractEncoderChannel.c b/src/codec/AbstractEncoderChannel.c
new file mode 100644
index 0000000..66234de
--- /dev/null
+++ b/src/codec/AbstractEncoderChannel.c
@@ -0,0 +1,573 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXIdizer.com
+ ********************************************************************/
+
+
+
+#include "EncoderChannel.h"
+#include "CoderChannel.h"
+#include "BitOutputStream.h"
+#include "EXIOptions.h"
+#include "EXITypes.h"
+#include "ErrorCodes.h"
+#include "MethodsBag.h"
+#include "EXICoder.h"
+
+#ifndef ABSTRACT_ENCODER_CHANNEL_C
+#define ABSTRACT_ENCODER_CHANNEL_C
+
+int encodeUnsignedInteger(bitstream_t* stream, exi_integer_t* iv) {
+ int errn = 0;
+ switch (iv->type) {
+ /* Unsigned Integer */
+ case EXI_UNSIGNED_INTEGER_8:
+ errn = encodeUnsignedInteger32(stream, iv->val.uint8);
+ break;
+ case EXI_UNSIGNED_INTEGER_16:
+ errn = encodeUnsignedInteger32(stream, iv->val.uint16);
+ break;
+ case EXI_UNSIGNED_INTEGER_32:
+ errn = encodeUnsignedInteger32(stream, iv->val.uint32);
+ break;
+ case EXI_UNSIGNED_INTEGER_64:
+ errn = encodeUnsignedInteger64(stream, iv->val.uint64);
+ break;
+ /* (Signed) Integer */
+ case EXI_INTEGER_8:
+ if (iv->val.int8 < 0) {
+ return EXI_NEGATIVE_UNSIGNED_INTEGER_VALUE;
+ }
+ errn = encodeUnsignedInteger32(stream, iv->val.int8);
+ break;
+ case EXI_INTEGER_16:
+ if (iv->val.int16 < 0) {
+ return EXI_NEGATIVE_UNSIGNED_INTEGER_VALUE;
+ }
+ errn = encodeUnsignedInteger32(stream, iv->val.int16);
+ break;
+ case EXI_INTEGER_32:
+ if (iv->val.int32 < 0) {
+ return EXI_NEGATIVE_UNSIGNED_INTEGER_VALUE;
+ }
+ errn = encodeUnsignedInteger32(stream, iv->val.int32);
+ break;
+ case EXI_INTEGER_64:
+ if (iv->val.int64 < 0) {
+ return EXI_NEGATIVE_UNSIGNED_INTEGER_VALUE;
+ }
+ errn = encodeUnsignedInteger64(stream, iv->val.int64);
+ break;
+ default:
+ errn = EXI_UNSUPPORTED_INTEGER_VALUE_TYPE;
+ break;
+ }
+
+ return errn;
+}
+
+/**
+ * Encode an arbitrary precision non negative integer using a sequence of
+ * octets. The most significant bit of the last octet is set to zero to
+ * indicate sequence termination. Only seven bits per octet are used to
+ * store the integer's value.
+ */
+int encodeUnsignedInteger32(bitstream_t* stream, uint32_t n) {
+ int errn = 0;
+ if (n < 128) {
+ /* write byte as is */
+ errn = encode(stream, (uint8_t) n);
+ } else {
+ uint8_t n7BitBlocks = numberOf7BitBlocksToRepresent(n);
+
+ switch (n7BitBlocks) {
+ case 5:
+ errn = encode(stream, (uint8_t) (128 | n));
+ n = n >> 7;
+ if (errn < 0) {
+ break;
+ }
+ /* no break */
+ case 4:
+ errn = encode(stream, (uint8_t) (128 | n));
+ n = n >> 7;
+ if (errn < 0) {
+ break;
+ }
+ /* no break */
+ case 3:
+ errn = encode(stream, (uint8_t) (128 | n));
+ n = n >> 7;
+ if (errn < 0) {
+ break;
+ }
+ /* no break */
+ case 2:
+ errn = encode(stream, (uint8_t) (128 | n));
+ n = n >> 7;
+ if (errn < 0) {
+ break;
+ }
+ /* no break */
+ case 1:
+ /* 0 .. 7 (last byte) */
+ errn = encode(stream, (uint8_t) (0 | n));
+ /* no break */
+ }
+ }
+
+ return errn;
+}
+
+/**
+ * Encode an arbitrary precision non negative integer using a sequence of
+ * octets. The most significant bit of the last octet is set to zero to
+ * indicate sequence termination. Only seven bits per octet are used to
+ * store the integer's value.
+ */
+int encodeUnsignedInteger64(bitstream_t* stream, uint64_t n) {
+ int errn = 0;
+ uint8_t lastEncode = (uint8_t) n;
+ n >>= 7;
+
+ while (n != 0) {
+ errn = encode(stream, lastEncode | 128);
+ if (errn < 0) {
+ return errn;
+ }
+ lastEncode = (uint8_t) n;
+ n >>= 7;
+ }
+
+ return encode(stream, lastEncode);
+}
+
+int encodeInteger(bitstream_t* stream, exi_integer_t* iv) {
+ int errn = 0;
+ switch (iv->type) {
+ /* Unsigned Integer */
+ case EXI_UNSIGNED_INTEGER_8:
+ errn = encodeInteger32(stream, iv->val.uint8);
+ break;
+ case EXI_UNSIGNED_INTEGER_16:
+ errn = encodeInteger32(stream, iv->val.uint16);
+ break;
+ case EXI_UNSIGNED_INTEGER_32:
+ errn = encodeInteger64(stream, iv->val.uint32);
+ break;
+ case EXI_UNSIGNED_INTEGER_64:
+ errn = encodeInteger64(stream, iv->val.uint64);
+ break;
+ /* (Signed) Integer */
+ case EXI_INTEGER_8:
+ errn = encodeInteger32(stream, iv->val.int8);
+ break;
+ case EXI_INTEGER_16:
+ errn = encodeInteger32(stream, iv->val.int16);
+ break;
+ case EXI_INTEGER_32:
+ errn = encodeInteger32(stream, iv->val.int32);
+ break;
+ case EXI_INTEGER_64:
+ errn = encodeInteger64(stream, iv->val.int64);
+ break;
+ default:
+ errn = EXI_UNSUPPORTED_INTEGER_VALUE_TYPE;
+ break;
+ }
+
+ return errn;
+}
+
+/**
+ * Encode an arbitrary precision integer using a sign bit followed by a
+ * sequence of octets. The most significant bit of the last octet is set to
+ * zero to indicate sequence termination. Only seven bits per octet are used
+ * to store the integer's value.
+ */
+int encodeInteger32(bitstream_t* stream, int32_t n) {
+ int errn;
+ /* signalize sign */
+ if (n < 0) {
+ errn = encodeBoolean(stream, 1);
+ /* For negative values, the Unsigned Integer holds the
+ * magnitude of the value minus 1 */
+ n = (-n) - 1;
+ } else {
+ errn = encodeBoolean(stream, 0);
+ }
+ if (errn < 0) {
+ return errn;
+ }
+ return encodeUnsignedInteger32(stream, n);
+}
+
+/**
+ * Encode an arbitrary precision integer using a sign bit followed by a
+ * sequence of octets. The most significant bit of the last octet is set to
+ * zero to indicate sequence termination. Only seven bits per octet are used
+ * to store the integer's value.
+ */
+int encodeInteger64(bitstream_t* stream, int64_t n) {
+ int errn;
+ /* signalize sign */
+ if (n < 0) {
+ errn = encodeBoolean(stream, 1);
+ /* For negative values, the Unsigned Integer holds the
+ * magnitude of the value minus 1 */
+ n = (-n) - 1;
+ } else {
+ errn = encodeBoolean(stream, 0);
+ }
+ if (errn < 0) {
+ return errn;
+ }
+ return encodeUnsignedInteger64(stream, n);
+}
+
+/**
+ * The Float datatype representation is two consecutive Integers.
+ * The first Integer represents the mantissa of the floating point
+ * number and the second Integer represents the base-10 exponent
+ * of the floating point number.
+ */
+int encodeFloat(bitstream_t* stream, exi_float_me_t* f) {
+ int errn = encodeInteger64(stream, f->mantissa);
+ if (errn >= 0) {
+ errn = encodeInteger32(stream, f->exponent);
+ }
+ return errn;
+}
+
+/**
+ * Encode a decimal represented as a Boolean sign followed by two Unsigned
+ * Integers. A sign value of zero (0) is used to represent positive Decimal
+ * values and a sign value of one (1) is used to represent negative Decimal
+ * values The first Integer represents the integral portion of the Decimal
+ * value. The second positive integer represents the fractional portion of
+ * the decimal with the digits in reverse order to preserve leading zeros.
+ */
+int encodeDecimal(bitstream_t* stream, exi_decimal_t* d) {
+ /* sign, integral, reverse fractional */
+ int errn = encodeBoolean(stream, d->negative);
+ if (errn < 0) {
+ return errn;
+ }
+ errn = encodeUnsignedInteger(stream, &d->integral);
+ if (errn < 0) {
+ return errn;
+ }
+ errn = encodeUnsignedInteger(stream, &d->reverseFraction);
+
+ return errn;
+}
+
+/**
+ * Encode a length prefixed sequence of characters.
+ */
+/*int encodeASCII(bitstream_t* stream, const char* ascii) {
+ int errn;
+ uint32_t slen = (uint32_t) strlen(ascii);
+ errn = encodeUnsignedInteger32(stream, slen);
+ if (errn >= 0) {
+ errn = encodeASCIICharacters(stream, ascii, slen);
+ }
+ return errn;
+ }*/
+
+int encodeString(bitstream_t* stream, exi_string_ucs_t* string) {
+ int errn = encodeUnsignedInteger32(stream, string->len);
+ if (errn >= 0) {
+ errn = encodeUCSCharacters(stream, string->codepoints, string->len);
+ }
+ return errn;
+}
+
+static int _writeStringValueLocalHit(bitstream_t* stream, exi_state_t* state,
+ uint16_t qnameID, uint32_t localID) {
+ int errn;
+ uint16_t codingLength;
+
+ if(!(state->stringTable.sizeLocalStrings > qnameID)) {
+ return EXI_ERROR_OUT_OF_BOUNDS;
+ }
+
+ errn = exiGetCodingLength(state->stringTable.numberOfLocalStrings[qnameID],
+ &codingLength);
+ if (errn) {
+ return errn;
+ }
+ errn = encodeNBitUnsignedInteger(stream, codingLength, localID);
+
+ return errn;
+}
+
+static int _writeStringValueGlobalHit(bitstream_t* stream, exi_state_t* state,
+ uint32_t globalID) {
+ int errn;
+ uint16_t codingLength;
+
+ errn = exiGetCodingLength(state->stringTable.numberOfGlobalStrings, &codingLength);
+ if (errn) {
+ return errn;
+ }
+ errn = encodeNBitUnsignedInteger(stream, codingLength, globalID);
+
+ return errn;
+}
+
+int encodeStringValue(bitstream_t* stream, exi_state_t* state, uint16_t qnameID,
+ exi_string_value_t* string) {
+ int errn;
+
+ switch (string->type) {
+ case EXI_STRING_VALUE_LOCAL_HIT:
+ errn = encodeUnsignedInteger32(stream, 0);
+ if (errn) {
+ return errn;
+ }
+ errn = _writeStringValueLocalHit(stream, state, qnameID,
+ string->localID);
+ break;
+ case EXI_STRING_VALUE_GLOBAL_HIT:
+ errn = encodeUnsignedInteger32(stream, 1);
+ if (errn) {
+ return errn;
+ }
+ errn = _writeStringValueGlobalHit(stream, state, string->globalID);
+ break;
+ case EXI_STRING_VALUE_MISS:
+ /* encode string as string table miss */
+ errn = encodeUnsignedInteger32(stream, string->miss.len + 2);
+ if (errn >= 0) {
+ errn = encodeUCSCharacters(stream, string->miss.codepoints,
+ string->miss.len);
+ }
+#if EXI_VALUE_PARTITION_CAPACITY != 0
+#if EXI_VALUE_MAX_LENGTH != 0
+ /* If length L is greater than zero the string S is added */
+ if (string->miss.len > 0) {
+ /* After encoding the string value, it is added to both the
+ * associated "local" value string table partition and the global
+ * value string table partition */
+#if EXI_VALUE_MAX_LENGTH < 0
+ errn = exi__IncrementStringValueCount(state, qnameID);
+# else /* EXI_VALUE_MAX_LENGTH < 0 */
+ if (string->miss.len <= EXI_VALUE_MAX_LENGTH) {
+ errn = exi__IncrementStringValueCount(state,
+ qnameID);
+ }
+#endif /* EXI_VALUE_MAX_LENGTH < 0 */
+ }
+#endif /* EXI_VALUE_MAX_LENGTH != 0 */
+#endif /* EXI_VALUE_PARTITION_CAPACITY != 0 */
+ break;
+ default:
+ errn = EXI_UNSUPPORTED_STRING_VALUE_TYPE;
+ break;
+ }
+
+ return errn;
+}
+
+int encodeRCSStringValue(bitstream_t* stream, exi_state_t* state,
+ uint16_t qnameID, exi_rcs_t* rcs, exi_string_value_t* string) {
+ unsigned int i;
+ int errn;
+ uint32_t k;
+
+ switch (string->type) {
+ case EXI_STRING_VALUE_LOCAL_HIT:
+ errn = encodeUnsignedInteger32(stream, 0);
+ if (errn) {
+ return errn;
+ }
+ errn = _writeStringValueLocalHit(stream, state, qnameID,
+ string->localID);
+ break;
+ case EXI_STRING_VALUE_GLOBAL_HIT:
+ errn = encodeUnsignedInteger32(stream, 1);
+ if (errn) {
+ return errn;
+ }
+ errn = _writeStringValueGlobalHit(stream, state, string->globalID);
+ break;
+ case EXI_STRING_VALUE_MISS:
+ /* encode string as string table miss */
+ errn = encodeUnsignedInteger32(stream, string->miss.len + 2);
+ if (errn) {
+ return errn;
+ }
+
+ for (i = 0; i < string->miss.len; i++) {
+ for (k = 0; k < rcs->size; k++) {
+ if (rcs->codepoints[k] == string->miss.codepoints[i]) {
+ errn = encodeNBitUnsignedInteger(stream, rcs->codingLength,
+ k);
+ if (errn) {
+ return errn;
+ }
+ break; /* break inner for loop */
+ }
+ }
+ }
+#if EXI_VALUE_PARTITION_CAPACITY != 0
+#if EXI_VALUE_MAX_LENGTH != 0
+ /* If length L is greater than zero the string S is added */
+ if (string->miss.len > 0) {
+ /* After encoding the string value, it is added to both the
+ * associated "local" value string table partition and the global
+ * value string table partition */
+#if EXI_VALUE_MAX_LENGTH < 0
+ errn = exi__IncrementStringValueCount(state, qnameID);
+#else /* EXI_VALUE_MAX_LENGTH < 0 */
+ if (string->miss.len <= EXI_VALUE_MAX_LENGTH) {
+ errn = exi__IncrementStringValueCount(state,
+ qnameID);
+ }
+#endif /* EXI_VALUE_MAX_LENGTH < 0 */
+ }
+#endif /* EXI_VALUE_MAX_LENGTH != 0 */
+#endif /* EXI_VALUE_PARTITION_CAPACITY != 0 */
+ break;
+ default:
+ errn = EXI_UNSUPPORTED_STRING_VALUE_TYPE;
+ break;
+ }
+
+ return errn;
+}
+
+/**
+ * Encode a sequence of characters according to a given length.
+ * Each character is represented by its UCS [ISO/IEC 10646]
+ * code point encoded as an Unsigned Integer
+ */
+int encodeUCSCharacters(bitstream_t* stream, uint32_t* chars, uint16_t len) {
+ unsigned int i;
+ int errn = 0;
+ for (i = 0; i < len && errn >= 0; i++) {
+ errn = encodeUnsignedInteger32(stream, chars[i]);
+ }
+ return errn;
+}
+
+/*int encodeASCIICharacters(bitstream_t* stream, const char* chars, uint16_t len) {
+ unsigned int i;
+ int errn = 0;
+ for (i = 0; i < len && errn >= 0; i++) {
+ errn = encode(stream, chars[i]);
+ }
+ return errn;
+ }*/
+
+/**
+ * Encode a binary value as a length-prefixed sequence of octets.
+ */
+int encodeBinary(bitstream_t* stream, exi_bytes_t* bytes) {
+ unsigned int i;
+ int errn = encodeUnsignedInteger32(stream, bytes->len);
+
+ for (i = 0; i < bytes->len && errn >= 0; i++) {
+ errn = encode(stream, bytes->data[i]);
+ }
+ return errn;
+}
+
+/**
+ * Encode a datetime representation which is a sequence of values
+ * representing the individual components of the Date-Time
+ */
+int encodeDateTime(bitstream_t* stream, exi_datetime_t* datetime) {
+ int errn = 0;
+ switch (datetime->type) {
+ case EXI_DATETIME_GYEAR: /* Year, [Time-Zone] */
+ errn = encodeInteger32(stream, datetime->year - DATETIME_YEAR_OFFSET);
+ break;
+ case EXI_DATETIME_GYEARMONTH: /* Year, MonthDay, [TimeZone] */
+ case EXI_DATETIME_DATE: /* Year, MonthDay, [TimeZone] */
+ errn = encodeInteger32(stream, datetime->year - DATETIME_YEAR_OFFSET);
+ if (errn < 0) {
+ return errn;
+ }
+ errn = encodeNBitUnsignedInteger(stream, DATETIME_NUMBER_BITS_MONTHDAY,
+ datetime->monthDay);
+ break;
+ case EXI_DATETIME_DATETIME: /* Year, MonthDay, Time, [FractionalSecs], [TimeZone] */
+ errn = encodeInteger32(stream, datetime->year - DATETIME_YEAR_OFFSET);
+ if (errn < 0) {
+ return errn;
+ }
+ errn = encodeNBitUnsignedInteger(stream, DATETIME_NUMBER_BITS_MONTHDAY,
+ datetime->monthDay);
+ if (errn < 0) {
+ return errn;
+ }
+ /* no break */
+ case EXI_DATETIME_TIME: /* Time, [FractionalSecs], [TimeZone] */
+ errn = encodeNBitUnsignedInteger(stream, DATETIME_NUMBER_BITS_TIME,
+ datetime->time);
+ if (errn < 0) {
+ return errn;
+ }
+ if (datetime->presenceFractionalSecs) {
+ encodeBoolean(stream, 1);
+ if (errn < 0) {
+ return errn;
+ }
+ encodeUnsignedInteger32(stream, datetime->fractionalSecs);
+ } else {
+ encodeBoolean(stream, 0);
+ }
+ break;
+ case EXI_DATETIME_GMONTH: /* MonthDay, [TimeZone] */
+ case EXI_DATETIME_GMONTHDAY: /* MonthDay, [TimeZone] */
+ case EXI_DATETIME_GDAY: /* MonthDay, [TimeZone] */
+ errn = encodeNBitUnsignedInteger(stream, DATETIME_NUMBER_BITS_MONTHDAY,
+ datetime->monthDay);
+ break;
+ default:
+ return EXI_UNSUPPORTED_DATETIME_TYPE;
+ }
+ if (errn < 0) {
+ return errn;
+ }
+ /* [TimeZone] */
+ if (datetime->presenceTimezone) {
+ errn = encodeBoolean(stream, 1);
+ if (errn < 0) {
+ return errn;
+ }
+ encodeNBitUnsignedInteger(stream, DATETIME_NUMBER_BITS_TIMEZONE,
+ datetime->timezone + DATETIME_TIMEZONE_OFFSET_IN_MINUTES);
+ } else {
+ encodeBoolean(stream, 0);
+ }
+
+ return errn;
+}
+
+#endif
+
diff --git a/src/codec/BitDecoderChannel.c b/src/codec/BitDecoderChannel.c
new file mode 100644
index 0000000..b5a7634
--- /dev/null
+++ b/src/codec/BitDecoderChannel.c
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXIdizer.com
+ ********************************************************************/
+
+
+
+#include "DecoderChannel.h"
+#include "BitInputStream.h"
+#include "EXITypes.h"
+#include "ErrorCodes.h"
+
+#ifndef BIT_DECODER_CHANNEL_C
+#define BIT_DECODER_CHANNEL_C
+
+
+#if EXI_ALIGNMENT == BIT_PACKED
+
+int decode(bitstream_t* stream, uint8_t* b) {
+ uint32_t bb;
+ int errn = readBits(stream, 8, &bb);
+ if (errn < 0) {
+ return errn;
+ }
+ if (bb > 256) {
+ return EXI_ERROR_UNEXPECTED_BYTE_VALUE;
+ } else {
+ *b = (uint8_t)bb;
+ }
+ return errn;
+}
+
+int decodeBoolean(bitstream_t* stream, int* b) {
+ uint32_t ub;
+ int errn = readBits(stream, 1, &ub);
+ *b = (ub == 0) ? 0 : 1;
+ return errn;
+}
+
+int decodeNBitUnsignedInteger(bitstream_t* stream, uint16_t nbits, uint32_t* uint32) {
+ if (nbits == 0) {
+ *uint32 = 0;
+ return 0;
+ } else {
+ return readBits(stream, nbits, uint32);
+ }
+}
+
+#endif
+
+#endif
+
diff --git a/src/codec/BitEncoderChannel.c b/src/codec/BitEncoderChannel.c
new file mode 100644
index 0000000..83051d1
--- /dev/null
+++ b/src/codec/BitEncoderChannel.c
@@ -0,0 +1,88 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXIdizer.com
+ ********************************************************************/
+
+
+
+#include "EncoderChannel.h"
+#include "CoderChannel.h"
+#include "BitOutputStream.h"
+#include "EXITypes.h"
+
+#ifndef BIT_ENCODER_CHANNEL_C
+#define BIT_ENCODER_CHANNEL_C
+
+#if EXI_ALIGNMENT == BIT_PACKED
+
+
+int encode(bitstream_t* stream, uint8_t b) {
+ return writeBits(stream, 8, b);
+}
+
+/**
+ * Encode a single boolean value. A false value is encoded as bit 0 and true
+ * value is encode as bit 1.
+ */
+int encodeBoolean(bitstream_t* stream, int b) {
+ uint8_t val = b ? 1 : 0;
+ return writeBits(stream, 1, val);
+}
+
+
+/**
+ * Encode n-bit unsigned integer. The n least significant bits of parameter
+ * b starting with the most significant, i.e. from left to right.
+ */
+int encodeNBitUnsignedInteger(bitstream_t* stream, uint16_t nbits, uint32_t val) {
+ if (nbits > 0) {
+ return writeBits(stream, nbits, val);
+ }
+ return 0;
+}
+
+/**
+ * Flush underlying bit output stream.
+ */
+int encodeFinish(bitstream_t* stream) {
+ return flush(stream);
+}
+
+
+#endif /* alignment */
+
+#endif
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/codec/BitInputStream.c b/src/codec/BitInputStream.c
new file mode 100644
index 0000000..eefc3a2
--- /dev/null
+++ b/src/codec/BitInputStream.c
@@ -0,0 +1,111 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXIdizer.com
+ ********************************************************************/
+
+
+
+#include "BitInputStream.h"
+#include "EXITypes.h"
+#include "ErrorCodes.h"
+
+#ifndef BIT_INPUT_STREAM_C
+#define BIT_INPUT_STREAM_C
+
+/* internal method to (re)fill buffer */
+static int readBuffer(bitstream_t* stream)
+{
+ int errn = 0;
+ if(stream->capacity==0)
+ {
+#if EXI_STREAM == BYTE_ARRAY
+ if ( (*stream->pos) < stream->size ) {
+ stream->buffer = stream->data[(*stream->pos)++];
+ stream->capacity = BITS_IN_BYTE;
+ } else {
+ errn = EXI_ERROR_INPUT_STREAM_EOF;
+ }
+#endif
+#if EXI_STREAM == FILE_STREAM
+ stream->buffer = (uint8_t)(getc(stream->file));
+ /* EOF cannot be used, 0xFF valid value */
+ if ( feof(stream->file) || ferror(stream->file) ) {
+ return EXI_ERROR_INPUT_STREAM_EOF;
+ }
+ stream->capacity = BITS_IN_BYTE;
+#endif
+ }
+ return errn;
+}
+
+int readBits(bitstream_t* stream, uint16_t num_bits, uint32_t* b)
+{
+ int errn = readBuffer(stream);
+ if (errn < 0) {
+ return errn;
+ }
+
+ /* read the bits in one step */
+ if(num_bits <= stream->capacity)
+ {
+ stream->capacity -= (uint8_t)num_bits;
+ *b = (stream->buffer >> stream->capacity) & (0xff >> (BITS_IN_BYTE - num_bits));
+ }
+ else
+ {
+ /* read bits as much as possible */
+ *b = stream->buffer & (0xff >> (BITS_IN_BYTE - stream->capacity));
+ num_bits -= stream->capacity;
+ stream->capacity = 0;
+
+ /* read whole bytes */
+ while(num_bits >= 8)
+ {
+ errn = readBuffer(stream);
+ if (errn < 0) {
+ return errn;
+ }
+ *b = ((*b) << BITS_IN_BYTE) | stream->buffer;
+ num_bits -= BITS_IN_BYTE;
+ stream->capacity = 0;
+ }
+
+ /* read the spare bits in the buffer */
+ if(num_bits>0)
+ {
+ errn = readBuffer(stream);
+ if (errn < 0) {
+ return errn;
+ }
+ *b = ((*b) << num_bits) | (stream->buffer >> (BITS_IN_BYTE - num_bits));
+ stream->capacity = (uint8_t)(BITS_IN_BYTE - num_bits);
+ }
+
+ }
+
+ return errn;
+}
+
+#endif
diff --git a/src/codec/BitInputStream.h b/src/codec/BitInputStream.h
new file mode 100644
index 0000000..f733c8b
--- /dev/null
+++ b/src/codec/BitInputStream.h
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXIdizer.com
+ ********************************************************************/
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \file BitInputStream.h
+ * \brief Bit Input Stream
+ *
+ * Read bits and bytes from an underlying input stream.
+ *
+ */
+
+#include "EXITypes.h"
+
+#ifndef BIT_INPUT_STREAM_H
+#define BIT_INPUT_STREAM_H
+
+/**
+ * \brief Read bits
+ *
+ * Read the next num_bits bits and returns result an integer.
+ *
+ * \param stream Input Stream
+ * \param num_bits Number of bits
+ * \param b Integer value (out)
+ * \return Error-Code <> 0
+ *
+ */
+int readBits(bitstream_t* stream, uint16_t num_bits, uint32_t* b);
+
+
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/src/codec/BitOutputStream.c b/src/codec/BitOutputStream.c
new file mode 100644
index 0000000..a80560f
--- /dev/null
+++ b/src/codec/BitOutputStream.c
@@ -0,0 +1,118 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXIdizer.com
+ ********************************************************************/
+
+
+
+#include "BitOutputStream.h"
+#include "EXITypes.h"
+#include "ErrorCodes.h"
+
+#ifndef BIT_OUTPUT_STREAM_C
+#define BIT_OUTPUT_STREAM_C
+
+int writeBits(bitstream_t* stream, uint16_t nbits, uint32_t val) {
+ /* is there enough space in the buffer */
+ if (nbits <= stream->capacity) {
+ /* all bits fit into the current buffer */
+ stream->buffer = (stream->buffer << (nbits)) | (val & (0xff
+ >> (BITS_IN_BYTE - nbits)));
+ stream->capacity -= (uint8_t)nbits;
+ /* if the buffer is full write byte */
+ if (stream->capacity == 0) {
+#if EXI_STREAM == BYTE_ARRAY
+ if ((*stream->pos) >= stream->size) {
+ return EXI_ERROR_OUTPUT_STREAM_EOF;
+ }
+ stream->data[(*stream->pos)++] = stream->buffer;
+#endif
+#if EXI_STREAM == FILE_STREAM
+ if ( putc(stream->buffer, stream->file) == EOF ) {
+ return EXI_ERROR_OUTPUT_STREAM_EOF;
+ }
+#endif
+ stream->capacity = BITS_IN_BYTE;
+ stream->buffer = 0;
+ }
+ } else {
+ /* the buffer is not enough
+ * fill the buffer */
+ stream->buffer = (stream->buffer << stream->capacity) | ((val >> (nbits
+ - stream->capacity)) & (0xff >> (BITS_IN_BYTE
+ - stream->capacity)));
+
+ nbits -= stream->capacity;
+#if EXI_STREAM == BYTE_ARRAY
+ if ((*stream->pos) >= stream->size) {
+ return EXI_ERROR_OUTPUT_STREAM_EOF;
+ }
+ stream->data[(*stream->pos)++] = stream->buffer;
+#endif
+#if EXI_STREAM == FILE_STREAM
+ if ( putc(stream->buffer, stream->file) == EOF ) {
+ return EXI_ERROR_OUTPUT_STREAM_EOF;
+ }
+#endif
+ stream->buffer = 0;
+
+ /* write whole bytes */
+ while (nbits >= BITS_IN_BYTE) {
+ nbits -= BITS_IN_BYTE;
+#if EXI_STREAM == BYTE_ARRAY
+ if ((*stream->pos) >= stream->size) {
+ return EXI_ERROR_OUTPUT_STREAM_EOF;
+ }
+ stream->data[(*stream->pos)++] = (val >> (nbits));
+#endif
+#if EXI_STREAM == FILE_STREAM
+ if ( putc((val >> (nbits)), stream->file) == EOF ) {
+ return EXI_ERROR_OUTPUT_STREAM_EOF;
+ }
+#endif
+ }
+
+ /* spared bits are kept in the buffer */
+ stream->buffer = (uint8_t)val; /* Note: the high bits will be shifted out during further filling */
+ stream->capacity = (uint8_t)(BITS_IN_BYTE - (nbits));
+ }
+
+ return 0;
+}
+
+/**
+ * Flush output
+ */
+int flush(bitstream_t* stream) {
+ if (stream->capacity == BITS_IN_BYTE) {
+ /* nothing to do, no bits in buffer */
+ return 0;
+ } else {
+ return writeBits(stream, stream->capacity, 0);
+ }
+}
+
+#endif
+
diff --git a/src/codec/BitOutputStream.h b/src/codec/BitOutputStream.h
new file mode 100644
index 0000000..69046db
--- /dev/null
+++ b/src/codec/BitOutputStream.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXIdizer.com
+ ********************************************************************/
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \file BitOutputStream.h
+ * \brief Bit Output Stream
+ *
+ * Write bits and bytes to an underlying output stream.
+ *
+ */
+
+#include
+
+#include "EXITypes.h"
+
+#ifndef BIT_OUTPUT_STREAM_H
+#define BIT_OUTPUT_STREAM_H
+
+/**
+ * \brief Write bits
+ *
+ * Write the n least significant bits of parameter b starting
+ * with the most significant, i.e. from left to right.
+ *
+ * \param stream Output Stream
+ * \param nbits Number of bits
+ * \param bits value
+ * \return Error-Code <> 0
+ *
+ */
+int writeBits(bitstream_t* stream, uint16_t nbits, uint32_t bits);
+
+
+/**
+ * \brief Flush output
+ *
+ * If there are some unwritten bits, pad them if necessary and
+ * write them out. Note that this method does flush the
+ * underlying stream.
+ *
+ * \param stream Output Stream
+ * \return Error-Code <> 0
+ *
+ */
+int flush(bitstream_t* stream);
+
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/codec/ByteDecoderChannel.c b/src/codec/ByteDecoderChannel.c
new file mode 100644
index 0000000..025f5d4
--- /dev/null
+++ b/src/codec/ByteDecoderChannel.c
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXIdizer.com
+ ********************************************************************/
+
+
+
+#include "DecoderChannel.h"
+#include "CoderChannel.h"
+#include "BitInputStream.h"
+#include "EXITypes.h"
+#include "ErrorCodes.h"
+
+#ifndef BYTE_DECODER_CHANNEL_C
+#define BYTE_DECODER_CHANNEL_C
+
+
+#if EXI_ALIGNMENT == BYTE_ALIGNMENT
+
+int decode(bitstream_t* stream, uint8_t* b) {
+ int errn = 0;
+#if EXI_STREAM == BYTE_ARRAY
+ if ( (*stream->pos) < stream->size ) {
+ *b = stream->data[(*stream->pos)++];
+ } else {
+ errn = EXI_ERROR_INPUT_STREAM_EOF;
+ }
+#endif /* EXI_STREAM == BYTE_ARRAY */
+#if EXI_STREAM == FILE_STREAM
+ *b = (uint8_t)(getc(stream->file));
+ /* EOF cannot be used, 0xFF valid value */
+ if ( feof(stream->file) || ferror(stream->file) ) {
+ return EXI_ERROR_INPUT_STREAM_EOF;
+ }
+#endif /* EXI_STREAM == FILE_STREAM */
+
+ return errn;
+}
+
+int decodeBoolean(bitstream_t* stream, int* b) {
+ uint8_t bb;
+ int errn = decode(stream, &bb);
+ *b = (bb == 0) ? 0 : 1;
+ return errn;
+}
+
+/**
+ * Decodes and returns an n-bit unsigned integer using the minimum number of
+ * bytes required for n bits.
+ */
+int decodeNBitUnsignedInteger(bitstream_t* stream, uint16_t nbits, uint32_t* uint32) {
+ uint16_t bitsRead = 0;
+ uint8_t b;
+ int errn = 0;
+ *uint32 = 0;
+
+ while (bitsRead < nbits) {
+ errn = decode(stream, &b);
+ if (errn != 0) {
+ return errn;
+ }
+ *uint32 += (b << bitsRead);
+ bitsRead += 8;
+ }
+
+ return errn;
+}
+
+#endif
+
+#endif
+
diff --git a/src/codec/ByteEncoderChannel.c b/src/codec/ByteEncoderChannel.c
new file mode 100644
index 0000000..bf8e730
--- /dev/null
+++ b/src/codec/ByteEncoderChannel.c
@@ -0,0 +1,128 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXIdizer.com
+ ********************************************************************/
+
+
+
+#include "EncoderChannel.h"
+#include "CoderChannel.h"
+#include "BitOutputStream.h"
+#include "EXITypes.h"
+#include "MethodsBag.h"
+#include "ErrorCodes.h"
+
+#ifndef BYTE_ENCODER_CHANNEL_C
+#define BYTE_ENCODER_CHANNEL_C
+
+#if EXI_ALIGNMENT == BYTE_ALIGNMENT
+
+
+int encode(bitstream_t* stream, uint8_t b) {
+#if EXI_STREAM == BYTE_ARRAY
+ if ( (*stream->pos) < stream->size ) {
+ stream->data[(*stream->pos)++] = b;
+ return 0;
+ } else {
+ return EXI_ERROR_OUTPUT_STREAM_EOF;
+ }
+#endif /* EXI_STREAM == BYTE_ARRAY */
+#if EXI_STREAM == FILE_STREAM
+ if ( putc(b, stream->file) == EOF ) {
+ return EXI_ERROR_OUTPUT_STREAM_EOF;
+ } else {
+ return 0;
+ }
+#endif /* EXI_STREAM == FILE_STREAM */
+}
+
+/**
+ * Encode a single boolean value. A false value is encoded as byte 0 and true
+ * value is encode as byte 1.
+ */
+int encodeBoolean(bitstream_t* stream, int b) {
+ uint8_t val = b ? 1 : 0;
+ return encode(stream, val);
+}
+
+
+/**
+ * Encode n-bit unsigned integer. The n least significant bits of parameter
+ * b starting with the most significant, i.e. from left to right.
+ */
+int encodeNBitUnsignedInteger(bitstream_t* stream, uint16_t nbits, uint32_t val) {
+ if (nbits > 0) {
+ if (nbits < 9) {
+ /* 1 byte */
+ encode(stream, val & 0xff);
+ } else if (nbits < 17) {
+ /* 2 bytes */
+ encode(stream, val & 0x00ff);
+ encode(stream, (val & 0xff00) >> 8);
+ } else if (nbits < 25) {
+ /* 3 bytes */
+ encode(stream, val & 0x0000ff);
+ encode(stream, (val & 0x00ff00) >> 8);
+ encode(stream, (uint8_t)((val & 0xff0000) >> 16));
+ } else if (nbits < 33) {
+ /* 4 bytes */
+ encode(stream, val & 0x000000ff);
+ encode(stream, (val & 0x0000ff00) >> 8);
+ encode(stream, (uint8_t)((val & 0x00ff0000) >> 16));
+ encode(stream, (uint8_t)((val & 0xff000000) >> 24));
+ } else {
+ /* TODO Currently not more than 4 Bytes allowed for NBitUnsignedInteger */
+ return EXI_UNSUPPORTED_NBIT_INTEGER_LENGTH;
+ }
+ }
+ return 0;
+}
+
+
+/**
+ * Flush underlying bit output stream.
+ */
+#pragma warning( disable : 4100 ) /* warning unreferenced parameter 'stream' */
+int encodeFinish(bitstream_t* stream) {
+ /* no pending bits in byte-aligned mode */
+ return 0;
+}
+#pragma warning( default : 4100 ) /* warning unreferenced parameter 'stream' */
+
+#endif /* alignment */
+
+#endif
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/codec/ByteStream.c b/src/codec/ByteStream.c
new file mode 100644
index 0000000..12ea6b5
--- /dev/null
+++ b/src/codec/ByteStream.c
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXIdizer.com
+ ********************************************************************/
+
+
+
+/* Avoid VS warning, put before your included header files */
+/* warning C4996: ‘fopen’: This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. */
+#define _CRT_SECURE_NO_DEPRECATE
+
+#include "EXITypes.h"
+#include "ErrorCodes.h"
+
+#ifndef BYTE_STREAM_C
+#define BYTE_STREAM_C
+
+int readBytesFromFile(const char * filename, uint8_t* data, uint32_t size, uint32_t pos) {
+ FILE* f;
+ int character;
+
+ f = fopen(filename, "rb");
+
+ if (f == NULL) {
+ return EXI_ERROR_INPUT_FILE_HANDLE;
+ } else {
+ /* read bytes */
+ while ((character = getc(f)) != EOF) {
+ if (pos >= size) {
+ return EXI_ERROR_OUT_OF_BYTE_BUFFER;
+ }
+ data[pos++] = (uint8_t) character;
+ }
+ fclose(f);
+ }
+
+ return pos;
+}
+
+int writeBytesToFile(uint8_t* data, uint32_t len, const char * filename) {
+ size_t rlen;
+ FILE* f = fopen(filename, "wb+");
+
+ if (f == NULL) {
+ return -1;
+ } else {
+ rlen = fwrite(data, sizeof(uint8_t), len, f);
+ fflush(f);
+ fclose(f);
+ if(rlen == len) {
+ return 0;
+ } else {
+ return EXI_ERROR_OUTPUT_FILE;
+ }
+ }
+}
+
+
+#endif
+
diff --git a/src/codec/ByteStream.h b/src/codec/ByteStream.h
new file mode 100644
index 0000000..65960e7
--- /dev/null
+++ b/src/codec/ByteStream.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXIdizer.com
+ ********************************************************************/
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "EXITypes.h"
+
+/**
+ * \file ByteStream.h
+ * \brief Byte Stream utilities
+ *
+ */
+
+#ifndef BYTE_STREAM_H
+#define BYTE_STREAM_H
+
+/**
+ * \brief Write bytes to file
+ *
+ * \param data byte array
+ * \param len length
+ * \param filename File name
+ * \return Error-Code <> 0
+ *
+ */
+int writeBytesToFile(uint8_t* data, uint32_t len, const char * filename);
+
+
+/**
+ * \brief Read bytes from file
+ *
+ * \param filename File name
+ * \param data byte array
+ * \param size byte array size
+ * \param pos byte array position
+ * \return Error-Code <> 0
+ *
+ */
+int readBytesFromFile(const char * filename, uint8_t* data, uint32_t size, uint32_t pos);
+
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/src/service/v2g_serviceDispatcher.h b/src/codec/CoderChannel.h
similarity index 66%
rename from src/service/v2g_serviceDispatcher.h
rename to src/codec/CoderChannel.h
index 754ff29..d24a197 100644
--- a/src/service/v2g_serviceDispatcher.h
+++ b/src/codec/CoderChannel.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2007-2010 Siemens AG
+ * Copyright (C) 2007-2012 Siemens AG
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
@@ -10,6 +10,7 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see .
@@ -17,27 +18,34 @@
/*******************************************************************
*
- * @author Sebastian.Kaebisch.EXT@siemens.com
- * @version 0.6
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
* @contact Joerg.Heuer@siemens.com
*
+ *
Code generated by EXIdizer.com
********************************************************************/
+
+
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef V2GSERVER_H_
-#define V2GSERVER_H_
+#include "EXITypes.h"
-#include "v2g_serviceDataTypes.h"
+#ifndef CODER_CHANNEL_H
+#define CODER_CHANNEL_H
+/** EXI alignment mode - Option bit-packed */
+#define BIT_PACKED 1
+/** EXI alignment mode - Option byte-packed */
+#define BYTE_ALIGNMENT 2
+/** EXI alignment mode */
+#define EXI_ALIGNMENT BIT_PACKED
-int init_v2gservice(struct EXIService* service,bytes_t bytes, string_ucs_t string, uint16_t transportHeaderOffset);
-int messageDispatcher(struct EXIService* service, uint8_t* inStream, uint16_t sizeInStream, uint8_t* outStream, uint16_t sizeOutStream, uint16_t* outPos);
-
-#endif /* V2GSERVER_H_ */
+#endif
#ifdef __cplusplus
}
#endif
+
diff --git a/src/codec/DecoderChannel.h b/src/codec/DecoderChannel.h
new file mode 100644
index 0000000..956ee64
--- /dev/null
+++ b/src/codec/DecoderChannel.h
@@ -0,0 +1,356 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXIdizer.com
+ ********************************************************************/
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \file DecoderChannel.h
+ * \brief EXI Decoder Channel
+ *
+ */
+
+#include "EXITypes.h"
+#include "CoderChannel.h"
+
+#ifndef DECODER_CHANNEL_H
+#define DECODER_CHANNEL_H
+
+
+/**
+ * \brief Decode byte value
+ *
+ * \param stream Input Stream
+ * \param b byte (out)
+ * \return Error-Code <> 0
+ *
+ */
+int decode(bitstream_t* stream, uint8_t* b);
+
+
+/**
+ * \brief Decode boolean
+ *
+ * Decode a single boolean value. The value false is
+ * represented by 0, and the value true is represented by 1.
+ *
+ * \param stream Input Stream
+ * \param b boolean (out)
+ * \return Error-Code <> 0
+ *
+ */
+int decodeBoolean(bitstream_t* stream, int* b);
+
+
+/**
+ * \brief Decode n-bit unsigned integer
+ *
+ * Decodes and returns an n-bit unsigned integer.
+ *
+ * \param stream Input Stream
+ * \param nbits Number of bits
+ * \param uint32 Value (out)
+ * \return Error-Code <> 0
+ *
+ */
+int decodeNBitUnsignedInteger(bitstream_t* stream, uint16_t nbits, uint32_t* uint32);
+
+
+/**
+ * \brief Decode unsigned integer
+ *
+ * Decode an arbitrary precision non negative integer using
+ * a sequence of octets. The most significant bit of the last
+ * octet is set to zero to indicate sequence termination.
+ * Only seven bits per octet are used to store the integer's value.
+ *
+ * \param stream Input Stream
+ * \param iv Unsigned Integer Value (out)
+ * \return Error-Code <> 0
+ *
+ */
+int decodeUnsignedInteger(bitstream_t* stream, exi_integer_t* iv);
+
+
+/**
+ * \brief Decode unsigned integer
+ *
+ * Decode an arbitrary precision non negative integer using
+ * a sequence of octets. The most significant bit of the last
+ * octet is set to zero to indicate sequence termination.
+ * Only seven bits per octet are used to store the integer's value.
+ *
+ * \param stream Input Stream
+ * \param uint16 Unsigned Integer Value 16 bits (out)
+ * \return Error-Code <> 0
+ *
+ */
+int decodeUnsignedInteger16(bitstream_t* stream, uint16_t* uint16);
+
+
+/**
+ * \brief Decode unsigned integer
+ *
+ * Decode an arbitrary precision non negative integer using
+ * a sequence of octets. The most significant bit of the last
+ * octet is set to zero to indicate sequence termination.
+ * Only seven bits per octet are used to store the integer's value.
+ *
+ * \param stream Input Stream
+ * \param uint32 Unsigned Integer Value 32 bits (out)
+ * \return Error-Code <> 0
+ *
+ */
+int decodeUnsignedInteger32(bitstream_t* stream, uint32_t* uint32);
+
+
+/**
+ * \brief Decode unsigned integer
+ *
+ * Decode an arbitrary precision non negative integer using
+ * a sequence of octets. The most significant bit of the last
+ * octet is set to zero to indicate sequence termination.
+ * Only seven bits per octet are used to store the integer's value.
+ *
+ * \param stream Input Stream
+ * \param uint64 Unsigned Integer Value 64 bits (out)
+ * \return Error-Code <> 0
+ *
+ */
+int decodeUnsignedInteger64(bitstream_t* stream, uint64_t* uint64);
+
+
+/**
+ * \brief Decode integer
+ *
+ * Decode an arbitrary precision integer using a sign bit
+ * followed by a sequence of octets. The most significant bit
+ * of the last octet is set to zero to indicate sequence termination.
+ * Only seven bits per octet are used to store the integer's value.
+ *
+ * \param stream Input Stream
+ * \param iv Integer Value 64 bits (out)
+ * \return Error-Code <> 0
+ *
+ */
+int decodeInteger(bitstream_t* stream, exi_integer_t* iv);
+
+
+/**
+ * \brief Decode integer
+ *
+ * Decode an arbitrary precision integer using a sign bit
+ * followed by a sequence of octets. The most significant bit
+ * of the last octet is set to zero to indicate sequence termination.
+ * Only seven bits per octet are used to store the integer's value.
+ *
+ * \param stream Input Stream
+ * \param int16 Integer Value 16 bits (out)
+ * \return Error-Code <> 0
+ *
+ */
+int decodeInteger16(bitstream_t* stream, int16_t* int16);
+
+
+/**
+ * \brief Decode integer
+ *
+ * Decode an arbitrary precision integer using a sign bit
+ * followed by a sequence of octets. The most significant bit
+ * of the last octet is set to zero to indicate sequence termination.
+ * Only seven bits per octet are used to store the integer's value.
+ *
+ * \param stream Input Stream
+ * \param int32 Integer Value 32 bits (out)
+ * \return Error-Code <> 0
+ *
+ */
+int decodeInteger32(bitstream_t* stream, int32_t* int32);
+
+
+/**
+ * \brief Decode integer
+ *
+ * Decode an arbitrary precision integer using a sign bit
+ * followed by a sequence of octets. The most significant bit
+ * of the last octet is set to zero to indicate sequence termination.
+ * Only seven bits per octet are used to store the integer's value.
+ *
+ * \param stream Input Stream
+ * \param int64 Integer Value 64 bits (out)
+ * \return Error-Code <> 0
+ *
+ */
+int decodeInteger64(bitstream_t* stream, int64_t* int64);
+
+
+/**
+ * \brief Decode float
+ *
+ * Decode a Float datatype as two consecutive Integers. The
+ * first Integer represents the mantissa of the floating point
+ * number and the second Integer represents the base-10 exponent
+ * of the floating point number.
+ *
+ * \param stream Input Stream
+ * \param f Float Value (out)
+ * \return Error-Code <> 0
+ *
+ */
+int decodeFloat(bitstream_t* stream, exi_float_me_t* f);
+
+
+/**
+ * \brief Decode decimal
+ *
+ * Decode a decimal represented as a Boolean sign followed by two
+ * Unsigned Integers. A sign value of zero (0) is used to represent
+ * positive Decimal values and a sign value of one (1) is used to
+ * represent negative Decimal values The first Integer represents
+ * the integral portion of the Decimal value. The second positive
+ * integer represents the fractional portion of the decimal with
+ * the digits in reverse order to preserve leading zeros.
+ *
+ * \param stream Input Stream
+ * \param d Decimal Value (out)
+ * \return Error-Code <> 0
+ *
+ */
+int decodeDecimal(bitstream_t* stream, exi_decimal_t* d);
+
+
+/**
+ * \brief Decode String (no length prefix)
+ *
+ * Decode a sequence of characters for a given length.
+ *
+ * \param stream Input Stream
+ * \param len Characters length
+ * \param s String Value (out)
+ * \return Error-Code <> 0
+ *
+ */
+int decodeStringOnly(bitstream_t* stream, uint16_t len, exi_string_ucs_t* s);
+
+
+/**
+ * \brief Decode String
+ *
+ * Decode a length prefixed sequence of characters.
+ *
+ * \param stream Input Stream
+ * \param s String Value (out)
+ * \return Error-Code <> 0
+ *
+ */
+int decodeString(bitstream_t* stream, exi_string_ucs_t* s);
+
+
+
+/**
+ * \brief Decode String value
+ *
+ * Decode a length prefixed sequence of characters in the sense of string tables.
+ * length == 0: local value partition hit.
+ * length == 1: global value partition hit.
+ * length > 1: string literal is encoded as a String with the length incremented by two
+ *
+ * \param stream Input Stream
+ * \param state Codec state
+ * \param qnameID Qualified Name ID
+ * \param s String Value (out)
+ * \return Error-Code <> 0
+ *
+ */
+int decodeStringValue(bitstream_t* stream, exi_state_t* state, uint16_t qnameID, exi_string_value_t* s);
+
+
+/**
+ * \brief Decode Restricted characters set string value
+ *
+ * \param stream Input Stream
+ * \param state Codec state
+ * \param qnameID Qualified Name ID
+ * \param rcs Restricted character set
+ * \param s String Value (out)
+ * \return Error-Code <> 0
+ *
+ */
+int decodeRCSStringValue(bitstream_t* stream, exi_state_t* state, uint16_t qnameID, exi_rcs_t* rcs, exi_string_value_t* s);
+
+
+/**
+ * \brief Decode characters
+ *
+ * Decode a sequence of characters according to a given length.
+ *
+ * \param stream Input Stream
+ * \param len Length
+ * \param chars Characters (out)
+ * \return Error-Code <> 0
+ *
+ */
+int decodeCharacters(bitstream_t* stream, uint16_t len, uint32_t* chars);
+
+
+/**
+ * \brief Decode Binary
+ *
+ * Decode a binary value as a length-prefixed sequence of octets.
+ *
+ * \param stream Input Stream
+ * \param bytes Bytes (out)
+ * \return Error-Code <> 0
+ *
+ */
+int decodeBinary(bitstream_t* stream, exi_bytes_t* bytes);
+
+
+/**
+ * \brief Decode DateTime
+ *
+ * Decode Date-Time as sequence of values representing the
+ * individual components of the Date-Time.
+ *
+ * \param stream Input Stream
+ * \param type Datetime type
+ * \param datetime Datetime (out)
+ * \return Error-Code <> 0
+ *
+ */
+int decodeDateTime(bitstream_t* stream, exi_datetime_type_t type, exi_datetime_t* datetime);
+
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/codec/EXICoder.c b/src/codec/EXICoder.c
new file mode 100644
index 0000000..3ca3792
--- /dev/null
+++ b/src/codec/EXICoder.c
@@ -0,0 +1,2962 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
+ ********************************************************************/
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef EXI__CODER_H
+#define EXI__CODER_H
+
+#include "EXITypes.h"
+
+#define DOCUMENT 0
+#define DOC_CONTENT 126
+#define DOC_END 127
+#define UR_TYPE_GRAMMAR_0 227
+#define UR_TYPE_GRAMMAR_1 228
+
+
+/* increments global and local string count */
+int exi__IncrementStringValueCount(exi_state_t* state, uint16_t qnameID);
+
+int exi__PushStack(exi_state_t* state, int16_t newState, uint16_t qnameID);
+
+int exi__PopStack(exi_state_t* state);
+
+int exi__HandleXsiNilTrue(exi_state_t* state);
+
+int exi__HandleXsiType(exi_state_t* state, exi_eqname_t* xsiType);
+
+int exi__RetrieveAndPushGlobalGrammar(exi_state_t* state, uint16_t qnameID);
+
+int exi__LearnAttribute(exi_state_t* state, uint16_t qnameID, uint16_t uriID, uint16_t localID);
+
+int exi__IsStartContent(int16_t ruleID);
+
+int exi__MoveToElementContentRule(exi_state_t* state);
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/codec/EXIDecoder.c b/src/codec/EXIDecoder.c
new file mode 100644
index 0000000..db4a5c9
--- /dev/null
+++ b/src/codec/EXIDecoder.c
@@ -0,0 +1,10835 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
+ ********************************************************************/
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef EXI__ENCODER_H
+#define EXI__ENCODER_H
+
+/**
+* \file EXIEncoder.h
+* \brief EXI Encoder
+*
+*/
+
+#include "EXITypes.h"
+#include "EXIEncoder.h"
+
+/**
+ * \brief Initialize EXI encoder
+ *
+ * Resets & initializes the EXI encoder.
+ *
+ * \param stream Output Stream
+ * \param state Codec state
+ * \param runtimeTable Runtime name-tables
+ * \param stringTable String table
+ * \return Error-Code <> 0
+ *
+ */
+int exiInitEncoder(bitstream_t* stream, exi_state_t* state,
+ exi_name_table_runtime_t runtimeTable, exi_string_table_t stringTable);
+
+/**
+ * \brief Reports the beginning of a set of XML events
+ *
+ * see EXI StartDocument (SD) event
+ *
+ * \param stream Output Stream
+ * \param state Codec state
+ * \return Error-Code <> 0
+ *
+ */
+int exiEncodeStartDocument(bitstream_t* stream,
+ exi_state_t* state);
+
+/**
+ * \brief Reports the end of a set of XML events
+ *
+ * see EXI EndDocument (ED) event
+ *
+ * \param stream Output Stream
+ * \param state Codec state
+ * \return Error-Code <> 0
+ *
+ */
+int exiEncodeEndDocument(bitstream_t* stream,
+ exi_state_t* state);
+
+/**
+ * \brief Supplies the start of a known element
+ *
+ * Provides access to the namespace URI and local name of the start tag by providing qnameID.
+ * Note: Both, namespace URI and local name are known (schema-informed) or have been encoded before.
+ * see EXI StartElement (SE) event
+ *
+ * \param stream Output Stream
+ * \param state Codec state
+ * \param qnameID qualified name ID
+ * \return Error-Code <> 0
+ *
+ */
+int
+exiEncodeStartElement(bitstream_t* stream,
+ exi_state_t* state, uint16_t qnameID);
+
+/**
+ * \brief Supplies the start of an element where the namespace is known
+ *
+ * Note: Namespace URI is known (schema-informed) or has been encoded before while local name is unknown.
+ * see EXI StartElement (SE) event
+ *
+ * \param stream Output Stream
+ * \param state Codec state
+ * \param namespaceUriID namespace URI ID
+ * \param localName local name as string
+ * \return Error-Code <> 0
+ *
+ */
+int exiEncodeStartElementNS(bitstream_t* stream,
+ exi_state_t* state, uint16_t namespaceUriID,
+ exi_string_ucs_t* localName);
+
+/**
+ * \brief Supplies the start of an element where the namespace and the local name is unknown
+ *
+ * Note: Neither namespace URI nor local name is known.
+ * see EXI StartElement (SE) event
+ *
+ * \param stream Output Stream
+ * \param state Codec state
+ * \param namespaceUri namespace URI as string
+ * \param localName local name as string
+ * \return Error-Code <> 0
+ *
+ */
+int exiEncodeStartElementGeneric(bitstream_t* stream,
+ exi_state_t* state, exi_string_ucs_t* namespaceUri,
+ exi_string_ucs_t* localName);
+
+/**
+ * \brief Supplies the end tag of an element
+ *
+ * see EXI EndElement (EE) event
+ *
+ * \param stream Output Stream
+ * \param state Codec state
+ * \return Error-Code <> 0
+ *
+ */
+int exiEncodeEndElement(bitstream_t* stream,
+ exi_state_t* state);
+
+/**
+ * \brief Supplies characters value
+ *
+ * Note: Special handling for list value.
+ * see EXI Characters (CH) event
+ *
+ * \param stream Output Stream
+ * \param state Codec state
+ * \param val Characters value
+ * \return Error-Code <> 0
+ *
+ */
+int exiEncodeCharacters(bitstream_t* stream,
+ exi_state_t* state, exi_value_t* val);
+
+/**
+ * \brief Supplies an attribute qname and value
+ *
+ * Note: Special handling for list value.
+ * see EXI Attribute (AT) event
+ *
+ * \param stream Output Stream
+ * \param state Codec state
+ * \param qnameID qualified name ID
+ * \param val Attribute value
+ * \return Error-Code <> 0
+ *
+ */
+int exiEncodeAttribute(bitstream_t* stream,
+ exi_state_t* state, uint16_t qnameID, exi_value_t* val);
+
+
+
+
+/**
+ * \brief Supplies an attribute qname and value where the namespace is known
+ *
+ * Note: Special handling for list value.
+ * see EXI Attribute (AT) event
+ *
+ * \param stream Output Stream
+ * \param state Codec state
+ * \param namespaceUriID Qualified namespace URI ID
+ * \param localName Qualified localname as String
+ * \param val Attribute value
+ * \return Error-Code <> 0
+ *
+ */
+int exiEncodeAttributeNS(bitstream_t* stream,
+ exi_state_t* state, uint16_t namespaceUriID,
+ exi_string_ucs_t* localName, exi_value_t* val);
+
+
+/**
+ * \brief Supplies an attribute qname and value where the namespace and the local name is unknown
+ *
+ *
+ * \param stream Output Stream
+ * \param state Codec state
+ * \param namespaceUri namespace URI as string
+ * \param localName local name as string
+ * \param val Attribute value
+ * \return Error-Code <> 0
+ *
+ */
+int exiEncodeAttributeGeneric(bitstream_t* stream,
+ exi_state_t* state, exi_string_ucs_t* namespaceUri,
+ exi_string_ucs_t* localName, exi_value_t* val);
+
+
+
+/**
+ * \brief Supplies an xsi:nil attribute
+ *
+ * see EXI Attribute (AT) event
+ *
+ * \param stream Output Stream
+ * \param state Codec state
+ * \param val Attribute value
+ * \return Error-Code <> 0
+ *
+ */
+int exiEncodeAttributeXsiNil(bitstream_t* stream,
+ exi_state_t* state, exi_value_t* val);
+
+/**
+ * \brief Supplies an xsi:type attribute
+ *
+ * see EXI Attribute (AT) event
+ *
+ * \param stream Output Stream
+ * \param state Codec state
+ * \param val Attribute value
+ * \return Error-Code <> 0
+ *
+ */
+int exiEncodeAttributeXsiType(bitstream_t* stream,
+ exi_state_t* state, exi_value_t* val);
+
+/**
+ * \brief Supplies list value for characters and attribute event
+ *
+ * List values are special given that first the number and type of entry needs to be passed (element/attribute event) and then one by one the actual values.
+ *
+ * \param stream Output Stream
+ * \param state Codec state
+ * \param qnameID qualified name ID
+ * \param val one list value
+ * \param lt list type
+ * \return Error-Code <> 0
+ *
+ */
+int exiEncodeListValue(bitstream_t* stream,
+ exi_state_t* state, uint16_t qnameID, exi_value_t* val, exi_list_t lt);
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/codec/EXIHeaderDecoder.c b/src/codec/EXIHeaderDecoder.c
new file mode 100644
index 0000000..5a72761
--- /dev/null
+++ b/src/codec/EXIHeaderDecoder.c
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXIdizer.com
+ ********************************************************************/
+
+
+
+#include "EXIHeaderDecoder.h"
+#include "BitInputStream.h"
+#include "DecoderChannel.h"
+#include "ErrorCodes.h"
+
+#ifndef EXI_HEADER_DECODER_C
+#define EXI_HEADER_DECODER_C
+
+int readEXIHeader(bitstream_t* stream) {
+ uint32_t header = 0;
+ int errn = readBits(stream, 8, &header);
+ if (errn < 0) {
+ return errn;
+ }
+ if(header == '$') {
+ /* we do not support "EXI Cookie" */
+ errn = EXI_UNSUPPORTED_HEADER_COOKIE;
+ } else if ( header & 0x20 ) {
+ /* we do not support "Presence Bit for EXI Options" */
+ errn = EXI_UNSUPPORTED_HEADER_OPTIONS;
+ } else {
+ /* Yes, a *simple* header */
+ errn = 0;
+ }
+ return errn;
+}
+
+
+#endif
+
+
diff --git a/src/codec/EXIHeaderDecoder.h b/src/codec/EXIHeaderDecoder.h
new file mode 100644
index 0000000..1c20091
--- /dev/null
+++ b/src/codec/EXIHeaderDecoder.h
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXIdizer.com
+ ********************************************************************/
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "EXITypes.h"
+
+/**
+ * \file EXIHeaderDecoder.h
+ * \brief EXI Header Decoder
+ *
+ */
+
+#ifndef EXI_HEADER_DECODER_H
+#define EXI_HEADER_DECODER_H
+
+/**
+ * \brief Reads EXI header
+ *
+ * \param stream Input Stream
+ * \return Error-Code <> 0
+ *
+ */
+int readEXIHeader(bitstream_t* stream);
+
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/src/codec/EXIHeaderEncoder.c b/src/codec/EXIHeaderEncoder.c
new file mode 100644
index 0000000..f33688c
--- /dev/null
+++ b/src/codec/EXIHeaderEncoder.c
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXIdizer.com
+ ********************************************************************/
+
+
+
+#include "EXIHeaderEncoder.h"
+#include "BitOutputStream.h"
+#include "EncoderChannel.h"
+
+#ifndef EXI_HEADER_ENCODER_C
+#define EXI_HEADER_ENCODER_C
+
+int writeEXIHeader(bitstream_t* stream) {
+ return writeBits(stream, 8, 128);
+}
+
+
+#endif
+
+
diff --git a/src/transport/v2gtp.h b/src/codec/EXIHeaderEncoder.h
similarity index 60%
rename from src/transport/v2gtp.h
rename to src/codec/EXIHeaderEncoder.h
index f253bfe..606817d 100644
--- a/src/transport/v2gtp.h
+++ b/src/codec/EXIHeaderEncoder.h
@@ -1,53 +1,59 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXIdizer.com
+ ********************************************************************/
+
-/*
- * Copyright (C) 2007-2011 Siemens AG
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-/*******************************************************************
- *
- * @author Sebastian.Kaebisch.EXT@siemens.com
- * @version 0.6
- * @contact Joerg.Heuer@siemens.com
- *
- ********************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef V2GTP_H_
-#define V2GTP_H_
+#include "EXITypes.h"
-/* generic V2GTP header length */
-#define V2GTP_HEADER_LENGTH 8
+/**
+ * \file EXIHeaderEncoder.h
+ * \brief EXI Header Encoder
+ *
+ */
-/* define V2GTP Version */
-#define V2GTP_VERSION 0x01
-#define V2GTP_VERSION_INV 0xFE
-
-/* define V2GTP payload types*/
-#define V2GTP_EXI_TYPE 0x8001
+#ifndef EXI_HEADER_ENCODER_H
+#define EXI_HEADER_ENCODER_H
+/**
+ * \brief Writes EXI header
+ *
+ * \param stream Output Stream
+ * \return Error-Code <> 0
+ *
+ */
+int writeEXIHeader(bitstream_t* stream);
-int write_v2gtpHeader(uint8_t* outStream, uint16_t* outStreamLength, uint16_t payloadType);
+#endif
-int read_v2gtpHeader(uint8_t* inStream, uint16_t inStreamLength, uint16_t* payloadLength);
-
-#endif /* V2GTP_H_ */
#ifdef __cplusplus
}
diff --git a/src/codec/EXIOptions.h b/src/codec/EXIOptions.h
new file mode 100644
index 0000000..3abc3b8
--- /dev/null
+++ b/src/codec/EXIOptions.h
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXIdizer.com
+ ********************************************************************/
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \file EXIOptions.h
+ * \brief EXI Options
+ *
+ */
+
+#ifndef EXI__OPTIONS_H
+#define EXI__OPTIONS_H
+
+
+/**
+ * \brief Option 'strict'
+ *
+ * Strict interpretation of schemas is used to achieve better compactness.
+ * Default Value: false
+ */
+#define EXI_STRICT 0
+
+
+/**
+ * \brief Option 'valueMaxLength'
+ *
+ * Specifies the maximum string length of value content items to be
+ * considered for addition to the string table.
+ * Default Value: unbounded (-1)
+ */
+#define EXI_VALUE_MAX_LENGTH -1
+
+
+/**
+ * \brief Option 'valuePartitionCapacity'
+ *
+ * Specifies the total capacity of value partitions in a string table.
+ * Default Value: unbounded (-1)
+ */
+#define EXI_VALUE_PARTITION_CAPACITY 0
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/src/codec/EXITypes.h b/src/codec/EXITypes.h
new file mode 100644
index 0000000..e62706a
--- /dev/null
+++ b/src/codec/EXITypes.h
@@ -0,0 +1,535 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXIdizer.com
+ ********************************************************************/
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \file EXITypes.h
+ * \brief Basic type definitions and structs
+ *
+ */
+
+#include
+#include
+
+#ifndef EXI_TYPES_H
+#define EXI_TYPES_H
+
+/** Number of bits for each byte */
+#define BITS_IN_BYTE 8
+
+/** EXI Date-Time offset for year */
+#define DATETIME_YEAR_OFFSET 2000
+/** EXI Date-Time number of bits for monthDay */
+#define DATETIME_NUMBER_BITS_MONTHDAY 9
+/** EXI Date-Time number of bits for time */
+#define DATETIME_NUMBER_BITS_TIME 17
+/** EXI Date-Time number of bits for timezone */
+#define DATETIME_NUMBER_BITS_TIMEZONE 11
+/** EXI Date-Time month multiplicator */
+#define DATETIME_MONTH_MULTIPLICATOR 32
+/** EXI Date-Time offset for timzone minutes */
+#define DATETIME_TIMEZONE_OFFSET_IN_MINUTES 896
+
+/** Maximum integer value for uint */
+#define UINT_MAX_VALUE 65535
+
+/** EXI stream - Option Byte Array */
+#define BYTE_ARRAY 1
+/** EXI stream - Option File */
+#define FILE_STREAM 2
+#define EXI_STREAM BYTE_ARRAY
+/** \brief EXI stream
+ *
+ * Byte array or file
+ * */
+/* #define EXI_STREAM FILE_STREAM */
+
+/** Maximum number of cascading elements, XML tree depth */
+#define EXI_ELEMENT_STACK_SIZE 24
+
+/** EXI Float exponent special values */
+#define FLOAT_EXPONENT_SPECIAL_VALUES -16384
+/** EXI Float mantissa infinity */
+#define FLOAT_MANTISSA_INFINITY 1
+/** EXI Float minus mantissa infinity */
+#define FLOAT_MANTISSA_MINUS_INFINITY -1
+/** EXI Float not a number */
+#define FLOAT_MANTISSA_NOT_A_NUMBER 0
+
+/** \brief EXI Events */
+typedef enum {
+ /** Start Document SD */
+ EXI_EVENT_START_DOCUMENT,
+ /** End Document ED */
+ EXI_EVENT_END_DOCUMENT,
+ /** Start Element SE(qname) */
+ EXI_EVENT_START_ELEMENT,
+ /** Start Element SE(uri:*) */
+ EXI_EVENT_START_ELEMENT_NS,
+ /** Start Element SE(*) generic */
+ EXI_EVENT_START_ELEMENT_GENERIC,
+ /** Start Element SE(*) generic undeclared */
+ EXI_EVENT_START_ELEMENT_GENERIC_UNDECLARED,
+ /** End Element EE */
+ EXI_EVENT_END_ELEMENT,
+ /** End Element EE undeclared*/
+ EXI_EVENT_END_ELEMENT_UNDECLARED,
+ /** Characters CH */
+ EXI_EVENT_CHARACTERS,
+ /** Characters CH generic */
+ EXI_EVENT_CHARACTERS_GENERIC,
+ /** Characters CH generic undeclared */
+ EXI_EVENT_CHARACTERS_GENERIC_UNDECLARED,
+ /** Attribute AT(xsi:type) */
+ EXI_EVENT_ATTRIBUTE_XSI_TYPE,
+ /** Attribute AT(xsi:nil) */
+ EXI_EVENT_ATTRIBUTE_XSI_NIL,
+ /** Attribute AT(qname) */
+ EXI_EVENT_ATTRIBUTE,
+ /** Attribute AT(uri:*) */
+ EXI_EVENT_ATTRIBUTE_NS,
+ /** Attribute AT(*) generic */
+ EXI_EVENT_ATTRIBUTE_GENERIC,
+ /** Attribute AT(*) invalid value */
+ EXI_EVENT_ATTRIBUTE_INVALID_VALUE,
+ /** Attribute AT(*) any invalid value */
+ EXI_EVENT_ATTRIBUTE_ANY_INVALID_VALUE,
+ /** Attribute AT(*) generic undeclared */
+ EXI_EVENT_ATTRIBUTE_GENERIC_UNDECLARED,
+ /* error state */
+ EXI_EVENT_ERROR
+} exi_event_t;
+
+
+/**
+ * \brief Bit stream container
+ *
+ * Structure for byteArray/file stream.
+ */
+typedef struct {
+#if EXI_STREAM == BYTE_ARRAY
+ /** byte array size */
+ uint32_t size;
+ /** byte array data */
+ uint8_t* data;
+ /** byte array next position in array */
+ uint32_t* pos;
+#endif
+#if EXI_STREAM == FILE_STREAM
+ /** file pointer */
+ FILE *file;
+#endif
+ /** Current byte buffer*/
+ uint8_t buffer;
+ /** Remaining bit capacity in current byte buffer*/
+ uint8_t capacity;
+} bitstream_t;
+
+
+/** \brief EXI Value Datatypes */
+typedef enum {
+ /** Binary Base64 */
+ EXI_DATATYPE_BINARY_BASE64,
+ /** Binary Hex */
+ EXI_DATATYPE_BINARY_HEX,
+ /** Boolean */
+ EXI_DATATYPE_BOOLEAN,
+ /** Boolean with Facets */
+ EXI_DATATYPE_BOOLEAN_FACET,
+ /** Decimal */
+ EXI_DATATYPE_DECIMAL,
+ /** Float & Double */
+ EXI_DATATYPE_FLOAT,
+ /** N-Bit Unsigned Integer */
+ EXI_DATATYPE_NBIT_UNSIGNED_INTEGER,
+ /** Unsigned Integer */
+ EXI_DATATYPE_UNSIGNED_INTEGER,
+ /** (Signed) Integer */
+ EXI_DATATYPE_INTEGER,
+ /** Datetime */
+ EXI_DATATYPE_DATETIME,
+ /** String */
+ EXI_DATATYPE_STRING,
+ /** Restricted Character Set String */
+ EXI_DATATYPE_RCS_STRING,
+ /** Enumeration */
+ EXI_DATATYPE_ENUMERATION,
+ /** List */
+ EXI_DATATYPE_LIST,
+ /** QName (e.g. xsi:type) */
+ EXI_DATATYPE_QNAME
+} exi_datatype_t;
+
+
+/** \brief EXI Integer Value types */
+typedef enum {
+ /** Unsigned Integer 8 bits */
+ EXI_UNSIGNED_INTEGER_8,
+ /** Unsigned Integer 16 bits */
+ EXI_UNSIGNED_INTEGER_16,
+ /** Unsigned Integer 32 bits */
+ EXI_UNSIGNED_INTEGER_32,
+ /** Unsigned Integer 64 bits */
+ EXI_UNSIGNED_INTEGER_64,
+ /** (Signed) Integer 8 bits */
+ EXI_INTEGER_8,
+ /** (Signed) Integer 16 bits */
+ EXI_INTEGER_16,
+ /** (Signed) Integer 32 bits */
+ EXI_INTEGER_32,
+ /** (Signed) Integer 64 bits */
+ EXI_INTEGER_64
+} exi_integer_type_t;
+
+
+/** \brief EXI Datetime types */
+typedef enum {
+ /** gYear */
+ EXI_DATETIME_GYEAR,
+ /** gYearMonth */
+ EXI_DATETIME_GYEARMONTH,
+ /** date */
+ EXI_DATETIME_DATE,
+ /** datetime */
+ EXI_DATETIME_DATETIME,
+ /** gMonth */
+ EXI_DATETIME_GMONTH,
+ /** gMonthDay */
+ EXI_DATETIME_GMONTHDAY,
+ /** gDay */
+ EXI_DATETIME_GDAY,
+ /** time */
+ EXI_DATETIME_TIME
+} exi_datetime_type_t;
+
+
+/** \brief String value type */
+typedef enum {
+ /** value miss */
+ EXI_STRING_VALUE_MISS,
+ /** value local-hit */
+ EXI_STRING_VALUE_LOCAL_HIT,
+ /** value global-hit */
+ EXI_STRING_VALUE_GLOBAL_HIT
+} exi_string_value_type_t;
+
+
+/** \brief Universal Character Set (UCS) strings */
+typedef struct {
+ /** UCS size */
+ uint16_t size;
+ /** UCS character container */
+ uint32_t* codepoints;
+ /** UCS current length == number of code-points, (len <= size) */
+ uint16_t len;
+} exi_string_ucs_t;
+
+
+/** \brief String value */
+typedef struct {
+ /** value type (e.g., miss, local-hit, global-hit) */
+ exi_string_value_type_t type;
+ /** miss entry */
+ exi_string_ucs_t miss;
+ /** (local) hit entry */
+ uint32_t localID;
+ /** (global) hit entry */
+ uint32_t globalID;
+} exi_string_value_t;
+
+
+/** \brief Restricted Characeter Set */
+typedef struct {
+ /** size */
+ uint16_t size;
+ /** rcs codepoints */
+ uint32_t* codepoints;
+ /** character coding length (less than 256 characters) */
+ uint8_t codingLength;
+} exi_rcs_t;
+
+
+/** \brief Byte value container */
+typedef struct {
+ /** bytes array size */
+ uint16_t size;
+ /** bytes array data container */
+ uint8_t* data;
+ /** bytes array length (len <= size) */
+ uint16_t len;
+} exi_bytes_t;
+
+
+/** \brief Integer value container */
+typedef struct {
+ /** type */
+ exi_integer_type_t type;
+ union {
+ /* (signed) values */
+ /** (signed) int 8 bits */
+ int8_t int8;
+ /** (signed) int 16 bits */
+ int16_t int16;
+ /** (signed) int 32 bits */
+ int32_t int32;
+ /** (signed) int 64 bits */
+ int64_t int64;
+ /* unsigned values */
+ /** unsigned int 8 bits */
+ uint8_t uint8;
+ /** unsigned int 16 bits */
+ uint16_t uint16;
+ /** unsigned int 32 bits */
+ uint32_t uint32;
+ /** unsigned int 64 bits */
+ uint64_t uint64;
+ } val;
+} exi_integer_t;
+
+
+/** \brief Float value container */
+typedef struct {
+ /** range of the mantissa is -(2^63) to 2^63-1 */
+ int64_t mantissa;
+ /** range of the exponent is - (2^14-1) to 2^14-1 */
+ int16_t exponent; /* base-10 */
+} exi_float_me_t;
+
+
+/** \brief Decimal value container */
+typedef struct {
+ /** a sign value */
+ int negative;
+ /** represents the integral portion of the Decimal */
+ exi_integer_t integral;
+ /** represents the fractional portion of the Decimal with the digits in reverse order to preserve leading zeros */
+ exi_integer_t reverseFraction;
+} exi_decimal_t;
+
+
+/** \brief Datetime value container */
+typedef struct {
+ /** datetime type */
+ exi_datetime_type_t type;
+ /** Datetime value for year */
+ int32_t year;
+ /** Datetime value for monthDay */
+ uint32_t monthDay;
+ /** Datetime value for time */
+ uint32_t time;
+ /** Datetime value for presenceFractionalSecs */
+ int presenceFractionalSecs;
+ /** Datetime value for fractionalSecs */
+ uint32_t fractionalSecs;
+ /** Datetime value for presenceTimezone */
+ int presenceTimezone;
+ /** Datetime value for timezone */
+ uint32_t timezone;
+} exi_datetime_t;
+
+
+/** \brief List value container */
+typedef struct {
+ /** list item type */
+ exi_datatype_t type;
+ /** number of items */
+ uint16_t len;
+ /* Special datatype: integer */
+ /* exi_integer_type_t intType;*/
+ /** Special datatype: datetime */
+ exi_datetime_type_t datetimeType;
+} exi_list_t;
+
+
+/** \brief Efficient qname */
+typedef struct {
+ /** namespace URI ID*/
+ uint16_t namespaceURI;
+ /** local name ID*/
+ uint16_t localPart;
+} exi_eqname_t;
+
+
+/** \brief Name entry type */
+typedef enum {
+ /** As known IDs */
+ EXI_NAME_ENTRY_TYPE_ID,
+ /** As String */
+ EXI_NAME_ENTRY_TYPE_STRING_AND_ID
+} exi_name_entry_type_t;
+
+
+/** \brief Name entry */
+typedef struct {
+ /** type */
+ exi_name_entry_type_t type;
+ /** entry ID */
+ uint16_t id;
+ /** entry string */
+ exi_string_ucs_t str;
+} exi_name_entry_t;
+
+
+/** \brief Qualified name */
+typedef struct {
+ /** Uri */
+ exi_name_entry_t uri;
+ /** LocalName */
+ exi_name_entry_t localName;
+} exi_qname_t;
+
+
+/*TODO Doxygen Documentation */
+
+/* ==================================== */
+/* URI and LocalName Entries */
+typedef struct exiNameTablePrepopulated {
+ /* number of namespaces AND length name-partitions array */
+ uint16_t len;
+ /* number of localName entries divided by URI */
+ uint16_t * localNames;
+} exi_name_table_prepopulated_t;
+
+#define EXI_MAXIMUM_NUMBER_OF_NAME_PARTITION_ENTRIES 25
+
+typedef enum {
+ EXI_NAME_PARTITION_URI, EXI_NAME_PARTITION_LOCALNAME
+} exi_name_partition_type_t;
+
+typedef struct {
+ char* uri;
+ uint16_t uriID;
+} exi_uri_partition_t;
+
+typedef struct {
+ char* localName;
+ uint16_t localNameID;
+ uint16_t uriID;
+} exi_localname_partition_t;
+
+typedef struct {
+ exi_name_partition_type_t namePartitionType;
+ struct {
+ exi_uri_partition_t uriPartition;
+ exi_localname_partition_t localNamePartition;
+ } entry;
+} exi_name_partition_t;
+
+typedef struct exiNameTableRuntime {
+ /* maximum number of characters in the name partitions entries PLUS null terminators */
+ /* char characters[EXI_MAXIMUM_NUMBER_OF_NAME_PARTITION_CHARACTERS + EXI_MAXIMUM_NUMBER_OF_NAME_PARTITION_ENTRIES]; */
+ /* uint16_t numberOfUsedCharacters; *//* initially zero <= EXI_MAXIMUM_NUMBER_OF_NAME_PARTITION_CHARACTERS */
+ /* maximum number of name partitions entries. Name partitions entries consist in all uri, and local-name partition entries */
+ exi_name_partition_t
+ namePartitionsEntries[EXI_MAXIMUM_NUMBER_OF_NAME_PARTITION_ENTRIES];
+ /* uint16_t numberOfUsedNamePartitions; *//* initially zero */
+ /* added entries */
+ uint16_t addedUriEntries; /* initially zero */
+ uint16_t addedLocalNameEntries; /* initially zero */
+} exi_name_table_runtime_t;
+
+
+/* StartTagContent grammar initially empty */
+/* ElementContent grammar has EE per default */
+typedef struct {
+ uint16_t qnameID;
+ uint16_t numberOfProductions;
+ int hasXsiType; /* StartTagContent only */
+ int hasEE; /* ElementContentper default TRUE */
+} exi_runtime_element_t;
+
+/* Note: We do have twice as many runtime grammars (StartTagContent and ElementContent)*/
+#define MAX_NUMBER_OF_RUNTIME_ELEMENTS 30
+
+typedef struct {
+ /** number of global strings */
+ uint16_t numberOfGlobalStrings;
+ /** size of local-names container */
+ uint16_t sizeLocalStrings;
+ /** number of local strings container */
+ uint16_t* numberOfLocalStrings;
+} exi_string_table_t;
+
+typedef struct {
+ /** stack of grammar states */
+ int16_t grammarStack[EXI_ELEMENT_STACK_SIZE];
+ /** stack of grammar elements / qnameIDs */
+ uint16_t elementStack[EXI_ELEMENT_STACK_SIZE];
+ /** stack index for both stacks */
+ uint16_t stackIndex;
+
+ /** event-code */
+ uint32_t eventCode;
+
+ /** name table entries, pre-populated */
+ exi_name_table_prepopulated_t nameTablePrepopulated;
+ /** name table entries, at runtime */
+ exi_name_table_runtime_t nameTableRuntime;
+
+ /** next qname ID */
+ uint16_t nextQNameID;
+
+ /** string table entries */
+ exi_string_table_t stringTable;
+
+ /** runtime built-in element grammars - numbers */
+ uint16_t numberOfRuntimeGrammars;
+ /** runtime built-in element grammars */
+ exi_runtime_element_t runtimeGrammars[MAX_NUMBER_OF_RUNTIME_ELEMENTS * 2];
+} exi_state_t;
+
+typedef struct {
+ /* type of value */
+ exi_datatype_t type;
+
+ /* base types */
+ int boolean;
+ uint32_t enumeration;
+
+ /* complex types: Integers, Bytes, Strings and Lists are not native types anymore */
+ exi_integer_t integer;
+ exi_bytes_t binary;
+ exi_string_value_t str;
+ exi_float_me_t float_me;
+ exi_decimal_t decimal;
+ exi_datetime_t datetime;
+ exi_list_t list;
+ exi_eqname_t eqname;
+} exi_value_t;
+
+
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/src/codec/EncoderChannel.h b/src/codec/EncoderChannel.h
new file mode 100644
index 0000000..0678a59
--- /dev/null
+++ b/src/codec/EncoderChannel.h
@@ -0,0 +1,320 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXIdizer.com
+ ********************************************************************/
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "EXITypes.h"
+
+/**
+ * \file EncoderChannel.h
+ * \brief EXI Encoder Channel
+ *
+ */
+
+#ifndef ENCODER_CHANNEL_H
+#define ENCODER_CHANNEL_H
+
+/**
+ * \brief Encode byte value
+ *
+ * \param stream Output Stream
+ * \param b byte
+ * \return Error-Code <> 0
+ *
+ */
+int encode(bitstream_t* stream, uint8_t b);
+
+
+/**
+ * \brief Encode a single boolean value
+ *
+ * A false value is encoded as 0 and true value is encode as 1.
+ *
+ * \param stream Output Stream
+ * \param b boolean
+ * \return Error-Code <> 0
+ *
+ */
+int encodeBoolean(bitstream_t* stream, int b);
+
+
+/**
+ * \brief Encode n-bit unsigned integer
+ *
+ * The n least significant bits of parameter b starting with the
+ * most significant, i.e. from left to right.
+ *
+ * \param stream Output Stream
+ * \param nbits number of bits
+ * \param val value
+ * \return Error-Code <> 0
+ *
+ */
+int encodeNBitUnsignedInteger(bitstream_t* stream, uint16_t nbits, uint32_t val);
+
+
+/**
+ * \brief Encode unsigned integer
+ *
+ * Encode an arbitrary precision non negative integer using
+ * a sequence of octets. The most significant bit of the last
+ * octet is set to zero to indicate sequence termination.
+ * Only seven bits per octet are used to store the integer's value.
+ *
+ * \param stream Output Stream
+ * \param iv Unsigned integer value
+ * \return Error-Code <> 0
+ *
+ */
+int encodeUnsignedInteger(bitstream_t* stream, exi_integer_t* iv);
+
+
+/**
+ * \brief Encode unsigned integer
+ *
+ * Encode an arbitrary precision non negative integer using
+ * a sequence of octets. The most significant bit of the last
+ * octet is set to zero to indicate sequence termination.
+ * Only seven bits per octet are used to store the integer's value.
+ *
+ * \param stream Output Stream
+ * \param n Unsigned integer value 32 bits
+ * \return Error-Code <> 0
+ *
+ */
+int encodeUnsignedInteger32(bitstream_t* stream, uint32_t n);
+
+
+/**
+ * \brief Encode unsigned integer
+ *
+ * Encode an arbitrary precision non negative integer using
+ * a sequence of octets. The most significant bit of the last
+ * octet is set to zero to indicate sequence termination.
+ * Only seven bits per octet are used to store the integer's value.
+ *
+ * \param stream Output Stream
+ * \param n Unsigned integer value 64 bits
+ * \return Error-Code <> 0
+ *
+ */
+int encodeUnsignedInteger64(bitstream_t* stream, uint64_t n);
+
+
+/**
+ * \brief Encode integer
+ *
+ * Encode an arbitrary precision integer using a sign boolean
+ * followed by a sequence of octets. The most significant bit
+ * of the last octet is set to zero to indicate sequence termination.
+ * Only seven bits per octet are used to store the integer's value.
+ *
+ * \param stream Output Stream
+ * \param iv Integer value
+ * \return Error-Code <> 0
+ *
+ */
+int encodeInteger(bitstream_t* stream, exi_integer_t* iv);
+
+
+/**
+ * \brief Encode integer
+ *
+ * Encode an arbitrary precision integer using a sign boolean
+ * followed by a sequence of octets. The most significant bit
+ * of the last octet is set to zero to indicate sequence termination.
+ * Only seven bits per octet are used to store the integer's value.
+ *
+ * \param stream Output Stream
+ * \param n Integer value 32 bits
+ * \return Error-Code <> 0
+ *
+ */
+int encodeInteger32(bitstream_t* stream, int32_t n);
+
+
+/**
+ * \brief Encode integer
+ *
+ * Encode an arbitrary precision integer using a sign boolean
+ * followed by a sequence of octets. The most significant bit
+ * of the last octet is set to zero to indicate sequence termination.
+ * Only seven bits per octet are used to store the integer's value.
+ *
+ * \param stream Output Stream
+ * \param n Integer value 64 bits
+ * \return Error-Code <> 0
+ *
+ */
+int encodeInteger64(bitstream_t* stream, int64_t n);
+
+
+/**
+ * \brief Encode float
+ *
+ * Encode a Float datatype as two consecutive Integers. The first
+ * Integer represents the mantissa of the floating point number
+ * and the second Integer represents the base-10 exponent of the
+ * floating point number.
+ *
+ * \param stream Output Stream
+ * \param f Float value
+ * \return Error-Code <> 0
+ *
+ */
+int encodeFloat(bitstream_t* stream, exi_float_me_t* f);
+
+
+/**
+ * \brief Encode decimal
+ *
+ * Encode a decimal represented as a Boolean sign followed by two
+ * Unsigned Integers. A sign value of zero (0) is used to represent
+ * positive Decimal values and a sign value of one (1) is used to
+ * represent negative Decimal values The first Integer represents
+ * the integral portion of the Decimal value. The second positive
+ * integer represents the fractional portion of the decimal with
+ * the digits in reverse order to preserve leading zeros.
+ *
+ * \param stream Output Stream
+ * \param d Decimal value
+ * \return Error-Code <> 0
+ *
+ */
+int encodeDecimal(bitstream_t* stream, exi_decimal_t* d);
+
+
+/**
+ * \brief Encode string
+ *
+ * Encode a length prefixed sequence of characters.
+ *
+ * \param stream Output Stream
+ * \param string String
+ * \return Error-Code <> 0
+ *
+ */
+int encodeString(bitstream_t* stream, exi_string_ucs_t* string);
+
+
+/**
+ * \brief Encode string value
+ *
+ * Encode a length prefixed sequence of characters
+ * in the sense of string tables
+ *
+ * \param stream Output Stream
+ * \param state Codec state
+ * \param qnameID Qualified Name ID
+ * \param string String value
+ * \return Error-Code <> 0
+ *
+ */
+int encodeStringValue(bitstream_t* stream, exi_state_t* state, uint16_t qnameID,
+ exi_string_value_t* string);
+
+
+/**
+ * \brief Encode restricted character set value
+ *
+ * Encode a length prefixed sequence of characters
+ * in the sense of string tables
+ *
+ * \param stream Output Stream
+ * \param state Codec state
+ * \param qnameID Qualified Name ID
+ * \param rcs Restricted character set
+ * \param string String value
+ * \return Error-Code <> 0
+ *
+ */
+int encodeRCSStringValue(bitstream_t* stream, exi_state_t* state,
+ uint16_t qnameID, exi_rcs_t* rcs, exi_string_value_t* string);
+
+
+/**
+ * \brief Encode characters
+ *
+ * Encode a sequence of characters according to a given length.
+ * Each character is represented by its UCS [ISO/IEC 10646]
+ * code point encoded as an Unsigned Integer.
+ *
+ * \param stream Output Stream
+ * \param chars Characters
+ * \param len Numbr of characters
+ * \return Error-Code <> 0
+ *
+ */
+int encodeUCSCharacters(bitstream_t* stream, uint32_t* chars, uint16_t len);
+
+
+/**
+ * \brief Encode binary
+ *
+ * Encode a binary value as a length-prefixed sequence of octets.
+ *
+ * \param stream Output Stream
+ * \param bytes Byte values
+ * \return Error-Code <> 0
+ *
+ */
+int encodeBinary(bitstream_t* stream, exi_bytes_t* bytes);
+
+
+/**
+ * \brief Encode datetime
+ *
+ * Encode a datetime representation which is a sequence of values
+ * representing the individual components of the Date-Time.
+ *
+ * \param stream Output Stream
+ * \param datetime Datetime values
+ * \return Error-Code <> 0
+ *
+ */
+int encodeDateTime(bitstream_t* stream, exi_datetime_t* datetime);
+
+
+/**
+ * \brief Flush underlying bit output stream
+ *
+ * \param stream Output Stream
+ * \return Error-Code <> 0
+ *
+ */
+int encodeFinish(bitstream_t* stream);
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/codec/ErrorCodes.h b/src/codec/ErrorCodes.h
new file mode 100644
index 0000000..4a0b5e9
--- /dev/null
+++ b/src/codec/ErrorCodes.h
@@ -0,0 +1,108 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXIdizer.com
+ ********************************************************************/
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \file ErrorCodes.h
+ * \brief Error Codes descriptions
+ *
+ */
+
+#ifndef EXI_ERROR_CODES_H
+#define EXI_ERROR_CODES_H
+
+
+#define EXI_ERROR_INPUT_STREAM_EOF -10
+#define EXI_ERROR_OUTPUT_STREAM_EOF -11
+#define EXI_ERROR_INPUT_FILE_HANDLE -12
+#define EXI_ERROR_OUTPUT_FILE -13
+
+#define EXI_ERROR_OUT_OF_BOUNDS -100
+#define EXI_ERROR_OUT_OF_STRING_BUFFER -101
+#define EXI_ERROR_OUT_OF_ASCII_BUFFER -102
+#define EXI_ERROR_OUT_OF_BYTE_BUFFER -103
+#define EXI_ERROR_OUT_OF_GRAMMAR_STACK -104
+#define EXI_ERROR_OUT_OF_RUNTIME_GRAMMAR_STACK -105
+#define EXI_ERROR_OUT_OF_QNAMES -106
+
+#define EXI_ERROR_UNKOWN_EVENT -109
+#define EXI_ERROR_UNKOWN_EVENT_CODE -110
+#define EXI_ERROR_UNEXPECTED_EVENT_LEVEL1 -111
+#define EXI_ERROR_UNEXPECTED_EVENT_LEVEL2 -112
+
+#define EXI_ERROR_UNEXPECTED_START_DOCUMENT -113
+#define EXI_ERROR_UNEXPECTED_END_DOCUMENT -114
+#define EXI_ERROR_UNEXPECTED_START_ELEMENT -115
+#define EXI_ERROR_UNEXPECTED_START_ELEMENT_NS -116
+#define EXI_ERROR_UNEXPECTED_START_ELEMENT_GENERIC -117
+#define EXI_ERROR_UNEXPECTED_START_ELEMENT_GENERIC_UNDECLARED -118
+#define EXI_ERROR_UNEXPECTED_END_ELEMENT -119
+#define EXI_ERROR_UNEXPECTED_CHARACTERS -120
+#define EXI_ERROR_UNEXPECTED_ATTRIBUTE -121
+#define EXI_ERROR_UNEXPECTED_ATTRIBUTE_NS -122
+#define EXI_ERROR_UNEXPECTED_ATTRIBUTE_GENERIC -123
+#define EXI_ERROR_UNEXPECTED_ATTRIBUTE_GENERIC_UNDECLARED -124
+#define EXI_ERROR_UNEXPECTED_ATTRIBUTE_XSI_TYPE -125
+#define EXI_ERROR_UNEXPECTED_ATTRIBUTE_XSI_NIL -126
+#define EXI_ERROR_UNEXPECTED_GRAMMAR_ID -127
+#define EXI_ERROR_UNEXPECTED_ATTRIBUTE_MOVE_TO_CONTENT_RULE -128
+
+#define EXI_UNSUPPORTED_NBIT_INTEGER_LENGTH -132
+#define EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS -133
+#define EXI_UNSUPPORTED_INTEGER_VALUE -134
+#define EXI_NEGATIVE_UNSIGNED_INTEGER_VALUE -135
+#define EXI_UNSUPPORTED_LIST_VALUE_TYPE -136
+#define EXI_UNSUPPORTED_HEADER_COOKIE -137
+#define EXI_UNSUPPORTED_HEADER_OPTIONS -138
+
+#define EXI_UNSUPPORTED_GLOBAL_ATTRIBUTE_VALUE_TYPE -139
+#define EXI_UNSUPPORTED_STRING_VALUE_TYPE -140
+#define EXI_UNSUPPORTED_INTEGER_VALUE_TYPE -141
+#define EXI_UNSUPPORTED_DATETIME_TYPE -142
+
+#define EXI_UNSUPPORTED_GRAMMAR_LEARNING_CH -150
+
+#define EXI_ERROR_UNEXPECTED_BYTE_VALUE -200
+
+
+#define EXI_ERROR_CONVERSION_NO_ASCII_CHARACTERS -300
+#define EXI_ERROR_CONVERSION_TYPE_TO_STRING -301
+
+
+#define EXI_DEVIANT_SUPPORT_NOT_DEPLOYED -500
+
+
+#endif /* EXI_ERROR_CODES_H */
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/src/codec/MethodsBag.c b/src/codec/MethodsBag.c
new file mode 100644
index 0000000..0cbe484
--- /dev/null
+++ b/src/codec/MethodsBag.c
@@ -0,0 +1,133 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXIdizer.com
+ ********************************************************************/
+
+
+
+#ifndef METHODS_BAG_C
+#define METHODS_BAG_C
+
+#include "MethodsBag.h"
+#include "ErrorCodes.h"
+
+static const uint16_t smallLengths[] = { 0, 0, 1, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4,
+ 4, 4, 4 };
+
+int exiGetCodingLength(uint32_t characteristics, uint16_t* codingLength) {
+ /* Note: we could use range expressions in switch statements but those are non-standard */
+ /* e.g., case 1 ... 5: */
+
+ if (characteristics < 17) {
+ *codingLength = smallLengths[characteristics];
+ return 0;
+ } else if (characteristics < 33) {
+ /* 17 .. 32 */
+ *codingLength = 5;
+ return 0;
+ } else if (characteristics < 65) {
+ /* 33 .. 64 */
+ *codingLength = 6;
+ return 0;
+ } else if (characteristics < 129) {
+ /* 65 .. 128 */
+ *codingLength = 7;
+ return 0;
+ } else if (characteristics < 257) {
+ /* 129 .. 256 */
+ *codingLength = 8;
+ return 0;
+ } else if (characteristics < 513) {
+ /* 257 .. 512 */
+ *codingLength = 9;
+ return 0;
+ } else if (characteristics < 1025) {
+ /* 513 .. 1024 */
+ *codingLength = 10;
+ return 0;
+ } else if (characteristics < 2049) {
+ /* 1025 .. 2048 */
+ *codingLength = 11;
+ return 0;
+ } else if (characteristics < 4097) {
+ /* 2049 .. 4096 */
+ *codingLength = 12;
+ return 0;
+ } else if (characteristics < 8193) {
+ /* 4097 .. 8192 */
+ *codingLength = 13;
+ return 0;
+ } else if (characteristics < 16385) {
+ /* 8193 .. 16384 */
+ *codingLength = 14;
+ return 0;
+ } else if (characteristics < 32769) {
+ /* 16385 .. 32768 */
+ *codingLength = 15;
+ return 0;
+ } else if (characteristics < 65537) {
+ /* 32769 .. 65536 */
+ *codingLength = 16;
+ return 0;
+ } else {
+ /*
+ return (int) Math.ceil(Math.log((double) (characteristics))
+ / Math.log(2.0)); */
+ return EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
+ }
+
+}
+
+
+uint8_t numberOf7BitBlocksToRepresent(uint32_t n) {
+ /* assert (n >= 0); */
+
+ /* 7 bits */
+ if (n < 128) {
+ return 1;
+ }
+ /* 14 bits */
+ else if (n < 16384) {
+ return 2;
+ }
+ /* 21 bits */
+ else if (n < 2097152) {
+ return 3;
+ }
+ /* 28 bits */
+ else if (n < 268435456) {
+ return 4;
+ }
+ /* 35 bits */
+ else {
+ /* int, 32 bits */
+ return 5;
+ }
+}
+
+
+
+#endif
+
diff --git a/src/codec/MethodsBag.h b/src/codec/MethodsBag.h
new file mode 100644
index 0000000..76a89aa
--- /dev/null
+++ b/src/codec/MethodsBag.h
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXIdizer.com
+ ********************************************************************/
+
+
+
+#ifndef METHODS_BAG_H
+#define METHODS_BAG_H
+
+/**
+* \file MethodsBag.h
+* \brief Method bag for bit and octet functions
+*
+*/
+
+
+#include
+#include
+#include
+#include
+
+
+/**
+ * \brief Returns the number of bits to identify the characteristics.
+ *
+ * \param characteristics number of characteristics
+ * \param codingLength number of bits
+ * \return Error-Code <> 0
+ *
+ */
+int exiGetCodingLength(uint32_t characteristics, uint16_t* codingLength);
+
+
+/**
+ * \brief Returns the least number of 7 bit-blocks that is needed to represent the passed integer value
+ *
+ * Note: Returns 1 if passed parameter is 0.
+ *
+ * \param n integer value
+ * \return Error-Code <> 0
+ *
+ */
+uint8_t numberOf7BitBlocksToRepresent(uint32_t n);
+
+
+#endif
+
diff --git a/src/codec/NameTableEntries.c b/src/codec/NameTableEntries.c
new file mode 100644
index 0000000..c3a331b
--- /dev/null
+++ b/src/codec/NameTableEntries.c
@@ -0,0 +1,200 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
********************************************************************/
-#ifndef EXI_appHand_NAME_TABLE_ENTRIES_C
-#define EXI_appHand_NAME_TABLE_ENTRIES_C
-
-#include "appHand_NameTableEntries.h"
-
+#ifndef EXI__NAME_TABLE_ENTRIES_H
+#define EXI__NAME_TABLE_ENTRIES_H
+#include "EXITypes.h"
/* ==================================== */
/* String Table Population */
-
-#if EXI_DEBUG == EXI_DEBUG_OFF
-static struct exiNamePartition localNamePartitions[5] = {
- { 7 },
- { 4 },
- { 2 },
- { 46 },
- { 8 }
-};
-#endif /*EXI_DEBUG*/
-
-
-#if EXI_DEBUG == EXI_DEBUG_OFF
-exi_name_table_prepopulated_t exiappHandNameTablePrepopulated = { 5, localNamePartitions };
-#endif /*EXI_DEBUG*/
-
-
-
+extern exi_name_table_prepopulated_t exiNameTablePrepopulated;
#endif
diff --git a/src/codec/QNameDefines.h b/src/codec/QNameDefines.h
new file mode 100644
index 0000000..543dc19
--- /dev/null
+++ b/src/codec/QNameDefines.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXIdizer.com
+ ********************************************************************/
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef EXI__QNAME_DEFINES_H
+#define EXI__QNAME_DEFINES_H
+
+/** Number of pre-populated qnames */
+#define EXI_NUMBER_OF_PREPOPULATED_QNAMES 446
+
+/** Number of runtime qnames */
+#define EXI_MAX_NUMBER_OF_SUPPORTED_RUNTIMES_QNAMES 100
+
+/** Number of overall qnames (pre-populated from schema and runtime qnames) */
+#define EXI_MAX_NUMBER_OF_QNAMES (EXI_NUMBER_OF_PREPOPULATED_QNAMES + EXI_MAX_NUMBER_OF_SUPPORTED_RUNTIMES_QNAMES)
+
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/src/codec/QNames.c b/src/codec/QNames.c
new file mode 100644
index 0000000..7f369f2
--- /dev/null
+++ b/src/codec/QNames.c
@@ -0,0 +1,981 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
+ ********************************************************************/
+
+
+
+#ifndef EXI__QNAMES_H
+#define EXI__QNAMES_H
+
+#include "EXITypes.h"
+
+/**
+ * \brief Returns efficient qname (namespaceURI & localName) IDs for qnameID
+ *
+ * \param state Codec state
+ * \param qnameID Qualified name ID
+ * \param namespaceURI QName namespace URI ID
+ * \param localPart QName local name ID
+ * \return Error-Code <> 0
+ *
+ */
+int exiGetEQName(exi_state_t* state, uint16_t qnameID, uint16_t* namespaceURI, uint16_t* localPart);
+
+
+/**
+ * \brief Returns qnameID for qname namespaceURI & localName
+ *
+ * \param state Codec state
+ * \param namespaceURI QName namespace URI ID
+ * \param localPart QName local name ID
+ * \param qnameID QName ID (out)
+ * \return Error-Code <> 0
+ *
+ */
+int exiGetQNameID(exi_state_t* state, uint16_t namespaceURI, uint16_t localPart, uint16_t* qnameID);
+
+
+/**
+ * \brief Add efficient qname (namespaceURI & localName) IDs for qnameID
+ *
+ * \param state Codec state
+ * \param qnameID Qualified name ID
+ * \param namespaceURI QName namespace URI ID
+ * \param localPart QName local name ID
+ * \return Error-Code <> 0
+ *
+ */
+int exiAddEQName(exi_state_t* state, uint16_t* qnameID, uint16_t namespaceURI, uint16_t localPart);
+
+#endif
+
diff --git a/src/codec/StringTable.c b/src/codec/StringTable.c
new file mode 100644
index 0000000..ccac33b
--- /dev/null
+++ b/src/codec/StringTable.c
@@ -0,0 +1,144 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXIdizer.com
+ ********************************************************************/
+
+
+
+#ifndef STRING_TABLE_C
+#define STRING_TABLE_C
+
+#include
+
+#include "StringTable.h"
+#include "NameTableEntries.h"
+#include "ErrorCodes.h"
+
+
+#ifndef __GNUC__
+#pragma warning( disable : 4100 ) /* warning unreferenced parameter 'runtimeTable' */
+#endif /* __GNUC__ */
+int exiGetUriSize(exi_name_table_prepopulated_t* prepopulatedTable, exi_name_table_runtime_t* runtimeTable, uint16_t* uriLength) {
+ *uriLength = prepopulatedTable->len;
+ return 0;
+}
+#ifndef __GNUC__
+#pragma warning( default : 4100 ) /* warning unreferenced parameter 'runtimeTable' */
+#endif /* __GNUC__ */
+
+
+int exiGetLocalNameSize(exi_name_table_prepopulated_t* prepopulatedTable, exi_name_table_runtime_t* runtimeTable,
+ uint16_t uriID, uint16_t* localNameLength) {
+ *localNameLength = 0;
+ /* 1. pre-populated entries*/
+ if (uriID < prepopulatedTable->len) {
+ (*localNameLength) += prepopulatedTable->localNames[uriID];
+ } else {
+ /* range check */
+ if (uriID >= ( prepopulatedTable->len + runtimeTable->addedUriEntries )) {
+ return EXI_ERROR_OUT_OF_BOUNDS;
+ }
+ }
+ /* 2. runtime entries */
+ if (runtimeTable->addedLocalNameEntries > 0 ) {
+ int i;
+ for(i=0; i<(runtimeTable->addedUriEntries+runtimeTable->addedLocalNameEntries); i++) {
+ if ( runtimeTable->namePartitionsEntries[i].namePartitionType == EXI_NAME_PARTITION_LOCALNAME &&
+ runtimeTable->namePartitionsEntries[i].entry.localNamePartition.uriID == uriID ) {
+ (*localNameLength)++;
+ }
+ }
+ }
+
+ return 0;
+}
+
+
+/* inline */
+/*
+static int _max(int a, int b) {
+ return (a > b) ? a : b;
+}
+*/
+
+int exiInitNameTableRuntime(exi_name_table_runtime_t* runtimeTable) {
+ /*runtimeTable->numberOfUsedCharacters = 0;*/
+ runtimeTable->addedLocalNameEntries = 0;
+ runtimeTable->addedUriEntries = 0;
+ return 0;
+}
+
+int exiAddUri(exi_name_table_prepopulated_t* prepopulatedTable, exi_name_table_runtime_t* runtimeTable) {
+/* , char* uri) { */
+ /*if (runtimeTable->addedUriEntries < EXI_RESERVED_NUMBER_URI_PARTITION_ENTRIES
+ || runtimeTable->addedUriEntries
+ < (EXI_MAXIMUM_NUMBER_OF_NAME_PARTITION_ENTRIES - _max(
+ runtimeTable->addedLocalNameEntries,
+ EXI_RESERVED_NUMBER_LOCALNAME_PARTITION_ENTRIES))) {*/
+
+ uint16_t index = runtimeTable->addedUriEntries + runtimeTable->addedLocalNameEntries;
+ /*int charsIndex = runtimeTable->numberOfUsedCharacters+runtimeTable->addedUriEntries+runtimeTable->addedLocalNameEntries;*/
+ runtimeTable->namePartitionsEntries[index].namePartitionType = EXI_NAME_PARTITION_URI;
+ /* strcpy(runtimeTable->characters+charsIndex, uri); */
+ /*runtimeTable->namePartitionsEntries[index].entry.uriPartition.uri = runtimeTable->characters+charsIndex;*/
+ runtimeTable->namePartitionsEntries[index].entry.uriPartition.uriID = prepopulatedTable->len + runtimeTable->addedUriEntries;
+ runtimeTable->addedUriEntries++;
+ /* runtimeTable->numberOfUsedCharacters += strlen(uri); */
+ return 0;
+ /*} else {
+ return -1;
+ }*/
+}
+
+int exiAddLocalName(exi_name_table_prepopulated_t* prepopulatedTable, exi_name_table_runtime_t* runtimeTable, uint16_t uriID, uint16_t* localNameID) {
+ /* ,char* localName) { */
+ /*if (runtimeTable->addedUriEntries < EXI_RESERVED_NUMBER_LOCALNAME_PARTITION_ENTRIES
+ || runtimeTable->addedLocalNameEntries
+ < (EXI_MAXIMUM_NUMBER_OF_NAME_PARTITION_ENTRIES - _max(
+ runtimeTable->addedUriEntries,
+ EXI_RESERVED_NUMBER_URI_PARTITION_ENTRIES))) {*/
+ uint16_t index = runtimeTable->addedUriEntries + runtimeTable->addedLocalNameEntries;
+ /*int charsIndex = runtimeTable->numberOfUsedCharacters+runtimeTable->addedUriEntries+runtimeTable->addedLocalNameEntries;*/
+ /*uint16_t localNameID;*/
+ int errn = exiGetLocalNameSize(prepopulatedTable, runtimeTable, uriID, localNameID);
+ if (errn < 0) {
+ return errn;
+ }
+
+ runtimeTable->namePartitionsEntries[index].namePartitionType = EXI_NAME_PARTITION_LOCALNAME;
+ /*strcpy(runtimeTable->characters+charsIndex, localName);*/
+ /*runtimeTable->namePartitionsEntries[index].entry.localNamePartition.localName = runtimeTable->characters+charsIndex;*/
+ runtimeTable->namePartitionsEntries[index].entry.localNamePartition.localNameID = *localNameID;
+ runtimeTable->namePartitionsEntries[index].entry.localNamePartition.uriID = uriID;
+ runtimeTable->addedLocalNameEntries++;
+ /*runtimeTable->numberOfUsedCharacters += strlen(localName);*/
+ return errn;
+ /*} else {
+ return -1;
+ }*/
+}
+
+#endif
+
diff --git a/src/codec/StringTable.h b/src/codec/StringTable.h
new file mode 100644
index 0000000..f3d20fb
--- /dev/null
+++ b/src/codec/StringTable.h
@@ -0,0 +1,116 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXIdizer.com
+ ********************************************************************/
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * \file StringTable.h
+ * \brief String table count implementation
+ *
+ */
+
+#ifndef STRING_TABLE_H
+#define STRING_TABLE_H
+
+#include "EXITypes.h"
+
+
+/**
+ * \brief Init name table
+ *
+ * Inits counter et cetera
+ *
+ * \param runtimeTable Runtime Table
+ * \return Error-Code <> 0
+ *
+ */
+int exiInitNameTableRuntime(exi_name_table_runtime_t* runtimeTable);
+
+
+/**
+ * \brief Get Uri Size
+ *
+ * \param prepopulatedTable Pre-Populated Table
+ * \param runtimeTable Runtime Table
+ * \param uriLength Uri Size (out)
+ * \return Error-Code <> 0
+ *
+ */
+int exiGetUriSize(exi_name_table_prepopulated_t* prepopulatedTable,
+ exi_name_table_runtime_t* runtimeTable, uint16_t* uriLength);
+
+
+/**
+ * \brief Get LocalName Size
+ *
+ * \param prepopulatedTable Pre-Populated Table
+ * \param runtimeTable Runtime Table
+ * \param uriID Uri ID for local-name
+ * \param localNameLength Local-Name Size (out)
+ * \return Error-Code <> 0
+ *
+ */
+int exiGetLocalNameSize(exi_name_table_prepopulated_t* prepopulatedTable,
+ exi_name_table_runtime_t* runtimeTable, uint16_t uriID,
+ uint16_t* localNameLength);
+
+
+/**
+ * \brief Add runtime URI entry
+ *
+ * \param prepopulatedTable Pre-Populated Table
+ * \param runtimeTable Runtime Table
+ * \return Error-Code <> 0
+ *
+ */
+int exiAddUri(exi_name_table_prepopulated_t* prepopulatedTable,
+ exi_name_table_runtime_t* runtimeTable);
+
+
+/**
+ * \brief Add runtime local-name entry
+ *
+ * \param prepopulatedTable Pre-Populated Table
+ * \param runtimeTable Runtime Table
+ * \param uriID Uri ID for local-name
+ * \param localNameID LocalName ID (out)
+ * \return Error-Code <> 0
+ *
+ */
+int exiAddLocalName(exi_name_table_prepopulated_t* prepopulatedTable,
+ exi_name_table_runtime_t* runtimeTable, uint16_t uriID, uint16_t* localNameID);
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/codec/UCSString.c b/src/codec/UCSString.c
new file mode 100644
index 0000000..2db8e8d
--- /dev/null
+++ b/src/codec/UCSString.c
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXIdizer.com
+ ********************************************************************/
+
+
+
+#include
+
+#include "DecoderChannel.h"
+#include "BitInputStream.h"
+#include "EXITypes.h"
+#include "ErrorCodes.h"
+
+#ifndef UCS_STRING_C
+#define UCS_STRING_C
+
+int toUCSString(char* chars, exi_string_ucs_t* s) {
+ unsigned int i;
+ s->len = (uint16_t)strlen(chars);
+
+ if (s->len <= s->size) {
+ for(i=0; ilen; i++) {
+ s->codepoints[i] = chars[i];
+ }
+ return 0;
+ } else {
+ return EXI_ERROR_OUT_OF_STRING_BUFFER;
+ }
+}
+
+/* Note A: fails if string contains non ASCII characters */
+/* Note B: causes harm if char array is not sufficiently long */
+int toASCIIString(exi_string_ucs_t* string, char* outASCII) {
+ unsigned int i;
+ for(i=0; ilen; i++) {
+ outASCII[i] = (char)string->codepoints[i];
+ }
+ outASCII[string->len] = '\0';
+
+ return 0;
+}
+
+#endif
+
diff --git a/src/codec/UCSString.h b/src/codec/UCSString.h
new file mode 100644
index 0000000..e884b65
--- /dev/null
+++ b/src/codec/UCSString.h
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXIdizer.com
+ ********************************************************************/
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "EXITypes.h"
+
+/**
+ * \file UCSString.h
+ * \brief UCS String utilities
+ *
+ */
+
+#ifndef UCS_STRING_H
+#define UCS_STRING_H
+
+/**
+ * \brief Converts characters to USC string
+ *
+ * \param chars Characters
+ * \param s UCS String
+ * \return Error-Code <> 0
+ *
+ */
+int toUCSString(char* chars, exi_string_ucs_t* s);
+
+
+/**
+ * \brief Converts String to ASCII characters
+ *
+ * Note: fails if string contains non ASCII characters.
+ *
+ * \param string UCS String
+ * \param string Input String
+ * \param outASCII ASCII Characters (out)
+ * \return Error-Code <> 0
+ *
+ */
+int toASCIIString(exi_string_ucs_t* string, char* outASCII);
+
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/src/codec/appHandCodec/appHandEXICoder.c b/src/codec/appHandCodec/appHandEXICoder.c
new file mode 100644
index 0000000..0940aa7
--- /dev/null
+++ b/src/codec/appHandCodec/appHandEXICoder.c
@@ -0,0 +1,862 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
+ ********************************************************************/
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef EXI_appHand_CODER_H
+#define EXI_appHand_CODER_H
+
+#include "EXITypes.h"
+
+#define DOCUMENT 0
+#define DOC_CONTENT 13
+#define DOC_END 14
+#define UR_TYPE_GRAMMAR_0 22
+#define UR_TYPE_GRAMMAR_1 23
+
+
+/* increments global and local string count */
+int exi_appHand_IncrementStringValueCount(exi_state_t* state, uint16_t qnameID);
+
+int exi_appHand_PushStack(exi_state_t* state, int16_t newState, uint16_t qnameID);
+
+int exi_appHand_PopStack(exi_state_t* state);
+
+int exi_appHand_HandleXsiNilTrue(exi_state_t* state);
+
+int exi_appHand_HandleXsiType(exi_state_t* state, exi_eqname_t* xsiType);
+
+int exi_appHand_RetrieveAndPushGlobalGrammar(exi_state_t* state, uint16_t qnameID);
+
+int exi_appHand_LearnAttribute(exi_state_t* state, uint16_t qnameID, uint16_t uriID, uint16_t localID);
+
+int exi_appHand_IsStartContent(int16_t ruleID);
+
+int exi_appHand_MoveToElementContentRule(exi_state_t* state);
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/codec/appHandCodec/appHandEXIDecoder.c b/src/codec/appHandCodec/appHandEXIDecoder.c
new file mode 100644
index 0000000..020deca
--- /dev/null
+++ b/src/codec/appHandCodec/appHandEXIDecoder.c
@@ -0,0 +1,2219 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXIdizer.com
+ ********************************************************************/
+
+
+
+#ifndef EXI_appHand_DECODER_C
+#define EXI_appHand_DECODER_C
+
+
+#include "appHandEXIDecoder.h"
+
+#include "EXITypes.h"
+#include "EXIOptions.h"
+#include "BitInputStream.h"
+#include "DecoderChannel.h"
+#include "CoderChannel.h"
+
+#include "StringTable.h"
+#include "appHandNameTableEntries.h"
+#include "MethodsBag.h"
+
+#include "appHandEXICoder.h"
+#include "EXIHeaderDecoder.h"
+#include "ErrorCodes.h"
+
+#include "appHandQNames.h"
+#include "appHandQNameDefines.h"
+
+
+
+/* local variables */
+static uint32_t xsi;
+static uint32_t bits;
+static int errn;
+static exi_event_t currEvent;
+
+#define URI_CODEPOINTS_SIZE 35
+#define LOCALNAME_CODEPOINTS_SIZE 25
+
+uint32_t codepointsUri[URI_CODEPOINTS_SIZE];
+uint32_t codepointsLocalName[LOCALNAME_CODEPOINTS_SIZE];
+
+/*static exi_string_ucs_t stringUri = {URI_CODEPOINTS_SIZE, codepointsUri, 0};*/
+/*static exi_name_entry_t uri = {EXI_NAME_ENTRY_TYPE_ID, 0, {URI_CODEPOINTS_SIZE, codepointsUri, 0}};*/
+/*static exi_name_entry_t localName = {EXI_NAME_ENTRY_TYPE_ID, 0, {LOCALNAME_CODEPOINTS_SIZE, codepointsLocalName, 0}};*/
+static exi_qname_t _qname = {
+ {EXI_NAME_ENTRY_TYPE_ID, 0, {URI_CODEPOINTS_SIZE, codepointsUri, 0}},
+ {EXI_NAME_ENTRY_TYPE_ID, 0, {LOCALNAME_CODEPOINTS_SIZE, codepointsLocalName, 0}}
+};
+
+
+static int _decodeNBitIntegerValue(bitstream_t* stream, exi_integer_t* iv, uint16_t nbits, int32_t lowerBound) {
+ int errn;
+ uint32_t val;
+
+ errn = decodeNBitUnsignedInteger(stream, nbits, &val);
+ if(errn) {
+ return errn;
+ }
+
+ /* TODO map integer value more fine-grained */
+ iv->type = EXI_INTEGER_32;
+ iv->val.int32 = val + lowerBound;
+
+ return errn;
+}
+
+
+
+static int exiDecodeNext2Event(bitstream_t* stream, exi_state_t* state,
+ exi_event_t* nextEvent) {
+ uint32_t eventCode2 = 0;
+ int16_t ruleID = state->grammarStack[state->stackIndex];
+
+ switch (ruleID) {
+ case 7:
+ /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */
+ case 11:
+ /* FirstStartTag[CHARACTERS[FLOAT]] */
+ case 10:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 18:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 20:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 21:
+ /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */
+ case 25:
+ /* FirstStartTag[CHARACTERS[LIST]] */
+ case 24:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 29:
+ /* FirstStartTag[CHARACTERS[LIST]] */
+ case 36:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 48:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 49:
+ /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */
+ case 53:
+ /* FirstStartTag[CHARACTERS[DECIMAL]] */
+ case 55:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 57:
+ /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */
+ case 58:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 45:
+ /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
+ case 64:
+ /* FirstStartTag[CHARACTERS[DATETIME]] */
+ case 16:
+ /* FirstStartTag[START_ELEMENT(ResponseCode)] */
+ case 68:
+ /* FirstStartTag[CHARACTERS[INTEGER]] */
+ case 46:
+ /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */
+ case 69:
+ /* FirstStartTag[CHARACTERS[INTEGER]] */
+ case 74:
+ /* FirstStartTag[CHARACTERS[DATETIME]] */
+ case 15:
+ /* FirstStartTag[START_ELEMENT(AppProtocol)] */
+ case 76:
+ /* FirstStartTag[CHARACTERS[INTEGER]] */
+ case 78:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 79:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 80:
+ /* FirstStartTag[CHARACTERS[BOOLEAN]] */
+ case 35:
+ /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */
+ case 44:
+ /* FirstStartTag[CHARACTERS[ENUMERATION]] */
+ case 86:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 89:
+ /* FirstStartTag[CHARACTERS[INTEGER]] */
+ case 93:
+ /* FirstStartTag[CHARACTERS[INTEGER]] */
+ case 98:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 99:
+ /* FirstStartTag[CHARACTERS[DATETIME]] */
+ case 101:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 100:
+ /* FirstStartTag[CHARACTERS[DATETIME]] */
+ case 102:
+ /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */
+ case 104:
+ /* FirstStartTag[CHARACTERS[DATETIME]] */
+ case 106:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 111:
+ /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
+ case 43:
+ /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
+ case 112:
+ /* FirstStartTag[CHARACTERS[DATETIME]] */
+ case 122:
+ /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
+ case 130:
+ /* FirstStartTag[CHARACTERS[FLOAT]] */
+ case 132:
+ /* FirstStartTag[CHARACTERS[BINARY_HEX]] */
+ case 133:
+ /* FirstStartTag[CHARACTERS[DATETIME]] */
+ case 134:
+ /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
+ case 135:
+ /* FirstStartTag[CHARACTERS[DATETIME]] */
+ case 5:
+ /* FirstStartTag[START_ELEMENT(ProtocolNamespace)] */
+ case 138:
+ /* FirstStartTag[CHARACTERS[INTEGER]] */
+ case 141:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 142:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 143:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 144:
+ /* FirstStartTag[CHARACTERS[LIST]] */
+ errn = decodeNBitUnsignedInteger(stream, 3, &eventCode2);
+ switch (eventCode2) {
+ case 0:
+ *nextEvent = EXI_EVENT_END_ELEMENT_UNDECLARED;
+ return errn;
+ case 1:
+ *nextEvent = EXI_EVENT_ATTRIBUTE_XSI_TYPE;
+ return errn;
+ case 2:
+ *nextEvent = EXI_EVENT_ATTRIBUTE_XSI_NIL;
+ return errn;
+ case 3:
+ *nextEvent = EXI_EVENT_ATTRIBUTE_GENERIC_UNDECLARED;
+ return errn;
+ case 4:
+ *nextEvent = EXI_EVENT_ATTRIBUTE_INVALID_VALUE;
+ errn = decodeNBitUnsignedInteger(stream, 0, &state->eventCode);
+ state->eventCode -= 1;
+ return errn;
+ case 5:
+ *nextEvent = EXI_EVENT_START_ELEMENT_GENERIC_UNDECLARED;
+ return errn;
+ case 6:
+ *nextEvent = EXI_EVENT_CHARACTERS_GENERIC_UNDECLARED;
+ return errn;
+ }
+ break;
+ case 22:
+ /* FirstStartTag[ATTRIBUTE_GENERIC, START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
+ case 50:
+ /* FirstStartTag[ATTRIBUTE_GENERIC, START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
+ errn = decodeNBitUnsignedInteger(stream, 3, &eventCode2);
+ switch (eventCode2) {
+ case 0:
+ *nextEvent = EXI_EVENT_ATTRIBUTE_XSI_TYPE;
+ return errn;
+ case 1:
+ *nextEvent = EXI_EVENT_ATTRIBUTE_XSI_NIL;
+ return errn;
+ case 2:
+ *nextEvent = EXI_EVENT_ATTRIBUTE_GENERIC_UNDECLARED;
+ return errn;
+ case 3:
+ *nextEvent = EXI_EVENT_ATTRIBUTE_INVALID_VALUE;
+ errn = decodeNBitUnsignedInteger(stream, 0, &state->eventCode);
+ state->eventCode -= 1;
+ return errn;
+ case 4:
+ *nextEvent = EXI_EVENT_START_ELEMENT_GENERIC_UNDECLARED;
+ return errn;
+ case 5:
+ *nextEvent = EXI_EVENT_CHARACTERS_GENERIC_UNDECLARED;
+ return errn;
+ }
+ break;
+ case 1:
+ /* Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
+ case 12:
+ /* Element[CHARACTERS[STRING]] */
+ case 17:
+ /* Element[CHARACTERS[INTEGER]] */
+ case 19:
+ /* Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
+ case 28:
+ /* Element[CHARACTERS[BINARY_HEX]] */
+ case 30:
+ /* Element[START_ELEMENT(ProtocolNamespace)] */
+ case 32:
+ /* Element[CHARACTERS[STRING]] */
+ case 33:
+ /* Element[START_ELEMENT(VersionNumberMinor)] */
+ case 37:
+ /* Element[CHARACTERS[BOOLEAN]] */
+ case 38:
+ /* Element[CHARACTERS[STRING]] */
+ case 40:
+ /* Element[CHARACTERS[STRING]] */
+ case 41:
+ /* Element[CHARACTERS[STRING]] */
+ case 47:
+ /* Element[CHARACTERS[INTEGER]] */
+ case 52:
+ /* Element[CHARACTERS[BINARY_BASE64]] */
+ case 54:
+ /* Element[CHARACTERS[STRING]] */
+ case 56:
+ /* Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
+ case 59:
+ /* Element[CHARACTERS[UNSIGNED_INTEGER]] */
+ case 31:
+ /* Element[START_ELEMENT(VersionNumberMajor)] */
+ case 62:
+ /* Element[CHARACTERS[FLOAT]] */
+ case 63:
+ /* Element[CHARACTERS[DATETIME]] */
+ case 65:
+ /* Element[CHARACTERS[LIST]] */
+ case 67:
+ /* Element[CHARACTERS[STRING]] */
+ case 70:
+ /* Element[CHARACTERS[STRING]] */
+ case 71:
+ /* Element[CHARACTERS[ENUMERATION]] */
+ case 75:
+ /* Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
+ case 77:
+ /* Element[CHARACTERS[STRING]] */
+ case 81:
+ /* Element[CHARACTERS[UNSIGNED_INTEGER]] */
+ case 82:
+ /* Element[CHARACTERS[DATETIME]] */
+ case 83:
+ /* Element[CHARACTERS[INTEGER]] */
+ case 84:
+ /* Element[CHARACTERS[DATETIME]] */
+ case 85:
+ /* Element[CHARACTERS[STRING]] */
+ case 87:
+ /* Element[CHARACTERS[STRING]] */
+ case 88:
+ /* Element[CHARACTERS[DATETIME]] */
+ case 34:
+ /* Element[START_ELEMENT(SchemaID)] */
+ case 91:
+ /* Element[CHARACTERS[INTEGER]] */
+ case 94:
+ /* Element[START_ELEMENT(AppProtocol)] */
+ case 95:
+ /* Element[CHARACTERS[LIST]] */
+ case 96:
+ /* Element[CHARACTERS[STRING]] */
+ case 103:
+ /* Element[CHARACTERS[FLOAT]] */
+ case 107:
+ /* Element[CHARACTERS[INTEGER]] */
+ case 108:
+ /* Element[CHARACTERS[UNSIGNED_INTEGER]] */
+ case 114:
+ /* Element[CHARACTERS[STRING]] */
+ case 116:
+ /* Element[CHARACTERS[DECIMAL]] */
+ case 117:
+ /* Element[START_ELEMENT(ResponseCode)] */
+ case 118:
+ /* Element[CHARACTERS[STRING]] */
+ case 119:
+ /* Element[CHARACTERS[UNSIGNED_INTEGER]] */
+ case 120:
+ /* Element[CHARACTERS[STRING]] */
+ case 121:
+ /* Element[CHARACTERS[DATETIME]] */
+ case 123:
+ /* Element[CHARACTERS[DATETIME]] */
+ case 126:
+ /* Element[CHARACTERS[DATETIME]] */
+ case 90:
+ /* Element[START_ELEMENT(Priority)] */
+ case 131:
+ /* Element[CHARACTERS[STRING]] */
+ case 136:
+ /* Element[CHARACTERS[INTEGER]] */
+ case 137:
+ /* Element[CHARACTERS[STRING]] */
+ case 140:
+ /* Element[CHARACTERS[LIST]] */
+ case 139:
+ /* Element[CHARACTERS[DATETIME]] */
+ case 145:
+ /* Element[CHARACTERS[UNSIGNED_INTEGER]] */
+ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode2);
+ switch (eventCode2) {
+ case 0:
+ *nextEvent = EXI_EVENT_END_ELEMENT_UNDECLARED;
+ return errn;
+ case 1:
+ *nextEvent = EXI_EVENT_START_ELEMENT_GENERIC_UNDECLARED;
+ return errn;
+ case 2:
+ *nextEvent = EXI_EVENT_CHARACTERS_GENERIC_UNDECLARED;
+ return errn;
+ }
+ break;
+ case 3:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 8:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 2:
+ /* Element[END_ELEMENT] */
+ case 26:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 39:
+ /* Element[END_ELEMENT] */
+ case 60:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 72:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 23:
+ /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
+ case 9:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 97:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 109:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 92:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 115:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 124:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 27:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 51:
+ /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
+ case 128:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 66:
+ /* Element[START_ELEMENT(SchemaID), END_ELEMENT] */
+ case 110:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 61:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 127:
+ /* Element[END_ELEMENT] */
+ case 113:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 4:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 125:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 129:
+ /* Element[END_ELEMENT] */
+ case 73:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode2);
+ switch (eventCode2) {
+ case 0:
+ *nextEvent = EXI_EVENT_START_ELEMENT_GENERIC_UNDECLARED;
+ return errn;
+ case 1:
+ *nextEvent = EXI_EVENT_CHARACTERS_GENERIC_UNDECLARED;
+ return errn;
+ }
+ break;
+
+ default:
+ if (ruleID < 0) {
+ /* built-in element grammar */
+ if ( exi_appHand_IsStartContent(ruleID) ) {
+ /* TODO generate 2nd level productions */
+
+ /* StartTagContent grammar */
+ errn = decodeNBitUnsignedInteger(stream, 2, &eventCode2);
+ if(errn) {
+ return errn;
+ }
+ switch(eventCode2) {
+ case 0:
+ /* 0: EE */
+ *nextEvent = EXI_EVENT_END_ELEMENT_UNDECLARED;
+ break;
+ case 1:
+ /* 1: AT(*) */
+ *nextEvent = EXI_EVENT_ATTRIBUTE_GENERIC_UNDECLARED;
+ break;
+ case 2:
+ /* 2: SE(*) */
+ *nextEvent = EXI_EVENT_START_ELEMENT_GENERIC_UNDECLARED;
+ break;
+ case 3:
+ /* 3: CH */
+ *nextEvent = EXI_EVENT_CHARACTERS_GENERIC_UNDECLARED;
+ break;
+ default:
+ return EXI_ERROR_UNEXPECTED_EVENT_LEVEL2;
+ break;
+ }
+ return errn;
+ } else {
+ /* TODO generate 2nd level productions */
+
+ /* ElementContent grammar */
+ errn = decodeNBitUnsignedInteger(stream, 1, &eventCode2);
+ if(errn) {
+ return errn;
+ }
+ switch(eventCode2) {
+ case 0:
+ /* 0: SE(*) */
+ *nextEvent = EXI_EVENT_START_ELEMENT_GENERIC_UNDECLARED;
+ break;
+ case 1:
+ /* 1: CH */
+ *nextEvent = EXI_EVENT_CHARACTERS_GENERIC_UNDECLARED;
+ break;
+ default:
+ return EXI_ERROR_UNEXPECTED_EVENT_LEVEL2;
+ break;
+ }
+
+
+
+ }
+
+ } else {
+ *nextEvent = EXI_EVENT_ERROR;
+ return EXI_ERROR_UNEXPECTED_EVENT_LEVEL2;
+ }
+ break;
+ }
+
+ return EXI_ERROR_UNEXPECTED_EVENT_LEVEL2;
+}
+
+
+
+static int _exiDecodeNamespaceUri(bitstream_t* stream, exi_state_t* state,
+ exi_name_entry_t* uri) {
+/* exi_string_ascii_t* namespaceURI, uint32_t* uriID) {*/
+ uint16_t uriSize, uriCodingLength;
+ uint32_t uriID;
+ int errn;
+
+ errn = exiGetUriSize(&state->nameTablePrepopulated, &state->nameTableRuntime, &uriSize);
+ if (errn) {
+ return errn;
+ }
+ /* URI Entries + 1 */
+ errn = exiGetCodingLength(uriSize + 1, &uriCodingLength);
+ if (errn) {
+ return errn;
+ }
+
+ errn = decodeNBitUnsignedInteger(stream, uriCodingLength, &uriID);
+ if (errn) {
+ return errn;
+ }
+
+ if (uriID == 0) {
+ /* uri string value was not found */
+ /* ==> zero (0) as an n-nit unsigned integer */
+ /* followed by uri encoded as string */
+ uri->type = EXI_NAME_ENTRY_TYPE_STRING_AND_ID;
+ errn = decodeString(stream, &uri->str);
+ if (errn) {
+ return errn;
+ }
+ /* after encoding string value is added to table */
+ errn = exiAddUri(&state->nameTablePrepopulated, &state->nameTableRuntime); /*, namespaceURI->chars); */
+ if (errn) {
+ return errn;
+ }
+ uri->id = uriSize;
+ /* uriID = uriSize; */
+ } else {
+ /* uri string value found */
+ /* ==> value(i+1) is encoded as n-bit unsigned integer */
+ uri->type = EXI_NAME_ENTRY_TYPE_ID;
+ uri->id = (uint16_t)(uriID - 1);
+ /* *uriID = *uriID - 1; */
+ }
+
+ return 0;
+}
+
+static int _exiDecodeLocalName(bitstream_t* stream, exi_state_t* state,
+ uint16_t uriID, exi_name_entry_t* localName) {
+/* exi_string_ascii_t* localName,
+ uint32_t* localNameID, uint32_t uriID) { */
+ uint32_t localNameID;
+ uint16_t slen;
+ uint16_t localNameSize;
+ uint16_t localNameCodingLength;
+
+
+ int errn = decodeUnsignedInteger16(stream, &slen);
+ if (errn) {
+ return errn;
+ }
+
+ if (slen > 0) {
+ /* string value was not found in local partition */
+ /* ==> string literal is encoded as a String */
+ /* with the length of the string incremented by one */
+ localName->type = EXI_NAME_ENTRY_TYPE_STRING_AND_ID;
+ if (slen-- >= (localName->str.size) ) {
+ return EXI_ERROR_OUT_OF_BOUNDS;
+ }
+ localName->str.len = slen;
+ errn = decodeCharacters(stream, slen, localName->str.codepoints);
+
+ /*if (slen-- >= localName->size) {
+ return EXI_ERROR_OUT_OF_BOUNDS;
+ }
+ errn = decodeCharactersASCII(stream, slen, localName->chars); */
+
+ if (errn) {
+ return errn;
+ }
+ /* After encoding the string value, it is added to the string table */
+ /* partition and assigned the next available compact identifier */
+ errn = exiAddLocalName(&state->nameTablePrepopulated, &state->nameTableRuntime, uriID, &localName->id); /* uriID); *//*, localName->chars); */
+
+ /*if (errn) {
+ return errn;
+ }*/
+ /* TODO UCD Profile */
+ /* qname = addLocalName(localName, uriID); */
+ } else {
+ /* string value found in local partition */
+ /* ==> string value is represented as zero (0) encoded as an */
+ /* 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 */
+ localName->type = EXI_NAME_ENTRY_TYPE_ID;
+ errn = exiGetLocalNameSize(&state->nameTablePrepopulated, &state->nameTableRuntime, uriID, &localNameSize); /* uriID, &localNameSize); */
+ if (errn) {
+ return errn;
+ }
+ errn = exiGetCodingLength(localNameSize, &localNameCodingLength);
+ if (errn) {
+ return errn;
+ }
+ errn = decodeNBitUnsignedInteger(stream, localNameCodingLength, &localNameID); /* localNameID);*/
+ localName->id = (uint16_t)(localNameID);
+ /*if (errn) {
+ return errn;
+ }*/
+ }
+
+ return errn;
+}
+
+static int _exiDecodeQName(bitstream_t* stream, exi_state_t* state,
+ uint16_t* qnameID, exi_qname_t* qname) {
+
+ /*uint32_t uriID;
+ uint32_t localNameID;*/
+ /* const char * clocalName; */
+
+ /* uri */
+ int errn =_exiDecodeNamespaceUri(stream, state, &qname->uri); /* &qname->namespaceURI, &uriID); */
+ if (errn) {
+ return errn;
+ }
+ /* localName */
+ errn = _exiDecodeLocalName(stream, state, qname->uri.id, &qname->localName); /* &qname->localName, &localNameID, uriID); */
+ if (errn) {
+ return errn;
+ }
+
+ /*
+ errn = exiGetLocalName(nameTable, runtimeTable, uriID, localNameID, &clocalName);
+ if (errn) {
+ return errn;
+ }
+ strcpy ( qname->localName.chars, clocalName );
+ */
+
+ if (_qname.localName.type == EXI_NAME_ENTRY_TYPE_STRING_AND_ID) {
+ errn = exiappHandAddEQName(state, qnameID, qname->uri.id, qname->localName.id);
+ } else {
+ /* IDs known --> retrieve qnameID */
+ errn = exiappHandGetQNameID(state, qname->uri.id, qname->localName.id, qnameID);
+ }
+
+
+ return errn;
+}
+
+
+static int _exiDecodeStartElement(exi_state_t* state, uint16_t qnameID,
+ uint16_t stackId, uint16_t newState) {
+ /*uint16_t ns, uint16_t ln, uint16_t qn, */
+ /*se->namespaceURI = ns;
+ se->localPart = ln;
+ se->qname = qn;*/
+ /* move on */
+ state->grammarStack[state->stackIndex] = stackId;
+ /* push element on stack */
+ return exi_appHand_PushStack(state, newState, qnameID); /* se);*/
+}
+
+
+int exiappHandGetLastQName(exi_qname_t** qname) {
+ *qname = &_qname;
+ return 0;
+}
+
+
+int exiappHandDecodeListValue(bitstream_t* stream, exi_state_t* state, uint16_t qnameID, exi_value_t* val, exi_list_t lt) {
+ uint32_t uint32;
+
+ val->type = lt.type;
+
+ switch(lt.type) {
+ case EXI_DATATYPE_BINARY_BASE64:
+ case EXI_DATATYPE_BINARY_HEX:
+ errn = decodeBinary(stream, &val->binary);
+ break;
+ case EXI_DATATYPE_BOOLEAN:
+ errn = decodeBoolean(stream, &val->boolean);
+ break;
+ case EXI_DATATYPE_BOOLEAN_FACET:
+ errn = decodeNBitUnsignedInteger(stream, 2, &uint32);
+ val->boolean = uint32 > 1;
+ break;
+ case EXI_DATATYPE_DECIMAL:
+ errn = decodeDecimal(stream, &val->decimal);
+ break;
+ case EXI_DATATYPE_FLOAT:
+ errn = decodeFloat(stream, &val->float_me);
+ break;
+ case EXI_DATATYPE_NBIT_UNSIGNED_INTEGER:
+ errn = EXI_UNSUPPORTED_LIST_VALUE_TYPE;
+ break;
+ case EXI_DATATYPE_UNSIGNED_INTEGER:
+ errn = decodeUnsignedInteger(stream, &val->integer);
+ break;
+ case EXI_DATATYPE_INTEGER:
+ errn = decodeInteger(stream, &val->integer);
+ break;
+ case EXI_DATATYPE_DATETIME:
+ errn = decodeDateTime(stream,lt.datetimeType, &val->datetime);
+ break;
+ case EXI_DATATYPE_STRING:
+ errn = decodeStringValue(stream, state, qnameID, &val->str);
+ break;
+ default:
+ return EXI_UNSUPPORTED_LIST_VALUE_TYPE;
+ }
+
+ return errn;
+}
+
+
+
+
+int exiappHandInitDecoder(bitstream_t* stream, exi_state_t* state,
+ exi_name_table_runtime_t runtimeTable, exi_string_table_t stringTable) {
+#if EXI_appHandVALUE_PARTITION_CAPACITY != 0
+#if EXI_appHandVALUE_MAX_LENGTH != 0
+ int i;
+#endif /* EXI_appHandVALUE_MAX_LENGTH != 0 */
+#endif /* EXI_appHandVALUE_PARTITION_CAPACITY != 0 */
+ /* init grammar state */
+ state->stackIndex = 0;
+ state->grammarStack[0] = DOCUMENT;
+ /* name table */
+ state->nameTablePrepopulated = exiappHandNameTablePrepopulated;
+ state->nameTableRuntime = runtimeTable;
+ /* next qname ID */
+ state->nextQNameID = EXI_appHandNUMBER_OF_PREPOPULATED_QNAMES;
+ /* string table */
+ state->stringTable = stringTable;
+ state->stringTable.numberOfGlobalStrings = 0;
+#if EXI_appHandVALUE_PARTITION_CAPACITY != 0
+#if EXI_appHandVALUE_MAX_LENGTH != 0
+ for(i=0; i<(state->stringTable.sizeLocalStrings); i++) {
+ state->stringTable.numberOfLocalStrings[i] = 0;
+ }
+#endif /* EXI_appHandVALUE_MAX_LENGTH != 0 */
+#endif /* EXI_appHandVALUE_PARTITION_CAPACITY != 0 */
+
+ /* runtime grammars */
+ state->numberOfRuntimeGrammars = 0;
+
+ /* Avoid warning: Unused declaration of variable 'name' */
+ xsi = 0;
+ bits = 0;
+
+ /* decode header */
+ return readEXIHeader(stream);
+}
+
+int exiappHandDecodeNextEvent(bitstream_t* stream, exi_state_t* state,
+ exi_event_t* nextEvent) {
+ uint16_t codingLength;
+ uint16_t numberOfProductions;
+ uint32_t eventCode1;
+ int16_t ruleID = state->grammarStack[state->stackIndex];
+ state->eventCode = 0;
+ errn = 0;
+
+ switch (ruleID) {
+ case 3:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 8:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 26:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 60:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 72:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 9:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 97:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 109:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 92:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 115:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 124:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 27:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 128:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 66:
+ /* Element[START_ELEMENT(SchemaID), END_ELEMENT] */
+ case 110:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 61:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 113:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 4:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 125:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ case 73:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ errn = decodeNBitUnsignedInteger(stream, 2, &state->eventCode);
+ switch (state->eventCode) {
+ case 0:
+ *nextEvent = EXI_EVENT_START_ELEMENT;
+ break;
+ case 1:
+ *nextEvent = EXI_EVENT_END_ELEMENT;
+ break;
+ case 2:
+ /* 2nd level events */
+ errn = exiDecodeNext2Event(stream, state, nextEvent);
+ break;
+ default:
+ errn = EXI_ERROR_UNEXPECTED_EVENT_LEVEL1;
+ break;
+ }
+ break;
+ case 30:
+ /* Element[START_ELEMENT(ProtocolNamespace)] */
+ case 33:
+ /* Element[START_ELEMENT(VersionNumberMinor)] */
+ case 31:
+ /* Element[START_ELEMENT(VersionNumberMajor)] */
+ case 16:
+ /* FirstStartTag[START_ELEMENT(ResponseCode)] */
+ case 15:
+ /* FirstStartTag[START_ELEMENT(AppProtocol)] */
+ case 34:
+ /* Element[START_ELEMENT(SchemaID)] */
+ case 94:
+ /* Element[START_ELEMENT(AppProtocol)] */
+ case 117:
+ /* Element[START_ELEMENT(ResponseCode)] */
+ case 90:
+ /* Element[START_ELEMENT(Priority)] */
+ case 5:
+ /* FirstStartTag[START_ELEMENT(ProtocolNamespace)] */
+ errn = decodeNBitUnsignedInteger(stream, 1, &state->eventCode);
+ switch (state->eventCode) {
+ case 0:
+ *nextEvent = EXI_EVENT_START_ELEMENT;
+ break;
+ case 1:
+ /* 2nd level events */
+ errn = exiDecodeNext2Event(stream, state, nextEvent);
+ break;
+ default:
+ errn = EXI_ERROR_UNEXPECTED_EVENT_LEVEL1;
+ break;
+ }
+ break;
+ case 0:
+ /* Document[START_DOCUMENT] */
+ case 105:
+ /* Fragment[START_DOCUMENT] */
+ *nextEvent = EXI_EVENT_START_DOCUMENT;
+ break;
+ case 14:
+ /* DocEnd[END_DOCUMENT] */
+ *nextEvent = EXI_EVENT_END_DOCUMENT;
+ break;
+ case 42:
+ /* FragmentContent[START_ELEMENT(AppProtocol), START_ELEMENT(Priority), START_ELEMENT(ProtocolNamespace), START_ELEMENT(ResponseCode), START_ELEMENT(SchemaID), START_ELEMENT(VersionNumberMajor), START_ELEMENT(VersionNumberMinor), START_ELEMENT({urn:iso:15118:2:2010:AppProtocol}supportedAppProtocolReq), START_ELEMENT({urn:iso:15118:2:2010:AppProtocol}supportedAppProtocolRes), START_ELEMENT_GENERIC, END_DOCUMENT] */
+ errn = decodeNBitUnsignedInteger(stream, 4, &state->eventCode);
+ switch (state->eventCode) {
+ case 0:
+ case 1:
+ case 2:
+ case 3:
+ case 4:
+ case 5:
+ case 6:
+ case 7:
+ case 8:
+ *nextEvent = EXI_EVENT_START_ELEMENT;
+ break;
+ case 9:
+ *nextEvent = EXI_EVENT_START_ELEMENT_GENERIC;
+ break;
+ case 10:
+ *nextEvent = EXI_EVENT_END_DOCUMENT;
+ break;
+ default:
+ errn = EXI_ERROR_UNEXPECTED_EVENT_LEVEL1;
+ break;
+ }
+ break;
+ case 22:
+ /* FirstStartTag[ATTRIBUTE_GENERIC, START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
+ case 50:
+ /* FirstStartTag[ATTRIBUTE_GENERIC, START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
+ errn = decodeNBitUnsignedInteger(stream, 3, &state->eventCode);
+ switch (state->eventCode) {
+ case 0:
+ *nextEvent = EXI_EVENT_ATTRIBUTE_GENERIC;
+ break;
+ case 1:
+ *nextEvent = EXI_EVENT_START_ELEMENT_GENERIC;
+ break;
+ case 2:
+ *nextEvent = EXI_EVENT_END_ELEMENT;
+ break;
+ case 3:
+ *nextEvent = EXI_EVENT_CHARACTERS_GENERIC;
+ break;
+ case 4:
+ /* 2nd level events */
+ errn = exiDecodeNext2Event(stream, state, nextEvent);
+ break;
+ default:
+ errn = EXI_ERROR_UNEXPECTED_EVENT_LEVEL1;
+ break;
+ }
+ break;
+ case 1:
+ /* Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
+ case 7:
+ /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */
+ case 11:
+ /* FirstStartTag[CHARACTERS[FLOAT]] */
+ case 10:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 12:
+ /* Element[CHARACTERS[STRING]] */
+ case 17:
+ /* Element[CHARACTERS[INTEGER]] */
+ case 18:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 19:
+ /* Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
+ case 20:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 21:
+ /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */
+ case 25:
+ /* FirstStartTag[CHARACTERS[LIST]] */
+ case 24:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 29:
+ /* FirstStartTag[CHARACTERS[LIST]] */
+ case 28:
+ /* Element[CHARACTERS[BINARY_HEX]] */
+ case 32:
+ /* Element[CHARACTERS[STRING]] */
+ case 37:
+ /* Element[CHARACTERS[BOOLEAN]] */
+ case 36:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 38:
+ /* Element[CHARACTERS[STRING]] */
+ case 40:
+ /* Element[CHARACTERS[STRING]] */
+ case 41:
+ /* Element[CHARACTERS[STRING]] */
+ case 48:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 47:
+ /* Element[CHARACTERS[INTEGER]] */
+ case 49:
+ /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */
+ case 52:
+ /* Element[CHARACTERS[BINARY_BASE64]] */
+ case 53:
+ /* FirstStartTag[CHARACTERS[DECIMAL]] */
+ case 54:
+ /* Element[CHARACTERS[STRING]] */
+ case 55:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 56:
+ /* Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
+ case 57:
+ /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */
+ case 58:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 59:
+ /* Element[CHARACTERS[UNSIGNED_INTEGER]] */
+ case 45:
+ /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
+ case 62:
+ /* Element[CHARACTERS[FLOAT]] */
+ case 63:
+ /* Element[CHARACTERS[DATETIME]] */
+ case 64:
+ /* FirstStartTag[CHARACTERS[DATETIME]] */
+ case 65:
+ /* Element[CHARACTERS[LIST]] */
+ case 67:
+ /* Element[CHARACTERS[STRING]] */
+ case 68:
+ /* FirstStartTag[CHARACTERS[INTEGER]] */
+ case 46:
+ /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */
+ case 69:
+ /* FirstStartTag[CHARACTERS[INTEGER]] */
+ case 70:
+ /* Element[CHARACTERS[STRING]] */
+ case 71:
+ /* Element[CHARACTERS[ENUMERATION]] */
+ case 74:
+ /* FirstStartTag[CHARACTERS[DATETIME]] */
+ case 75:
+ /* Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
+ case 76:
+ /* FirstStartTag[CHARACTERS[INTEGER]] */
+ case 77:
+ /* Element[CHARACTERS[STRING]] */
+ case 78:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 79:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 80:
+ /* FirstStartTag[CHARACTERS[BOOLEAN]] */
+ case 81:
+ /* Element[CHARACTERS[UNSIGNED_INTEGER]] */
+ case 35:
+ /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */
+ case 82:
+ /* Element[CHARACTERS[DATETIME]] */
+ case 44:
+ /* FirstStartTag[CHARACTERS[ENUMERATION]] */
+ case 83:
+ /* Element[CHARACTERS[INTEGER]] */
+ case 84:
+ /* Element[CHARACTERS[DATETIME]] */
+ case 85:
+ /* Element[CHARACTERS[STRING]] */
+ case 86:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 87:
+ /* Element[CHARACTERS[STRING]] */
+ case 88:
+ /* Element[CHARACTERS[DATETIME]] */
+ case 89:
+ /* FirstStartTag[CHARACTERS[INTEGER]] */
+ case 91:
+ /* Element[CHARACTERS[INTEGER]] */
+ case 93:
+ /* FirstStartTag[CHARACTERS[INTEGER]] */
+ case 95:
+ /* Element[CHARACTERS[LIST]] */
+ case 96:
+ /* Element[CHARACTERS[STRING]] */
+ case 98:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 99:
+ /* FirstStartTag[CHARACTERS[DATETIME]] */
+ case 101:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 100:
+ /* FirstStartTag[CHARACTERS[DATETIME]] */
+ case 102:
+ /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */
+ case 103:
+ /* Element[CHARACTERS[FLOAT]] */
+ case 104:
+ /* FirstStartTag[CHARACTERS[DATETIME]] */
+ case 106:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 107:
+ /* Element[CHARACTERS[INTEGER]] */
+ case 111:
+ /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
+ case 108:
+ /* Element[CHARACTERS[UNSIGNED_INTEGER]] */
+ case 43:
+ /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
+ case 112:
+ /* FirstStartTag[CHARACTERS[DATETIME]] */
+ case 114:
+ /* Element[CHARACTERS[STRING]] */
+ case 116:
+ /* Element[CHARACTERS[DECIMAL]] */
+ case 118:
+ /* Element[CHARACTERS[STRING]] */
+ case 119:
+ /* Element[CHARACTERS[UNSIGNED_INTEGER]] */
+ case 120:
+ /* Element[CHARACTERS[STRING]] */
+ case 121:
+ /* Element[CHARACTERS[DATETIME]] */
+ case 123:
+ /* Element[CHARACTERS[DATETIME]] */
+ case 122:
+ /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
+ case 126:
+ /* Element[CHARACTERS[DATETIME]] */
+ case 130:
+ /* FirstStartTag[CHARACTERS[FLOAT]] */
+ case 131:
+ /* Element[CHARACTERS[STRING]] */
+ case 132:
+ /* FirstStartTag[CHARACTERS[BINARY_HEX]] */
+ case 133:
+ /* FirstStartTag[CHARACTERS[DATETIME]] */
+ case 134:
+ /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
+ case 135:
+ /* FirstStartTag[CHARACTERS[DATETIME]] */
+ case 136:
+ /* Element[CHARACTERS[INTEGER]] */
+ case 137:
+ /* Element[CHARACTERS[STRING]] */
+ case 140:
+ /* Element[CHARACTERS[LIST]] */
+ case 139:
+ /* Element[CHARACTERS[DATETIME]] */
+ case 138:
+ /* FirstStartTag[CHARACTERS[INTEGER]] */
+ case 141:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 142:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 143:
+ /* FirstStartTag[CHARACTERS[STRING]] */
+ case 144:
+ /* FirstStartTag[CHARACTERS[LIST]] */
+ case 145:
+ /* Element[CHARACTERS[UNSIGNED_INTEGER]] */
+ errn = decodeNBitUnsignedInteger(stream, 1, &state->eventCode);
+ switch (state->eventCode) {
+ case 0:
+ *nextEvent = EXI_EVENT_CHARACTERS;
+ break;
+ case 1:
+ /* 2nd level events */
+ errn = exiDecodeNext2Event(stream, state, nextEvent);
+ break;
+ default:
+ errn = EXI_ERROR_UNEXPECTED_EVENT_LEVEL1;
+ break;
+ }
+ break;
+ case 2:
+ /* Element[END_ELEMENT] */
+ case 39:
+ /* Element[END_ELEMENT] */
+ case 127:
+ /* Element[END_ELEMENT] */
+ case 129:
+ /* Element[END_ELEMENT] */
+ errn = decodeNBitUnsignedInteger(stream, 1, &state->eventCode);
+ switch (state->eventCode) {
+ case 0:
+ *nextEvent = EXI_EVENT_END_ELEMENT;
+ break;
+ case 1:
+ /* 2nd level events */
+ errn = exiDecodeNext2Event(stream, state, nextEvent);
+ break;
+ default:
+ errn = EXI_ERROR_UNEXPECTED_EVENT_LEVEL1;
+ break;
+ }
+ break;
+ case 13:
+ /* DocContent[START_ELEMENT({urn:iso:15118:2:2010:AppProtocol}supportedAppProtocolReq), START_ELEMENT({urn:iso:15118:2:2010:AppProtocol}supportedAppProtocolRes), START_ELEMENT_GENERIC] */
+ errn = decodeNBitUnsignedInteger(stream, 2, &state->eventCode);
+ switch (state->eventCode) {
+ case 0:
+ case 1:
+ *nextEvent = EXI_EVENT_START_ELEMENT;
+ break;
+ case 2:
+ *nextEvent = EXI_EVENT_START_ELEMENT_GENERIC;
+ break;
+ default:
+ errn = EXI_ERROR_UNEXPECTED_EVENT_LEVEL1;
+ break;
+ }
+ break;
+ case 23:
+ /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
+ case 51:
+ /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
+ errn = decodeNBitUnsignedInteger(stream, 2, &state->eventCode);
+ switch (state->eventCode) {
+ case 0:
+ *nextEvent = EXI_EVENT_START_ELEMENT_GENERIC;
+ break;
+ case 1:
+ *nextEvent = EXI_EVENT_END_ELEMENT;
+ break;
+ case 2:
+ *nextEvent = EXI_EVENT_CHARACTERS_GENERIC;
+ break;
+ case 3:
+ /* 2nd level events */
+ errn = exiDecodeNext2Event(stream, state, nextEvent);
+ break;
+ default:
+ errn = EXI_ERROR_UNEXPECTED_EVENT_LEVEL1;
+ break;
+ }
+ break;
+
+ default:
+ if(ruleID < 0) {
+ /* built-in element grammar */
+ numberOfProductions = state->runtimeGrammars[(ruleID + 1)*(-1)].numberOfProductions;
+ if(numberOfProductions > 0) {
+ /* decode 1st level event code */
+ errn = exiGetCodingLength(numberOfProductions + 1, &codingLength);
+ if(errn) {
+ return errn;
+ }
+ errn = decodeNBitUnsignedInteger(stream, codingLength, &eventCode1);
+ if(errn) {
+ return errn;
+ }
+
+ if(eventCode1 == numberOfProductions) {
+ /* 2nd level */
+ errn = exiDecodeNext2Event(stream, state, nextEvent);
+ } else {
+ /* 1st level event not supported in profile */
+ errn = EXI_ERROR_UNEXPECTED_EVENT_LEVEL1;
+ }
+ } else {
+ errn = exiDecodeNext2Event(stream, state, nextEvent);
+ }
+ } else {
+ *nextEvent = EXI_EVENT_ERROR;
+ errn = EXI_ERROR_UNEXPECTED_EVENT_LEVEL1;
+ }
+ break;
+ }
+
+ currEvent = *nextEvent;
+ return errn;
+}
+
+#ifndef __GNUC__
+#pragma warning( disable : 4100 ) /* warning unreferenced parameter 'stream' */
+#endif /* __GNUC__ */
+int exiappHandDecodeStartDocument(bitstream_t* stream, exi_state_t* state) {
+ if ( state->grammarStack[state->stackIndex] == 0 ) {
+ /* move on */
+ state->grammarStack[state->stackIndex] = 13;
+ return 0;
+ }
+ if ( state->grammarStack[state->stackIndex] == 105 ) {
+ /* move on */
+ state->grammarStack[state->stackIndex] = 42;
+ return 0;
+ }
+
+ return EXI_ERROR_UNEXPECTED_START_DOCUMENT;
+}
+#ifndef __GNUC__
+#pragma warning( default : 4100 ) /* warning unreferenced parameter 'stream' */
+#endif /* __GNUC__ */
+
+#ifndef __GNUC__
+#pragma warning( disable : 4100 ) /* warning unreferenced parameter 'stream' */
+#endif /* __GNUC__ */
+int exiappHandDecodeEndDocument(bitstream_t* stream, exi_state_t* state) {
+ if ( state->grammarStack[state->stackIndex] == 42) {
+ return 0;
+ }
+ if ( state->grammarStack[state->stackIndex] == 14) {
+ return 0;
+ }
+
+ return EXI_ERROR_UNEXPECTED_END_DOCUMENT;
+}
+#ifndef __GNUC__
+#pragma warning( default : 4100 ) /* warning unreferenced parameter 'stream' */
+#endif /* __GNUC__ */
+
+
+int exiappHandDecodeStartElement(bitstream_t* stream, exi_state_t* state,
+ uint16_t* qnameID) {
+ errn = EXI_ERROR_UNEXPECTED_START_ELEMENT;
+
+ switch(currEvent) {
+ case EXI_EVENT_START_ELEMENT:
+ switch (state->grammarStack[state->stackIndex]) {
+ case 3:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ switch(state->eventCode) {
+ case 0:
+ errn = _exiDecodeStartElement(state, *qnameID = 0, 4, 5);
+ break;
+ }
+ break;
+ case 4:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ switch(state->eventCode) {
+ case 0:
+ errn = _exiDecodeStartElement(state, *qnameID = 0, 124, 5);
+ break;
+ }
+ break;
+ case 5:
+ /* FirstStartTag[START_ELEMENT(ProtocolNamespace)] */
+ switch(state->eventCode) {
+ case 0:
+ errn = _exiDecodeStartElement(state, *qnameID = 2, 31, 18);
+ break;
+ }
+ break;
+ case 8:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ switch(state->eventCode) {
+ case 0:
+ errn = _exiDecodeStartElement(state, *qnameID = 0, 9, 5);
+ break;
+ }
+ break;
+ case 9:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ switch(state->eventCode) {
+ case 0:
+ errn = _exiDecodeStartElement(state, *qnameID = 0, 92, 5);
+ break;
+ }
+ break;
+ case 13:
+ /* DocContent[START_ELEMENT({urn:iso:15118:2:2010:AppProtocol}supportedAppProtocolReq), START_ELEMENT({urn:iso:15118:2:2010:AppProtocol}supportedAppProtocolRes), START_ELEMENT_GENERIC] */
+ switch(state->eventCode) {
+ case 0:
+ errn = _exiDecodeStartElement(state, *qnameID = 65, 14, 15);
+ break;
+ case 1:
+ errn = _exiDecodeStartElement(state, *qnameID = 66, 14, 16);
+ break;
+ }
+ break;
+ case 15:
+ /* FirstStartTag[START_ELEMENT(AppProtocol)] */
+ switch(state->eventCode) {
+ case 0:
+ errn = _exiDecodeStartElement(state, *qnameID = 0, 3, 5);
+ break;
+ }
+ break;
+ case 16:
+ /* FirstStartTag[START_ELEMENT(ResponseCode)] */
+ switch(state->eventCode) {
+ case 0:
+ errn = _exiDecodeStartElement(state, *qnameID = 3, 66, 44);
+ break;
+ }
+ break;
+ case 26:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ switch(state->eventCode) {
+ case 0:
+ errn = _exiDecodeStartElement(state, *qnameID = 0, 27, 5);
+ break;
+ }
+ break;
+ case 27:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ switch(state->eventCode) {
+ case 0:
+ errn = _exiDecodeStartElement(state, *qnameID = 0, 97, 5);
+ break;
+ }
+ break;
+ case 30:
+ /* Element[START_ELEMENT(ProtocolNamespace)] */
+ switch(state->eventCode) {
+ case 0:
+ errn = _exiDecodeStartElement(state, *qnameID = 2, 31, 18);
+ break;
+ }
+ break;
+ case 31:
+ /* Element[START_ELEMENT(VersionNumberMajor)] */
+ switch(state->eventCode) {
+ case 0:
+ errn = _exiDecodeStartElement(state, *qnameID = 5, 33, 46);
+ break;
+ }
+ break;
+ case 33:
+ /* Element[START_ELEMENT(VersionNumberMinor)] */
+ switch(state->eventCode) {
+ case 0:
+ errn = _exiDecodeStartElement(state, *qnameID = 6, 34, 35);
+ break;
+ }
+ break;
+ case 34:
+ /* Element[START_ELEMENT(SchemaID)] */
+ switch(state->eventCode) {
+ case 0:
+ errn = _exiDecodeStartElement(state, *qnameID = 4, 90, 45);
+ break;
+ }
+ break;
+ case 42:
+ /* FragmentContent[START_ELEMENT(AppProtocol), START_ELEMENT(Priority), START_ELEMENT(ProtocolNamespace), START_ELEMENT(ResponseCode), START_ELEMENT(SchemaID), START_ELEMENT(VersionNumberMajor), START_ELEMENT(VersionNumberMinor), START_ELEMENT({urn:iso:15118:2:2010:AppProtocol}supportedAppProtocolReq), START_ELEMENT({urn:iso:15118:2:2010:AppProtocol}supportedAppProtocolRes), START_ELEMENT_GENERIC, END_DOCUMENT] */
+ switch(state->eventCode) {
+ case 0:
+ errn = _exiDecodeStartElement(state, *qnameID = 0, 42, 5);
+ break;
+ case 1:
+ errn = _exiDecodeStartElement(state, *qnameID = 1, 42, 43);
+ break;
+ case 2:
+ errn = _exiDecodeStartElement(state, *qnameID = 2, 42, 18);
+ break;
+ case 3:
+ errn = _exiDecodeStartElement(state, *qnameID = 3, 42, 44);
+ break;
+ case 4:
+ errn = _exiDecodeStartElement(state, *qnameID = 4, 42, 45);
+ break;
+ case 5:
+ errn = _exiDecodeStartElement(state, *qnameID = 5, 42, 46);
+ break;
+ case 6:
+ errn = _exiDecodeStartElement(state, *qnameID = 6, 42, 35);
+ break;
+ case 7:
+ errn = _exiDecodeStartElement(state, *qnameID = 65, 42, 15);
+ break;
+ case 8:
+ errn = _exiDecodeStartElement(state, *qnameID = 66, 42, 16);
+ break;
+ }
+ break;
+ case 60:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ switch(state->eventCode) {
+ case 0:
+ errn = _exiDecodeStartElement(state, *qnameID = 0, 61, 5);
+ break;
+ }
+ break;
+ case 61:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ switch(state->eventCode) {
+ case 0:
+ errn = _exiDecodeStartElement(state, *qnameID = 0, 26, 5);
+ break;
+ }
+ break;
+ case 66:
+ /* Element[START_ELEMENT(SchemaID), END_ELEMENT] */
+ switch(state->eventCode) {
+ case 0:
+ errn = _exiDecodeStartElement(state, *qnameID = 4, 129, 45);
+ break;
+ }
+ break;
+ case 72:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ switch(state->eventCode) {
+ case 0:
+ errn = _exiDecodeStartElement(state, *qnameID = 0, 73, 5);
+ break;
+ }
+ break;
+ case 73:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ switch(state->eventCode) {
+ case 0:
+ errn = _exiDecodeStartElement(state, *qnameID = 0, 109, 5);
+ break;
+ }
+ break;
+ case 90:
+ /* Element[START_ELEMENT(Priority)] */
+ switch(state->eventCode) {
+ case 0:
+ errn = _exiDecodeStartElement(state, *qnameID = 1, 127, 43);
+ break;
+ }
+ break;
+ case 92:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ switch(state->eventCode) {
+ case 0:
+ errn = _exiDecodeStartElement(state, *qnameID = 0, 113, 5);
+ break;
+ }
+ break;
+ case 94:
+ /* Element[START_ELEMENT(AppProtocol)] */
+ switch(state->eventCode) {
+ case 0:
+ errn = _exiDecodeStartElement(state, *qnameID = 0, 3, 5);
+ break;
+ }
+ break;
+ case 97:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ switch(state->eventCode) {
+ case 0:
+ errn = _exiDecodeStartElement(state, *qnameID = 0, 39, 5);
+ break;
+ }
+ break;
+ case 109:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ switch(state->eventCode) {
+ case 0:
+ errn = _exiDecodeStartElement(state, *qnameID = 0, 110, 5);
+ break;
+ }
+ break;
+ case 110:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ switch(state->eventCode) {
+ case 0:
+ errn = _exiDecodeStartElement(state, *qnameID = 0, 60, 5);
+ break;
+ }
+ break;
+ case 113:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ switch(state->eventCode) {
+ case 0:
+ errn = _exiDecodeStartElement(state, *qnameID = 0, 115, 5);
+ break;
+ }
+ break;
+ case 115:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ switch(state->eventCode) {
+ case 0:
+ errn = _exiDecodeStartElement(state, *qnameID = 0, 72, 5);
+ break;
+ }
+ break;
+ case 117:
+ /* Element[START_ELEMENT(ResponseCode)] */
+ switch(state->eventCode) {
+ case 0:
+ errn = _exiDecodeStartElement(state, *qnameID = 3, 66, 44);
+ break;
+ }
+ break;
+ case 124:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ switch(state->eventCode) {
+ case 0:
+ errn = _exiDecodeStartElement(state, *qnameID = 0, 125, 5);
+ break;
+ }
+ break;
+ case 125:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ switch(state->eventCode) {
+ case 0:
+ errn = _exiDecodeStartElement(state, *qnameID = 0, 128, 5);
+ break;
+ }
+ break;
+ case 128:
+ /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
+ switch(state->eventCode) {
+ case 0:
+ errn = _exiDecodeStartElement(state, *qnameID = 0, 8, 5);
+ break;
+ }
+ break;
+
+ }
+ break;
+ case EXI_EVENT_START_ELEMENT_NS:
+ errn = EXI_ERROR_UNEXPECTED_START_ELEMENT;
+ break;
+ case EXI_EVENT_START_ELEMENT_GENERIC:
+ case EXI_EVENT_START_ELEMENT_GENERIC_UNDECLARED:
+ errn = _exiDecodeQName(stream, state, qnameID,
+ &_qname);
+ if (errn) {
+ return errn;
+ }
+
+ /* update current rule --> element content rule (if not already) */
+ errn = exi_appHand_MoveToElementContentRule(state);
+ if (errn) {
+ return errn;
+ }
+
+ /* retrieve global grammar(existing OR runtime) and push it stack */
+ errn = exi_appHand_RetrieveAndPushGlobalGrammar(state, *qnameID);
+ break;
+ default:
+ errn = EXI_ERROR_UNEXPECTED_START_ELEMENT;
+ break;
+ }
+
+ return errn;
+}
+
+
+
+/*int exiappHandDecodeStartElementGeneric(bitstream_t* stream, exi_state_t* state,
+ qname_t* qname) {
+ // decode qname
+ int errn = _exiDecodeQName(stream, &(state->nameTablePrepopulated), &(state->nameTableRuntime), qname);
+ if (errn) {
+ return errn;
+ }
+
+ switch (state->grammarStack[state->stackIndex]) {
+ // $EXI_DECODE_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 EXI_ERROR_UNEXPECTED_START_ELEMENT_GENERIC;
+}*/
+
+#ifndef __GNUC__
+#pragma warning( disable : 4100 ) /* warning unreferenced parameter 'stream' */
+#endif /* __GNUC__ */
+int exiappHandDecodeEndElement(bitstream_t* stream, exi_state_t* state, uint16_t* qnameID) {
+ int16_t currentID;
+ switch(currEvent) {
+ case EXI_EVENT_END_ELEMENT_UNDECLARED:
+ currentID = state->grammarStack[state->stackIndex];
+ if (currentID < 0) {
+ /* runtime grammars do have IDs smaller than 0 */
+ /* TODO learn EE event */
+ return -1;
+ }
+ /* Note: no break statement */
+ default:
+ /* copy IDs */
+ *qnameID = state->elementStack[state->stackIndex];
+ /*ee->localPart = state->elementStack[state->stackIndex].localPart;
+ ee->namespaceURI = state->elementStack[state->stackIndex].namespaceURI;*/
+
+ return exi_appHand_PopStack(state);
+ }
+}
+#ifndef __GNUC__
+#pragma warning( default : 4100 ) /* warning unreferenced parameter 'stream' */
+#endif /* __GNUC__ */
+
+/*int exiappHandDecodeEndElementUndeclared(bitstream_t* stream, exi_state_t* state, eqname_t* ee) {
+ int16_t currentID = state->grammarStack[state->stackIndex];
+ if (currentID < 0) {
+ // runtime grammars do have IDs smaller than 0
+ // TODO learn EE event
+ return -1;
+ }
+
+ return exiappHandDecodeEndElement(stream, state, ee);
+}*/
+
+int exiappHandDecodeCharacters(bitstream_t* stream, exi_state_t* state,
+ exi_value_t* val) {
+ int16_t moveOnID = 0;
+ errn = EXI_ERROR_UNEXPECTED_CHARACTERS;
+
+ switch(currEvent) {
+ case EXI_EVENT_CHARACTERS:
+ case EXI_EVENT_CHARACTERS_GENERIC:
+ switch (state->grammarStack[state->stackIndex]) {
+ case 53:
+ /* DECIMAL */
+ case 116:
+ /* DECIMAL */
+ val->type = EXI_DATATYPE_DECIMAL;
+ errn = decodeDecimal(stream, &val->decimal);
+ moveOnID = 2; /* move on ID */
+ break;
+ case 10:
+ /* STRING */
+ case 12:
+ /* STRING */
+ case 18:
+ /* STRING */
+ case 20:
+ /* STRING */
+ case 24:
+ /* STRING */
+ case 32:
+ /* STRING */
+ case 36:
+ /* STRING */
+ case 38:
+ /* STRING */
+ case 40:
+ /* STRING */
+ case 41:
+ /* STRING */
+ case 48:
+ /* STRING */
+ case 54:
+ /* STRING */
+ case 55:
+ /* STRING */
+ case 58:
+ /* STRING */
+ case 67:
+ /* STRING */
+ case 70:
+ /* STRING */
+ case 77:
+ /* STRING */
+ case 78:
+ /* STRING */
+ case 79:
+ /* STRING */
+ case 85:
+ /* STRING */
+ case 86:
+ /* STRING */
+ case 87:
+ /* STRING */
+ case 96:
+ /* STRING */
+ case 98:
+ /* STRING */
+ case 101:
+ /* STRING */
+ case 106:
+ /* STRING */
+ case 114:
+ /* STRING */
+ case 118:
+ /* STRING */
+ case 120:
+ /* STRING */
+ case 131:
+ /* STRING */
+ case 137:
+ /* STRING */
+ case 141:
+ /* STRING */
+ case 142:
+ /* STRING */
+ case 143:
+ /* STRING */
+ val->type = EXI_DATATYPE_STRING;
+ errn = decodeStringValue(stream, state, state->elementStack[state->stackIndex], &val->str);
+ moveOnID = 2; /* move on ID */
+ break;
+ case 25:
+ /* LIST */
+ case 29:
+ /* LIST */
+ case 65:
+ /* LIST */
+ case 95:
+ /* LIST */
+ case 140:
+ /* LIST */
+ case 144:
+ /* LIST */
+ val->type = EXI_DATATYPE_LIST;
+ val->list.type = EXI_DATATYPE_STRING;
+ errn = decodeUnsignedInteger16(stream, &val->list.len);
+ moveOnID = 2; /* move on ID */
+ break;
+ case 112:
+ /* DATETIME */
+ case 126:
+ /* DATETIME */
+ val->type = EXI_DATATYPE_DATETIME;
+ errn = decodeDateTime(stream, EXI_DATETIME_TIME, &val->datetime);
+ moveOnID = 2; /* move on ID */
+ break;
+ case 28:
+ /* BINARY_HEX */
+ case 132:
+ /* BINARY_HEX */
+ val->type = EXI_DATATYPE_BINARY_HEX;
+ errn = decodeBinary(stream, &val->binary);
+ moveOnID = 2; /* move on ID */
+ break;
+ case 74:
+ /* DATETIME */
+ case 123:
+ /* DATETIME */
+ val->type = EXI_DATATYPE_DATETIME;
+ errn = decodeDateTime(stream, EXI_DATETIME_GYEARMONTH, &val->datetime);
+ moveOnID = 2; /* move on ID */
+ break;
+ case 1:
+ /* NBIT_UNSIGNED_INTEGER */
+ case 45:
+ /* NBIT_UNSIGNED_INTEGER */
+ case 75:
+ /* NBIT_UNSIGNED_INTEGER */
+ case 122:
+ /* NBIT_UNSIGNED_INTEGER */
+ val->type = EXI_DATATYPE_NBIT_UNSIGNED_INTEGER;
+ errn = _decodeNBitIntegerValue(stream, &val->integer, 8, 0);
+ moveOnID = 2; /* move on ID */
+ break;
+ case 88:
+ /* DATETIME */
+ case 104:
+ /* DATETIME */
+ val->type = EXI_DATATYPE_DATETIME;
+ errn = decodeDateTime(stream, EXI_DATETIME_DATETIME, &val->datetime);
+ moveOnID = 2; /* move on ID */
+ break;
+ case 56:
+ /* NBIT_UNSIGNED_INTEGER */
+ case 134:
+ /* NBIT_UNSIGNED_INTEGER */
+ val->type = EXI_DATATYPE_NBIT_UNSIGNED_INTEGER;
+ errn = _decodeNBitIntegerValue(stream, &val->integer, 8, -128);
+ moveOnID = 2; /* move on ID */
+ break;
+ case 100:
+ /* DATETIME */
+ case 139:
+ /* DATETIME */
+ val->type = EXI_DATATYPE_DATETIME;
+ errn = decodeDateTime(stream, EXI_DATETIME_GMONTHDAY, &val->datetime);
+ moveOnID = 2; /* move on ID */
+ break;
+ case 17:
+ /* INTEGER */
+ case 47:
+ /* INTEGER */
+ case 68:
+ /* INTEGER */
+ case 69:
+ /* INTEGER */
+ case 76:
+ /* INTEGER */
+ case 83:
+ /* INTEGER */
+ case 89:
+ /* INTEGER */
+ case 91:
+ /* INTEGER */
+ case 93:
+ /* INTEGER */
+ case 107:
+ /* INTEGER */
+ case 136:
+ /* INTEGER */
+ case 138:
+ /* INTEGER */
+ val->type = EXI_DATATYPE_INTEGER;
+ errn = decodeInteger(stream, &val->integer);
+ moveOnID = 2; /* move on ID */
+ break;
+ case 71:
+ /* ENUMERATION */
+ case 44:
+ /* ENUMERATION */
+ val->type = EXI_DATATYPE_ENUMERATION;
+ errn = decodeNBitUnsignedInteger(stream, 2, &val->enumeration);
+ moveOnID = 2; /* move on ID */
+ break;
+ case 64:
+ /* DATETIME */
+ case 82:
+ /* DATETIME */
+ val->type = EXI_DATATYPE_DATETIME;
+ errn = decodeDateTime(stream, EXI_DATETIME_GMONTH, &val->datetime);
+ moveOnID = 2; /* move on ID */
+ break;
+ case 84:
+ /* DATETIME */
+ case 99:
+ /* DATETIME */
+ val->type = EXI_DATATYPE_DATETIME;
+ errn = decodeDateTime(stream, EXI_DATETIME_GYEAR, &val->datetime);
+ moveOnID = 2; /* move on ID */
+ break;
+ case 121:
+ /* DATETIME */
+ case 133:
+ /* DATETIME */
+ val->type = EXI_DATATYPE_DATETIME;
+ errn = decodeDateTime(stream, EXI_DATETIME_DATE, &val->datetime);
+ moveOnID = 2; /* move on ID */
+ break;
+ case 63:
+ /* DATETIME */
+ case 135:
+ /* DATETIME */
+ val->type = EXI_DATATYPE_DATETIME;
+ errn = decodeDateTime(stream, EXI_DATETIME_GDAY, &val->datetime);
+ moveOnID = 2; /* move on ID */
+ break;
+ case 22:
+ /* STRING */
+ case 23:
+ /* STRING */
+ val->type = EXI_DATATYPE_STRING;
+ errn = decodeStringValue(stream, state, state->elementStack[state->stackIndex], &val->str);
+ moveOnID = 23; /* move on ID */
+ break;
+ case 11:
+ /* FLOAT */
+ case 62:
+ /* FLOAT */
+ case 103:
+ /* FLOAT */
+ case 130:
+ /* FLOAT */
+ val->type = EXI_DATATYPE_FLOAT;
+ errn = decodeFloat(stream, &val->float_me);
+ moveOnID = 2; /* move on ID */
+ break;
+ case 19:
+ /* NBIT_UNSIGNED_INTEGER */
+ case 43:
+ /* NBIT_UNSIGNED_INTEGER */
+ val->type = EXI_DATATYPE_NBIT_UNSIGNED_INTEGER;
+ errn = _decodeNBitIntegerValue(stream, &val->integer, 5, 1);
+ moveOnID = 2; /* move on ID */
+ break;
+ case 37:
+ /* BOOLEAN */
+ case 80:
+ /* BOOLEAN */
+ val->type = EXI_DATATYPE_BOOLEAN;
+ errn = decodeBoolean(stream, &val->boolean);
+ moveOnID = 2; /* move on ID */
+ break;
+ case 7:
+ /* UNSIGNED_INTEGER */
+ case 21:
+ /* UNSIGNED_INTEGER */
+ case 49:
+ /* UNSIGNED_INTEGER */
+ case 57:
+ /* UNSIGNED_INTEGER */
+ case 59:
+ /* UNSIGNED_INTEGER */
+ case 46:
+ /* UNSIGNED_INTEGER */
+ case 81:
+ /* UNSIGNED_INTEGER */
+ case 35:
+ /* UNSIGNED_INTEGER */
+ case 102:
+ /* UNSIGNED_INTEGER */
+ case 108:
+ /* UNSIGNED_INTEGER */
+ case 119:
+ /* UNSIGNED_INTEGER */
+ case 145:
+ /* UNSIGNED_INTEGER */
+ val->type = EXI_DATATYPE_UNSIGNED_INTEGER;
+ errn = decodeUnsignedInteger(stream, &val->integer);
+ moveOnID = 2; /* move on ID */
+ break;
+ case 50:
+ /* STRING */
+ case 51:
+ /* STRING */
+ val->type = EXI_DATATYPE_STRING;
+ errn = decodeStringValue(stream, state, state->elementStack[state->stackIndex], &val->str);
+ moveOnID = 51; /* move on ID */
+ break;
+ case 52:
+ /* BINARY_BASE64 */
+ case 111:
+ /* BINARY_BASE64 */
+ val->type = EXI_DATATYPE_BINARY_BASE64;
+ errn = decodeBinary(stream, &val->binary);
+ moveOnID = 2; /* move on ID */
+ break;
+
+ }
+ if (errn) {
+ /* error */
+ } else {
+ /* move on */
+ state->grammarStack[state->stackIndex] = moveOnID;
+ }
+ break;
+ case EXI_EVENT_CHARACTERS_GENERIC_UNDECLARED:
+ if (state->grammarStack[state->stackIndex] < 0) {
+ /* runtime grammars do have IDs smaller than 0 */
+ return EXI_UNSUPPORTED_GRAMMAR_LEARNING_CH;
+ }
+
+ /* update current rule --> element content rule (if not already) */
+ errn = exi_appHand_MoveToElementContentRule(state);
+ if (errn) {
+ return errn;
+ }
+
+ /* read content value as STRING */
+ val->type = EXI_DATATYPE_STRING;
+ errn = decodeStringValue(stream, state, state->elementStack[state->stackIndex], &val->str);
+ break;
+ default:
+ errn = EXI_ERROR_UNEXPECTED_CHARACTERS;
+ break;
+ }
+
+ return errn;
+}
+
+/*int exiappHandDecodeCharactersGeneric(bitstream_t* stream, exi_state_t* state,
+ exi_value_t* val) {
+ return exiappHandDecodeCharacters(stream, state, val);
+}*/
+
+/*int exiappHandDecodeCharactersGenericUndeclared(bitstream_t* stream, exi_state_t* state,
+ exi_value_t* val) {
+ int errn = 0;
+ if (state->grammarStack[state->stackIndex] < 0) {
+ // runtime grammars do have IDs smaller than 0
+ // TODO learn CH event
+ return -1;
+ }
+
+ // update current rule --> element content rule (if not already)
+ errn = exiMoveToElementContentRule(state);
+ if (errn) {
+ return errn;
+ }
+
+ // read content value
+ // STRING
+ val->type = EXI_DATATYPE_STRING;
+ errn = decodeStringValue(stream, &val->string);
+ return errn;
+}*/
+
+int exiappHandDecodeAttributeGenericValue(bitstream_t* stream, exi_state_t* state, uint16_t* qnameID, exi_value_t* val) {
+ int16_t currentID;
+
+ if (_qname.uri.id == 2 && _qname.localName.id == 1 ) {
+ /* xsi:type --> QName type */
+ errn = exiappHandDecodeAttributeXsiType(stream, state, val);
+ } else {
+ currentID = state->grammarStack[state->stackIndex];
+ if (currentID >= 0) {
+ /* if schema-informed value type according global attribute */
+ switch(*qnameID) {
+
+ default:
+ val->type = EXI_DATATYPE_STRING;
+ errn = decodeStringValue(stream, state, *qnameID, &val->str);
+ break;
+ }
+
+ } else {
+ val->type = EXI_DATATYPE_STRING;
+ errn = decodeStringValue(stream, state, *qnameID, &val->str);
+ }
+ }
+
+ return errn;
+}
+
+int exiappHandDecodeAttribute(bitstream_t* stream, exi_state_t* state,
+ uint16_t* qnameID, exi_value_t* val) {
+ int16_t moveOnID = 0;
+ int16_t currentID = state->grammarStack[state->stackIndex];
+ errn = EXI_ERROR_UNEXPECTED_ATTRIBUTE;
+
+ switch(currEvent) {
+ case EXI_EVENT_ATTRIBUTE:
+ case EXI_EVENT_ATTRIBUTE_INVALID_VALUE:
+ switch (currentID) {
+
+ }
+
+ if (errn) {
+ /* error */
+ } else {
+ /* move on */
+ state->grammarStack[state->stackIndex] = moveOnID;
+ }
+ break;
+ case EXI_EVENT_ATTRIBUTE_GENERIC:
+ case EXI_EVENT_ATTRIBUTE_GENERIC_UNDECLARED:
+ errn = _exiDecodeQName(stream, state, qnameID, &_qname);
+ if (errn) {
+ return errn;
+ }
+ /* learn attribute ? */
+ errn = exi_appHand_LearnAttribute(state, *qnameID, _qname.uri.id, _qname.localName.id);
+ if (errn) {
+ return errn;
+ }
+ /* decode attribute value */
+ errn = exiappHandDecodeAttributeGenericValue(stream, state, qnameID, val);
+ break;
+ default:
+ errn = EXI_ERROR_UNEXPECTED_ATTRIBUTE;
+ break;
+ }
+
+ return errn;
+}
+
+
+
+/*int exiappHandDecodeAttributeGenericUndeclared(bitstream_t* stream, exi_state_t* state,
+ qname_t* at, exi_value_t* val) {
+ int errn;
+ int16_t currentID = state->grammarStack[state->stackIndex];
+
+ if (currentID < 0) {
+ // TODO runtime elements
+ return -1;
+ } else {
+ // decode qname
+ errn = _exiDecodeQName(stream, &(state->nameTablePrepopulated), &(state->nameTableRuntime), at);
+ if (errn) {
+ return errn;
+ }
+ }
+
+
+ if (currentID < 0) {
+ // TODO learn AT event
+ return -1;
+ }
+
+ decode attribute value
+ val->type = EXI_DATATYPE_STRING;
+ errn = decodeStringValue(stream, &val->string);
+
+ // we do not move forward in grammars
+
+ return errn;
+}*/
+
+
+
+int exiappHandDecodeAttributeXsiNil(bitstream_t* stream, exi_state_t* state,
+ exi_value_t* val) {
+ errn = decodeBoolean(stream, &val->boolean);
+ if (errn >= 0 && val->boolean) {
+ /* handle xsi:nil == true */
+ errn = exi_appHand_HandleXsiNilTrue(state);
+ }
+ return errn;
+}
+
+
+int exiappHandDecodeAttributeXsiType(bitstream_t* stream, exi_state_t* state,
+ exi_value_t* val) {
+ /*uint32_t uriID;
+ uint32_t localNameID; */
+ /* uri */
+ errn =_exiDecodeNamespaceUri(stream, state, &_qname.uri); /* NULL, &uriID); */
+ if (errn) {
+ return errn;
+ }
+ /* localName */
+ errn = _exiDecodeLocalName(stream, state, _qname.uri.id, &_qname.localName); /* NULL, &localNameID, uriID);*/
+ if (errn) {
+ return errn;
+ }
+
+ val->type = EXI_DATATYPE_QNAME;
+ val->eqname.namespaceURI = _qname.uri.id; /* uriID; */
+ val->eqname.localPart = _qname.localName.id; /* localNameID; */
+
+ /* handle xsi type cast */
+ errn = exi_appHand_HandleXsiType(state, &val->eqname);
+
+ return errn;
+}
+
+
+
+#endif
+
diff --git a/src/codec/appHandCodec/appHandEXIDecoder.h b/src/codec/appHandCodec/appHandEXIDecoder.h
new file mode 100644
index 0000000..ecb3f52
--- /dev/null
+++ b/src/codec/appHandCodec/appHandEXIDecoder.h
@@ -0,0 +1,222 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXIdizer.com
+ ********************************************************************/
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef EXI_appHand_DECODER_H
+#define EXI_appHand_DECODER_H
+
+/**
+* \file EXIDecoder.h
+* \brief EXI Decoder
+*
+*/
+
+#include "EXITypes.h"
+
+/**
+ * \brief Initialize EXI decoder
+ *
+ * Resets & initializes the EXI decoder.
+ *
+ * \param stream Input Stream
+ * \param state Codec state
+ * \param runtimeTable Runtime name-tables
+ * \param stringTable String table
+ * \return Error-Code <> 0
+ *
+ */
+int exiappHandInitDecoder(bitstream_t* stream, exi_state_t* state,
+ exi_name_table_runtime_t runtimeTable, exi_string_table_t stringTable);
+
+
+/**
+ * \brief Reports last decoded qualified name
+ *
+ * Note: Qualified name only available for previously unknown qname. Otherwise make use of name table entries.
+ *
+ * \param qname Qualified name
+ * \return Error-Code <> 0
+ *
+ */
+int exiappHandGetLastQName(exi_qname_t** qname);
+
+
+/**
+ * \brief Decodes next event
+ *
+ * Inspects EXI stream and decodes next EXI event.
+ *
+ * \param stream Input Stream
+ * \param state Codec state
+ * \param nextEvent Next event
+ * \return Error-Code <> 0
+ *
+ */
+int exiappHandDecodeNextEvent(bitstream_t* stream,
+ exi_state_t* state, exi_event_t* nextEvent);
+
+
+/**
+ * \brief Decodes StartDocument (SD) event
+ *
+ * \param stream Input Stream
+ * \param state Codec state
+ * \return Error-Code <> 0
+ *
+ */
+int exiappHandDecodeStartDocument(bitstream_t* stream,
+ exi_state_t* state);
+
+/**
+ * \brief Decodes EndDocument (ED) event
+ *
+ * \param stream Input Stream
+ * \param state Codec state
+ * \return Error-Code <> 0
+ *
+ */
+int exiappHandDecodeEndDocument(bitstream_t* stream,
+ exi_state_t* state);
+
+/**
+ * \brief Decodes StartElemnt (SE) event
+ *
+ * Note: The first time a qnameID is larger than schema-informed NUMBER_OF_QNAMES it is possible to retrieve the qname by calling GetLastQName(...).
+ * It is up to the caller to track qnames.
+ *
+ * \param stream Input Stream
+ * \param state Codec state
+ * \param qnameID Qualified Name ID
+ * \return Error-Code <> 0
+ *
+ */
+int
+exiappHandDecodeStartElement(bitstream_t* stream,
+ exi_state_t* state, uint16_t* qnameID);
+
+
+/**
+ * \brief Decodes EndElement (EE) event
+ *
+ * \param stream Input Stream
+ * \param state Codec state
+ * \param qnameID Qualified Name ID
+ * \return Error-Code <> 0
+ *
+ */
+int exiappHandDecodeEndElement(bitstream_t* stream,
+ exi_state_t* state, uint16_t* qnameID);
+
+
+/**
+ * \brief Decodes Characters (CH) event.
+ *
+ * Reports characters value.
+ *
+ * \param stream Input Stream
+ * \param state Codec state
+ * \param val Characters value
+ * \return Error-Code <> 0
+ *
+ */
+int exiappHandDecodeCharacters(bitstream_t* stream,
+ exi_state_t* state, exi_value_t* val);
+
+
+/**
+ * \brief Decodes Attribute (AT) event.
+ *
+ * Reports attribute qname and value.
+ *
+ * \param stream Input Stream
+ * \param state Codec state
+ * \param qnameID Qualified Name ID
+ * \param val Characters value
+ * \return Error-Code <> 0
+ *
+ */
+int exiappHandDecodeAttribute(bitstream_t* stream,
+ exi_state_t* state, uint16_t* qnameID, exi_value_t* val);
+
+
+/**
+ * \brief Decodes attribute xsi:nil
+ *
+ * Reports value.
+ *
+ * \param stream Input Stream
+ * \param state Codec state
+ * \param val Characters value
+ * \return Error-Code <> 0
+ *
+ */
+int exiappHandDecodeAttributeXsiNil(bitstream_t* stream,
+ exi_state_t* state, exi_value_t* val);
+
+
+/**
+ * \brief Decodes attribute xsi:type
+ *
+ * Reports value.
+ *
+ * \param stream Input Stream
+ * \param state Codec state
+ * \param val Characters value
+ * \return Error-Code <> 0
+ *
+ */
+int exiappHandDecodeAttributeXsiType(bitstream_t* stream,
+ exi_state_t* state, exi_value_t* val);
+
+
+/**
+ * \brief Decodes attribute/characters list value
+ *
+ * List values are special and are processed one by one.
+ *
+ * \param stream Input Stream
+ * \param state Codec state
+ * \param qnameID Qualified Name ID
+ * \param val List value
+ * \param lt List type
+ * \return Error-Code <> 0
+ *
+ */
+int exiappHandDecodeListValue(bitstream_t* stream, exi_state_t* state, uint16_t qnameID,
+ exi_value_t* val, exi_list_t lt);
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/codec/appHandCodec/appHand_EXIEncoder.c b/src/codec/appHandCodec/appHandEXIEncoder.c
similarity index 56%
rename from src/codec/appHandCodec/appHand_EXIEncoder.c
rename to src/codec/appHandCodec/appHandEXIEncoder.c
index bff5ce6..e79d7ea 100644
--- a/src/codec/appHandCodec/appHand_EXIEncoder.c
+++ b/src/codec/appHandCodec/appHandEXIEncoder.c
@@ -19,10 +19,10 @@
/*******************************************************************
*
* @author Daniel.Peintner.EXT@siemens.com
- * @version 0.6
+ * @version 0.7
* @contact Joerg.Heuer@siemens.com
*
- *
+ ********************************************************************/
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef EXI_appHand_ENCODER_H
+#define EXI_appHand_ENCODER_H
+
+/**
+* \file EXIEncoder.h
+* \brief EXI Encoder
+*
+*/
+
+#include "EXITypes.h"
+#include "appHandEXIEncoder.h"
+
+/**
+ * \brief Initialize EXI encoder
+ *
+ * Resets & initializes the EXI encoder.
+ *
+ * \param stream Output Stream
+ * \param state Codec state
+ * \param runtimeTable Runtime name-tables
+ * \param stringTable String table
+ * \return Error-Code <> 0
+ *
+ */
+int exiappHandInitEncoder(bitstream_t* stream, exi_state_t* state,
+ exi_name_table_runtime_t runtimeTable, exi_string_table_t stringTable);
+
+/**
+ * \brief Reports the beginning of a set of XML events
+ *
+ * see EXI StartDocument (SD) event
+ *
+ * \param stream Output Stream
+ * \param state Codec state
+ * \return Error-Code <> 0
+ *
+ */
+int exiappHandEncodeStartDocument(bitstream_t* stream,
+ exi_state_t* state);
+
+/**
+ * \brief Reports the end of a set of XML events
+ *
+ * see EXI EndDocument (ED) event
+ *
+ * \param stream Output Stream
+ * \param state Codec state
+ * \return Error-Code <> 0
+ *
+ */
+int exiappHandEncodeEndDocument(bitstream_t* stream,
+ exi_state_t* state);
+
+/**
+ * \brief Supplies the start of a known element
+ *
+ * Provides access to the namespace URI and local name of the start tag by providing qnameID.
+ * Note: Both, namespace URI and local name are known (schema-informed) or have been encoded before.
+ * see EXI StartElement (SE) event
+ *
+ * \param stream Output Stream
+ * \param state Codec state
+ * \param qnameID qualified name ID
+ * \return Error-Code <> 0
+ *
+ */
+int
+exiappHandEncodeStartElement(bitstream_t* stream,
+ exi_state_t* state, uint16_t qnameID);
+
+/**
+ * \brief Supplies the start of an element where the namespace is known
+ *
+ * Note: Namespace URI is known (schema-informed) or has been encoded before while local name is unknown.
+ * see EXI StartElement (SE) event
+ *
+ * \param stream Output Stream
+ * \param state Codec state
+ * \param namespaceUriID namespace URI ID
+ * \param localName local name as string
+ * \return Error-Code <> 0
+ *
+ */
+int exiappHandEncodeStartElementNS(bitstream_t* stream,
+ exi_state_t* state, uint16_t namespaceUriID,
+ exi_string_ucs_t* localName);
+
+/**
+ * \brief Supplies the start of an element where the namespace and the local name is unknown
+ *
+ * Note: Neither namespace URI nor local name is known.
+ * see EXI StartElement (SE) event
+ *
+ * \param stream Output Stream
+ * \param state Codec state
+ * \param namespaceUri namespace URI as string
+ * \param localName local name as string
+ * \return Error-Code <> 0
+ *
+ */
+int exiappHandEncodeStartElementGeneric(bitstream_t* stream,
+ exi_state_t* state, exi_string_ucs_t* namespaceUri,
+ exi_string_ucs_t* localName);
+
+/**
+ * \brief Supplies the end tag of an element
+ *
+ * see EXI EndElement (EE) event
+ *
+ * \param stream Output Stream
+ * \param state Codec state
+ * \return Error-Code <> 0
+ *
+ */
+int exiappHandEncodeEndElement(bitstream_t* stream,
+ exi_state_t* state);
+
+/**
+ * \brief Supplies characters value
+ *
+ * Note: Special handling for list value.
+ * see EXI Characters (CH) event
+ *
+ * \param stream Output Stream
+ * \param state Codec state
+ * \param val Characters value
+ * \return Error-Code <> 0
+ *
+ */
+int exiappHandEncodeCharacters(bitstream_t* stream,
+ exi_state_t* state, exi_value_t* val);
+
+/**
+ * \brief Supplies an attribute qname and value
+ *
+ * Note: Special handling for list value.
+ * see EXI Attribute (AT) event
+ *
+ * \param stream Output Stream
+ * \param state Codec state
+ * \param qnameID qualified name ID
+ * \param val Attribute value
+ * \return Error-Code <> 0
+ *
+ */
+int exiappHandEncodeAttribute(bitstream_t* stream,
+ exi_state_t* state, uint16_t qnameID, exi_value_t* val);
+
+
+
+
+/**
+ * \brief Supplies an attribute qname and value where the namespace is known
+ *
+ * Note: Special handling for list value.
+ * see EXI Attribute (AT) event
+ *
+ * \param stream Output Stream
+ * \param state Codec state
+ * \param namespaceUriID Qualified namespace URI ID
+ * \param localName Qualified localname as String
+ * \param val Attribute value
+ * \return Error-Code <> 0
+ *
+ */
+int exiappHandEncodeAttributeNS(bitstream_t* stream,
+ exi_state_t* state, uint16_t namespaceUriID,
+ exi_string_ucs_t* localName, exi_value_t* val);
+
+
+/**
+ * \brief Supplies an attribute qname and value where the namespace and the local name is unknown
+ *
+ *
+ * \param stream Output Stream
+ * \param state Codec state
+ * \param namespaceUri namespace URI as string
+ * \param localName local name as string
+ * \param val Attribute value
+ * \return Error-Code <> 0
+ *
+ */
+int exiappHandEncodeAttributeGeneric(bitstream_t* stream,
+ exi_state_t* state, exi_string_ucs_t* namespaceUri,
+ exi_string_ucs_t* localName, exi_value_t* val);
+
+
+
+/**
+ * \brief Supplies an xsi:nil attribute
+ *
+ * see EXI Attribute (AT) event
+ *
+ * \param stream Output Stream
+ * \param state Codec state
+ * \param val Attribute value
+ * \return Error-Code <> 0
+ *
+ */
+int exiappHandEncodeAttributeXsiNil(bitstream_t* stream,
+ exi_state_t* state, exi_value_t* val);
+
+/**
+ * \brief Supplies an xsi:type attribute
+ *
+ * see EXI Attribute (AT) event
+ *
+ * \param stream Output Stream
+ * \param state Codec state
+ * \param val Attribute value
+ * \return Error-Code <> 0
+ *
+ */
+int exiappHandEncodeAttributeXsiType(bitstream_t* stream,
+ exi_state_t* state, exi_value_t* val);
+
+/**
+ * \brief Supplies list value for characters and attribute event
+ *
+ * List values are special given that first the number and type of entry needs to be passed (element/attribute event) and then one by one the actual values.
+ *
+ * \param stream Output Stream
+ * \param state Codec state
+ * \param qnameID qualified name ID
+ * \param val one list value
+ * \param lt list type
+ * \return Error-Code <> 0
+ *
+ */
+int exiappHandEncodeListValue(bitstream_t* stream,
+ exi_state_t* state, uint16_t qnameID, exi_value_t* val, exi_list_t lt);
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/src/codec/appHandCodec/appHandNameTableEntries.c b/src/codec/appHandCodec/appHandNameTableEntries.c
new file mode 100644
index 0000000..5ede2f7
--- /dev/null
+++ b/src/codec/appHandCodec/appHandNameTableEntries.c
@@ -0,0 +1,98 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
********************************************************************/
diff --git a/src/codec/appHandCodec/appHandQNameDefines.h b/src/codec/appHandCodec/appHandQNameDefines.h
new file mode 100644
index 0000000..ac6dbce
--- /dev/null
+++ b/src/codec/appHandCodec/appHandQNameDefines.h
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
Code generated by EXIdizer.com
+ ********************************************************************/
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifndef EXI_appHand_QNAME_DEFINES_H
+#define EXI_appHand_QNAME_DEFINES_H
+
+/** Number of pre-populated qnames */
+#define EXI_appHandNUMBER_OF_PREPOPULATED_QNAMES 67
+
+/** Number of runtime qnames */
+#define EXI_appHandMAX_NUMBER_OF_SUPPORTED_RUNTIMES_QNAMES 100
+
+/** Number of overall qnames (pre-populated from schema and runtime qnames) */
+#define EXI_appHandMAX_NUMBER_OF_QNAMES (EXI_appHandNUMBER_OF_PREPOPULATED_QNAMES + EXI_appHandMAX_NUMBER_OF_SUPPORTED_RUNTIMES_QNAMES)
+
+
+#endif
+
+#ifdef __cplusplus
+}
+#endif
diff --git a/src/codec/appHandCodec/appHandQNames.c b/src/codec/appHandCodec/appHandQNames.c
new file mode 100644
index 0000000..238eb49
--- /dev/null
+++ b/src/codec/appHandCodec/appHandQNames.c
@@ -0,0 +1,223 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *
+ ********************************************************************/
+
+
+
+#ifndef EXI_appHand_QNAMES_H
+#define EXI_appHand_QNAMES_H
+
+#include "EXITypes.h"
+
+/**
+ * \brief Returns efficient qname (namespaceURI & localName) IDs for qnameID
+ *
+ * \param state Codec state
+ * \param qnameID Qualified name ID
+ * \param namespaceURI QName namespace URI ID
+ * \param localPart QName local name ID
+ * \return Error-Code <> 0
+ *
+ */
+int exiappHandGetEQName(exi_state_t* state, uint16_t qnameID, uint16_t* namespaceURI, uint16_t* localPart);
+
+
+/**
+ * \brief Returns qnameID for qname namespaceURI & localName
+ *
+ * \param state Codec state
+ * \param namespaceURI QName namespace URI ID
+ * \param localPart QName local name ID
+ * \param qnameID QName ID (out)
+ * \return Error-Code <> 0
+ *
+ */
+int exiappHandGetQNameID(exi_state_t* state, uint16_t namespaceURI, uint16_t localPart, uint16_t* qnameID);
+
+
+/**
+ * \brief Add efficient qname (namespaceURI & localName) IDs for qnameID
+ *
+ * \param state Codec state
+ * \param qnameID Qualified name ID
+ * \param namespaceURI QName namespace URI ID
+ * \param localPart QName local name ID
+ * \return Error-Code <> 0
+ *
+ */
+int exiappHandAddEQName(exi_state_t* state, uint16_t* qnameID, uint16_t namespaceURI, uint16_t localPart);
+
+#endif
+
diff --git a/src/codec/appHandCodec/appHand_EXIDecoder.c b/src/codec/appHandCodec/appHand_EXIDecoder.c
deleted file mode 100644
index 43f8b85..0000000
--- a/src/codec/appHandCodec/appHand_EXIDecoder.c
+++ /dev/null
@@ -1,1881 +0,0 @@
-/*
- * Copyright (C) 2007-2012 Siemens AG
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-/*******************************************************************
- *
- * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.6
- * @contact Joerg.Heuer@siemens.com
- *
- *
Code generated by EXIdizer
- ********************************************************************/
-
-
-
-#ifndef EXI_appHand_DECODER_C
-#define EXI_appHand_DECODER_C
-
-#include "EXITypes.h"
-#include "BitInputStream.h"
-#include "DecoderChannel.h"
-#include "CoderChannel.h"
-
-#include "StringTable.h"
-#include "appHand_NameTableEntries.h"
-#include "MethodsBag.h"
-
-#include "EXICoder.h"
-#include "EXIHeaderDecoder.h"
-
-
-
-/* local variables */
-static uint32_t bits;
-static int errn;
-
-
-int exiappHandDecodeListValue(bitstream_t* stream, exi_value_t* val, list_t lt) {
- uint32_t uint32;
-
- val->type = lt.type;
-
- switch(lt.type) {
- case EXI_DATATYPE_BINARY_BASE64:
- case EXI_DATATYPE_BINARY_HEX:
- errn = decodeBinary(stream, &val->binary);
- break;
- case EXI_DATATYPE_BOOLEAN:
- errn = decodeBoolean(stream, &val->boolean);
- break;
- case EXI_DATATYPE_BOOLEAN_FACET:
- errn = decodeNBitUnsignedInteger(stream, 2, &uint32);
- val->boolean = uint32 > 1;
- break;
- case EXI_DATATYPE_DECIMAL:
- errn = decodeDecimal(stream, &val->decimal);
- break;
- case EXI_DATATYPE_FLOAT:
- errn = decodeFloat(stream, &val->float_me);
- break;
- case EXI_DATATYPE_NBIT_UNSIGNED_INTEGER:
- case EXI_DATATYPE_UNSIGNED_INTEGER:
- case EXI_DATATYPE_INTEGER:
- switch(lt.intType) {
- /* (Signed) Integer */
- case EXI_UNSIGNED_INTEGER_8:
- case EXI_UNSIGNED_INTEGER_16:
- case EXI_UNSIGNED_INTEGER_32:
- case EXI_UNSIGNED_INTEGER_64:
- errn = decodeUnsignedInteger(stream, &val->integer);
- break;
- /* (Signed) Integer */
- case EXI_INTEGER_8:
- case EXI_INTEGER_16:
- case EXI_INTEGER_32:
- case EXI_INTEGER_64:
- errn = decodeInteger(stream, &val->integer);
- break;
- }
- break;
- case EXI_DATATYPE_DATETIME:
- errn = decodeDateTime(stream,lt.datetimeType, &val->datetime);
- break;
- case EXI_DATATYPE_STRING:
- errn = decodeStringValue(stream, &val->string);
- break;
- default:
- return EXI_UNSUPPORTED_LIST_VALUE_TYPE;
- }
-
- return errn;
-}
-
-
-
-
-int exiappHandInitDecoder(bitstream_t* stream, exi_state_t* state, exi_name_table_runtime_t runtimeTable) {
- /* init grammar state */
- state->stackIndex = 0;
- state->grammarStack[0] = DOCUMENT;
- /* string table */
- state->nameTablePrepopulated = exiappHandNameTablePrepopulated;
- state->nameTableRuntime = runtimeTable;
- /* decode header */
- return readEXIHeader(stream);
-}
-
-static int exiDecodeNext2Event(bitstream_t* stream, exi_state_t* state,
- exi_event_t* nextEvent) {
- uint32_t eventCode2 = 0;
-
- switch (state->grammarStack[state->stackIndex]) {
- 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 103:
- /* FirstStartTag[CHARACTERS[DATETIME]] */
- case 7:
- /* FirstStartTag[CHARACTERS[STRING]] */
- case 133:
- /* FirstStartTag[CHARACTERS[STRING]] */
- case 123:
- /* FirstStartTag[CHARACTERS[STRING]] */
- case 61:
- /* FirstStartTag[CHARACTERS[STRING]] */
- case 99:
- /* FirstStartTag[CHARACTERS[DATETIME]] */
- case 107:
- /* FirstStartTag[CHARACTERS[BINARY_HEX]] */
- case 73:
- /* 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 67:
- /* FirstStartTag[CHARACTERS[STRING]] */
- case 93:
- /* FirstStartTag[CHARACTERS[STRING]] */
- case 53:
- /* FirstStartTag[CHARACTERS[STRING]] */
- case 137:
- /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */
- case 81:
- /* FirstStartTag[CHARACTERS[BOOLEAN]] */
- case 79:
- /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
- 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 138:
- /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */
- case 15:
- /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */
- case 131:
- /* FirstStartTag[CHARACTERS[DATETIME]] */
- case 89:
- /* FirstStartTag[CHARACTERS[DECIMAL]] */
- case 127:
- /* FirstStartTag[CHARACTERS[INTEGER]] */
- case 95:
- /* FirstStartTag[CHARACTERS[FLOAT]] */
- errn = decodeNBitUnsignedInteger(stream, 3, &eventCode2);
- switch (eventCode2) {
- case 0:
- *nextEvent = EXI_EVENT_END_ELEMENT_UNDECLARED;
- return errn;
- case 1:
- *nextEvent = EXI_EVENT_ATTRIBUTE_XSI_TYPE;
- return errn;
- case 2:
- *nextEvent = EXI_EVENT_ATTRIBUTE_XSI_NIL;
- return errn;
- case 3:
- *nextEvent = EXI_EVENT_ATTRIBUTE_GENERIC_UNDECLARED;
- return errn;
- case 4:
- *nextEvent = EXI_EVENT_ATTRIBUTE_INVALID_VALUE;
- return errn;
- case 5:
- *nextEvent = EXI_EVENT_START_ELEMENT_GENERIC_UNDECLARED;
- return errn;
- case 6:
- *nextEvent = EXI_EVENT_CHARACTERS_GENERIC_UNDECLARED;
- return errn;
- }
- break;
- case 49:
- /* FirstStartTag[ATTRIBUTE_GENERIC, START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
- case 75:
- /* FirstStartTag[ATTRIBUTE_GENERIC, START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
- errn = decodeNBitUnsignedInteger(stream, 3, &eventCode2);
- switch (eventCode2) {
- case 0:
- *nextEvent = EXI_EVENT_ATTRIBUTE_XSI_TYPE;
- return errn;
- case 1:
- *nextEvent = EXI_EVENT_ATTRIBUTE_XSI_NIL;
- return errn;
- case 2:
- *nextEvent = EXI_EVENT_ATTRIBUTE_GENERIC_UNDECLARED;
- return errn;
- case 3:
- *nextEvent = EXI_EVENT_ATTRIBUTE_INVALID_VALUE;
- return errn;
- case 4:
- *nextEvent = EXI_EVENT_START_ELEMENT_GENERIC_UNDECLARED;
- return errn;
- case 5:
- *nextEvent = EXI_EVENT_CHARACTERS_GENERIC_UNDECLARED;
- return errn;
- }
- break;
- 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 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 94:
- /* Element[CHARACTERS[STRING]] */
- case 21:
- /* Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
- case 78:
- /* Element[CHARACTERS[STRING]] */
- case 134:
- /* 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 92:
- /* Element[CHARACTERS[FLOAT]] */
- case 42:
- /* Element[START_ELEMENT(AppProtocol)] */
- case 143:
- /* Element[CHARACTERS[STRING]] */
- case 110:
- /* Element[CHARACTERS[INTEGER]] */
- case 66:
- /* Element[CHARACTERS[LIST]] */
- 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 132:
- /* 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 136:
- /* Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
- 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 80:
- /* Element[CHARACTERS[BINARY_BASE64]] */
- case 56:
- /* Element[CHARACTERS[STRING]] */
- case 18:
- /* Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
- errn = decodeNBitUnsignedInteger(stream, 2, &eventCode2);
- switch (eventCode2) {
- case 0:
- *nextEvent = EXI_EVENT_END_ELEMENT_UNDECLARED;
- return errn;
- case 1:
- *nextEvent = EXI_EVENT_START_ELEMENT_GENERIC_UNDECLARED;
- return errn;
- case 2:
- *nextEvent = EXI_EVENT_CHARACTERS_GENERIC_UNDECLARED;
- return errn;
- }
- break;
- case 8:
- /* Element[END_ELEMENT] */
- case 34:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 40:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 44:
- /* Element[START_ELEMENT(SchemaID), END_ELEMENT] */
- case 25:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 31:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 39:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 33:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 50:
- /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
- case 26:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 32:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 47:
- /* Element[END_ELEMENT] */
- case 38:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 35:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 24:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 30:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 4:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 19:
- /* Element[END_ELEMENT] */
- case 37:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 29:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 23:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 27:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 76:
- /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
- case 41:
- /* Element[END_ELEMENT] */
- case 36:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 28:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- errn = decodeNBitUnsignedInteger(stream, 1, &eventCode2);
- switch (eventCode2) {
- case 0:
- *nextEvent = EXI_EVENT_START_ELEMENT_GENERIC_UNDECLARED;
- return errn;
- case 1:
- *nextEvent = EXI_EVENT_CHARACTERS_GENERIC_UNDECLARED;
- return errn;
- }
- break;
-
- default:
- *nextEvent = EXI_EVENT_ERROR;
- return EXI_ERROR_UNEXPECTED_EVENT_LEVEL2;
- }
-
- return EXI_ERROR_UNEXPECTED_EVENT_LEVEL2;
-}
-
-
-int exiappHandDecodeNextEvent(bitstream_t* stream, exi_state_t* state,
- exi_event_t* nextEvent) {
- state->eventCode = 0;
-
- switch (state->grammarStack[state->stackIndex]) {
- case 5:
- /* FirstStartTag[START_ELEMENT(ProtocolNamespace)] */
- case 22:
- /* Element[START_ELEMENT(ProtocolNamespace)] */
- case 3:
- /* FirstStartTag[START_ELEMENT(AppProtocol)] */
- case 42:
- /* Element[START_ELEMENT(AppProtocol)] */
- case 14:
- /* Element[START_ELEMENT(SchemaID)] */
- case 16:
- /* Element[START_ELEMENT(Priority)] */
- case 11:
- /* Element[START_ELEMENT(VersionNumberMinor)] */
- case 43:
- /* FirstStartTag[START_ELEMENT(ResponseCode)] */
- case 6:
- /* Element[START_ELEMENT(VersionNumberMajor)] */
- case 48:
- /* Element[START_ELEMENT(ResponseCode)] */
- errn = decodeNBitUnsignedInteger(stream, 1, &state->eventCode);
- switch (state->eventCode) {
- case 0:
- *nextEvent = EXI_EVENT_START_ELEMENT;
- return errn;
- case 1:
- /* 2nd level events */
- errn = exiDecodeNext2Event(stream, state, nextEvent);
- return errn;
- }
- break;
- 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 70:
- /* Element[CHARACTERS[STRING]] */
- case 124:
- /* Element[CHARACTERS[STRING]] */
- case 57:
- /* FirstStartTag[CHARACTERS[STRING]] */
- case 97:
- /* FirstStartTag[CHARACTERS[DATETIME]] */
- case 135:
- /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
- case 91:
- /* FirstStartTag[CHARACTERS[FLOAT]] */
- case 111:
- /* FirstStartTag[CHARACTERS[INTEGER]] */
- case 139:
- /* Element[CHARACTERS[UNSIGNED_INTEGER]] */
- case 103:
- /* FirstStartTag[CHARACTERS[DATETIME]] */
- case 46:
- /* Element[CHARACTERS[ENUMERATION]] */
- case 86:
- /* Element[CHARACTERS[DATETIME]] */
- case 7:
- /* FirstStartTag[CHARACTERS[STRING]] */
- case 133:
- /* FirstStartTag[CHARACTERS[STRING]] */
- case 123:
- /* FirstStartTag[CHARACTERS[STRING]] */
- case 61:
- /* FirstStartTag[CHARACTERS[STRING]] */
- case 99:
- /* FirstStartTag[CHARACTERS[DATETIME]] */
- case 120:
- /* Element[CHARACTERS[UNSIGNED_INTEGER]] */
- case 107:
- /* FirstStartTag[CHARACTERS[BINARY_HEX]] */
- case 73:
- /* FirstStartTag[CHARACTERS[STRING]] */
- case 100:
- /* Element[CHARACTERS[DATETIME]] */
- case 54:
- /* Element[CHARACTERS[STRING]] */
- case 59:
- /* FirstStartTag[CHARACTERS[LIST]] */
- case 68:
- /* Element[CHARACTERS[STRING]] */
- case 72:
- /* Element[CHARACTERS[STRING]] */
- case 63:
- /* FirstStartTag[CHARACTERS[STRING]] */
- case 94:
- /* Element[CHARACTERS[STRING]] */
- case 115:
- /* FirstStartTag[CHARACTERS[INTEGER]] */
- case 101:
- /* FirstStartTag[CHARACTERS[DATETIME]] */
- case 21:
- /* Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
- case 71:
- /* FirstStartTag[CHARACTERS[STRING]] */
- case 77:
- /* FirstStartTag[CHARACTERS[STRING]] */
- case 142:
- /* FirstStartTag[CHARACTERS[STRING]] */
- case 78:
- /* Element[CHARACTERS[STRING]] */
- case 121:
- /* FirstStartTag[CHARACTERS[INTEGER]] */
- case 134:
- /* 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 17:
- /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
- case 83:
- /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
- case 117:
- /* FirstStartTag[CHARACTERS[INTEGER]] */
- case 87:
- /* FirstStartTag[CHARACTERS[DATETIME]] */
- 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 67:
- /* FirstStartTag[CHARACTERS[STRING]] */
- case 93:
- /* FirstStartTag[CHARACTERS[STRING]] */
- case 13:
- /* Element[CHARACTERS[UNSIGNED_INTEGER]] */
- case 90:
- /* Element[CHARACTERS[DECIMAL]] */
- case 92:
- /* Element[CHARACTERS[FLOAT]] */
- case 53:
- /* FirstStartTag[CHARACTERS[STRING]] */
- case 137:
- /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */
- case 81:
- /* FirstStartTag[CHARACTERS[BOOLEAN]] */
- case 79:
- /* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
- case 119:
- /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */
- case 143:
- /* Element[CHARACTERS[STRING]] */
- case 110:
- /* Element[CHARACTERS[INTEGER]] */
- case 66:
- /* Element[CHARACTERS[LIST]] */
- case 51:
- /* FirstStartTag[CHARACTERS[LIST]] */
- case 112:
- /* Element[CHARACTERS[INTEGER]] */
- case 58:
- /* Element[CHARACTERS[STRING]] */
- case 105:
- /* FirstStartTag[CHARACTERS[DATETIME]] */
- case 122:
- /* Element[CHARACTERS[INTEGER]] */
- case 69:
- /* FirstStartTag[CHARACTERS[STRING]] */
- case 104:
- /* Element[CHARACTERS[DATETIME]] */
- case 132:
- /* Element[CHARACTERS[DATETIME]] */
- case 114:
- /* Element[CHARACTERS[STRING]] */
- case 45:
- /* FirstStartTag[CHARACTERS[ENUMERATION]] */
- case 65:
- /* FirstStartTag[CHARACTERS[LIST]] */
- case 108:
- /* Element[CHARACTERS[BINARY_HEX]] */
- case 84:
- /* Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
- case 129:
- /* FirstStartTag[CHARACTERS[STRING]] */
- case 106:
- /* Element[CHARACTERS[DATETIME]] */
- case 55:
- /* FirstStartTag[CHARACTERS[STRING]] */
- case 74:
- /* Element[CHARACTERS[STRING]] */
- case 20:
- /* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
- case 85:
- /* FirstStartTag[CHARACTERS[DATETIME]] */
- case 125:
- /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */
- case 64:
- /* Element[CHARACTERS[STRING]] */
- case 62:
- /* Element[CHARACTERS[STRING]] */
- case 136:
- /* Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
- case 138:
- /* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */
- case 130:
- /* Element[CHARACTERS[STRING]] */
- case 126:
- /* Element[CHARACTERS[UNSIGNED_INTEGER]] */
- case 15:
- /* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */
- case 118:
- /* Element[CHARACTERS[INTEGER]] */
- case 131:
- /* FirstStartTag[CHARACTERS[DATETIME]] */
- case 10:
- /* Element[CHARACTERS[STRING]] */
- case 80:
- /* Element[CHARACTERS[BINARY_BASE64]] */
- case 89:
- /* FirstStartTag[CHARACTERS[DECIMAL]] */
- case 56:
- /* Element[CHARACTERS[STRING]] */
- case 127:
- /* FirstStartTag[CHARACTERS[INTEGER]] */
- case 95:
- /* FirstStartTag[CHARACTERS[FLOAT]] */
- case 18:
- /* Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
- errn = decodeNBitUnsignedInteger(stream, 1, &state->eventCode);
- switch (state->eventCode) {
- case 0:
- *nextEvent = EXI_EVENT_CHARACTERS;
- return errn;
- case 1:
- /* 2nd level events */
- errn = exiDecodeNext2Event(stream, state, nextEvent);
- return errn;
- }
- break;
- case 2:
- /* DocEnd[END_DOCUMENT] */
- *nextEvent = EXI_EVENT_END_DOCUMENT;
- return errn;
- case 1:
- /* DocContent[START_ELEMENT({urn:iso:15118:2:2010:AppProtocol}supportedAppProtocolReq), START_ELEMENT({urn:iso:15118:2:2010:AppProtocol}supportedAppProtocolRes), START_ELEMENT_GENERIC] */
- errn = decodeNBitUnsignedInteger(stream, 2, &state->eventCode);
- switch (state->eventCode) {
- case 0:
- case 1:
- *nextEvent = EXI_EVENT_START_ELEMENT;
- return errn;
- case 2:
- *nextEvent = EXI_EVENT_START_ELEMENT_GENERIC;
- return errn;
- }
- break;
- case 49:
- /* FirstStartTag[ATTRIBUTE_GENERIC, START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
- case 75:
- /* FirstStartTag[ATTRIBUTE_GENERIC, START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
- errn = decodeNBitUnsignedInteger(stream, 3, &state->eventCode);
- switch (state->eventCode) {
- case 0:
- *nextEvent = EXI_EVENT_ATTRIBUTE_GENERIC;
- return errn;
- case 1:
- *nextEvent = EXI_EVENT_START_ELEMENT_GENERIC;
- return errn;
- case 2:
- *nextEvent = EXI_EVENT_END_ELEMENT;
- return errn;
- case 3:
- *nextEvent = EXI_EVENT_CHARACTERS_GENERIC;
- return errn;
- case 4:
- /* 2nd level events */
- errn = exiDecodeNext2Event(stream, state, nextEvent);
- return errn;
- }
- break;
- case 50:
- /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
- case 76:
- /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
- errn = decodeNBitUnsignedInteger(stream, 2, &state->eventCode);
- switch (state->eventCode) {
- case 0:
- *nextEvent = EXI_EVENT_START_ELEMENT_GENERIC;
- return errn;
- case 1:
- *nextEvent = EXI_EVENT_END_ELEMENT;
- return errn;
- case 2:
- *nextEvent = EXI_EVENT_CHARACTERS_GENERIC;
- return errn;
- case 3:
- /* 2nd level events */
- errn = exiDecodeNext2Event(stream, state, nextEvent);
- return errn;
- }
- break;
- case 34:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 40:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 44:
- /* Element[START_ELEMENT(SchemaID), END_ELEMENT] */
- case 25:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 31:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 39:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 33:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 26:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 32:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 38:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 35:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 24:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 30:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 4:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 37:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 29:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 23:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 27:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 36:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- case 28:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- errn = decodeNBitUnsignedInteger(stream, 2, &state->eventCode);
- switch (state->eventCode) {
- case 0:
- *nextEvent = EXI_EVENT_START_ELEMENT;
- return errn;
- case 1:
- *nextEvent = EXI_EVENT_END_ELEMENT;
- return errn;
- case 2:
- /* 2nd level events */
- errn = exiDecodeNext2Event(stream, state, nextEvent);
- return errn;
- }
- break;
- case 0:
- /* Document[START_DOCUMENT] */
- *nextEvent = EXI_EVENT_START_DOCUMENT;
- return errn;
- case 8:
- /* Element[END_ELEMENT] */
- case 47:
- /* Element[END_ELEMENT] */
- case 19:
- /* Element[END_ELEMENT] */
- case 41:
- /* Element[END_ELEMENT] */
- errn = decodeNBitUnsignedInteger(stream, 1, &state->eventCode);
- switch (state->eventCode) {
- case 0:
- *nextEvent = EXI_EVENT_END_ELEMENT;
- return errn;
- case 1:
- /* 2nd level events */
- errn = exiDecodeNext2Event(stream, state, nextEvent);
- return errn;
- }
- break;
-
- default:
- *nextEvent = EXI_EVENT_ERROR;
- return EXI_ERROR_UNEXPECTED_EVENT_LEVEL1;
- }
-
- return EXI_ERROR_UNEXPECTED_EVENT_LEVEL1;
-}
-
-int exiappHandDecodeStartDocument(bitstream_t* stream, exi_state_t* state) {
- if ( state->grammarStack[state->stackIndex] == 0 ) {
- /* move on */
- state->grammarStack[state->stackIndex] = 1;
- return 0;
- }
-
- return EXI_ERROR_UNEXPECTED_START_DOCUMENT;
-}
-
-int exiappHandDecodeEndDocument(bitstream_t* stream, exi_state_t* state) {
- if ( state->grammarStack[state->stackIndex] == 2) {
- return 0;
- }
-
- return EXI_ERROR_UNEXPECTED_END_DOCUMENT;
-}
-
-static int _exiDecodeStartElement(exi_state_t* state, eqname_t* se,
- uint16_t ns, uint16_t ln, uint16_t stackId, uint16_t newState) {
- se->namespaceURI = ns;
- se->localPart = ln;
- /* move on */
- state->grammarStack[state->stackIndex] = stackId;
- /* push element on stack */
- return exiPushStack(state, newState, se);
-}
-
-
-int exiappHandDecodeStartElement(bitstream_t* stream, exi_state_t* state,
- eqname_t* se) {
- switch (state->grammarStack[state->stackIndex]) {
- case 1:
- /* DocContent[START_ELEMENT({urn:iso:15118:2:2010:AppProtocol}supportedAppProtocolReq), START_ELEMENT({urn:iso:15118:2:2010:AppProtocol}supportedAppProtocolRes), START_ELEMENT_GENERIC] */
- switch(state->eventCode) {
- case 0:
- return _exiDecodeStartElement(state, se, 4, 6, 2, 3);
- case 1:
- return _exiDecodeStartElement(state, se, 4, 7, 2, 43);
- case 2:
- return _exiDecodeStartElement(state, se, 65535, 65535, 2, 49);
- }
- break;
- case 3:
- /* FirstStartTag[START_ELEMENT(AppProtocol)] */
- switch(state->eventCode) {
- case 0:
- return _exiDecodeStartElement(state, se, 0, 0, 4, 5);
- }
- break;
- case 4:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- switch(state->eventCode) {
- case 0:
- return _exiDecodeStartElement(state, se, 0, 0, 23, 5);
- }
- break;
- case 5:
- /* FirstStartTag[START_ELEMENT(ProtocolNamespace)] */
- switch(state->eventCode) {
- case 0:
- return _exiDecodeStartElement(state, se, 0, 2, 6, 7);
- }
- break;
- case 6:
- /* Element[START_ELEMENT(VersionNumberMajor)] */
- switch(state->eventCode) {
- case 0:
- return _exiDecodeStartElement(state, se, 0, 5, 11, 12);
- }
- break;
- case 11:
- /* Element[START_ELEMENT(VersionNumberMinor)] */
- switch(state->eventCode) {
- case 0:
- return _exiDecodeStartElement(state, se, 0, 6, 14, 15);
- }
- break;
- case 14:
- /* Element[START_ELEMENT(SchemaID)] */
- switch(state->eventCode) {
- case 0:
- return _exiDecodeStartElement(state, se, 0, 4, 16, 17);
- }
- break;
- case 16:
- /* Element[START_ELEMENT(Priority)] */
- switch(state->eventCode) {
- case 0:
- return _exiDecodeStartElement(state, se, 0, 1, 19, 20);
- }
- break;
- case 22:
- /* Element[START_ELEMENT(ProtocolNamespace)] */
- switch(state->eventCode) {
- case 0:
- return _exiDecodeStartElement(state, se, 0, 2, 6, 7);
- }
- break;
- case 23:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- switch(state->eventCode) {
- case 0:
- return _exiDecodeStartElement(state, se, 0, 0, 24, 5);
- }
- break;
- case 24:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- switch(state->eventCode) {
- case 0:
- return _exiDecodeStartElement(state, se, 0, 0, 25, 5);
- }
- break;
- case 25:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- switch(state->eventCode) {
- case 0:
- return _exiDecodeStartElement(state, se, 0, 0, 26, 5);
- }
- break;
- case 26:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- switch(state->eventCode) {
- case 0:
- return _exiDecodeStartElement(state, se, 0, 0, 27, 5);
- }
- break;
- case 27:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- switch(state->eventCode) {
- case 0:
- return _exiDecodeStartElement(state, se, 0, 0, 28, 5);
- }
- break;
- case 28:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- switch(state->eventCode) {
- case 0:
- return _exiDecodeStartElement(state, se, 0, 0, 29, 5);
- }
- break;
- case 29:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- switch(state->eventCode) {
- case 0:
- return _exiDecodeStartElement(state, se, 0, 0, 30, 5);
- }
- break;
- case 30:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- switch(state->eventCode) {
- case 0:
- return _exiDecodeStartElement(state, se, 0, 0, 31, 5);
- }
- break;
- case 31:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- switch(state->eventCode) {
- case 0:
- return _exiDecodeStartElement(state, se, 0, 0, 32, 5);
- }
- break;
- case 32:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- switch(state->eventCode) {
- case 0:
- return _exiDecodeStartElement(state, se, 0, 0, 33, 5);
- }
- break;
- case 33:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- switch(state->eventCode) {
- case 0:
- return _exiDecodeStartElement(state, se, 0, 0, 34, 5);
- }
- break;
- case 34:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- switch(state->eventCode) {
- case 0:
- return _exiDecodeStartElement(state, se, 0, 0, 35, 5);
- }
- break;
- case 35:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- switch(state->eventCode) {
- case 0:
- return _exiDecodeStartElement(state, se, 0, 0, 36, 5);
- }
- break;
- case 36:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- switch(state->eventCode) {
- case 0:
- return _exiDecodeStartElement(state, se, 0, 0, 37, 5);
- }
- break;
- case 37:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- switch(state->eventCode) {
- case 0:
- return _exiDecodeStartElement(state, se, 0, 0, 38, 5);
- }
- break;
- case 38:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- switch(state->eventCode) {
- case 0:
- return _exiDecodeStartElement(state, se, 0, 0, 39, 5);
- }
- break;
- case 39:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- switch(state->eventCode) {
- case 0:
- return _exiDecodeStartElement(state, se, 0, 0, 40, 5);
- }
- break;
- case 40:
- /* Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
- switch(state->eventCode) {
- case 0:
- return _exiDecodeStartElement(state, se, 0, 0, 41, 5);
- }
- break;
- case 42:
- /* Element[START_ELEMENT(AppProtocol)] */
- switch(state->eventCode) {
- case 0:
- return _exiDecodeStartElement(state, se, 0, 0, 4, 5);
- }
- break;
- case 43:
- /* FirstStartTag[START_ELEMENT(ResponseCode)] */
- switch(state->eventCode) {
- case 0:
- return _exiDecodeStartElement(state, se, 0, 3, 44, 45);
- }
- break;
- case 44:
- /* Element[START_ELEMENT(SchemaID), END_ELEMENT] */
- switch(state->eventCode) {
- case 0:
- return _exiDecodeStartElement(state, se, 0, 4, 47, 17);
- }
- break;
- case 48:
- /* Element[START_ELEMENT(ResponseCode)] */
- switch(state->eventCode) {
- case 0:
- return _exiDecodeStartElement(state, se, 0, 3, 44, 45);
- }
- break;
- case 49:
- /* FirstStartTag[ATTRIBUTE_GENERIC, START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
- switch(state->eventCode) {
- case 1:
- return _exiDecodeStartElement(state, se, 65535, 65535, 50, 49);
- }
- break;
- case 50:
- /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
- switch(state->eventCode) {
- case 0:
- return _exiDecodeStartElement(state, se, 65535, 65535, 50, 49);
- }
- break;
- case 75:
- /* FirstStartTag[ATTRIBUTE_GENERIC, START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
- switch(state->eventCode) {
- case 1:
- return _exiDecodeStartElement(state, se, 65535, 65535, 76, 49);
- }
- break;
- case 76:
- /* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
- switch(state->eventCode) {
- case 0:
- return _exiDecodeStartElement(state, se, 65535, 65535, 76, 49);
- }
- break;
-
- default:
- return EXI_ERROR_UNEXPECTED_START_ELEMENT;
- }
-
- return EXI_ERROR_UNEXPECTED_START_ELEMENT;
-}
-
-
-static int _exiDecodeNamespaceUri(bitstream_t* stream, exi_name_table_prepopulated_t* nameTable, exi_name_table_runtime_t* runtimeTable,
- string_ascii_t* namespaceURI, uint32_t* uriID) {
- uint16_t uriSize, uriCodingLength;
- int errn;
-
- errn = exiGetUriSize(nameTable, runtimeTable, &uriSize);
- if (errn) {
- return errn;
- }
- /* URI Entries + 1 */
- errn = exiGetCodingLength(uriSize + 1, &uriCodingLength);
- if (errn) {
- return errn;
- }
-
- errn = decodeNBitUnsignedInteger(stream, uriCodingLength, uriID);
- if (errn) {
- return errn;
- }
-
- if (*uriID == 0) {
- /* uri string value was not found */
- /* ==> zero (0) as an n-nit unsigned integer */
- /* followed by uri encoded as string */
- decodeStringASCII(stream, namespaceURI);
- /* after encoding string value is added to table */
- errn = exiAddUri(nameTable, runtimeTable, namespaceURI->chars);
- if (errn) {
- return errn;
- }
- *uriID = uriSize;
- } else {
- /* uri string value found */
- /* ==> value(i+1) is encoded as n-bit unsigned integer */
- *uriID = *uriID - 1;
- }
-
- return 0;
-}
-
-static int _exiDecodeLocalName(bitstream_t* stream, exi_name_table_prepopulated_t* nameTable, exi_name_table_runtime_t* runtimeTable,
- string_ascii_t* localName,
- uint32_t* localNameID, uint32_t uriID) {
- uint16_t slen;
- uint16_t localNameSize;
- uint16_t localNameCodingLength;
-
-
- int errn = decodeUnsignedInteger16(stream, &slen);
- if (errn) {
- return errn;
- }
-
- if (slen > 0) {
- /* string value was not found in local partition */
- /* ==> string literal is encoded as a String */
- /* with the length of the string incremented by one */
- if (slen-- >= localName->size) {
- return EXI_ERROR_OUT_OF_BOUNDS;
- }
- errn = decodeCharactersASCII(stream, slen, localName->chars);
- if (errn) {
- return errn;
- }
- /* After encoding the string value, it is added to the string table */
- /* partition and assigned the next available compact identifier */
- errn = exiAddLocalName(nameTable, runtimeTable, uriID, localName->chars);
- if (errn) {
- return errn;
- }
- /* TODO UCD Profile */
- /* qname = addLocalName(localName, uriID); */
- } else {
- /* string value found in local partition */
- /* ==> string value is represented as zero (0) encoded as an */
- /* 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) {
- return errn;
- }
- errn = exiGetCodingLength(localNameSize, &localNameCodingLength);
- if (errn) {
- return errn;
- }
- errn = decodeNBitUnsignedInteger(stream, localNameCodingLength, localNameID);
- if (errn) {
- return errn;
- }
- }
-
- return 0;
-}
-
-static int _exiDecodeQName(bitstream_t* stream, exi_name_table_prepopulated_t* nameTable, exi_name_table_runtime_t* runtimeTable,
- qname_t* qname) {
- uint32_t uriID;
- uint32_t localNameID;
- /* const char * clocalName; */
-
- /* uri */
- int errn =_exiDecodeNamespaceUri(stream, nameTable, runtimeTable, &qname->namespaceURI, &uriID);
- if (errn) {
- return errn;
- }
- /* localName */
- errn = _exiDecodeLocalName(stream, nameTable, runtimeTable, &qname->localName, &localNameID, uriID);
- if (errn) {
- return errn;
- }
-
- /*
- errn = exiGetLocalName(nameTable, runtimeTable, uriID, localNameID, &clocalName);
- if (errn) {
- return errn;
- }
- strcpy ( qname->localName.chars, clocalName );
- */
-
- return 0 ;
-}
-
-int exiappHandDecodeStartElementGeneric(bitstream_t* stream, exi_state_t* state,
- qname_t* qname) {
- /* decode qname */
- int errn = _exiDecodeQName(stream, &(state->nameTablePrepopulated), &(state->nameTableRuntime), qname);
- if (errn) {
- return errn;
- }
-
- switch (state->grammarStack[state->stackIndex]) {
- /* $EXI_DECODE_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 EXI_ERROR_UNEXPECTED_START_ELEMENT_GENERIC;
-}
-
-int exiappHandDecodeEndElement(bitstream_t* stream, exi_state_t* state, eqname_t* ee) {
- /* copy IDs */
- ee->localPart = state->elementStack[state->stackIndex].localPart;
- ee->namespaceURI = state->elementStack[state->stackIndex].namespaceURI;
-
- return exiPopStack(state);
-}
-
-int exiappHandDecodeEndElementUndeclared(bitstream_t* stream, exi_state_t* state, eqname_t* ee) {
- int16_t currentID = state->grammarStack[state->stackIndex];
- if (currentID < 0) {
- /* runtime grammars do have IDs smaller than 0 */
- /* TODO learn EE event */
- return -1;
- }
-
- return exiappHandDecodeEndElement(stream, state, ee);
-}
-
-int exiappHandDecodeCharacters(bitstream_t* stream, exi_state_t* state,
- exi_value_t* val) {
- switch (state->grammarStack[state->stackIndex]) {
- case 12:
- /* UNSIGNED_INTEGER */
- case 13:
- /* UNSIGNED_INTEGER */
- case 15:
- /* UNSIGNED_INTEGER */
- case 119:
- /* UNSIGNED_INTEGER */
- case 120:
- /* UNSIGNED_INTEGER */
- case 125:
- /* UNSIGNED_INTEGER */
- case 126:
- /* UNSIGNED_INTEGER */
- case 137:
- /* UNSIGNED_INTEGER */
- case 138:
- /* UNSIGNED_INTEGER */
- case 139:
- /* UNSIGNED_INTEGER */
- case 140:
- /* UNSIGNED_INTEGER */
- case 141:
- /* UNSIGNED_INTEGER */
- val->type = EXI_DATATYPE_UNSIGNED_INTEGER;
- errn = decodeUnsignedInteger(stream, &val->integer);
- if (errn) {
- return errn;
- }
- /* move on */
- state->grammarStack[state->stackIndex] = 8;
- return 0;
- case 17:
- /* NBIT_UNSIGNED_INTEGER */
- case 18:
- /* NBIT_UNSIGNED_INTEGER */
- case 135:
- /* NBIT_UNSIGNED_INTEGER */
- case 136:
- /* NBIT_UNSIGNED_INTEGER */
- val->type = EXI_DATATYPE_NBIT_UNSIGNED_INTEGER;
- errn = decodeNBitUnsignedInteger(stream, 8, &bits);
- val->integer.val.uint8 = bits + 0;
- val->integer.type = EXI_UNSIGNED_INTEGER_8;
- if (errn) {
- return errn;
- }
- /* move on */
- state->grammarStack[state->stackIndex] = 8;
- return 0;
- case 50:
- /* STRING */
- case 49:
- /* STRING */
- val->type = EXI_DATATYPE_STRING;
- errn = decodeStringValue(stream, &val->string);
- if (errn) {
- return errn;
- }
- /* move on */
- state->grammarStack[state->stackIndex] = 50;
- return 0;
- case 101:
- /* DATETIME */
- case 102:
- /* DATETIME */
- val->type = EXI_DATATYPE_DATETIME;
- errn = decodeDateTime(stream, EXI_DATETIME_GMONTHDAY, &val->datetime);
- if (errn) {
- return errn;
- }
- /* move on */
- state->grammarStack[state->stackIndex] = 8;
- return 0;
- case 20:
- /* NBIT_UNSIGNED_INTEGER */
- case 21:
- /* NBIT_UNSIGNED_INTEGER */
- val->type = EXI_DATATYPE_NBIT_UNSIGNED_INTEGER;
- errn = decodeNBitUnsignedInteger(stream, 5, &bits);
- val->integer.val.uint8 = bits + 1;
- val->integer.type = EXI_UNSIGNED_INTEGER_8;
- if (errn) {
- return errn;
- }
- /* move on */
- state->grammarStack[state->stackIndex] = 8;
- return 0;
- case 97:
- /* DATETIME */
- case 98:
- /* DATETIME */
- val->type = EXI_DATATYPE_DATETIME;
- errn = decodeDateTime(stream, EXI_DATETIME_GDAY, &val->datetime);
- if (errn) {
- return errn;
- }
- /* move on */
- state->grammarStack[state->stackIndex] = 8;
- return 0;
- case 51:
- /* LIST */
- case 52:
- /* LIST */
- case 59:
- /* LIST */
- case 60:
- /* LIST */
- case 65:
- /* LIST */
- case 66:
- /* LIST */
- val->type = EXI_DATATYPE_LIST;
- /* List not supported properly yet */
- val->list.type = EXI_DATATYPE_STRING;
- errn = decodeUnsignedInteger16(stream, &val->list.len);
- if (errn) {
- return errn;
- }
- if (errn) {
- return errn;
- }
- /* move on */
- state->grammarStack[state->stackIndex] = 8;
- return 0;
- case 79:
- /* BINARY_BASE64 */
- case 80:
- /* BINARY_BASE64 */
- val->type = EXI_DATATYPE_BINARY_BASE64;
- errn = decodeBinary(stream, &val->binary);
- if (errn) {
- return errn;
- }
- /* move on */
- state->grammarStack[state->stackIndex] = 8;
- return 0;
- case 89:
- /* DECIMAL */
- case 90:
- /* DECIMAL */
- val->type = EXI_DATATYPE_DECIMAL;
- errn = decodeDecimal(stream, &val->decimal);
- if (errn) {
- return errn;
- }
- /* move on */
- state->grammarStack[state->stackIndex] = 8;
- return 0;
- case 99:
- /* DATETIME */
- case 100:
- /* DATETIME */
- val->type = EXI_DATATYPE_DATETIME;
- errn = decodeDateTime(stream, EXI_DATETIME_GMONTH, &val->datetime);
- if (errn) {
- return errn;
- }
- /* move on */
- state->grammarStack[state->stackIndex] = 8;
- return 0;
- case 91:
- /* FLOAT */
- case 92:
- /* FLOAT */
- case 95:
- /* FLOAT */
- case 96:
- /* FLOAT */
- val->type = EXI_DATATYPE_FLOAT;
- errn = decodeFloat(stream, &val->float_me);
- if (errn) {
- return errn;
- }
- /* move on */
- state->grammarStack[state->stackIndex] = 8;
- return 0;
- case 107:
- /* BINARY_HEX */
- case 108:
- /* BINARY_HEX */
- val->type = EXI_DATATYPE_BINARY_HEX;
- errn = decodeBinary(stream, &val->binary);
- if (errn) {
- return errn;
- }
- /* move on */
- state->grammarStack[state->stackIndex] = 8;
- return 0;
- case 83:
- /* NBIT_UNSIGNED_INTEGER */
- case 84:
- /* NBIT_UNSIGNED_INTEGER */
- val->type = EXI_DATATYPE_NBIT_UNSIGNED_INTEGER;
- errn = decodeNBitUnsignedInteger(stream, 8, &bits);
- val->integer.val.int8 = bits -128;
- val->integer.type = EXI_INTEGER_8;
- if (errn) {
- return errn;
- }
- /* move on */
- state->grammarStack[state->stackIndex] = 8;
- return 0;
- case 85:
- /* DATETIME */
- case 86:
- /* DATETIME */
- val->type = EXI_DATATYPE_DATETIME;
- errn = decodeDateTime(stream, EXI_DATETIME_DATE, &val->datetime);
- if (errn) {
- return errn;
- }
- /* move on */
- state->grammarStack[state->stackIndex] = 8;
- return 0;
- case 103:
- /* DATETIME */
- case 104:
- /* DATETIME */
- val->type = EXI_DATATYPE_DATETIME;
- errn = decodeDateTime(stream, EXI_DATETIME_GYEAR, &val->datetime);
- if (errn) {
- return errn;
- }
- /* move on */
- state->grammarStack[state->stackIndex] = 8;
- return 0;
- case 131:
- /* DATETIME */
- case 132:
- /* DATETIME */
- val->type = EXI_DATATYPE_DATETIME;
- errn = decodeDateTime(stream, EXI_DATETIME_TIME, &val->datetime);
- if (errn) {
- return errn;
- }
- /* move on */
- state->grammarStack[state->stackIndex] = 8;
- return 0;
- case 105:
- /* DATETIME */
- case 106:
- /* DATETIME */
- val->type = EXI_DATATYPE_DATETIME;
- errn = decodeDateTime(stream, EXI_DATETIME_GYEARMONTH, &val->datetime);
- if (errn) {
- return errn;
- }
- /* move on */
- state->grammarStack[state->stackIndex] = 8;
- return 0;
- case 109:
- /* INTEGER */
- case 110:
- /* INTEGER */
- case 111:
- /* INTEGER */
- case 112:
- /* INTEGER */
- case 115:
- /* INTEGER */
- case 116:
- /* INTEGER */
- case 117:
- /* INTEGER */
- case 118:
- /* INTEGER */
- case 121:
- /* INTEGER */
- case 122:
- /* INTEGER */
- case 127:
- /* INTEGER */
- case 128:
- /* INTEGER */
- val->type = EXI_DATATYPE_INTEGER;
- errn = decodeInteger(stream, &val->integer);
- if (errn) {
- return errn;
- }
- /* move on */
- state->grammarStack[state->stackIndex] = 8;
- return 0;
- case 7:
- /* STRING */
- case 10:
- /* STRING */
- case 53:
- /* STRING */
- case 54:
- /* STRING */
- case 55:
- /* STRING */
- case 56:
- /* STRING */
- case 57:
- /* STRING */
- case 58:
- /* STRING */
- case 61:
- /* STRING */
- case 62:
- /* STRING */
- case 63:
- /* STRING */
- case 64:
- /* STRING */
- case 67:
- /* STRING */
- case 68:
- /* STRING */
- case 69:
- /* STRING */
- case 70:
- /* STRING */
- case 71:
- /* STRING */
- case 72:
- /* STRING */
- case 73:
- /* STRING */
- case 74:
- /* STRING */
- case 77:
- /* STRING */
- case 78:
- /* STRING */
- case 93:
- /* STRING */
- case 94:
- /* STRING */
- case 113:
- /* STRING */
- case 114:
- /* STRING */
- case 123:
- /* STRING */
- case 124:
- /* STRING */
- case 129:
- /* STRING */
- case 130:
- /* STRING */
- case 133:
- /* STRING */
- case 134:
- /* STRING */
- case 142:
- /* STRING */
- case 143:
- /* STRING */
- val->type = EXI_DATATYPE_STRING;
- errn = decodeStringValue(stream, &val->string);
- if (errn) {
- return errn;
- }
- /* move on */
- state->grammarStack[state->stackIndex] = 8;
- return 0;
- case 45:
- /* ENUMERATION */
- case 46:
- /* ENUMERATION */
- val->type = EXI_DATATYPE_ENUMERATION;
- errn = decodeNBitUnsignedInteger(stream, 2, &val->enumeration);
- if (errn) {
- return errn;
- }
- /* move on */
- state->grammarStack[state->stackIndex] = 8;
- return 0;
- case 76:
- /* STRING */
- case 75:
- /* STRING */
- val->type = EXI_DATATYPE_STRING;
- errn = decodeStringValue(stream, &val->string);
- if (errn) {
- return errn;
- }
- /* move on */
- state->grammarStack[state->stackIndex] = 76;
- return 0;
- case 87:
- /* DATETIME */
- case 88:
- /* DATETIME */
- val->type = EXI_DATATYPE_DATETIME;
- errn = decodeDateTime(stream, EXI_DATETIME_DATETIME, &val->datetime);
- if (errn) {
- return errn;
- }
- /* move on */
- state->grammarStack[state->stackIndex] = 8;
- return 0;
- case 81:
- /* BOOLEAN */
- case 82:
- /* BOOLEAN */
- val->type = EXI_DATATYPE_BOOLEAN;
- errn = decodeBoolean(stream, &val->boolean);
- if (errn) {
- return errn;
- }
- /* move on */
- state->grammarStack[state->stackIndex] = 8;
- return 0;
-
- default:
- return EXI_ERROR_UNEXPECTED_CHARACTERS;
- }
-
- return 0;
-}
-
-int exiappHandDecodeCharactersGeneric(bitstream_t* stream, exi_state_t* state,
- exi_value_t* val) {
- return exiappHandDecodeCharacters(stream, state, val);
-}
-
-int exiappHandDecodeCharactersGenericUndeclared(bitstream_t* stream, exi_state_t* state,
- exi_value_t* val) {
- int errn = 0;
- if (state->grammarStack[state->stackIndex] < 0) {
- /* runtime grammars do have IDs smaller than 0 */
- /* TODO learn CH event */
- return -1;
- }
-
- /* update current rule --> element content rule (if not already) */
- errn = exiMoveToElementContentRule(state);
- if (errn) {
- return errn;
- }
-
- /* read content value */
- /* STRING */
- val->type = EXI_DATATYPE_STRING;
- errn = decodeStringValue(stream, &val->string);
- return errn;
-}
-
-
-int exiappHandDecodeAttribute(bitstream_t* stream, exi_state_t* state,
- eqname_t* at, exi_value_t* val) {
- switch (state->grammarStack[state->stackIndex]) {
-
- default:
- return EXI_ERROR_UNEXPECTED_ATTRIBUTE;
- }
- return EXI_ERROR_UNEXPECTED_ATTRIBUTE;
-}
-
-
-
-int exiappHandDecodeAttributeXsiNil(bitstream_t* stream, exi_state_t* state,
- exi_value_t* val) {
- errn = decodeBoolean(stream, &val->boolean);
- if (errn >= 0 && val->boolean) {
- /* handle xsi:nil == true */
- errn = exiHandleXsiNilTrue(state);
- }
- return errn;
-}
-
-
-int exiappHandDecodeAttributeXsiType(bitstream_t* stream, exi_state_t* state,
- exi_value_t* val) {
- uint32_t uriID;
- uint32_t localNameID;
- /* uri */
- errn =_exiDecodeNamespaceUri(stream, &(state->nameTablePrepopulated), &(state->nameTableRuntime), NULL, &uriID);
- if (errn) {
- return errn;
- }
- /* localName */
- errn = _exiDecodeLocalName(stream, &(state->nameTablePrepopulated), &(state->nameTableRuntime), NULL, &localNameID, uriID);
- if (errn) {
- return errn;
- }
-
- val->eqname.namespaceURI = uriID;
- val->eqname.localPart = localNameID;
-
- /* handle xsi type cast */
- errn = exiHandleXsiType(state, &val->eqname);
-
- return errn;
-}
-
-int exiappHandDecodeAttributeGenericUndeclared(bitstream_t* stream, exi_state_t* state,
- qname_t* at, exi_value_t* val) {
- int errn;
- int16_t currentID = state->grammarStack[state->stackIndex];
-
- if (currentID < 0) {
- /* TODO runtime elements */
- return -1;
- } else {
- /* decode qname */
- errn = _exiDecodeQName(stream, &(state->nameTablePrepopulated), &(state->nameTableRuntime), at);
- if (errn) {
- return errn;
- }
- }
-
-
- if (currentID < 0) {
- /* TODO learn AT event */
- return -1;
- }
-
- /* decode attribute value */
- val->type = EXI_DATATYPE_STRING;
- errn = decodeStringValue(stream, &val->string);
-
- /* we do not move forward in grammars */
-
- return errn;
-}
-
-
-
-#endif
-
diff --git a/src/codec/appHandCodec/appHand_EXIDecoder.h b/src/codec/appHandCodec/appHand_EXIDecoder.h
deleted file mode 100644
index e328e45..0000000
--- a/src/codec/appHandCodec/appHand_EXIDecoder.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Copyright (C) 2007-2012 Siemens AG
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-/*******************************************************************
- *
- * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.6
- * @contact Joerg.Heuer@siemens.com
- *
- *
Code generated by EXIdizer
- ********************************************************************/
-
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef EXI_appHand_DECODER_H
-#define EXI_appHand_DECODER_H
-
-#include "EXITypes.h"
-
-int exiappHandInitDecoder(bitstream_t* stream, exi_state_t* state,
- exi_name_table_runtime_t runtimeTable);
-
-int exiappHandDecodeNextEvent(bitstream_t* stream,
- exi_state_t* state, exi_event_t* nextEvent);
-
-int exiappHandDecodeStartDocument(bitstream_t* stream,
- exi_state_t* state);
-
-int exiappHandDecodeEndDocument(bitstream_t* stream,
- exi_state_t* state);
-
-int
-exiappHandDecodeStartElement(bitstream_t* stream,
- exi_state_t* state, eqname_t* se);
-
-int exiappHandDecodeStartElementGeneric(bitstream_t* stream,
- exi_state_t* state, qname_t* qname);
-
-int exiappHandDecodeEndElement(bitstream_t* stream,
- exi_state_t* state, eqname_t* ee);
-
-int exiappHandDecodeEndElementUndeclared(bitstream_t* stream,
- exi_state_t* state, eqname_t* ee);
-
-int exiappHandDecodeCharacters(bitstream_t* stream,
- exi_state_t* state, exi_value_t* val);
-
-int exiappHandDecodeCharactersGeneric(bitstream_t* stream,
- exi_state_t* state, exi_value_t* val);
-
-int exiappHandDecodeCharactersGenericUndeclared(bitstream_t* stream,
- exi_state_t* state, exi_value_t* val);
-
-int exiappHandDecodeAttribute(bitstream_t* stream,
- exi_state_t* state, eqname_t* at, exi_value_t* val);
-
-int exiappHandDecodeAttributeXsiNil(bitstream_t* stream,
- exi_state_t* state, exi_value_t* val);
-
-int exiappHandDecodeAttributeXsiType(bitstream_t* stream,
- exi_state_t* state, exi_value_t* val);
-
-int exiappHandDecodeAttributeGenericUndeclared(bitstream_t* stream,
- exi_state_t* state, qname_t* at, exi_value_t* val);
-
-int exiappHandDecodeListValue(bitstream_t* stream, exi_value_t* val,
- list_t lt);
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
diff --git a/src/codec/appHandCodec/appHand_EXIEncoder.h b/src/codec/appHandCodec/appHand_EXIEncoder.h
deleted file mode 100644
index 7f2e0a0..0000000
--- a/src/codec/appHandCodec/appHand_EXIEncoder.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright (C) 2007-2012 Siemens AG
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-/*******************************************************************
- *
- * @author Daniel.Peintner.EXT@siemens.com
- * @version 0.6
- * @contact Joerg.Heuer@siemens.com
- *
- *
- *
- ********************************************************************/
-
-
-
- #ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef SERVICECLIENTSTUBS_H
-#define SERVICECLIENTSTUBS_H
-
- #include "v2g_service.h"
- #include "v2g_serviceDataTypes.h"
- #include "v2g_serviceClientStubs.h"
-
-/**
- * \brief Prepares the remote sessionSetup method
- * \param service struct EXIService* Service data structure (has to be initialized before)
- * \param header struct MessageHeaderType* Header data structure
- * \param params struct SessionSetupReqType* Request data for the server (has to be set up before)
- * \param result struct SessionSetupResType* Contains the response data from the server
- * \return 0 = 0K; -1 = ERROR */
- int prepare_sessionSetup(struct EXIService* service, struct MessageHeaderType* header, struct SessionSetupReqType* params, struct SessionSetupResType* result);
-
-
-
-
-/**
- * \brief Prepares the remote serviceDiscovery method
- * \param service struct EXIService* Service data structure (has to be initialized before)
- * \param header struct MessageHeaderType* Header data structure
- * \param params struct ServiceDiscoveryReqType* Request data for the server (has to be set up before)
- * \param result struct ServiceDiscoveryResType* Contains the response data from the server
- * \return 0 = 0K; -1 = ERROR */
- int prepare_serviceDiscovery(struct EXIService* service, struct MessageHeaderType* header, struct ServiceDiscoveryReqType* params, struct ServiceDiscoveryResType* result);
-
-
-
-
-/**
- * \brief Prepares the remote serviceDetail method
- * \param service struct EXIService* Service data structure (has to be initialized before)
- * \param header struct MessageHeaderType* Header data structure
- * \param params struct ServiceDetailReqType* Request data for the server (has to be set up before)
- * \param result struct ServiceDetailResType* Contains the response data from the server
- * \return 0 = 0K; -1 = ERROR */
- int prepare_serviceDetail(struct EXIService* service, struct MessageHeaderType* header, struct ServiceDetailReqType* params, struct ServiceDetailResType* result);
-
-
-
-
-/**
- * \brief Prepares the remote servicePaymentSelection method
- * \param service struct EXIService* Service data structure (has to be initialized before)
- * \param header struct MessageHeaderType* Header data structure
- * \param params struct ServicePaymentSelectionReqType* Request data for the server (has to be set up before)
- * \param result struct ServicePaymentSelectionResType* Contains the response data from the server
- * \return 0 = 0K; -1 = ERROR */
- int prepare_servicePaymentSelection(struct EXIService* service, struct MessageHeaderType* header, struct ServicePaymentSelectionReqType* params, struct ServicePaymentSelectionResType* result);
-
-
-
-
-/**
- * \brief Prepares the remote paymentDetails method
- * \param service struct EXIService* Service data structure (has to be initialized before)
- * \param header struct MessageHeaderType* Header data structure
- * \param params struct PaymentDetailsReqType* Request data for the server (has to be set up before)
- * \param result struct PaymentDetailsResType* Contains the response data from the server
- * \return 0 = 0K; -1 = ERROR */
- int prepare_paymentDetails(struct EXIService* service, struct MessageHeaderType* header, struct PaymentDetailsReqType* params, struct PaymentDetailsResType* result);
-
-
-
-
-/**
- * \brief Prepares the remote contractAuthentication method
- * \param service struct EXIService* Service data structure (has to be initialized before)
- * \param header struct MessageHeaderType* Header data structure
- * \param params struct ContractAuthenticationReqType* Request data for the server (has to be set up before)
- * \param result struct ContractAuthenticationResType* Contains the response data from the server
- * \return 0 = 0K; -1 = ERROR */
- int prepare_contractAuthentication(struct EXIService* service, struct MessageHeaderType* header, struct ContractAuthenticationReqType* params, struct ContractAuthenticationResType* result);
-
-
-
-
-/**
- * \brief Prepares the remote chargeParameterDiscovery method
- * \param service struct EXIService* Service data structure (has to be initialized before)
- * \param header struct MessageHeaderType* Header data structure
- * \param params struct ChargeParameterDiscoveryReqType* Request data for the server (has to be set up before)
- * \param result struct ChargeParameterDiscoveryResType* Contains the response data from the server
- * \return 0 = 0K; -1 = ERROR */
- int prepare_chargeParameterDiscovery(struct EXIService* service, struct MessageHeaderType* header, struct ChargeParameterDiscoveryReqType* params, struct ChargeParameterDiscoveryResType* result);
-
-
-
-
-/**
- * \brief Prepares the remote powerDelivery method
- * \param service struct EXIService* Service data structure (has to be initialized before)
- * \param header struct MessageHeaderType* Header data structure
- * \param params struct PowerDeliveryReqType* Request data for the server (has to be set up before)
- * \param result struct PowerDeliveryResType* Contains the response data from the server
- * \return 0 = 0K; -1 = ERROR */
- int prepare_powerDelivery(struct EXIService* service, struct MessageHeaderType* header, struct PowerDeliveryReqType* params, struct PowerDeliveryResType* result);
-
-
-
-
-/**
- * \brief Prepares the remote chargingStatus method
- * \param service struct EXIService* Service data structure (has to be initialized before)
- * \param header struct MessageHeaderType* Header data structure
- * \param result struct ChargingStatusResType* Contains the response data from the server
- * \return 0 = 0K; -1 = ERROR */
- int prepare_chargingStatus(struct EXIService* service, struct MessageHeaderType* header, struct ChargingStatusResType* result);
-
-
-
-
-/**
- * \brief Prepares the remote meteringReceipt method
- * \param service struct EXIService* Service data structure (has to be initialized before)
- * \param header struct MessageHeaderType* Header data structure
- * \param params struct MeteringReceiptReqType* Request data for the server (has to be set up before)
- * \param result struct MeteringReceiptResType* Contains the response data from the server
- * \return 0 = 0K; -1 = ERROR */
- int prepare_meteringReceipt(struct EXIService* service, struct MessageHeaderType* header, struct MeteringReceiptReqType* params, struct MeteringReceiptResType* result);
-
-
-
-
-/**
- * \brief Prepares the remote certificateUpdate method
- * \param service struct EXIService* Service data structure (has to be initialized before)
- * \param header struct MessageHeaderType* Header data structure
- * \param params struct CertificateUpdateReqType* Request data for the server (has to be set up before)
- * \param result struct CertificateUpdateResType* Contains the response data from the server
- * \return 0 = 0K; -1 = ERROR */
- int prepare_certificateUpdate(struct EXIService* service, struct MessageHeaderType* header, struct CertificateUpdateReqType* params, struct CertificateUpdateResType* result);
-
-
-
-
-/**
- * \brief Prepares the remote certificateInstallation method
- * \param service struct EXIService* Service data structure (has to be initialized before)
- * \param header struct MessageHeaderType* Header data structure
- * \param params struct CertificateInstallationReqType* Request data for the server (has to be set up before)
- * \param result struct CertificateInstallationResType* Contains the response data from the server
- * \return 0 = 0K; -1 = ERROR */
- int prepare_certificateInstallation(struct EXIService* service, struct MessageHeaderType* header, struct CertificateInstallationReqType* params, struct CertificateInstallationResType* result);
-
-
-
-
-/**
- * \brief Prepares the remote cableCheck method
- * \param service struct EXIService* Service data structure (has to be initialized before)
- * \param header struct MessageHeaderType* Header data structure
- * \param params struct CableCheckReqType* Request data for the server (has to be set up before)
- * \param result struct CableCheckResType* Contains the response data from the server
- * \return 0 = 0K; -1 = ERROR */
- int prepare_cableCheck(struct EXIService* service, struct MessageHeaderType* header, struct CableCheckReqType* params, struct CableCheckResType* result);
-
-
-
-
-/**
- * \brief Prepares the remote preCharge method
- * \param service struct EXIService* Service data structure (has to be initialized before)
- * \param header struct MessageHeaderType* Header data structure
- * \param params struct PreChargeReqType* Request data for the server (has to be set up before)
- * \param result struct PreChargeResType* Contains the response data from the server
- * \return 0 = 0K; -1 = ERROR */
- int prepare_preCharge(struct EXIService* service, struct MessageHeaderType* header, struct PreChargeReqType* params, struct PreChargeResType* result);
-
-
-
-
-/**
- * \brief Prepares the remote currentDemand method
- * \param service struct EXIService* Service data structure (has to be initialized before)
- * \param header struct MessageHeaderType* Header data structure
- * \param params struct CurrentDemandReqType* Request data for the server (has to be set up before)
- * \param result struct CurrentDemandResType* Contains the response data from the server
- * \return 0 = 0K; -1 = ERROR */
- int prepare_currentDemand(struct EXIService* service, struct MessageHeaderType* header, struct CurrentDemandReqType* params, struct CurrentDemandResType* result);
-
-
-
-
-/**
- * \brief Prepares the remote weldingDetection method
- * \param service struct EXIService* Service data structure (has to be initialized before)
- * \param header struct MessageHeaderType* Header data structure
- * \param params struct WeldingDetectionReqType* Request data for the server (has to be set up before)
- * \param result struct WeldingDetectionResType* Contains the response data from the server
- * \return 0 = 0K; -1 = ERROR */
- int prepare_weldingDetection(struct EXIService* service, struct MessageHeaderType* header, struct WeldingDetectionReqType* params, struct WeldingDetectionResType* result);
-
-
-
-
-/**
- * \brief Prepares the remote sessionStop method
- * \param service struct EXIService* Service data structure (has to be initialized before)
- * \param header struct MessageHeaderType* Header data structure
- * \param result struct SessionStopResType* Contains the response data from the server
- * \return 0 = 0K; -1 = ERROR */
- int prepare_sessionStop(struct EXIService* service, struct MessageHeaderType* header, struct SessionStopResType* result);
-
-
-
-
-
-
- /**
- * \brief Determines which response message was received
- * \param service struct EXIService* Service data structure (has to be initialized before)
- * \param respMsg enum responseMessages* contains the name of the response message
- * \param result struct SessionStopResType* Contains the response data from the server
- * \return 0 = 0K; 0 != ERROR */
-int determineResponseMesssage(struct EXIService* service, enum responseMessages* respMsg);
-
-
-
-
- /* Initialize the v2g client */
-int init_v2gServiceClient(struct EXIService* service, bytes_t bytes, string_ucs_t string, uint8_t* inStream, size_t max_inStream_size, uint8_t* outStream, size_t max_outStream_size, uint32_t* outPayloadLength, uint16_t transportHeaderOffset);
-
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
diff --git a/src/service/v2g_serviceDataSerialization.c b/src/service/v2g_serviceDataSerialization.c
deleted file mode 100644
index 6fcce74..0000000
--- a/src/service/v2g_serviceDataSerialization.c
+++ /dev/null
@@ -1,7882 +0,0 @@
-
-/*
- * Copyright (C) 2007-2012 Siemens AG
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-/*******************************************************************
- *
- * @author Sebastian.Kaebisch.EXT@siemens.com
- * @version 0.6
- * @contact Joerg.Heuer@siemens.com
- *
- *
Code generated by EXISeGen
- *
- ********************************************************************/
-
-
-#include "v2g_service.h"
-#include "v2g_serviceDataTypes.h"
-
-#include "EXITypes.h"
-#include "EXIEncoder.h"
-
-#include
-
-
-
-
-static int serialize_NotificationType(struct NotificationType* type, struct EXIService* service)
-{
-
- /* element ID assignment of FaultCode*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=74;
-
-
- /* encode start element FaultCode */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_ENUMERATION;
- service->val.enumeration=type->FaultCode;
-
- /* encode character FaultCode */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of FaultCode */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- if(type->isused.FaultMsg)
- {
-
- /* element ID assignment of FaultMsg*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=75;
-
-
- /* encode start element FaultMsg */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->FaultMsg.arraylen.data;
- memcpy(service->val.string.codepoints, type->FaultMsg.data,type->FaultMsg.arraylen.data*sizeof(uint32_t));
-
-
- /* encode character FaultMsg */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of FaultMsg */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_CanonicalizationMethodType(struct CanonicalizationMethodType* type, struct EXIService* service)
-{
-
- /* element ID assignment of attr_Algorithm*/
- service->eqn.namespaceURI=0;
- service->eqn.localPart=0;
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->attr_Algorithm.arraylen.data;
- service->val.string.codepoints= type->attr_Algorithm.data;
- if (exiEncodeAttribute(&(service->outStream), &(service->stateEncode), &(service->eqn),&(service->val)))
- {
- return -1;
- }
-
-
- return 0;
-}
-
-
-static int serialize_SignatureMethodType(struct SignatureMethodType* type, struct EXIService* service)
-{
-
- /* element ID assignment of attr_Algorithm*/
- service->eqn.namespaceURI=0;
- service->eqn.localPart=0;
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->attr_Algorithm.arraylen.data;
- service->val.string.codepoints= type->attr_Algorithm.data;
- if (exiEncodeAttribute(&(service->outStream), &(service->stateEncode), &(service->eqn),&(service->val)))
- {
- return -1;
- }
-
-
- return 0;
-}
-
-
-static int serialize_DigestMethodType(struct DigestMethodType* type, struct EXIService* service)
-{
-
- /* element ID assignment of attr_Algorithm*/
- service->eqn.namespaceURI=0;
- service->eqn.localPart=0;
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->attr_Algorithm.arraylen.data;
- service->val.string.codepoints= type->attr_Algorithm.data;
- if (exiEncodeAttribute(&(service->outStream), &(service->stateEncode), &(service->eqn),&(service->val)))
- {
- return -1;
- }
-
-
- return 0;
-}
-
-
-static int serialize_ReferenceType(struct ReferenceType* type, struct EXIService* service)
-{
-
- if(type->isused.attr_Id)
- {
-
- /* element ID assignment of attr_Id*/
- service->eqn.namespaceURI=0;
- service->eqn.localPart=2;
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->attr_Id.arraylen.data;
- service->val.string.codepoints= type->attr_Id.data;
- if (exiEncodeAttribute(&(service->outStream), &(service->stateEncode), &(service->eqn),&(service->val)))
- {
- return -1;
- }
- }
-
- if(type->isused.attr_URI)
- {
-
- /* element ID assignment of attr_URI*/
- service->eqn.namespaceURI=0;
- service->eqn.localPart=7;
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->attr_URI.arraylen.data;
- service->val.string.codepoints= type->attr_URI.data;
- if (exiEncodeAttribute(&(service->outStream), &(service->stateEncode), &(service->eqn),&(service->val)))
- {
- return -1;
- }
- }
-
- if(type->isused.attr_Type)
- {
-
- /* element ID assignment of attr_Type*/
- service->eqn.namespaceURI=0;
- service->eqn.localPart=6;
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->attr_Type.arraylen.data;
- service->val.string.codepoints= type->attr_Type.data;
- if (exiEncodeAttribute(&(service->outStream), &(service->stateEncode), &(service->eqn),&(service->val)))
- {
- return -1;
- }
- }
-
- /* element ID assignment of DigestMethod*/
- service->eqn.namespaceURI=4;
- service->eqn.localPart=5;
-
-
- /* encode start element DigestMethod */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of DigestMethod */
- if(serialize_DigestMethodType( &(type->DigestMethod),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of DigestMethod */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of DigestValue*/
- service->eqn.namespaceURI=4;
- service->eqn.localPart=7;
-
-
- /* encode start element DigestValue */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
- service->val.type = EXI_DATATYPE_BINARY_BASE64;
- service->val.binary.len = type->DigestValue.arraylen.data;
- memcpy(service->val.binary.data, type->DigestValue.data,type->DigestValue.arraylen.data);
-
-
- /* encode character DigestValue */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
-
- /* encode end element of DigestValue */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_SignedInfoType(struct SignedInfoType* type, struct EXIService* service)
-{
-
- size_t i_loop;
-
- if(type->isused.attr_Id)
- {
-
- /* element ID assignment of attr_Id*/
- service->eqn.namespaceURI=0;
- service->eqn.localPart=2;
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->attr_Id.arraylen.data;
- service->val.string.codepoints= type->attr_Id.data;
- if (exiEncodeAttribute(&(service->outStream), &(service->stateEncode), &(service->eqn),&(service->val)))
- {
- return -1;
- }
- }
-
- /* element ID assignment of CanonicalizationMethod*/
- service->eqn.namespaceURI=4;
- service->eqn.localPart=0;
-
-
- /* encode start element CanonicalizationMethod */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of CanonicalizationMethod */
- if(serialize_CanonicalizationMethodType( &(type->CanonicalizationMethod),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of CanonicalizationMethod */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of SignatureMethod*/
- service->eqn.namespaceURI=4;
- service->eqn.localPart=43;
-
-
- /* encode start element SignatureMethod */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of SignatureMethod */
- if(serialize_SignatureMethodType( &(type->SignatureMethod),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of SignatureMethod */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- for(i_loop=0;i_loop < 1;i_loop++)
- {
-
- /* element ID assignment of Reference*/
- service->eqn.namespaceURI=4;
- service->eqn.localPart=34;
-
-
- /* encode start element Reference */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of Reference */
- if(serialize_ReferenceType(&(type->Reference[i_loop]),service))
- {
- return -1;
- }
-
-
- /* encode end element of Reference */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_X509IssuerSerialType(struct X509IssuerSerialType* type, struct EXIService* service)
-{
-
- /* element ID assignment of X509IssuerName*/
- service->eqn.namespaceURI=4;
- service->eqn.localPart=62;
-
-
- /* encode start element X509IssuerName */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->X509IssuerName.arraylen.data;
- memcpy(service->val.string.codepoints, type->X509IssuerName.data,type->X509IssuerName.arraylen.data*sizeof(uint32_t));
-
-
- /* encode character X509IssuerName */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of X509IssuerName */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of X509SerialNumber*/
- service->eqn.namespaceURI=4;
- service->eqn.localPart=66;
-
-
- /* encode start element X509SerialNumber */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_INTEGER;
- service->val.integer.val.int64=type->X509SerialNumber;
- service->val.integer.type = EXI_INTEGER_64;
-
- /* encode character X509SerialNumber */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of X509SerialNumber */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_X509DataType(struct X509DataType* type, struct EXIService* service)
-{
-
- /* element ID assignment of X509IssuerSerial*/
- service->eqn.namespaceURI=4;
- service->eqn.localPart=63;
-
-
- /* encode start element X509IssuerSerial */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of X509IssuerSerial */
- if(serialize_X509IssuerSerialType( &(type->X509IssuerSerial),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of X509IssuerSerial */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of X509SKI*/
- service->eqn.namespaceURI=4;
- service->eqn.localPart=65;
-
-
- /* encode start element X509SKI */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
- service->val.type = EXI_DATATYPE_BINARY_BASE64;
- service->val.binary.len = type->X509SKI.arraylen.data;
- memcpy(service->val.binary.data, type->X509SKI.data,type->X509SKI.arraylen.data);
-
-
- /* encode character X509SKI */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
-
- /* encode end element of X509SKI */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of X509SubjectName*/
- service->eqn.namespaceURI=4;
- service->eqn.localPart=67;
-
-
- /* encode start element X509SubjectName */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->X509SubjectName.arraylen.data;
- memcpy(service->val.string.codepoints, type->X509SubjectName.data,type->X509SubjectName.arraylen.data*sizeof(uint32_t));
-
-
- /* encode character X509SubjectName */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of X509SubjectName */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of X509Certificate*/
- service->eqn.namespaceURI=4;
- service->eqn.localPart=59;
-
-
- /* encode start element X509Certificate */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
- service->val.type = EXI_DATATYPE_BINARY_BASE64;
- service->val.binary.len = type->X509Certificate.arraylen.data;
- memcpy(service->val.binary.data, type->X509Certificate.data,type->X509Certificate.arraylen.data);
-
-
- /* encode character X509Certificate */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
-
- /* encode end element of X509Certificate */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of X509CRL*/
- service->eqn.namespaceURI=4;
- service->eqn.localPart=58;
-
-
- /* encode start element X509CRL */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
- service->val.type = EXI_DATATYPE_BINARY_BASE64;
- service->val.binary.len = type->X509CRL.arraylen.data;
- memcpy(service->val.binary.data, type->X509CRL.data,type->X509CRL.arraylen.data);
-
-
- /* encode character X509CRL */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
-
- /* encode end element of X509CRL */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_KeyInfoType(struct KeyInfoType* type, struct EXIService* service)
-{
-
- if(type->isused.attr_Id)
- {
-
- /* element ID assignment of attr_Id*/
- service->eqn.namespaceURI=0;
- service->eqn.localPart=2;
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->attr_Id.arraylen.data;
- service->val.string.codepoints= type->attr_Id.data;
- if (exiEncodeAttribute(&(service->outStream), &(service->stateEncode), &(service->eqn),&(service->val)))
- {
- return -1;
- }
- }
-
- /* element ID assignment of X509Data*/
- service->eqn.namespaceURI=4;
- service->eqn.localPart=60;
-
-
- /* encode start element X509Data */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of X509Data */
- if(serialize_X509DataType( &(type->X509Data),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of X509Data */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_SignatureType(struct SignatureType* type, struct EXIService* service)
-{
-
- if(type->isused.attr_Id)
- {
-
- /* element ID assignment of attr_Id*/
- service->eqn.namespaceURI=0;
- service->eqn.localPart=2;
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->attr_Id.arraylen.data;
- service->val.string.codepoints= type->attr_Id.data;
- if (exiEncodeAttribute(&(service->outStream), &(service->stateEncode), &(service->eqn),&(service->val)))
- {
- return -1;
- }
- }
-
- /* element ID assignment of SignedInfo*/
- service->eqn.namespaceURI=4;
- service->eqn.localPart=52;
-
-
- /* encode start element SignedInfo */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of SignedInfo */
- if(serialize_SignedInfoType( &(type->SignedInfo),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of SignedInfo */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of SignatureValue*/
- service->eqn.namespaceURI=4;
- service->eqn.localPart=50;
-
-
- /* encode start element SignatureValue */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_BINARY_BASE64;
- service->val.binary.len = type->SignatureValue.arraylen.data;
- service->val.binary.data= type->SignatureValue.data;
-
- /* encode character DigestValue */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
-
- /* encode end element of SignatureValue */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- if(type->isused.KeyInfo)
- {
-
- /* element ID assignment of KeyInfo*/
- service->eqn.namespaceURI=4;
- service->eqn.localPart=14;
-
-
- /* encode start element KeyInfo */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of KeyInfo */
- if(serialize_KeyInfoType( &(type->KeyInfo),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of KeyInfo */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_MessageHeaderType(struct MessageHeaderType* type, struct EXIService* service)
-{
-
- /* element ID assignment of SessionID*/
- service->eqn.namespaceURI=8;
- service->eqn.localPart=2;
-
-
- /* encode start element SessionID */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
- service->val.type = EXI_DATATYPE_BINARY_HEX;
- service->val.binary.len = type->SessionID.arraylen.data;
- memcpy(service->val.binary.data, type->SessionID.data,type->SessionID.arraylen.data);
-
-
- /* encode character SessionID */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
-
- /* encode end element of SessionID */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- if(type->isused.Notification)
- {
-
- /* element ID assignment of Notification*/
- service->eqn.namespaceURI=8;
- service->eqn.localPart=1;
-
-
- /* encode start element Notification */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of Notification */
- if(serialize_NotificationType( &(type->Notification),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of Notification */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.Signature)
- {
-
- /* element ID assignment of Signature*/
- service->eqn.namespaceURI=4;
- service->eqn.localPart=42;
-
-
- /* encode start element Signature */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of Signature */
- if(serialize_SignatureType( (type->Signature),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of Signature */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_SessionSetupReqType(struct SessionSetupReqType* type, struct EXIService* service)
-{
-
- /* element ID assignment of EVCCID*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=40;
-
-
- /* encode start element EVCCID */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
- service->val.type = EXI_DATATYPE_BINARY_HEX;
- service->val.binary.len = type->EVCCID.arraylen.data;
- memcpy(service->val.binary.data, type->EVCCID.data,type->EVCCID.arraylen.data);
-
-
- /* encode character EVCCID */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
-
- /* encode end element of EVCCID */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_SessionSetupResType(struct SessionSetupResType* type, struct EXIService* service)
-{
-
- /* element ID assignment of ResponseCode*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=82;
-
-
- /* encode start element ResponseCode */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_ENUMERATION;
- service->val.enumeration=type->ResponseCode;
-
- /* encode character ResponseCode */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ResponseCode */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of EVSEID*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=46;
-
-
- /* encode start element EVSEID */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
- service->val.type = EXI_DATATYPE_BINARY_HEX;
- service->val.binary.len = type->EVSEID.arraylen.data;
- memcpy(service->val.binary.data, type->EVSEID.data,type->EVSEID.arraylen.data);
-
-
- /* encode character EVSEID */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
-
- /* encode end element of EVSEID */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- if(type->isused.DateTimeNow)
- {
-
- /* element ID assignment of DateTimeNow*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=39;
-
-
- /* encode start element DateTimeNow */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_INTEGER;
- service->val.integer.val.int64=type->DateTimeNow;
- service->val.integer.type = EXI_INTEGER_64;
-
- /* encode character DateTimeNow */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of DateTimeNow */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_ServiceDiscoveryReqType(struct ServiceDiscoveryReqType* type, struct EXIService* service)
-{
-
- if(type->isused.ServiceScope)
- {
-
- /* element ID assignment of ServiceScope*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=103;
-
-
- /* encode start element ServiceScope */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->ServiceScope.arraylen.data;
- memcpy(service->val.string.codepoints, type->ServiceScope.data,type->ServiceScope.arraylen.data*sizeof(uint32_t));
-
-
- /* encode character ServiceScope */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ServiceScope */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.ServiceCategory)
- {
-
- /* element ID assignment of ServiceCategory*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=87;
-
-
- /* encode start element ServiceCategory */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_ENUMERATION;
- service->val.enumeration=type->ServiceCategory;
-
- /* encode character ServiceCategory */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ServiceCategory */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_PaymentOptionsType(struct PaymentOptionsType* type, struct EXIService* service)
-{
-
- size_t i_loop;
-
- for(i_loop=0;i_loop < type->arraylen.PaymentOption;i_loop++)
- {
-
- /* element ID assignment of PaymentOption*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=99;
-
-
- /* encode start element PaymentOption */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_ENUMERATION;
- service->val.enumeration=type->PaymentOption[i_loop];
-
- /* encode character PaymentOption */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of PaymentOption */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_ServiceTagType(struct ServiceTagType* type, struct EXIService* service)
-{
-
- /* element ID assignment of ServiceID*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=130;
-
-
- /* encode start element ServiceID */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_UNSIGNED_INTEGER;
- service->val.integer.val.uint16=type->ServiceID;
- service->val.integer.type = EXI_UNSIGNED_INTEGER_16;
-
- /* encode character ServiceID */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ServiceID */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- if(type->isused.ServiceName)
- {
-
- /* element ID assignment of ServiceName*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=131;
-
-
- /* encode start element ServiceName */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->ServiceName.arraylen.data;
- memcpy(service->val.string.codepoints, type->ServiceName.data,type->ServiceName.arraylen.data*sizeof(uint32_t));
-
-
- /* encode character ServiceName */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ServiceName */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.ServiceCategory)
- {
-
- /* element ID assignment of ServiceCategory*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=127;
-
-
- /* encode start element ServiceCategory */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_ENUMERATION;
- service->val.enumeration=type->ServiceCategory;
-
- /* encode character ServiceCategory */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ServiceCategory */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.ServiceScope)
- {
-
- /* element ID assignment of ServiceScope*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=133;
-
-
- /* encode start element ServiceScope */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->ServiceScope.arraylen.data;
- memcpy(service->val.string.codepoints, type->ServiceScope.data,type->ServiceScope.arraylen.data*sizeof(uint32_t));
-
-
- /* encode character ServiceScope */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ServiceScope */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_ServiceChargeType(struct ServiceChargeType* type, struct EXIService* service)
-{
-
- /* element ID assignment of ServiceTag*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=134;
-
-
- /* encode start element ServiceTag */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of ServiceTag */
- if(serialize_ServiceTagType( &(type->ServiceTag),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of ServiceTag */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of FreeService*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=76;
-
-
- /* encode start element FreeService */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_BOOLEAN;
- service->val.boolean=type->FreeService;
-
- /* encode character FreeService */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of FreeService */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of EnergyTransferType*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=71;
-
-
- /* encode start element EnergyTransferType */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_ENUMERATION;
- service->val.enumeration=type->EnergyTransferType;
-
- /* encode character EnergyTransferType */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of EnergyTransferType */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_ServiceType(struct ServiceType* type, struct EXIService* service)
-{
-
- /* element ID assignment of ServiceTag*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=134;
-
-
- /* encode start element ServiceTag */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of ServiceTag */
- if(serialize_ServiceTagType( &(type->ServiceTag),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of ServiceTag */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of FreeService*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=76;
-
-
- /* encode start element FreeService */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_BOOLEAN;
- service->val.boolean=type->FreeService;
-
- /* encode character FreeService */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of FreeService */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_ServiceTagListType(struct ServiceTagListType* type, struct EXIService* service)
-{
-
- size_t i_loop;
-
- for(i_loop=0;i_loop < type->arraylen.Service;i_loop++)
- {
-
- /* element ID assignment of Service*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=126;
-
-
- /* encode start element Service */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of Service */
- if(serialize_ServiceType(&(type->Service[i_loop]),service))
- {
- return -1;
- }
-
-
- /* encode end element of Service */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_ServiceDiscoveryResType(struct ServiceDiscoveryResType* type, struct EXIService* service)
-{
-
- /* element ID assignment of ResponseCode*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=82;
-
-
- /* encode start element ResponseCode */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_ENUMERATION;
- service->val.enumeration=type->ResponseCode;
-
- /* encode character ResponseCode */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ResponseCode */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of PaymentOptions*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=69;
-
-
- /* encode start element PaymentOptions */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of PaymentOptions */
- if(serialize_PaymentOptionsType( &(type->PaymentOptions),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of PaymentOptions */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of ChargeService*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=18;
-
-
- /* encode start element ChargeService */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of ChargeService */
- if(serialize_ServiceChargeType( &(type->ChargeService),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of ChargeService */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- if(type->isused.ServiceList)
- {
-
- /* element ID assignment of ServiceList*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=97;
-
-
- /* encode start element ServiceList */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of ServiceList */
- if(serialize_ServiceTagListType( &(type->ServiceList),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of ServiceList */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_ServiceDetailReqType(struct ServiceDetailReqType* type, struct EXIService* service)
-{
-
- /* element ID assignment of ServiceID*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=96;
-
-
- /* encode start element ServiceID */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_UNSIGNED_INTEGER;
- service->val.integer.val.uint16=type->ServiceID;
- service->val.integer.type = EXI_UNSIGNED_INTEGER_16;
-
- /* encode character ServiceID */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ServiceID */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_PhysicalValueType(struct PhysicalValueType* type, struct EXIService* service)
-{
-
- /* element ID assignment of Multiplier*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=84;
-
-
- /* encode start element Multiplier */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_NBIT_UNSIGNED_INTEGER;
- service->val.integer.val.int8=type->Multiplier;
- service->val.integer.type = EXI_INTEGER_8;
-
- /* encode character Multiplier */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of Multiplier */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- if(type->isused.Unit)
- {
-
- /* element ID assignment of Unit*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=145;
-
-
- /* encode start element Unit */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_ENUMERATION;
- service->val.enumeration=type->Unit;
-
- /* encode character Unit */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of Unit */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- /* element ID assignment of Value*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=146;
-
-
- /* encode start element Value */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_INTEGER;
- service->val.integer.val.int16=type->Value;
- service->val.integer.type = EXI_INTEGER_16;
-
- /* encode character Value */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of Value */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_ParameterType(struct ParameterType* type, struct EXIService* service)
-{
-
- /* element ID assignment of attr_Name*/
- service->eqn.namespaceURI=0;
- service->eqn.localPart=4;
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->attr_Name.arraylen.data;
- service->val.string.codepoints= type->attr_Name.data;
- if (exiEncodeAttribute(&(service->outStream), &(service->stateEncode), &(service->eqn),&(service->val)))
- {
- return -1;
- }
-
- /* element ID assignment of attr_ValueType*/
- service->eqn.namespaceURI=0;
- service->eqn.localPart=8;
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->attr_ValueType.arraylen.data;
- service->val.string.codepoints= type->attr_ValueType.data;
- if (exiEncodeAttribute(&(service->outStream), &(service->stateEncode), &(service->eqn),&(service->val)))
- {
- return -1;
- }
-
- /* element ID assignment of boolValue*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=149;
-
-
- /* encode start element boolValue */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_BOOLEAN;
- service->val.boolean=type->boolValue;
-
- /* encode character boolValue */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of boolValue */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of byteValue*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=150;
-
-
- /* encode start element byteValue */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_NBIT_UNSIGNED_INTEGER;
- service->val.integer.val.int8=type->byteValue;
- service->val.integer.type = EXI_INTEGER_8;
-
- /* encode character byteValue */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of byteValue */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of shortValue*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=177;
-
-
- /* encode start element shortValue */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_INTEGER;
- service->val.integer.val.int16=type->shortValue;
- service->val.integer.type = EXI_INTEGER_16;
-
- /* encode character shortValue */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of shortValue */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of intValue*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=162;
-
-
- /* encode start element intValue */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_INTEGER;
- service->val.integer.val.int32=type->intValue;
- service->val.integer.type = EXI_INTEGER_32;
-
- /* encode character intValue */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of intValue */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of physicalValue*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=168;
-
-
- /* encode start element physicalValue */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of physicalValue */
- if(serialize_PhysicalValueType( &(type->physicalValue),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of physicalValue */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of stringValue*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=181;
-
-
- /* encode start element stringValue */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->stringValue.arraylen.data;
- memcpy(service->val.string.codepoints, type->stringValue.data,type->stringValue.arraylen.data*sizeof(uint32_t));
-
-
- /* encode character stringValue */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of stringValue */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_ParameterSetType(struct ParameterSetType* type, struct EXIService* service)
-{
-
- size_t i_loop;
-
- /* element ID assignment of ParameterSetID*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=96;
-
-
- /* encode start element ParameterSetID */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_INTEGER;
- service->val.integer.val.int16=type->ParameterSetID;
- service->val.integer.type = EXI_INTEGER_16;
-
- /* encode character ParameterSetID */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ParameterSetID */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- for(i_loop=0;i_loop < type->arraylen.Parameter;i_loop++)
- {
-
- /* element ID assignment of Parameter*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=94;
-
-
- /* encode start element Parameter */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of Parameter */
- if(serialize_ParameterType(&(type->Parameter[i_loop]),service))
- {
- return -1;
- }
-
-
- /* encode end element of Parameter */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_ServiceParameterListType(struct ServiceParameterListType* type, struct EXIService* service)
-{
-
- size_t i_loop;
-
- for(i_loop=0;i_loop < type->arraylen.ParameterSet;i_loop++)
- {
-
- /* element ID assignment of ParameterSet*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=95;
-
-
- /* encode start element ParameterSet */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of ParameterSet */
- if(serialize_ParameterSetType(&(type->ParameterSet[i_loop]),service))
- {
- return -1;
- }
-
-
- /* encode end element of ParameterSet */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_ServiceDetailResType(struct ServiceDetailResType* type, struct EXIService* service)
-{
-
- /* element ID assignment of ResponseCode*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=82;
-
-
- /* encode start element ResponseCode */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_ENUMERATION;
- service->val.enumeration=type->ResponseCode;
-
- /* encode character ResponseCode */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ResponseCode */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of ServiceID*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=96;
-
-
- /* encode start element ServiceID */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_UNSIGNED_INTEGER;
- service->val.integer.val.uint16=type->ServiceID;
- service->val.integer.type = EXI_UNSIGNED_INTEGER_16;
-
- /* encode character ServiceID */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ServiceID */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- if(type->isused.ServiceParameterList)
- {
-
- /* element ID assignment of ServiceParameterList*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=98;
-
-
- /* encode start element ServiceParameterList */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of ServiceParameterList */
- if(serialize_ServiceParameterListType( &(type->ServiceParameterList),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of ServiceParameterList */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_SelectedServiceType(struct SelectedServiceType* type, struct EXIService* service)
-{
-
- /* element ID assignment of ServiceID*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=130;
-
-
- /* encode start element ServiceID */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_UNSIGNED_INTEGER;
- service->val.integer.val.uint16=type->ServiceID;
- service->val.integer.type = EXI_UNSIGNED_INTEGER_16;
-
- /* encode character ServiceID */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ServiceID */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- if(type->isused.ParameterSetID)
- {
-
- /* element ID assignment of ParameterSetID*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=96;
-
-
- /* encode start element ParameterSetID */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_INTEGER;
- service->val.integer.val.int16=type->ParameterSetID;
- service->val.integer.type = EXI_INTEGER_16;
-
- /* encode character ParameterSetID */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ParameterSetID */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_SelectedServiceListType(struct SelectedServiceListType* type, struct EXIService* service)
-{
-
- size_t i_loop;
-
- for(i_loop=0;i_loop < type->arraylen.SelectedService;i_loop++)
- {
-
- /* element ID assignment of SelectedService*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=123;
-
-
- /* encode start element SelectedService */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of SelectedService */
- if(serialize_SelectedServiceType(&(type->SelectedService[i_loop]),service))
- {
- return -1;
- }
-
-
- /* encode end element of SelectedService */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_ServicePaymentSelectionReqType(struct ServicePaymentSelectionReqType* type, struct EXIService* service)
-{
-
- /* element ID assignment of SelectedPaymentOption*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=85;
-
-
- /* encode start element SelectedPaymentOption */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_ENUMERATION;
- service->val.enumeration=type->SelectedPaymentOption;
-
- /* encode character SelectedPaymentOption */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of SelectedPaymentOption */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of SelectedServiceList*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=86;
-
-
- /* encode start element SelectedServiceList */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of SelectedServiceList */
- if(serialize_SelectedServiceListType( &(type->SelectedServiceList),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of SelectedServiceList */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_ServicePaymentSelectionResType(struct ServicePaymentSelectionResType* type, struct EXIService* service)
-{
-
- /* element ID assignment of ResponseCode*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=82;
-
-
- /* encode start element ResponseCode */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_ENUMERATION;
- service->val.enumeration=type->ResponseCode;
-
- /* encode character ResponseCode */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ResponseCode */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_SubCertificatesType(struct SubCertificatesType* type, struct EXIService* service)
-{
-
- size_t i_loop;
-
- for(i_loop=0;i_loop < type->arraylen.Certificate;i_loop++)
- {
-
- /* element ID assignment of Certificate*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=8;
-
-
- /* encode start element Certificate */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
- service->val.type = EXI_DATATYPE_BINARY_BASE64;
- service->val.binary.len = type->Certificate[i_loop].arraylen.data;
- memcpy(service->val.binary.data, type->Certificate[i_loop].data,type->Certificate[i_loop].arraylen.data);
-
-
- /* encode character Certificate */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
-
- /* encode end element of Certificate */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_CertificateChainType(struct CertificateChainType* type, struct EXIService* service)
-{
-
- /* element ID assignment of Certificate*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=8;
-
-
- /* encode start element Certificate */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
- service->val.type = EXI_DATATYPE_BINARY_BASE64;
- service->val.binary.len = type->Certificate.arraylen.data;
- memcpy(service->val.binary.data, type->Certificate.data,type->Certificate.arraylen.data);
-
-
- /* encode character Certificate */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
-
- /* encode end element of Certificate */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- if(type->isused.SubCertificates)
- {
-
- /* element ID assignment of SubCertificates*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=141;
-
-
- /* encode start element SubCertificates */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of SubCertificates */
- if(serialize_SubCertificatesType( &(type->SubCertificates),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of SubCertificates */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_PaymentDetailsReqType(struct PaymentDetailsReqType* type, struct EXIService* service)
-{
-
- /* element ID assignment of ContractID*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=29;
-
-
- /* encode start element ContractID */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->ContractID.arraylen.data;
- memcpy(service->val.string.codepoints, type->ContractID.data,type->ContractID.arraylen.data*sizeof(uint32_t));
-
-
- /* encode character ContractID */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ContractID */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of ContractSignatureCertChain*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=30;
-
-
- /* encode start element ContractSignatureCertChain */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of ContractSignatureCertChain */
- if(serialize_CertificateChainType( &(type->ContractSignatureCertChain),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of ContractSignatureCertChain */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_PaymentDetailsResType(struct PaymentDetailsResType* type, struct EXIService* service)
-{
-
- /* element ID assignment of ResponseCode*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=82;
-
-
- /* encode start element ResponseCode */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_ENUMERATION;
- service->val.enumeration=type->ResponseCode;
-
- /* encode character ResponseCode */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ResponseCode */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of GenChallenge*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=57;
-
-
- /* encode start element GenChallenge */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->GenChallenge.arraylen.data;
- memcpy(service->val.string.codepoints, type->GenChallenge.data,type->GenChallenge.arraylen.data*sizeof(uint32_t));
-
-
- /* encode character GenChallenge */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of GenChallenge */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of DateTimeNow*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=39;
-
-
- /* encode start element DateTimeNow */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_INTEGER;
- service->val.integer.val.int64=type->DateTimeNow;
- service->val.integer.type = EXI_INTEGER_64;
-
- /* encode character DateTimeNow */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of DateTimeNow */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_ContractAuthenticationReqType(struct ContractAuthenticationReqType* type, struct EXIService* service)
-{
-
- /* element ID assignment of attr_Id*/
- service->eqn.namespaceURI=0;
- service->eqn.localPart=2;
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->attr_Id.arraylen.data;
- service->val.string.codepoints= type->attr_Id.data;
- if (exiEncodeAttribute(&(service->outStream), &(service->stateEncode), &(service->eqn),&(service->val)))
- {
- return -1;
- }
-
- /* element ID assignment of GenChallenge*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=57;
-
-
- /* encode start element GenChallenge */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->GenChallenge.arraylen.data;
- memcpy(service->val.string.codepoints, type->GenChallenge.data,type->GenChallenge.arraylen.data*sizeof(uint32_t));
-
-
- /* encode character GenChallenge */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of GenChallenge */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_ContractAuthenticationResType(struct ContractAuthenticationResType* type, struct EXIService* service)
-{
-
- /* element ID assignment of ResponseCode*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=82;
-
-
- /* encode start element ResponseCode */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_ENUMERATION;
- service->val.enumeration=type->ResponseCode;
-
- /* encode character ResponseCode */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ResponseCode */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_AC_EVChargeParameterType(struct AC_EVChargeParameterType* type, struct EXIService* service)
-{
-
- /* element ID assignment of DepartureTime*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=30;
-
-
- /* encode start element DepartureTime */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_UNSIGNED_INTEGER;
- service->val.integer.val.uint32=type->DepartureTime;
- service->val.integer.type = EXI_UNSIGNED_INTEGER_32;
-
- /* encode character DepartureTime */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of DepartureTime */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of EAmount*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=31;
-
-
- /* encode start element EAmount */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EAmount */
- if(serialize_PhysicalValueType( &(type->EAmount),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EAmount */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of EVMaxVoltage*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=40;
-
-
- /* encode start element EVMaxVoltage */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVMaxVoltage */
- if(serialize_PhysicalValueType( &(type->EVMaxVoltage),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVMaxVoltage */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of EVMaxCurrent*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=39;
-
-
- /* encode start element EVMaxCurrent */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVMaxCurrent */
- if(serialize_PhysicalValueType( &(type->EVMaxCurrent),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVMaxCurrent */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of EVMinCurrent*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=44;
-
-
- /* encode start element EVMinCurrent */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVMinCurrent */
- if(serialize_PhysicalValueType( &(type->EVMinCurrent),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVMinCurrent */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_DC_EVStatusType(struct DC_EVStatusType* type, struct EXIService* service)
-{
-
- /* element ID assignment of EVReady*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=49;
-
-
- /* encode start element EVReady */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_BOOLEAN;
- service->val.boolean=type->EVReady;
-
- /* encode character EVReady */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of EVReady */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- if(type->isused.EVCabinConditioning)
- {
-
- /* element ID assignment of EVCabinConditioning*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=33;
-
-
- /* encode start element EVCabinConditioning */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_BOOLEAN;
- service->val.boolean=type->EVCabinConditioning;
-
- /* encode character EVCabinConditioning */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of EVCabinConditioning */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.EVRESSConditioning)
- {
-
- /* element ID assignment of EVRESSConditioning*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=47;
-
-
- /* encode start element EVRESSConditioning */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_BOOLEAN;
- service->val.boolean=type->EVRESSConditioning;
-
- /* encode character EVRESSConditioning */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of EVRESSConditioning */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- /* element ID assignment of EVErrorCode*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=38;
-
-
- /* encode start element EVErrorCode */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_ENUMERATION;
- service->val.enumeration=type->EVErrorCode;
-
- /* encode character EVErrorCode */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of EVErrorCode */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of EVRESSSOC*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=48;
-
-
- /* encode start element EVRESSSOC */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_NBIT_UNSIGNED_INTEGER;
- service->val.integer.val.int8=type->EVRESSSOC;
- service->val.integer.type = EXI_INTEGER_8;
-
- /* encode character EVRESSSOC */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of EVRESSSOC */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_DC_EVChargeParameterType(struct DC_EVChargeParameterType* type, struct EXIService* service)
-{
-
- /* element ID assignment of DC_EVStatus*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=28;
-
-
- /* encode start element DC_EVStatus */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of DC_EVStatus */
- if(serialize_DC_EVStatusType( &(type->DC_EVStatus),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of DC_EVStatus */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of EVMaximumCurrentLimit*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=41;
-
-
- /* encode start element EVMaximumCurrentLimit */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVMaximumCurrentLimit */
- if(serialize_PhysicalValueType( &(type->EVMaximumCurrentLimit),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVMaximumCurrentLimit */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- if(type->isused.EVMaximumPowerLimit)
- {
-
- /* element ID assignment of EVMaximumPowerLimit*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=42;
-
-
- /* encode start element EVMaximumPowerLimit */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVMaximumPowerLimit */
- if(serialize_PhysicalValueType( &(type->EVMaximumPowerLimit),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVMaximumPowerLimit */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- /* element ID assignment of EVMaximumVoltageLimit*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=43;
-
-
- /* encode start element EVMaximumVoltageLimit */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVMaximumVoltageLimit */
- if(serialize_PhysicalValueType( &(type->EVMaximumVoltageLimit),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVMaximumVoltageLimit */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- if(type->isused.EVEnergyCapacity)
- {
-
- /* element ID assignment of EVEnergyCapacity*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=36;
-
-
- /* encode start element EVEnergyCapacity */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVEnergyCapacity */
- if(serialize_PhysicalValueType( &(type->EVEnergyCapacity),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVEnergyCapacity */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.EVEnergyRequest)
- {
-
- /* element ID assignment of EVEnergyRequest*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=37;
-
-
- /* encode start element EVEnergyRequest */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVEnergyRequest */
- if(serialize_PhysicalValueType( &(type->EVEnergyRequest),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVEnergyRequest */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.FullSOC)
- {
-
- /* element ID assignment of FullSOC*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=77;
-
-
- /* encode start element FullSOC */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_NBIT_UNSIGNED_INTEGER;
- service->val.integer.val.int8=type->FullSOC;
- service->val.integer.type = EXI_INTEGER_8;
-
- /* encode character FullSOC */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of FullSOC */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.BulkSOC)
- {
-
- /* element ID assignment of BulkSOC*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=7;
-
-
- /* encode start element BulkSOC */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_NBIT_UNSIGNED_INTEGER;
- service->val.integer.val.int8=type->BulkSOC;
- service->val.integer.type = EXI_INTEGER_8;
-
- /* encode character BulkSOC */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of BulkSOC */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_ChargeParameterDiscoveryReqType(struct ChargeParameterDiscoveryReqType* type, struct EXIService* service)
-{
-
- /* element ID assignment of EVRequestedEnergyTransferType*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=44;
-
-
- /* encode start element EVRequestedEnergyTransferType */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_ENUMERATION;
- service->val.enumeration=type->EVRequestedEnergyTransferType;
-
- /* encode character EVRequestedEnergyTransferType */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of EVRequestedEnergyTransferType */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- if(type->isused.AC_EVChargeParameter)
- {
-
- /* element ID assignment of AC_EVChargeParameter*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=0;
-
-
- /* encode start element AC_EVChargeParameter */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of AC_EVChargeParameter */
- if(serialize_AC_EVChargeParameterType( (type->AC_EVChargeParameter),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of AC_EVChargeParameter */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.DC_EVChargeParameter)
- {
-
- /* element ID assignment of DC_EVChargeParameter*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=18;
-
-
- /* encode start element DC_EVChargeParameter */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of DC_EVChargeParameter */
- if(serialize_DC_EVChargeParameterType( (type->DC_EVChargeParameter),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of DC_EVChargeParameter */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_RelativeTimeIntervalType(struct RelativeTimeIntervalType* type, struct EXIService* service)
-{
-
- /* element ID assignment of start*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=179;
-
-
- /* encode start element start */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_UNSIGNED_INTEGER;
- service->val.integer.val.uint32=type->start;
- service->val.integer.type = EXI_UNSIGNED_INTEGER_32;
-
- /* encode character start */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of start */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- if(type->isused.duration)
- {
-
- /* element ID assignment of duration*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=156;
-
-
- /* encode start element duration */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_UNSIGNED_INTEGER;
- service->val.integer.val.uint32=type->duration;
- service->val.integer.type = EXI_UNSIGNED_INTEGER_32;
-
- /* encode character duration */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of duration */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_PMaxScheduleEntryType(struct PMaxScheduleEntryType* type, struct EXIService* service)
-{
-
- /* element ID assignment of RelativeTimeInterval*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=106;
-
-
- /* encode start element RelativeTimeInterval */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of RelativeTimeInterval */
- if(serialize_RelativeTimeIntervalType( &(type->RelativeTimeInterval),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of RelativeTimeInterval */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of PMax*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=87;
-
-
- /* encode start element PMax */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_INTEGER;
- service->val.integer.val.int16=type->PMax;
- service->val.integer.type = EXI_INTEGER_16;
-
- /* encode character PMax */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of PMax */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_PMaxScheduleType(struct PMaxScheduleType* type, struct EXIService* service)
-{
-
- size_t i_loop;
-
- /* element ID assignment of PMaxScheduleID*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=91;
-
-
- /* encode start element PMaxScheduleID */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_INTEGER;
- service->val.integer.val.int16=type->PMaxScheduleID;
- service->val.integer.type = EXI_INTEGER_16;
-
- /* encode character PMaxScheduleID */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of PMaxScheduleID */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- for(i_loop=0;i_loop < type->arraylen.PMaxScheduleEntry;i_loop++)
- {
-
- /* element ID assignment of PMaxScheduleEntry*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=89;
-
-
- /* encode start element PMaxScheduleEntry */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of PMaxScheduleEntry */
- if(serialize_PMaxScheduleEntryType(&(type->PMaxScheduleEntry[i_loop]),service))
- {
- return -1;
- }
-
-
- /* encode end element of PMaxScheduleEntry */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_CostType(struct CostType* type, struct EXIService* service)
-{
-
- /* element ID assignment of costKind*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=153;
-
-
- /* encode start element costKind */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_ENUMERATION;
- service->val.enumeration=type->costKind;
-
- /* encode character costKind */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of costKind */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of amount*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=147;
-
-
- /* encode start element amount */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_UNSIGNED_INTEGER;
- service->val.integer.val.uint32=type->amount;
- service->val.integer.type = EXI_UNSIGNED_INTEGER_32;
-
- /* encode character amount */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of amount */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- if(type->isused.amountMultiplier)
- {
-
- /* element ID assignment of amountMultiplier*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=148;
-
-
- /* encode start element amountMultiplier */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_NBIT_UNSIGNED_INTEGER;
- service->val.integer.val.int8=type->amountMultiplier;
- service->val.integer.type = EXI_INTEGER_8;
-
- /* encode character amountMultiplier */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of amountMultiplier */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_ConsumptionCostType(struct ConsumptionCostType* type, struct EXIService* service)
-{
-
- size_t i_loop;
-
- /* element ID assignment of startValue*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=180;
-
-
- /* encode start element startValue */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_UNSIGNED_INTEGER;
- service->val.integer.val.uint32=type->startValue;
- service->val.integer.type = EXI_UNSIGNED_INTEGER_32;
-
- /* encode character startValue */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of startValue */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- if(type->isused.Cost)
- {
-
- for(i_loop=0;i_loop < type->arraylen.Cost;i_loop++)
- {
-
- /* element ID assignment of Cost*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=16;
-
-
- /* encode start element Cost */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of Cost */
- if(serialize_CostType(&(type->Cost[i_loop]),service))
- {
- return -1;
- }
-
-
- /* encode end element of Cost */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
- }
-
-
- return 0;
-}
-
-
-static int serialize_SalesTariffEntryType(struct SalesTariffEntryType* type, struct EXIService* service)
-{
-
- size_t i_loop;
-
- /* element ID assignment of RelativeTimeInterval*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=106;
-
-
- /* encode start element RelativeTimeInterval */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of RelativeTimeInterval */
- if(serialize_RelativeTimeIntervalType( &(type->RelativeTimeInterval),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of RelativeTimeInterval */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of EPriceLevel*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=32;
-
-
- /* encode start element EPriceLevel */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_NBIT_UNSIGNED_INTEGER;
- service->val.integer.val.uint8=type->EPriceLevel;
- service->val.integer.type = EXI_UNSIGNED_INTEGER_8;
-
- /* encode character EPriceLevel */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of EPriceLevel */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- if(type->isused.ConsumptionCost)
- {
-
- for(i_loop=0;i_loop < type->arraylen.ConsumptionCost;i_loop++)
- {
-
- /* element ID assignment of ConsumptionCost*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=14;
-
-
- /* encode start element ConsumptionCost */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of ConsumptionCost */
- if(serialize_ConsumptionCostType(&(type->ConsumptionCost[i_loop]),service))
- {
- return -1;
- }
-
-
- /* encode end element of ConsumptionCost */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
- }
-
-
- return 0;
-}
-
-
-static int serialize_SalesTariffType(struct SalesTariffType* type, struct EXIService* service)
-{
-
- size_t i_loop;
-
- /* element ID assignment of attr_Id*/
- service->eqn.namespaceURI=0;
- service->eqn.localPart=2;
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->attr_Id.arraylen.data;
- service->val.string.codepoints= type->attr_Id.data;
- if (exiEncodeAttribute(&(service->outStream), &(service->stateEncode), &(service->eqn),&(service->val)))
- {
- return -1;
- }
-
- /* element ID assignment of SalesTariffID*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=121;
-
-
- /* encode start element SalesTariffID */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_INTEGER;
- service->val.integer.val.int16=type->SalesTariffID;
- service->val.integer.type = EXI_INTEGER_16;
-
- /* encode character SalesTariffID */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of SalesTariffID */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- if(type->isused.SalesTariffDescription)
- {
-
- /* element ID assignment of SalesTariffDescription*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=118;
-
-
- /* encode start element SalesTariffDescription */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->SalesTariffDescription.arraylen.data;
- memcpy(service->val.string.codepoints, type->SalesTariffDescription.data,type->SalesTariffDescription.arraylen.data*sizeof(uint32_t));
-
-
- /* encode character SalesTariffDescription */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of SalesTariffDescription */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- /* element ID assignment of NumEPriceLevels*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=86;
-
-
- /* encode start element NumEPriceLevels */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_NBIT_UNSIGNED_INTEGER;
- service->val.integer.val.uint8=type->NumEPriceLevels;
- service->val.integer.type = EXI_UNSIGNED_INTEGER_8;
-
- /* encode character NumEPriceLevels */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of NumEPriceLevels */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- for(i_loop=0;i_loop < type->arraylen.SalesTariffEntry;i_loop++)
- {
-
- /* element ID assignment of SalesTariffEntry*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=119;
-
-
- /* encode start element SalesTariffEntry */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of SalesTariffEntry */
- if(serialize_SalesTariffEntryType(&(type->SalesTariffEntry[i_loop]),service))
- {
- return -1;
- }
-
-
- /* encode end element of SalesTariffEntry */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_SAScheduleTupleType(struct SAScheduleTupleType* type, struct EXIService* service)
-{
-
- /* element ID assignment of SAScheduleTupleID*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=113;
-
-
- /* encode start element SAScheduleTupleID */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_INTEGER;
- service->val.integer.val.int16=type->SAScheduleTupleID;
- service->val.integer.type = EXI_INTEGER_16;
-
- /* encode character SAScheduleTupleID */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of SAScheduleTupleID */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of PMaxSchedule*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=88;
-
-
- /* encode start element PMaxSchedule */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of PMaxSchedule */
- if(serialize_PMaxScheduleType( &(type->PMaxSchedule),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of PMaxSchedule */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- if(type->isused.SalesTariff)
- {
-
- /* element ID assignment of SalesTariff*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=117;
-
-
- /* encode start element SalesTariff */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of SalesTariff */
- if(serialize_SalesTariffType( (type->SalesTariff),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of SalesTariff */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_SAScheduleListType(struct SAScheduleListType* type, struct EXIService* service)
-{
-
- size_t i_loop;
-
- for(i_loop=0;i_loop < type->arraylen.SAScheduleTuple;i_loop++)
- {
-
- /* element ID assignment of SAScheduleTuple*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=112;
-
-
- /* encode start element SAScheduleTuple */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of SAScheduleTuple */
- if(serialize_SAScheduleTupleType(&(type->SAScheduleTuple[i_loop]),service))
- {
- return -1;
- }
-
-
- /* encode end element of SAScheduleTuple */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_AC_EVSEStatusType(struct AC_EVSEStatusType* type, struct EXIService* service)
-{
-
- /* element ID assignment of PowerSwitchClosed*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=102;
-
-
- /* encode start element PowerSwitchClosed */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_BOOLEAN;
- service->val.boolean=type->PowerSwitchClosed;
-
- /* encode character PowerSwitchClosed */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of PowerSwitchClosed */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of RCD*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=105;
-
-
- /* encode start element RCD */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_BOOLEAN;
- service->val.boolean=type->RCD;
-
- /* encode character RCD */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of RCD */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of ShutDownTime*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=138;
-
-
- /* encode start element ShutDownTime */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_UNSIGNED_INTEGER;
- service->val.integer.val.uint32=type->ShutDownTime;
- service->val.integer.type = EXI_UNSIGNED_INTEGER_32;
-
- /* encode character ShutDownTime */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ShutDownTime */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of StopCharging*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=140;
-
-
- /* encode start element StopCharging */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_BOOLEAN;
- service->val.boolean=type->StopCharging;
-
- /* encode character StopCharging */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of StopCharging */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_AC_EVSEChargeParameterType(struct AC_EVSEChargeParameterType* type, struct EXIService* service)
-{
-
- /* element ID assignment of AC_EVSEStatus*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=4;
-
-
- /* encode start element AC_EVSEStatus */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of AC_EVSEStatus */
- if(serialize_AC_EVSEStatusType( &(type->AC_EVSEStatus),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of AC_EVSEStatus */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of EVSEMaxVoltage*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=57;
-
-
- /* encode start element EVSEMaxVoltage */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVSEMaxVoltage */
- if(serialize_PhysicalValueType( &(type->EVSEMaxVoltage),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVSEMaxVoltage */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of EVSEMaxCurrent*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=56;
-
-
- /* encode start element EVSEMaxCurrent */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVSEMaxCurrent */
- if(serialize_PhysicalValueType( &(type->EVSEMaxCurrent),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVSEMaxCurrent */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of EVSEMinCurrent*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=61;
-
-
- /* encode start element EVSEMinCurrent */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVSEMinCurrent */
- if(serialize_PhysicalValueType( &(type->EVSEMinCurrent),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVSEMinCurrent */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_DC_EVSEStatusType(struct DC_EVSEStatusType* type, struct EXIService* service)
-{
-
- if(type->isused.EVSEIsolationStatus)
- {
-
- /* element ID assignment of EVSEIsolationStatus*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=55;
-
-
- /* encode start element EVSEIsolationStatus */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_ENUMERATION;
- service->val.enumeration=type->EVSEIsolationStatus;
-
- /* encode character EVSEIsolationStatus */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of EVSEIsolationStatus */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- /* element ID assignment of EVSEStatusCode*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=66;
-
-
- /* encode start element EVSEStatusCode */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_ENUMERATION;
- service->val.enumeration=type->EVSEStatusCode;
-
- /* encode character EVSEStatusCode */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of EVSEStatusCode */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_DC_EVSEChargeParameterType(struct DC_EVSEChargeParameterType* type, struct EXIService* service)
-{
-
- /* element ID assignment of DC_EVSEStatus*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=25;
-
-
- /* encode start element DC_EVSEStatus */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of DC_EVSEStatus */
- if(serialize_DC_EVSEStatusType( &(type->DC_EVSEStatus),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of DC_EVSEStatus */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of EVSEMaximumCurrentLimit*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=58;
-
-
- /* encode start element EVSEMaximumCurrentLimit */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVSEMaximumCurrentLimit */
- if(serialize_PhysicalValueType( &(type->EVSEMaximumCurrentLimit),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVSEMaximumCurrentLimit */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- if(type->isused.EVSEMaximumPowerLimit)
- {
-
- /* element ID assignment of EVSEMaximumPowerLimit*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=59;
-
-
- /* encode start element EVSEMaximumPowerLimit */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVSEMaximumPowerLimit */
- if(serialize_PhysicalValueType( &(type->EVSEMaximumPowerLimit),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVSEMaximumPowerLimit */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- /* element ID assignment of EVSEMaximumVoltageLimit*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=60;
-
-
- /* encode start element EVSEMaximumVoltageLimit */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVSEMaximumVoltageLimit */
- if(serialize_PhysicalValueType( &(type->EVSEMaximumVoltageLimit),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVSEMaximumVoltageLimit */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of EVSEMinimumCurrentLimit*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=62;
-
-
- /* encode start element EVSEMinimumCurrentLimit */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVSEMinimumCurrentLimit */
- if(serialize_PhysicalValueType( &(type->EVSEMinimumCurrentLimit),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVSEMinimumCurrentLimit */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of EVSEMinimumVoltageLimit*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=63;
-
-
- /* encode start element EVSEMinimumVoltageLimit */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVSEMinimumVoltageLimit */
- if(serialize_PhysicalValueType( &(type->EVSEMinimumVoltageLimit),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVSEMinimumVoltageLimit */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- if(type->isused.EVSECurrentRegulationTolerance)
- {
-
- /* element ID assignment of EVSECurrentRegulationTolerance*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=53;
-
-
- /* encode start element EVSECurrentRegulationTolerance */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVSECurrentRegulationTolerance */
- if(serialize_PhysicalValueType( &(type->EVSECurrentRegulationTolerance),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVSECurrentRegulationTolerance */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- /* element ID assignment of EVSEPeakCurrentRipple*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=64;
-
-
- /* encode start element EVSEPeakCurrentRipple */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVSEPeakCurrentRipple */
- if(serialize_PhysicalValueType( &(type->EVSEPeakCurrentRipple),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVSEPeakCurrentRipple */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- if(type->isused.EVSEEnergyToBeDelivered)
- {
-
- /* element ID assignment of EVSEEnergyToBeDelivered*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=54;
-
-
- /* encode start element EVSEEnergyToBeDelivered */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVSEEnergyToBeDelivered */
- if(serialize_PhysicalValueType( &(type->EVSEEnergyToBeDelivered),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVSEEnergyToBeDelivered */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_ChargeParameterDiscoveryResType(struct ChargeParameterDiscoveryResType* type, struct EXIService* service)
-{
-
- /* element ID assignment of ResponseCode*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=82;
-
-
- /* encode start element ResponseCode */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_ENUMERATION;
- service->val.enumeration=type->ResponseCode;
-
- /* encode character ResponseCode */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ResponseCode */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- if(type->isused.SAScheduleList)
- {
-
- /* element ID assignment of SAScheduleList*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=110;
-
-
- /* encode start element SAScheduleList */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of SAScheduleList */
- if(serialize_SAScheduleListType( (type->SAScheduleList),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of SAScheduleList */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.AC_EVSEChargeParameter)
- {
-
- /* element ID assignment of AC_EVSEChargeParameter*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=2;
-
-
- /* encode start element AC_EVSEChargeParameter */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of AC_EVSEChargeParameter */
- if(serialize_AC_EVSEChargeParameterType( (type->AC_EVSEChargeParameter),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of AC_EVSEChargeParameter */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.DC_EVSEChargeParameter)
- {
-
- /* element ID assignment of DC_EVSEChargeParameter*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=23;
-
-
- /* encode start element DC_EVSEChargeParameter */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of DC_EVSEChargeParameter */
- if(serialize_DC_EVSEChargeParameterType( (type->DC_EVSEChargeParameter),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of DC_EVSEChargeParameter */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_ProfileEntryType(struct ProfileEntryType* type, struct EXIService* service)
-{
-
- /* element ID assignment of ChargingProfileEntryStart*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=12;
-
-
- /* encode start element ChargingProfileEntryStart */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_UNSIGNED_INTEGER;
- service->val.integer.val.uint32=type->ChargingProfileEntryStart;
- service->val.integer.type = EXI_UNSIGNED_INTEGER_32;
-
- /* encode character ChargingProfileEntryStart */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ChargingProfileEntryStart */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of ChargingProfileEntryMaxPower*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=11;
-
-
- /* encode start element ChargingProfileEntryMaxPower */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_INTEGER;
- service->val.integer.val.int16=type->ChargingProfileEntryMaxPower;
- service->val.integer.type = EXI_INTEGER_16;
-
- /* encode character ChargingProfileEntryMaxPower */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ChargingProfileEntryMaxPower */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_ChargingProfileType(struct ChargingProfileType* type, struct EXIService* service)
-{
-
- size_t i_loop;
-
- /* element ID assignment of SAScheduleTupleID*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=113;
-
-
- /* encode start element SAScheduleTupleID */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_INTEGER;
- service->val.integer.val.int16=type->SAScheduleTupleID;
- service->val.integer.type = EXI_INTEGER_16;
-
- /* encode character SAScheduleTupleID */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of SAScheduleTupleID */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- for(i_loop=0;i_loop < type->arraylen.ProfileEntry;i_loop++)
- {
-
- /* element ID assignment of ProfileEntry*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=103;
-
-
- /* encode start element ProfileEntry */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of ProfileEntry */
- if(serialize_ProfileEntryType(&(type->ProfileEntry[i_loop]),service))
- {
- return -1;
- }
-
-
- /* encode end element of ProfileEntry */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_DC_EVPowerDeliveryParameterType(struct DC_EVPowerDeliveryParameterType* type, struct EXIService* service)
-{
-
- /* element ID assignment of DC_EVStatus*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=28;
-
-
- /* encode start element DC_EVStatus */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of DC_EVStatus */
- if(serialize_DC_EVStatusType( &(type->DC_EVStatus),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of DC_EVStatus */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- if(type->isused.BulkChargingComplete)
- {
-
- /* element ID assignment of BulkChargingComplete*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=6;
-
-
- /* encode start element BulkChargingComplete */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_BOOLEAN;
- service->val.boolean=type->BulkChargingComplete;
-
- /* encode character BulkChargingComplete */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of BulkChargingComplete */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- /* element ID assignment of ChargingComplete*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=10;
-
-
- /* encode start element ChargingComplete */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_BOOLEAN;
- service->val.boolean=type->ChargingComplete;
-
- /* encode character ChargingComplete */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ChargingComplete */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_PowerDeliveryReqType(struct PowerDeliveryReqType* type, struct EXIService* service)
-{
-
- /* element ID assignment of ReadyToChargeState*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=78;
-
-
- /* encode start element ReadyToChargeState */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_BOOLEAN;
- service->val.boolean=type->ReadyToChargeState;
-
- /* encode character ReadyToChargeState */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ReadyToChargeState */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- if(type->isused.ChargingProfile)
- {
-
- /* element ID assignment of ChargingProfile*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=20;
-
-
- /* encode start element ChargingProfile */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of ChargingProfile */
- if(serialize_ChargingProfileType( &(type->ChargingProfile),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of ChargingProfile */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.DC_EVPowerDeliveryParameter)
- {
-
- /* element ID assignment of DC_EVPowerDeliveryParameter*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=21;
-
-
- /* encode start element DC_EVPowerDeliveryParameter */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of DC_EVPowerDeliveryParameter */
- if(serialize_DC_EVPowerDeliveryParameterType( (type->DC_EVPowerDeliveryParameter),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of DC_EVPowerDeliveryParameter */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_PowerDeliveryResType(struct PowerDeliveryResType* type, struct EXIService* service)
-{
-
- /* element ID assignment of ResponseCode*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=82;
-
-
- /* encode start element ResponseCode */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_ENUMERATION;
- service->val.enumeration=type->ResponseCode;
-
- /* encode character ResponseCode */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ResponseCode */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- if(type->isused.AC_EVSEStatus)
- {
-
- /* element ID assignment of AC_EVSEStatus*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=4;
-
-
- /* encode start element AC_EVSEStatus */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of AC_EVSEStatus */
- if(serialize_AC_EVSEStatusType( (type->AC_EVSEStatus),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of AC_EVSEStatus */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.DC_EVSEStatus)
- {
-
- /* element ID assignment of DC_EVSEStatus*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=25;
-
-
- /* encode start element DC_EVSEStatus */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of DC_EVSEStatus */
- if(serialize_DC_EVSEStatusType( (type->DC_EVSEStatus),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of DC_EVSEStatus */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_ChargingStatusReqType(struct ChargingStatusReqType* type, struct EXIService* service)
-{
-
-
- return 0;
-}
-
-
-static int serialize_MeterInfoType(struct MeterInfoType* type, struct EXIService* service)
-{
-
- /* element ID assignment of MeterID*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=80;
-
-
- /* encode start element MeterID */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->MeterID.arraylen.data;
- memcpy(service->val.string.codepoints, type->MeterID.data,type->MeterID.arraylen.data*sizeof(uint32_t));
-
-
- /* encode character MeterID */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of MeterID */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- if(type->isused.MeterReading)
- {
-
- /* element ID assignment of MeterReading*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=82;
-
-
- /* encode start element MeterReading */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of MeterReading */
- if(serialize_PhysicalValueType( &(type->MeterReading),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of MeterReading */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.SigMeterReading)
- {
-
- /* element ID assignment of SigMeterReading*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=139;
-
-
- /* encode start element SigMeterReading */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
- service->val.type = EXI_DATATYPE_BINARY_BASE64;
- service->val.binary.len = type->SigMeterReading.arraylen.data;
- memcpy(service->val.binary.data, type->SigMeterReading.data,type->SigMeterReading.arraylen.data);
-
-
- /* encode character SigMeterReading */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
-
- /* encode end element of SigMeterReading */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.MeterStatus)
- {
-
- /* element ID assignment of MeterStatus*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=83;
-
-
- /* encode start element MeterStatus */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_INTEGER;
- service->val.integer.val.int16=type->MeterStatus;
- service->val.integer.type = EXI_INTEGER_16;
-
- /* encode character MeterStatus */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of MeterStatus */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.TMeter)
- {
-
- /* element ID assignment of TMeter*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=143;
-
-
- /* encode start element TMeter */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_INTEGER;
- service->val.integer.val.int64=type->TMeter;
- service->val.integer.type = EXI_INTEGER_64;
-
- /* encode character TMeter */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of TMeter */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_ChargingStatusResType(struct ChargingStatusResType* type, struct EXIService* service)
-{
-
- /* element ID assignment of ResponseCode*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=82;
-
-
- /* encode start element ResponseCode */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_ENUMERATION;
- service->val.enumeration=type->ResponseCode;
-
- /* encode character ResponseCode */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ResponseCode */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of EVSEID*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=46;
-
-
- /* encode start element EVSEID */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
- service->val.type = EXI_DATATYPE_BINARY_HEX;
- service->val.binary.len = type->EVSEID.arraylen.data;
- memcpy(service->val.binary.data, type->EVSEID.data,type->EVSEID.arraylen.data);
-
-
- /* encode character EVSEID */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
-
- /* encode end element of EVSEID */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- if(type->isused.SAScheduleTupleID)
- {
-
- /* element ID assignment of SAScheduleTupleID*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=84;
-
-
- /* encode start element SAScheduleTupleID */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_INTEGER;
- service->val.integer.val.int16=type->SAScheduleTupleID;
- service->val.integer.type = EXI_INTEGER_16;
-
- /* encode character SAScheduleTupleID */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of SAScheduleTupleID */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.EVSEMaxCurrent)
- {
-
- /* element ID assignment of EVSEMaxCurrent*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=47;
-
-
- /* encode start element EVSEMaxCurrent */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVSEMaxCurrent */
- if(serialize_PhysicalValueType( &(type->EVSEMaxCurrent),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVSEMaxCurrent */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.MeterInfo)
- {
-
- /* element ID assignment of MeterInfo*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=59;
-
-
- /* encode start element MeterInfo */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of MeterInfo */
- if(serialize_MeterInfoType( &(type->MeterInfo),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of MeterInfo */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- /* element ID assignment of ReceiptRequired*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=79;
-
-
- /* encode start element ReceiptRequired */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_BOOLEAN;
- service->val.boolean=type->ReceiptRequired;
-
- /* encode character ReceiptRequired */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ReceiptRequired */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of AC_EVSEStatus*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=0;
-
-
- /* encode start element AC_EVSEStatus */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of AC_EVSEStatus */
- if(serialize_AC_EVSEStatusType( &(type->AC_EVSEStatus),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of AC_EVSEStatus */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_MeteringReceiptReqType(struct MeteringReceiptReqType* type, struct EXIService* service)
-{
-
- if(type->isused.attr_Id)
- {
-
- /* element ID assignment of attr_Id*/
- service->eqn.namespaceURI=0;
- service->eqn.localPart=2;
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->attr_Id.arraylen.data;
- service->val.string.codepoints= type->attr_Id.data;
- if (exiEncodeAttribute(&(service->outStream), &(service->stateEncode), &(service->eqn),&(service->val)))
- {
- return -1;
- }
- }
-
- /* element ID assignment of SessionID*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=104;
-
-
- /* encode start element SessionID */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
- service->val.type = EXI_DATATYPE_BINARY_HEX;
- service->val.binary.len = type->SessionID.arraylen.data;
- memcpy(service->val.binary.data, type->SessionID.data,type->SessionID.arraylen.data);
-
-
- /* encode character SessionID */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
-
- /* encode end element of SessionID */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- if(type->isused.SAScheduleTupleID)
- {
-
- /* element ID assignment of SAScheduleTupleID*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=84;
-
-
- /* encode start element SAScheduleTupleID */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_INTEGER;
- service->val.integer.val.int16=type->SAScheduleTupleID;
- service->val.integer.type = EXI_INTEGER_16;
-
- /* encode character SAScheduleTupleID */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of SAScheduleTupleID */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- /* element ID assignment of MeterInfo*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=59;
-
-
- /* encode start element MeterInfo */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of MeterInfo */
- if(serialize_MeterInfoType( &(type->MeterInfo),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of MeterInfo */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_MeteringReceiptResType(struct MeteringReceiptResType* type, struct EXIService* service)
-{
-
- /* element ID assignment of ResponseCode*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=82;
-
-
- /* encode start element ResponseCode */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_ENUMERATION;
- service->val.enumeration=type->ResponseCode;
-
- /* encode character ResponseCode */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ResponseCode */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of AC_EVSEStatus*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=0;
-
-
- /* encode start element AC_EVSEStatus */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of AC_EVSEStatus */
- if(serialize_AC_EVSEStatusType( &(type->AC_EVSEStatus),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of AC_EVSEStatus */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_SessionStopType(struct SessionStopType* type, struct EXIService* service)
-{
-
-
- return 0;
-}
-
-
-static int serialize_SessionStopResType(struct SessionStopResType* type, struct EXIService* service)
-{
-
- /* element ID assignment of ResponseCode*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=82;
-
-
- /* encode start element ResponseCode */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_ENUMERATION;
- service->val.enumeration=type->ResponseCode;
-
- /* encode character ResponseCode */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ResponseCode */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_ListOfRootCertificateIDsType(struct ListOfRootCertificateIDsType* type, struct EXIService* service)
-{
-
- size_t i_loop;
-
- for(i_loop=0;i_loop < type->arraylen.RootCertificateID;i_loop++)
- {
-
- /* element ID assignment of RootCertificateID*/
- service->eqn.namespaceURI=6;
- service->eqn.localPart=108;
-
-
- /* encode start element RootCertificateID */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->RootCertificateID[i_loop].arraylen.data;
- memcpy(service->val.string.codepoints, type->RootCertificateID[i_loop].data,type->RootCertificateID[i_loop].arraylen.data*sizeof(uint32_t));
-
- /* encode character RootCertificateID */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of RootCertificateID */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_CertificateUpdateReqType(struct CertificateUpdateReqType* type, struct EXIService* service)
-{
-
- if(type->isused.attr_Id)
- {
-
- /* element ID assignment of attr_Id*/
- service->eqn.namespaceURI=0;
- service->eqn.localPart=2;
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->attr_Id.arraylen.data;
- service->val.string.codepoints= type->attr_Id.data;
- if (exiEncodeAttribute(&(service->outStream), &(service->stateEncode), &(service->eqn),&(service->val)))
- {
- return -1;
- }
- }
-
- /* element ID assignment of ContractSignatureCertChain*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=30;
-
-
- /* encode start element ContractSignatureCertChain */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of ContractSignatureCertChain */
- if(serialize_CertificateChainType( &(type->ContractSignatureCertChain),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of ContractSignatureCertChain */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of ContractID*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=29;
-
-
- /* encode start element ContractID */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->ContractID.arraylen.data;
- memcpy(service->val.string.codepoints, type->ContractID.data,type->ContractID.arraylen.data*sizeof(uint32_t));
-
-
- /* encode character ContractID */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ContractID */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of ListOfRootCertificateIDs*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=58;
-
-
- /* encode start element ListOfRootCertificateIDs */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of ListOfRootCertificateIDs */
- if(serialize_ListOfRootCertificateIDsType( &(type->ListOfRootCertificateIDs),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of ListOfRootCertificateIDs */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of DHParams*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=38;
-
-
- /* encode start element DHParams */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
- service->val.type = EXI_DATATYPE_BINARY_BASE64;
- service->val.binary.len = type->DHParams.arraylen.data;
- memcpy(service->val.binary.data, type->DHParams.data,type->DHParams.arraylen.data);
-
-
- /* encode character DHParams */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
-
- /* encode end element of DHParams */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_CertificateUpdateResType(struct CertificateUpdateResType* type, struct EXIService* service)
-{
-
- /* element ID assignment of attr_Id*/
- service->eqn.namespaceURI=0;
- service->eqn.localPart=2;
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->attr_Id.arraylen.data;
- service->val.string.codepoints= type->attr_Id.data;
- if (exiEncodeAttribute(&(service->outStream), &(service->stateEncode), &(service->eqn),&(service->val)))
- {
- return -1;
- }
-
- /* element ID assignment of ResponseCode*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=82;
-
-
- /* encode start element ResponseCode */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_ENUMERATION;
- service->val.enumeration=type->ResponseCode;
-
- /* encode character ResponseCode */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ResponseCode */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of ContractSignatureCertChain*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=30;
-
-
- /* encode start element ContractSignatureCertChain */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of ContractSignatureCertChain */
- if(serialize_CertificateChainType( &(type->ContractSignatureCertChain),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of ContractSignatureCertChain */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of ContractSignatureEncryptedPrivateKey*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=31;
-
-
- /* encode start element ContractSignatureEncryptedPrivateKey */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
- service->val.type = EXI_DATATYPE_BINARY_BASE64;
- service->val.binary.len = type->ContractSignatureEncryptedPrivateKey.arraylen.data;
- memcpy(service->val.binary.data, type->ContractSignatureEncryptedPrivateKey.data,type->ContractSignatureEncryptedPrivateKey.arraylen.data);
-
-
- /* encode character ContractSignatureEncryptedPrivateKey */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
-
- /* encode end element of ContractSignatureEncryptedPrivateKey */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of DHParams*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=38;
-
-
- /* encode start element DHParams */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
- service->val.type = EXI_DATATYPE_BINARY_BASE64;
- service->val.binary.len = type->DHParams.arraylen.data;
- memcpy(service->val.binary.data, type->DHParams.data,type->DHParams.arraylen.data);
-
-
- /* encode character DHParams */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
-
- /* encode end element of DHParams */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of ContractID*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=29;
-
-
- /* encode start element ContractID */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->ContractID.arraylen.data;
- memcpy(service->val.string.codepoints, type->ContractID.data,type->ContractID.arraylen.data*sizeof(uint32_t));
-
-
- /* encode character ContractID */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ContractID */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of RetryCounter*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=83;
-
-
- /* encode start element RetryCounter */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_INTEGER;
- service->val.integer.val.int16=type->RetryCounter;
- service->val.integer.type = EXI_INTEGER_16;
-
- /* encode character RetryCounter */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of RetryCounter */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_CertificateInstallationReqType(struct CertificateInstallationReqType* type, struct EXIService* service)
-{
-
- if(type->isused.attr_Id)
- {
-
- /* element ID assignment of attr_Id*/
- service->eqn.namespaceURI=0;
- service->eqn.localPart=2;
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->attr_Id.arraylen.data;
- service->val.string.codepoints= type->attr_Id.data;
- if (exiEncodeAttribute(&(service->outStream), &(service->stateEncode), &(service->eqn),&(service->val)))
- {
- return -1;
- }
- }
-
- /* element ID assignment of OEMProvisioningCert*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=64;
-
-
- /* encode start element OEMProvisioningCert */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
- service->val.type = EXI_DATATYPE_BINARY_BASE64;
- service->val.binary.len = type->OEMProvisioningCert.arraylen.data;
- memcpy(service->val.binary.data, type->OEMProvisioningCert.data,type->OEMProvisioningCert.arraylen.data);
-
-
- /* encode character OEMProvisioningCert */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
-
- /* encode end element of OEMProvisioningCert */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of ListOfRootCertificateIDs*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=58;
-
-
- /* encode start element ListOfRootCertificateIDs */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of ListOfRootCertificateIDs */
- if(serialize_ListOfRootCertificateIDsType( &(type->ListOfRootCertificateIDs),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of ListOfRootCertificateIDs */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of DHParams*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=38;
-
-
- /* encode start element DHParams */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
- service->val.type = EXI_DATATYPE_BINARY_BASE64;
- service->val.binary.len = type->DHParams.arraylen.data;
- memcpy(service->val.binary.data, type->DHParams.data,type->DHParams.arraylen.data);
-
-
- /* encode character DHParams */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
-
- /* encode end element of DHParams */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_CertificateInstallationResType(struct CertificateInstallationResType* type, struct EXIService* service)
-{
-
- /* element ID assignment of attr_Id*/
- service->eqn.namespaceURI=0;
- service->eqn.localPart=2;
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->attr_Id.arraylen.data;
- service->val.string.codepoints= type->attr_Id.data;
- if (exiEncodeAttribute(&(service->outStream), &(service->stateEncode), &(service->eqn),&(service->val)))
- {
- return -1;
- }
-
- /* element ID assignment of ResponseCode*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=82;
-
-
- /* encode start element ResponseCode */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_ENUMERATION;
- service->val.enumeration=type->ResponseCode;
-
- /* encode character ResponseCode */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ResponseCode */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of ContractSignatureCertChain*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=30;
-
-
- /* encode start element ContractSignatureCertChain */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of ContractSignatureCertChain */
- if(serialize_CertificateChainType( &(type->ContractSignatureCertChain),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of ContractSignatureCertChain */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of ContractSignatureEncryptedPrivateKey*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=31;
-
-
- /* encode start element ContractSignatureEncryptedPrivateKey */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
- service->val.type = EXI_DATATYPE_BINARY_BASE64;
- service->val.binary.len = type->ContractSignatureEncryptedPrivateKey.arraylen.data;
- memcpy(service->val.binary.data, type->ContractSignatureEncryptedPrivateKey.data,type->ContractSignatureEncryptedPrivateKey.arraylen.data);
-
-
- /* encode character ContractSignatureEncryptedPrivateKey */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
-
- /* encode end element of ContractSignatureEncryptedPrivateKey */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of DHParams*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=38;
-
-
- /* encode start element DHParams */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
- service->val.type = EXI_DATATYPE_BINARY_BASE64;
- service->val.binary.len = type->DHParams.arraylen.data;
- memcpy(service->val.binary.data, type->DHParams.data,type->DHParams.arraylen.data);
-
-
- /* encode character DHParams */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
-
- /* encode end element of DHParams */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of ContractID*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=29;
-
-
- /* encode start element ContractID */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_STRING;
- service->val.string.len = type->ContractID.arraylen.data;
- memcpy(service->val.string.codepoints, type->ContractID.data,type->ContractID.arraylen.data*sizeof(uint32_t));
-
-
- /* encode character ContractID */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ContractID */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_CableCheckReqType(struct CableCheckReqType* type, struct EXIService* service)
-{
-
- /* element ID assignment of DC_EVStatus*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=37;
-
-
- /* encode start element DC_EVStatus */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of DC_EVStatus */
- if(serialize_DC_EVStatusType( &(type->DC_EVStatus),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of DC_EVStatus */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_CableCheckResType(struct CableCheckResType* type, struct EXIService* service)
-{
-
- /* element ID assignment of ResponseCode*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=82;
-
-
- /* encode start element ResponseCode */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_ENUMERATION;
- service->val.enumeration=type->ResponseCode;
-
- /* encode character ResponseCode */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ResponseCode */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of DC_EVSEStatus*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=36;
-
-
- /* encode start element DC_EVSEStatus */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of DC_EVSEStatus */
- if(serialize_DC_EVSEStatusType( &(type->DC_EVSEStatus),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of DC_EVSEStatus */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_PreChargeReqType(struct PreChargeReqType* type, struct EXIService* service)
-{
-
- /* element ID assignment of DC_EVStatus*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=37;
-
-
- /* encode start element DC_EVStatus */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of DC_EVStatus */
- if(serialize_DC_EVStatusType( &(type->DC_EVStatus),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of DC_EVStatus */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of EVTargetVoltage*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=56;
-
-
- /* encode start element EVTargetVoltage */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVTargetVoltage */
- if(serialize_PhysicalValueType( &(type->EVTargetVoltage),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVTargetVoltage */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of EVTargetCurrent*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=55;
-
-
- /* encode start element EVTargetCurrent */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVTargetCurrent */
- if(serialize_PhysicalValueType( &(type->EVTargetCurrent),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVTargetCurrent */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_PreChargeResType(struct PreChargeResType* type, struct EXIService* service)
-{
-
- /* element ID assignment of ResponseCode*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=82;
-
-
- /* encode start element ResponseCode */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_ENUMERATION;
- service->val.enumeration=type->ResponseCode;
-
- /* encode character ResponseCode */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ResponseCode */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of DC_EVSEStatus*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=36;
-
-
- /* encode start element DC_EVSEStatus */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of DC_EVSEStatus */
- if(serialize_DC_EVSEStatusType( &(type->DC_EVSEStatus),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of DC_EVSEStatus */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of EVSEPresentVoltage*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=53;
-
-
- /* encode start element EVSEPresentVoltage */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVSEPresentVoltage */
- if(serialize_PhysicalValueType( &(type->EVSEPresentVoltage),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVSEPresentVoltage */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_CurrentDemandReqType(struct CurrentDemandReqType* type, struct EXIService* service)
-{
-
- /* element ID assignment of DC_EVStatus*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=37;
-
-
- /* encode start element DC_EVStatus */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of DC_EVStatus */
- if(serialize_DC_EVStatusType( &(type->DC_EVStatus),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of DC_EVStatus */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of EVTargetCurrent*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=55;
-
-
- /* encode start element EVTargetCurrent */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVTargetCurrent */
- if(serialize_PhysicalValueType( &(type->EVTargetCurrent),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVTargetCurrent */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- if(type->isused.EVMaximumVoltageLimit)
- {
-
- /* element ID assignment of EVMaximumVoltageLimit*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=43;
-
-
- /* encode start element EVMaximumVoltageLimit */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVMaximumVoltageLimit */
- if(serialize_PhysicalValueType( &(type->EVMaximumVoltageLimit),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVMaximumVoltageLimit */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.EVMaximumCurrentLimit)
- {
-
- /* element ID assignment of EVMaximumCurrentLimit*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=41;
-
-
- /* encode start element EVMaximumCurrentLimit */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVMaximumCurrentLimit */
- if(serialize_PhysicalValueType( &(type->EVMaximumCurrentLimit),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVMaximumCurrentLimit */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.EVMaximumPowerLimit)
- {
-
- /* element ID assignment of EVMaximumPowerLimit*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=42;
-
-
- /* encode start element EVMaximumPowerLimit */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVMaximumPowerLimit */
- if(serialize_PhysicalValueType( &(type->EVMaximumPowerLimit),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVMaximumPowerLimit */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.BulkChargingComplete)
- {
-
- /* element ID assignment of BulkChargingComplete*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=1;
-
-
- /* encode start element BulkChargingComplete */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_BOOLEAN;
- service->val.boolean=type->BulkChargingComplete;
-
- /* encode character BulkChargingComplete */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of BulkChargingComplete */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- /* element ID assignment of ChargingComplete*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=19;
-
-
- /* encode start element ChargingComplete */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_BOOLEAN;
- service->val.boolean=type->ChargingComplete;
-
- /* encode character ChargingComplete */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ChargingComplete */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- if(type->isused.RemainingTimeToFullSoC)
- {
-
- /* element ID assignment of RemainingTimeToFullSoC*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=81;
-
-
- /* encode start element RemainingTimeToFullSoC */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of RemainingTimeToFullSoC */
- if(serialize_PhysicalValueType( &(type->RemainingTimeToFullSoC),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of RemainingTimeToFullSoC */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.RemainingTimeToBulkSoC)
- {
-
- /* element ID assignment of RemainingTimeToBulkSoC*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=80;
-
-
- /* encode start element RemainingTimeToBulkSoC */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of RemainingTimeToBulkSoC */
- if(serialize_PhysicalValueType( &(type->RemainingTimeToBulkSoC),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of RemainingTimeToBulkSoC */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- /* element ID assignment of EVTargetVoltage*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=56;
-
-
- /* encode start element EVTargetVoltage */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVTargetVoltage */
- if(serialize_PhysicalValueType( &(type->EVTargetVoltage),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVTargetVoltage */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_CurrentDemandResType(struct CurrentDemandResType* type, struct EXIService* service)
-{
-
- /* element ID assignment of ResponseCode*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=82;
-
-
- /* encode start element ResponseCode */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_ENUMERATION;
- service->val.enumeration=type->ResponseCode;
-
- /* encode character ResponseCode */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ResponseCode */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of DC_EVSEStatus*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=36;
-
-
- /* encode start element DC_EVSEStatus */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of DC_EVSEStatus */
- if(serialize_DC_EVSEStatusType( &(type->DC_EVSEStatus),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of DC_EVSEStatus */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of EVSEPresentVoltage*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=53;
-
-
- /* encode start element EVSEPresentVoltage */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVSEPresentVoltage */
- if(serialize_PhysicalValueType( &(type->EVSEPresentVoltage),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVSEPresentVoltage */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of EVSEPresentCurrent*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=52;
-
-
- /* encode start element EVSEPresentCurrent */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVSEPresentCurrent */
- if(serialize_PhysicalValueType( &(type->EVSEPresentCurrent),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVSEPresentCurrent */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of EVSECurrentLimitAchieved*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=45;
-
-
- /* encode start element EVSECurrentLimitAchieved */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_BOOLEAN;
- service->val.boolean=type->EVSECurrentLimitAchieved;
-
- /* encode character EVSECurrentLimitAchieved */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of EVSECurrentLimitAchieved */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of EVSEVoltageLimitAchieved*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=54;
-
-
- /* encode start element EVSEVoltageLimitAchieved */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_BOOLEAN;
- service->val.boolean=type->EVSEVoltageLimitAchieved;
-
- /* encode character EVSEVoltageLimitAchieved */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of EVSEVoltageLimitAchieved */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of EVSEPowerLimitAchieved*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=51;
-
-
- /* encode start element EVSEPowerLimitAchieved */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_BOOLEAN;
- service->val.boolean=type->EVSEPowerLimitAchieved;
-
- /* encode character EVSEPowerLimitAchieved */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of EVSEPowerLimitAchieved */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- if(type->isused.EVSEMaximumVoltageLimit)
- {
-
- /* element ID assignment of EVSEMaximumVoltageLimit*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=50;
-
-
- /* encode start element EVSEMaximumVoltageLimit */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVSEMaximumVoltageLimit */
- if(serialize_PhysicalValueType( &(type->EVSEMaximumVoltageLimit),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVSEMaximumVoltageLimit */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.EVSEMaximumCurrentLimit)
- {
-
- /* element ID assignment of EVSEMaximumCurrentLimit*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=48;
-
-
- /* encode start element EVSEMaximumCurrentLimit */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVSEMaximumCurrentLimit */
- if(serialize_PhysicalValueType( &(type->EVSEMaximumCurrentLimit),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVSEMaximumCurrentLimit */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.EVSEMaximumPowerLimit)
- {
-
- /* element ID assignment of EVSEMaximumPowerLimit*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=49;
-
-
- /* encode start element EVSEMaximumPowerLimit */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVSEMaximumPowerLimit */
- if(serialize_PhysicalValueType( &(type->EVSEMaximumPowerLimit),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVSEMaximumPowerLimit */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_WeldingDetectionReqType(struct WeldingDetectionReqType* type, struct EXIService* service)
-{
-
- /* element ID assignment of DC_EVStatus*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=37;
-
-
- /* encode start element DC_EVStatus */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of DC_EVStatus */
- if(serialize_DC_EVStatusType( &(type->DC_EVStatus),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of DC_EVStatus */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_WeldingDetectionResType(struct WeldingDetectionResType* type, struct EXIService* service)
-{
-
- /* element ID assignment of ResponseCode*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=82;
-
-
- /* encode start element ResponseCode */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- service->val.type = EXI_DATATYPE_ENUMERATION;
- service->val.enumeration=type->ResponseCode;
-
- /* encode character ResponseCode */
- if (exiEncodeCharacters(&(service->outStream), &(service->stateEncode), &(service->val)))
- {
-
- return -1;
- }
-
-
- /* encode end element of ResponseCode */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of DC_EVSEStatus*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=36;
-
-
- /* encode start element DC_EVSEStatus */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of DC_EVSEStatus */
- if(serialize_DC_EVSEStatusType( &(type->DC_EVSEStatus),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of DC_EVSEStatus */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of EVSEPresentVoltage*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=53;
-
-
- /* encode start element EVSEPresentVoltage */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of EVSEPresentVoltage */
- if(serialize_PhysicalValueType( &(type->EVSEPresentVoltage),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of EVSEPresentVoltage */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_BodyType(struct BodyType* type, struct EXIService* service)
-{
-
- if(type->isused.SessionSetupReq)
- {
-
- /* element ID assignment of SessionSetupReq*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=105;
-
-
- /* encode start element SessionSetupReq */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of SessionSetupReq */
- if(serialize_SessionSetupReqType( (type->SessionSetupReq),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of SessionSetupReq */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.SessionSetupRes)
- {
-
- /* element ID assignment of SessionSetupRes*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=107;
-
-
- /* encode start element SessionSetupRes */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of SessionSetupRes */
- if(serialize_SessionSetupResType( (type->SessionSetupRes),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of SessionSetupRes */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.ServiceDiscoveryReq)
- {
-
- /* element ID assignment of ServiceDiscoveryReq*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=92;
-
-
- /* encode start element ServiceDiscoveryReq */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of ServiceDiscoveryReq */
- if(serialize_ServiceDiscoveryReqType( (type->ServiceDiscoveryReq),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of ServiceDiscoveryReq */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.ServiceDiscoveryRes)
- {
-
- /* element ID assignment of ServiceDiscoveryRes*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=94;
-
-
- /* encode start element ServiceDiscoveryRes */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of ServiceDiscoveryRes */
- if(serialize_ServiceDiscoveryResType( (type->ServiceDiscoveryRes),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of ServiceDiscoveryRes */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.ServiceDetailReq)
- {
-
- /* element ID assignment of ServiceDetailReq*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=88;
-
-
- /* encode start element ServiceDetailReq */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of ServiceDetailReq */
- if(serialize_ServiceDetailReqType( (type->ServiceDetailReq),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of ServiceDetailReq */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.ServiceDetailRes)
- {
-
- /* element ID assignment of ServiceDetailRes*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=90;
-
-
- /* encode start element ServiceDetailRes */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of ServiceDetailRes */
- if(serialize_ServiceDetailResType( (type->ServiceDetailRes),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of ServiceDetailRes */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.ServicePaymentSelectionReq)
- {
-
- /* element ID assignment of ServicePaymentSelectionReq*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=99;
-
-
- /* encode start element ServicePaymentSelectionReq */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of ServicePaymentSelectionReq */
- if(serialize_ServicePaymentSelectionReqType( (type->ServicePaymentSelectionReq),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of ServicePaymentSelectionReq */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.ServicePaymentSelectionRes)
- {
-
- /* element ID assignment of ServicePaymentSelectionRes*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=101;
-
-
- /* encode start element ServicePaymentSelectionRes */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of ServicePaymentSelectionRes */
- if(serialize_ServicePaymentSelectionResType( (type->ServicePaymentSelectionRes),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of ServicePaymentSelectionRes */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.PaymentDetailsReq)
- {
-
- /* element ID assignment of PaymentDetailsReq*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=65;
-
-
- /* encode start element PaymentDetailsReq */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of PaymentDetailsReq */
- if(serialize_PaymentDetailsReqType( (type->PaymentDetailsReq),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of PaymentDetailsReq */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.PaymentDetailsRes)
- {
-
- /* element ID assignment of PaymentDetailsRes*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=67;
-
-
- /* encode start element PaymentDetailsRes */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of PaymentDetailsRes */
- if(serialize_PaymentDetailsResType( (type->PaymentDetailsRes),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of PaymentDetailsRes */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.ContractAuthenticationReq)
- {
-
- /* element ID assignment of ContractAuthenticationReq*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=25;
-
-
- /* encode start element ContractAuthenticationReq */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of ContractAuthenticationReq */
- if(serialize_ContractAuthenticationReqType( (type->ContractAuthenticationReq),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of ContractAuthenticationReq */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.ContractAuthenticationRes)
- {
-
- /* element ID assignment of ContractAuthenticationRes*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=27;
-
-
- /* encode start element ContractAuthenticationRes */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of ContractAuthenticationRes */
- if(serialize_ContractAuthenticationResType( (type->ContractAuthenticationRes),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of ContractAuthenticationRes */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.ChargeParameterDiscoveryReq)
- {
-
- /* element ID assignment of ChargeParameterDiscoveryReq*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=14;
-
-
- /* encode start element ChargeParameterDiscoveryReq */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of ChargeParameterDiscoveryReq */
- if(serialize_ChargeParameterDiscoveryReqType( (type->ChargeParameterDiscoveryReq),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of ChargeParameterDiscoveryReq */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.ChargeParameterDiscoveryRes)
- {
-
- /* element ID assignment of ChargeParameterDiscoveryRes*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=16;
-
-
- /* encode start element ChargeParameterDiscoveryRes */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of ChargeParameterDiscoveryRes */
- if(serialize_ChargeParameterDiscoveryResType( (type->ChargeParameterDiscoveryRes),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of ChargeParameterDiscoveryRes */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.PowerDeliveryReq)
- {
-
- /* element ID assignment of PowerDeliveryReq*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=70;
-
-
- /* encode start element PowerDeliveryReq */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of PowerDeliveryReq */
- if(serialize_PowerDeliveryReqType( (type->PowerDeliveryReq),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of PowerDeliveryReq */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.PowerDeliveryRes)
- {
-
- /* element ID assignment of PowerDeliveryRes*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=72;
-
-
- /* encode start element PowerDeliveryRes */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of PowerDeliveryRes */
- if(serialize_PowerDeliveryResType( (type->PowerDeliveryRes),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of PowerDeliveryRes */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.ChargingStatusReq)
- {
-
- /* element ID assignment of ChargingStatusReq*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=21;
-
-
- /* encode start element ChargingStatusReq */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of ChargingStatusReq */
- if(serialize_ChargingStatusReqType( (type->ChargingStatusReq),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of ChargingStatusReq */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.ChargingStatusRes)
- {
-
- /* element ID assignment of ChargingStatusRes*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=23;
-
-
- /* encode start element ChargingStatusRes */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of ChargingStatusRes */
- if(serialize_ChargingStatusResType( (type->ChargingStatusRes),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of ChargingStatusRes */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.MeteringReceiptReq)
- {
-
- /* element ID assignment of MeteringReceiptReq*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=60;
-
-
- /* encode start element MeteringReceiptReq */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of MeteringReceiptReq */
- if(serialize_MeteringReceiptReqType( (type->MeteringReceiptReq),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of MeteringReceiptReq */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.MeteringReceiptRes)
- {
-
- /* element ID assignment of MeteringReceiptRes*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=62;
-
-
- /* encode start element MeteringReceiptRes */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of MeteringReceiptRes */
- if(serialize_MeteringReceiptResType( (type->MeteringReceiptRes),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of MeteringReceiptRes */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.SessionStopReq)
- {
-
- /* element ID assignment of SessionStopReq*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=109;
-
-
- /* encode start element SessionStopReq */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of SessionStopReq */
- if(serialize_SessionStopType( (type->SessionStopReq),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of SessionStopReq */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.SessionStopRes)
- {
-
- /* element ID assignment of SessionStopRes*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=110;
-
-
- /* encode start element SessionStopRes */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of SessionStopRes */
- if(serialize_SessionStopResType( (type->SessionStopRes),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of SessionStopRes */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.CertificateUpdateReq)
- {
-
- /* element ID assignment of CertificateUpdateReq*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=10;
-
-
- /* encode start element CertificateUpdateReq */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of CertificateUpdateReq */
- if(serialize_CertificateUpdateReqType( (type->CertificateUpdateReq),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of CertificateUpdateReq */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.CertificateUpdateRes)
- {
-
- /* element ID assignment of CertificateUpdateRes*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=12;
-
-
- /* encode start element CertificateUpdateRes */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of CertificateUpdateRes */
- if(serialize_CertificateUpdateResType( (type->CertificateUpdateRes),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of CertificateUpdateRes */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.CertificateInstallationReq)
- {
-
- /* element ID assignment of CertificateInstallationReq*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=6;
-
-
- /* encode start element CertificateInstallationReq */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of CertificateInstallationReq */
- if(serialize_CertificateInstallationReqType( (type->CertificateInstallationReq),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of CertificateInstallationReq */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.CertificateInstallationRes)
- {
-
- /* element ID assignment of CertificateInstallationRes*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=8;
-
-
- /* encode start element CertificateInstallationRes */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of CertificateInstallationRes */
- if(serialize_CertificateInstallationResType( (type->CertificateInstallationRes),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of CertificateInstallationRes */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.CableCheckReq)
- {
-
- /* element ID assignment of CableCheckReq*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=2;
-
-
- /* encode start element CableCheckReq */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of CableCheckReq */
- if(serialize_CableCheckReqType( (type->CableCheckReq),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of CableCheckReq */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.CableCheckRes)
- {
-
- /* element ID assignment of CableCheckRes*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=4;
-
-
- /* encode start element CableCheckRes */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of CableCheckRes */
- if(serialize_CableCheckResType( (type->CableCheckRes),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of CableCheckRes */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.PreChargeReq)
- {
-
- /* element ID assignment of PreChargeReq*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=74;
-
-
- /* encode start element PreChargeReq */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of PreChargeReq */
- if(serialize_PreChargeReqType( (type->PreChargeReq),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of PreChargeReq */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.PreChargeRes)
- {
-
- /* element ID assignment of PreChargeRes*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=76;
-
-
- /* encode start element PreChargeRes */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of PreChargeRes */
- if(serialize_PreChargeResType( (type->PreChargeRes),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of PreChargeRes */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.CurrentDemandReq)
- {
-
- /* element ID assignment of CurrentDemandReq*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=32;
-
-
- /* encode start element CurrentDemandReq */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of CurrentDemandReq */
- if(serialize_CurrentDemandReqType( (type->CurrentDemandReq),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of CurrentDemandReq */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.CurrentDemandRes)
- {
-
- /* element ID assignment of CurrentDemandRes*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=34;
-
-
- /* encode start element CurrentDemandRes */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of CurrentDemandRes */
- if(serialize_CurrentDemandResType( (type->CurrentDemandRes),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of CurrentDemandRes */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.WeldingDetectionReq)
- {
-
- /* element ID assignment of WeldingDetectionReq*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=113;
-
-
- /* encode start element WeldingDetectionReq */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of WeldingDetectionReq */
- if(serialize_WeldingDetectionReqType( (type->WeldingDetectionReq),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of WeldingDetectionReq */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
- if(type->isused.WeldingDetectionRes)
- {
-
- /* element ID assignment of WeldingDetectionRes*/
- service->eqn.namespaceURI=5;
- service->eqn.localPart=115;
-
-
- /* encode start element WeldingDetectionRes */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of WeldingDetectionRes */
- if(serialize_WeldingDetectionResType( (type->WeldingDetectionRes),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of WeldingDetectionRes */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
- }
-
-
- return 0;
-}
-
-
-static int serialize_AnonType_V2G_Message(struct AnonType_V2G_Message* type, struct EXIService* service)
-{
-
- /* element ID assignment of Header*/
- service->eqn.namespaceURI=7;
- service->eqn.localPart=4;
-
-
- /* encode start element Header */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of Header */
- if(serialize_MessageHeaderType( (type->Header),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of Header */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
- /* element ID assignment of Body*/
- service->eqn.namespaceURI=7;
- service->eqn.localPart=0;
-
-
- /* encode start element Body */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of Body */
- if(serialize_BodyType( &(type->Body),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of Body */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-static int serialize_EXIDocumentType(struct EXIDocumentType* type, struct EXIService* service)
-{
-
- /* element ID assignment of V2G_Message*/
- service->eqn.namespaceURI=7;
- service->eqn.localPart=5;
-
-
- /* encode start element V2G_Message */
- if (exiEncodeStartElement(&(service->outStream), &(service->stateEncode), &(service->eqn)))
- {
- return -1;
- }
-
- /* encode children of V2G_Message */
- if(serialize_AnonType_V2G_Message( &(type->V2G_Message),service))
- {
- return -1;
- }
-
-
-
- /* encode end element of V2G_Message */
- exiEncodeEndElement(&(service->outStream), &(service->stateEncode));
-
-
-
- return 0;
-}
-
-
-
-
-
-
- /* marshal data to EXI stream */
-static int serialize_message(struct EXIService* service)
- {
-
-
- /* encode start document */
- if (exiEncodeStartDocument(&(service->outStream), &(service->stateEncode)) )
- {
-
- return -1;
- }
-
- /* encode root element of V2G_Message */
- if (serialize_EXIDocumentType(&(service->exiMsg), service))
- {
-
- return -1;
- }
-
-
- /* encode end document */
- if (exiEncodeEndDocument(&(service->outStream), &(service->stateEncode))) {
-
- return -1;
- }
-
- return 0;
-
- }
-
-
-
-
diff --git a/src/service/v2g_serviceDispatcher.c b/src/service/v2g_serviceDispatcher.c
deleted file mode 100644
index 0f06ab5..0000000
--- a/src/service/v2g_serviceDispatcher.c
+++ /dev/null
@@ -1,2551 +0,0 @@
-
-
-
-/*
- * Copyright (C) 2007-2012 Siemens AG
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published
- * by the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see .
- */
-
-/*******************************************************************
- *
- * @author Sebastian.Kaebisch.EXT@siemens.com
- * @version 0.6
- * @contact Joerg.Heuer@siemens.com
- *
- *
diff --git a/src/test/main.h b/src/test/main.h
index 9dd212d..af3b001 100644
--- a/src/test/main.h
+++ b/src/test/main.h
@@ -19,7 +19,7 @@
*
* @author Daniel.Peintner.EXT@siemens.com
* @author Sebastian.Kaebisch.EXT@siemens.com
- * @version 0.6
+ * @version 0.7
* @contact Joerg.Heuer@siemens.com
*
*
diff --git a/src/test/main_codec.c b/src/test/main_codec.c
new file mode 100644
index 0000000..05e6d07
--- /dev/null
+++ b/src/test/main_codec.c
@@ -0,0 +1,462 @@
+/*
+ * Copyright (C) 2007-2012 Siemens AG
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program. If not, see .
+ */
+
+/*******************************************************************
+ *
+ * @author Daniel.Peintner.EXT@siemens.com
+ * @version 0.7
+ * @contact Joerg.Heuer@siemens.com
+ *
+ *