mirror of
https://github.com/Martin-P/OpenV2G.git
synced 2024-11-18 12:53:58 +00:00
OpenV2G 0.7 init
git-svn-id: https://svn.code.sf.net/p/openv2g/code/trunk@73 d9f2db14-54d0-4bde-b00c-16405c910529
This commit is contained in:
parent
c4fcca04a4
commit
732d394324
80 changed files with 38387 additions and 19082 deletions
21
.settings/org.eclipse.cdt.managedbuilder.core.prefs
Normal file
21
.settings/org.eclipse.cdt.managedbuilder.core.prefs
Normal file
|
@ -0,0 +1,21 @@
|
|||
eclipse.preferences.version=1
|
||||
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.181718907/CPATH/delimiter=;
|
||||
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.181718907/CPATH/operation=remove
|
||||
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.181718907/C_INCLUDE_PATH/delimiter=;
|
||||
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.181718907/C_INCLUDE_PATH/operation=remove
|
||||
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.181718907/append=true
|
||||
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.debug.181718907/appendContributed=true
|
||||
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.release.681614450/CPATH/delimiter=;
|
||||
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.release.681614450/CPATH/operation=remove
|
||||
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.release.681614450/C_INCLUDE_PATH/delimiter=;
|
||||
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.release.681614450/C_INCLUDE_PATH/operation=remove
|
||||
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.release.681614450/append=true
|
||||
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.exe.release.681614450/appendContributed=true
|
||||
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.181718907/LIBRARY_PATH/delimiter=;
|
||||
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.181718907/LIBRARY_PATH/operation=remove
|
||||
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.181718907/append=true
|
||||
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.debug.181718907/appendContributed=true
|
||||
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.release.681614450/LIBRARY_PATH/delimiter=;
|
||||
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.release.681614450/LIBRARY_PATH/operation=remove
|
||||
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.release.681614450/append=true
|
||||
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.exe.release.681614450/appendContributed=true
|
11
README.txt
11
README.txt
|
@ -1,6 +1,6 @@
|
|||
-------------------------------------------------------------------------
|
||||
OpenV2G - an open source project implementing the basic functionality of the ISO IEC 15118 vehicle to grid (V2G) communication interface
|
||||
Version 0.6, released April 2, 2012
|
||||
Version 0.7, released July 2, 2012
|
||||
http://openv2g.sourceforge.net/
|
||||
|
||||
Please report bugs via the SourceForge bug tracking system at http://sourceforge.net/tracker/?group_id=350113.
|
||||
|
@ -23,6 +23,15 @@ You should have received a copy of the GNU Lesser General Public License
|
|||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
CHANGES from version 0.6:
|
||||
-------------------------------------------------------------------------
|
||||
* adaption of V2G schema changes (reflects the 15118 DIS status)
|
||||
* reduced memory usage
|
||||
* skips schema derivations followed by the EXI Profile
|
||||
* bug-fixes
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
CHANGES from version 0.5:
|
||||
-------------------------------------------------------------------------
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -21,7 +21,7 @@
|
|||
/*******************************************************************
|
||||
*
|
||||
* @author Sebastian.Kaebisch.EXT@siemens.com
|
||||
* @version 0.6
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXISeGen</p>
|
||||
|
@ -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 <string.h>
|
||||
|
||||
uint16_t numberOfLocalStringsDecode[EXI_appHandMAX_NUMBER_OF_QNAMES];
|
||||
|
||||
static int _setUnsignedInt32Value(integer_t* iv, uint32_t* int32) {
|
||||
|
||||
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)
|
||||
{
|
||||
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*/
|
||||
|
||||
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*/
|
||||
|
||||
case 6: /* VersionNumberMinor */
|
||||
|
||||
if(service->val.type == EXI_DATATYPE_UNSIGNED_INTEGER)
|
||||
{
|
||||
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 4: /* SchemaID */
|
||||
|
||||
if(service->val.type == EXI_DATATYPE_NBIT_UNSIGNED_INTEGER)
|
||||
{
|
||||
service->exiMsg.supportedAppProtocolReq->AppProtocol[service->exiMsg.supportedAppProtocolReq->arraylen.AppProtocol].Priority = service->val.integer.val.uint8;
|
||||
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;
|
||||
case 3: /*ResponseCode*/
|
||||
|
||||
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;
|
||||
|
||||
service->exiMsg.supportedAppProtocolRes->ResponseCode=service->val.enumeration;
|
||||
}
|
||||
else
|
||||
{
|
||||
service->errorCode=EXI_DATATYPE_FAILED;
|
||||
return -1; /* wrong data type */
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
} /* close switch(service->eqn.localPart) */
|
||||
break;
|
||||
|
||||
} /* close switch(service->eqn.namespaceURI) */
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -194,33 +208,19 @@ 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 */
|
||||
switch(service->qnameID) {
|
||||
case 0: /* AppProtocol */
|
||||
service->exiMsg.supportedAppProtocolReq->arraylen.AppProtocol++;
|
||||
|
||||
service->exiMsg.supportedAppProtocolReq->arraylen.AppProtocol++;
|
||||
break;
|
||||
case 65: /* supportedAppProtocolReq */
|
||||
service->exiMsg.isused.supportedAppProtocolReq=1;
|
||||
|
||||
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;
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
|
|
415
src/appHandshake/appHand_dataSerialization.c
Normal file
415
src/appHandshake/appHand_dataSerialization.c
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Sebastian.Kaebisch.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXISeGen</p>
|
||||
*
|
||||
********************************************************************/
|
||||
|
||||
|
||||
#include "appHand_service.h"
|
||||
#include "appHand_dataTypes.h"
|
||||
#include "EXITypes.h"
|
||||
#include "StringTable.h"
|
||||
#include "appHandEXIEncoder.h"
|
||||
#include "appHandQNameDefines.h"
|
||||
#include <string.h>
|
||||
|
||||
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;
|
||||
}
|
||||
|
70
src/appHandshake/appHand_dataTypes.c
Normal file
70
src/appHandshake/appHand_dataTypes.c
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Sebastian.Kaebisch.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXISeGen</p>
|
||||
*
|
||||
********************************************************************/
|
||||
|
||||
|
||||
#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;
|
||||
|
||||
}
|
133
src/appHandshake/appHand_dataTypes.h
Normal file
133
src/appHandshake/appHand_dataTypes.h
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Sebastian.Kaebisch.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXISeGen</p>
|
||||
*
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
|
@ -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
|
||||
}
|
699
src/codec/AbstractDecoderChannel.c
Normal file
699
src/codec/AbstractDecoderChannel.c
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
||||
|
573
src/codec/AbstractEncoderChannel.c
Normal file
573
src/codec/AbstractEncoderChannel.c
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
||||
|
74
src/codec/BitDecoderChannel.c
Normal file
74
src/codec/BitDecoderChannel.c
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
||||
|
88
src/codec/BitEncoderChannel.c
Normal file
88
src/codec/BitEncoderChannel.c
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
111
src/codec/BitInputStream.c
Normal file
111
src/codec/BitInputStream.c
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
66
src/codec/BitInputStream.h
Normal file
66
src/codec/BitInputStream.h
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
118
src/codec/BitOutputStream.c
Normal file
118
src/codec/BitOutputStream.c
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
||||
|
83
src/codec/BitOutputStream.h
Normal file
83
src/codec/BitOutputStream.h
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \file BitOutputStream.h
|
||||
* \brief Bit Output Stream
|
||||
*
|
||||
* Write bits and bytes to an underlying output stream.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#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
|
||||
|
94
src/codec/ByteDecoderChannel.c
Normal file
94
src/codec/ByteDecoderChannel.c
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
||||
|
128
src/codec/ByteEncoderChannel.c
Normal file
128
src/codec/ByteEncoderChannel.c
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
82
src/codec/ByteStream.c
Normal file
82
src/codec/ByteStream.c
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
/* 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
|
||||
|
74
src/codec/ByteStream.h
Normal file
74
src/codec/ByteStream.h
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
|
@ -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
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
||||
|
356
src/codec/DecoderChannel.h
Normal file
356
src/codec/DecoderChannel.h
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
||||
|
2962
src/codec/EXICoder.c
Normal file
2962
src/codec/EXICoder.c
Normal file
File diff suppressed because one or more lines are too long
70
src/codec/EXICoder.h
Normal file
70
src/codec/EXICoder.h
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
||||
|
10835
src/codec/EXIDecoder.c
Normal file
10835
src/codec/EXIDecoder.c
Normal file
File diff suppressed because one or more lines are too long
222
src/codec/EXIDecoder.h
Normal file
222
src/codec/EXIDecoder.h
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef EXI__DECODER_H
|
||||
#define EXI__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 exiInitDecoder(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 exiGetLastQName(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 exiDecodeNextEvent(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 exiDecodeStartDocument(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 exiDecodeEndDocument(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
|
||||
exiDecodeStartElement(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 exiDecodeEndElement(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 exiDecodeCharacters(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 exiDecodeAttribute(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 exiDecodeAttributeXsiNil(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 exiDecodeAttributeXsiType(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 exiDecodeListValue(bitstream_t* stream, exi_state_t* state, uint16_t qnameID,
|
||||
exi_value_t* val, exi_list_t lt);
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
8463
src/codec/EXIEncoder.c
Normal file
8463
src/codec/EXIEncoder.c
Normal file
File diff suppressed because one or more lines are too long
271
src/codec/EXIEncoder.h
Normal file
271
src/codec/EXIEncoder.h
Normal file
|
@ -0,0 +1,271 @@
|
|||
/*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
||||
|
60
src/codec/EXIHeaderDecoder.c
Normal file
60
src/codec/EXIHeaderDecoder.c
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
||||
|
||||
|
59
src/codec/EXIHeaderDecoder.h
Normal file
59
src/codec/EXIHeaderDecoder.h
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
44
src/codec/EXIHeaderEncoder.c
Normal file
44
src/codec/EXIHeaderEncoder.c
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
||||
|
||||
|
|
@ -1,6 +1,5 @@
|
|||
|
||||
/*
|
||||
* Copyright (C) 2007-2011 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
|
||||
|
@ -11,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 <http://www.gnu.org/licenses/>.
|
||||
|
@ -18,36 +18,42 @@
|
|||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Sebastian.Kaebisch.EXT@siemens.com
|
||||
* @version 0.6
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
||||
}
|
75
src/codec/EXIOptions.h
Normal file
75
src/codec/EXIOptions.h
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
535
src/codec/EXITypes.h
Normal file
535
src/codec/EXITypes.h
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* \file EXITypes.h
|
||||
* \brief Basic type definitions and structs
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#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
|
320
src/codec/EncoderChannel.h
Normal file
320
src/codec/EncoderChannel.h
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
||||
|
108
src/codec/ErrorCodes.h
Normal file
108
src/codec/ErrorCodes.h
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
133
src/codec/MethodsBag.c
Normal file
133
src/codec/MethodsBag.c
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
||||
|
70
src/codec/MethodsBag.h
Normal file
70
src/codec/MethodsBag.h
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef METHODS_BAG_H
|
||||
#define METHODS_BAG_H
|
||||
|
||||
/**
|
||||
* \file MethodsBag.h
|
||||
* \brief Method bag for bit and octet functions
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
|
||||
/**
|
||||
* \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
|
||||
|
200
src/codec/NameTableEntries.c
Normal file
200
src/codec/NameTableEntries.c
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef EXI__NAME_TABLE_ENTRIES_C
|
||||
#define EXI__NAME_TABLE_ENTRIES_C
|
||||
|
||||
#include "NameTableEntries.h"
|
||||
|
||||
|
||||
|
||||
/* ==================================== */
|
||||
/* String Table Population */
|
||||
|
||||
/* localName entries for URI '', id = 0 */
|
||||
/*
|
||||
"Algorithm", "Encoding", "Id", "MimeType", "Name",
|
||||
"Target", "Type", "URI", "ValueType"
|
||||
*/
|
||||
|
||||
/* localName entries for URI 'http://www.w3.org/XML/1998/namespace', id = 1 */
|
||||
/*
|
||||
"base", "id", "lang", "space"
|
||||
*/
|
||||
|
||||
/* localName entries for URI 'http://www.w3.org/2001/XMLSchema-instance', id = 2 */
|
||||
/*
|
||||
"nil", "type"
|
||||
*/
|
||||
|
||||
/* localName entries for URI 'http://www.w3.org/2001/XMLSchema', id = 3 */
|
||||
/*
|
||||
"ENTITIES", "ENTITY", "ID", "IDREF", "IDREFS",
|
||||
"NCName", "NMTOKEN", "NMTOKENS", "NOTATION", "Name",
|
||||
"QName", "anySimpleType", "anyType", "anyURI", "base64Binary",
|
||||
"boolean", "byte", "date", "dateTime", "decimal",
|
||||
"double", "duration", "float", "gDay", "gMonth",
|
||||
"gMonthDay", "gYear", "gYearMonth", "hexBinary", "int",
|
||||
"integer", "language", "long", "negativeInteger", "nonNegativeInteger",
|
||||
"nonPositiveInteger", "normalizedString", "positiveInteger", "short", "string",
|
||||
"time", "token", "unsignedByte", "unsignedInt", "unsignedLong",
|
||||
"unsignedShort"
|
||||
*/
|
||||
|
||||
/* localName entries for URI 'http://www.w3.org/2000/09/xmldsig#', id = 4 */
|
||||
/*
|
||||
"CanonicalizationMethod", "CanonicalizationMethodType", "CryptoBinary", "DSAKeyValue", "DSAKeyValueType",
|
||||
"DigestMethod", "DigestMethodType", "DigestValue", "DigestValueType", "Exponent",
|
||||
"G", "HMACOutputLength", "HMACOutputLengthType", "J", "KeyInfo",
|
||||
"KeyInfoType", "KeyName", "KeyValue", "KeyValueType", "Manifest",
|
||||
"ManifestType", "MgmtData", "Modulus", "Object", "ObjectType",
|
||||
"P", "PGPData", "PGPDataType", "PGPKeyID", "PGPKeyPacket",
|
||||
"PgenCounter", "Q", "RSAKeyValue", "RSAKeyValueType", "Reference",
|
||||
"ReferenceType", "RetrievalMethod", "RetrievalMethodType", "SPKIData", "SPKIDataType",
|
||||
"SPKISexp", "Seed", "Signature", "SignatureMethod", "SignatureMethodType",
|
||||
"SignatureProperties", "SignaturePropertiesType", "SignatureProperty", "SignaturePropertyType", "SignatureType",
|
||||
"SignatureValue", "SignatureValueType", "SignedInfo", "SignedInfoType", "Transform",
|
||||
"TransformType", "Transforms", "TransformsType", "X509CRL", "X509Certificate",
|
||||
"X509Data", "X509DataType", "X509IssuerName", "X509IssuerSerial", "X509IssuerSerialType",
|
||||
"X509SKI", "X509SerialNumber", "X509SubjectName", "XPath", "Y"
|
||||
|
||||
*/
|
||||
|
||||
/* localName entries for URI 'urn:iso:15118:2:2010:MsgBody', id = 5 */
|
||||
/*
|
||||
"AC_EVSEStatus", "BulkChargingComplete", "CableCheckReq", "CableCheckReqType", "CableCheckRes",
|
||||
"CableCheckResType", "CertificateInstallationReq", "CertificateInstallationReqType", "CertificateInstallationRes", "CertificateInstallationResType",
|
||||
"CertificateUpdateReq", "CertificateUpdateReqType", "CertificateUpdateRes", "CertificateUpdateResType", "ChargeParameterDiscoveryReq",
|
||||
"ChargeParameterDiscoveryReqType", "ChargeParameterDiscoveryRes", "ChargeParameterDiscoveryResType", "ChargeService", "ChargingComplete",
|
||||
"ChargingProfile", "ChargingStatusReq", "ChargingStatusReqType", "ChargingStatusRes", "ChargingStatusResType",
|
||||
"ContractAuthenticationReq", "ContractAuthenticationReqType", "ContractAuthenticationRes", "ContractAuthenticationResType", "ContractID",
|
||||
"ContractSignatureCertChain", "ContractSignatureEncryptedPrivateKey", "CurrentDemandReq", "CurrentDemandReqType", "CurrentDemandRes",
|
||||
"CurrentDemandResType", "DC_EVSEStatus", "DC_EVStatus", "DHParams", "DateTimeNow",
|
||||
"EVCCID", "EVMaximumCurrentLimit", "EVMaximumPowerLimit", "EVMaximumVoltageLimit", "EVRequestedEnergyTransferType",
|
||||
"EVSECurrentLimitAchieved", "EVSEID", "EVSEMaxCurrent", "EVSEMaximumCurrentLimit", "EVSEMaximumPowerLimit",
|
||||
"EVSEMaximumVoltageLimit", "EVSEPowerLimitAchieved", "EVSEPresentCurrent", "EVSEPresentVoltage", "EVSEProcessing",
|
||||
"EVSEVoltageLimitAchieved", "EVTargetCurrent", "EVTargetVoltage", "GenChallenge", "ListOfRootCertificateIDs",
|
||||
"MeterInfo", "MeteringReceiptReq", "MeteringReceiptReqType", "MeteringReceiptRes", "MeteringReceiptResType",
|
||||
"OEMProvisioningCert", "PaymentDetailsReq", "PaymentDetailsReqType", "PaymentDetailsRes", "PaymentDetailsResType",
|
||||
"PaymentOptions", "PowerDeliveryReq", "PowerDeliveryReqType", "PowerDeliveryRes", "PowerDeliveryResType",
|
||||
"PreChargeReq", "PreChargeReqType", "PreChargeRes", "PreChargeResType", "ReadyToChargeState",
|
||||
"ReceiptRequired", "RemainingTimeToBulkSoC", "RemainingTimeToFullSoC", "ResponseCode", "RetryCounter",
|
||||
"SAScheduleTupleID", "SelectedPaymentOption", "SelectedServiceList", "ServiceCategory", "ServiceDetailReq",
|
||||
"ServiceDetailReqType", "ServiceDetailRes", "ServiceDetailResType", "ServiceDiscoveryReq", "ServiceDiscoveryReqType",
|
||||
"ServiceDiscoveryRes", "ServiceDiscoveryResType", "ServiceID", "ServiceList", "ServiceParameterList",
|
||||
"ServicePaymentSelectionReq", "ServicePaymentSelectionReqType", "ServicePaymentSelectionRes", "ServicePaymentSelectionResType", "ServiceScope",
|
||||
"SessionID", "SessionSetupReq", "SessionSetupReqType", "SessionSetupRes", "SessionSetupResType",
|
||||
"SessionStopReq", "SessionStopRes", "SessionStopResType", "SessionStopType", "WeldingDetectionReq",
|
||||
"WeldingDetectionReqType", "WeldingDetectionRes", "WeldingDetectionResType"
|
||||
*/
|
||||
|
||||
/* localName entries for URI 'urn:iso:15118:2:2010:MsgDataTypes', id = 6 */
|
||||
/*
|
||||
"AC_EVChargeParameter", "AC_EVChargeParameterType", "AC_EVSEChargeParameter", "AC_EVSEChargeParameterType", "AC_EVSEStatus",
|
||||
"AC_EVSEStatusType", "BulkChargingComplete", "BulkSOC", "Certificate", "CertificateChainType",
|
||||
"ChargingComplete", "ChargingProfileEntryMaxPower", "ChargingProfileEntryStart", "ChargingProfileType", "ConsumptionCost",
|
||||
"ConsumptionCostType", "Cost", "CostType", "DC_EVChargeParameter", "DC_EVChargeParameterType",
|
||||
"DC_EVErrorCodeType", "DC_EVPowerDeliveryParameter", "DC_EVPowerDeliveryParameterType", "DC_EVSEChargeParameter", "DC_EVSEChargeParameterType",
|
||||
"DC_EVSEStatus", "DC_EVSEStatusCodeType", "DC_EVSEStatusType", "DC_EVStatus", "DC_EVStatusType",
|
||||
"DepartureTime", "EAmount", "EPriceLevel", "EVCabinConditioning", "EVChargeParameter",
|
||||
"EVChargeParameterType", "EVEnergyCapacity", "EVEnergyRequest", "EVErrorCode", "EVMaxCurrent",
|
||||
"EVMaxVoltage", "EVMaximumCurrentLimit", "EVMaximumPowerLimit", "EVMaximumVoltageLimit", "EVMinCurrent",
|
||||
"EVPowerDeliveryParameter", "EVPowerDeliveryParameterType", "EVRESSConditioning", "EVRESSSOC", "EVReady",
|
||||
"EVRequestedEnergyTransferType", "EVSEChargeParameter", "EVSEChargeParameterType", "EVSECurrentRegulationTolerance", "EVSEEnergyToBeDelivered",
|
||||
"EVSEIsolationStatus", "EVSEMaxCurrent", "EVSEMaxVoltage", "EVSEMaximumCurrentLimit", "EVSEMaximumPowerLimit",
|
||||
"EVSEMaximumVoltageLimit", "EVSEMinCurrent", "EVSEMinimumCurrentLimit", "EVSEMinimumVoltageLimit", "EVSENotification",
|
||||
"EVSENotificationType", "EVSEPeakCurrentRipple", "EVSEProcessingType", "EVSEStatus", "EVSEStatusCode",
|
||||
"EVSEStatusType", "EVSESupportedEnergyTransferType", "EVStatus", "EVStatusType", "EnergyTransferType",
|
||||
"Entry", "EntryType", "FaultCode", "FaultMsg", "FreeService",
|
||||
"FullSOC", "IntervalType", "ListOfRootCertificateIDsType", "MeterID", "MeterInfoType",
|
||||
"MeterReading", "MeterStatus", "Multiplier", "NotificationMaxDelay", "NotificationType",
|
||||
"NumEPriceLevels", "PMax", "PMaxSchedule", "PMaxScheduleEntry", "PMaxScheduleEntryType",
|
||||
"PMaxScheduleID", "PMaxScheduleType", "PMaxType", "Parameter", "ParameterSet",
|
||||
"ParameterSetID", "ParameterSetType", "ParameterType", "PaymentOption", "PaymentOptionsType",
|
||||
"PhysicalValueType", "PowerSwitchClosed", "ProfileEntry", "ProfileEntryType", "RCD",
|
||||
"RelativeTimeInterval", "RelativeTimeIntervalType", "RootCertificateID", "SAIDType", "SAScheduleList",
|
||||
"SAScheduleListType", "SAScheduleTuple", "SAScheduleTupleID", "SAScheduleTupleType", "SASchedules",
|
||||
"SASchedulesType", "SalesTariff", "SalesTariffDescription", "SalesTariffEntry", "SalesTariffEntryType",
|
||||
"SalesTariffID", "SalesTariffType", "SelectedService", "SelectedServiceListType", "SelectedServiceType",
|
||||
"Service", "ServiceCategory", "ServiceCharge", "ServiceChargeType", "ServiceID",
|
||||
"ServiceName", "ServiceParameterListType", "ServiceScope", "ServiceTag", "ServiceTagListType",
|
||||
"ServiceTagType", "ServiceType", "SigMeterReading", "SubCertificates", "SubCertificatesType",
|
||||
"TMeter", "TimeInterval", "Unit", "Value", "amount",
|
||||
"amountMultiplier", "boolValue", "byteValue", "certificateType", "contractIDType",
|
||||
"costKind", "costKindType", "dHParamsType", "duration", "evccIDType",
|
||||
"evseIDType", "faultCodeType", "faultMsgType", "genChallengeType", "intValue",
|
||||
"isolationLevelType", "meterIDType", "meterStatusType", "paymentOptionType", "percentValueType",
|
||||
"physicalValue", "privateKeyType", "responseCodeType", "rootCertificateIDType", "serviceCategoryType",
|
||||
"serviceIDType", "serviceNameType", "serviceScopeType", "sessionIDType", "shortValue",
|
||||
"sigMeterReadingType", "start", "startValue", "stringValue", "tariffDescriptionType",
|
||||
"unitMultiplierType", "unitSymbolType", "valueType"
|
||||
*/
|
||||
|
||||
/* localName entries for URI 'urn:iso:15118:2:2010:MsgDef', id = 7 */
|
||||
/*
|
||||
"Body", "BodyBaseType", "BodyElement", "BodyType", "Header",
|
||||
"V2G_Message"
|
||||
*/
|
||||
|
||||
/* localName entries for URI 'urn:iso:15118:2:2010:MsgHeader', id = 8 */
|
||||
/*
|
||||
"MessageHeaderType", "Notification", "SessionID"
|
||||
*/
|
||||
|
||||
|
||||
/* number of local-name entries per URI */
|
||||
static uint16_t localNames[9] = {
|
||||
/* '' */
|
||||
9,
|
||||
/* 'http://www.w3.org/XML/1998/namespace' */
|
||||
4,
|
||||
/* 'http://www.w3.org/2001/XMLSchema-instance' */
|
||||
2,
|
||||
/* 'http://www.w3.org/2001/XMLSchema' */
|
||||
46,
|
||||
/* 'http://www.w3.org/2000/09/xmldsig#' */
|
||||
70,
|
||||
/* 'urn:iso:15118:2:2010:MsgBody' */
|
||||
118,
|
||||
/* 'urn:iso:15118:2:2010:MsgDataTypes' */
|
||||
188,
|
||||
/* 'urn:iso:15118:2:2010:MsgDef' */
|
||||
6,
|
||||
/* 'urn:iso:15118:2:2010:MsgHeader' */
|
||||
3
|
||||
};
|
||||
|
||||
|
||||
exi_name_table_prepopulated_t exiNameTablePrepopulated = { 9, localNames };
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -19,42 +19,23 @@
|
|||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.6
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer</p>
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
||||
|
51
src/codec/QNameDefines.h
Normal file
51
src/codec/QNameDefines.h
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
981
src/codec/QNames.c
Normal file
981
src/codec/QNames.c
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef EXI__QNAMES_C
|
||||
#define EXI__QNAMES_C
|
||||
|
||||
#include "EXITypes.h"
|
||||
#include "ErrorCodes.h"
|
||||
#include "QNameDefines.h"
|
||||
|
||||
/* qname is a composition of namespaceURI(ID) and localPart(ID) */
|
||||
static exi_eqname_t qnames[EXI_MAX_NUMBER_OF_QNAMES] = {
|
||||
/* qnameID == 0: Algorithm */
|
||||
{0, 0},
|
||||
/* qnameID == 1: Encoding */
|
||||
{0, 1},
|
||||
/* qnameID == 2: Id */
|
||||
{0, 2},
|
||||
/* qnameID == 3: MimeType */
|
||||
{0, 3},
|
||||
/* qnameID == 4: Name */
|
||||
{0, 4},
|
||||
/* qnameID == 5: Target */
|
||||
{0, 5},
|
||||
/* qnameID == 6: Type */
|
||||
{0, 6},
|
||||
/* qnameID == 7: URI */
|
||||
{0, 7},
|
||||
/* qnameID == 8: ValueType */
|
||||
{0, 8},
|
||||
/* qnameID == 9: {http://www.w3.org/XML/1998/namespace}base */
|
||||
{1, 0},
|
||||
/* qnameID == 10: {http://www.w3.org/XML/1998/namespace}id */
|
||||
{1, 1},
|
||||
/* qnameID == 11: {http://www.w3.org/XML/1998/namespace}lang */
|
||||
{1, 2},
|
||||
/* qnameID == 12: {http://www.w3.org/XML/1998/namespace}space */
|
||||
{1, 3},
|
||||
/* qnameID == 13: {http://www.w3.org/2001/XMLSchema-instance}nil */
|
||||
{2, 0},
|
||||
/* qnameID == 14: {http://www.w3.org/2001/XMLSchema-instance}type */
|
||||
{2, 1},
|
||||
/* qnameID == 15: {http://www.w3.org/2001/XMLSchema}ENTITIES */
|
||||
{3, 0},
|
||||
/* qnameID == 16: {http://www.w3.org/2001/XMLSchema}ENTITY */
|
||||
{3, 1},
|
||||
/* qnameID == 17: {http://www.w3.org/2001/XMLSchema}ID */
|
||||
{3, 2},
|
||||
/* qnameID == 18: {http://www.w3.org/2001/XMLSchema}IDREF */
|
||||
{3, 3},
|
||||
/* qnameID == 19: {http://www.w3.org/2001/XMLSchema}IDREFS */
|
||||
{3, 4},
|
||||
/* qnameID == 20: {http://www.w3.org/2001/XMLSchema}NCName */
|
||||
{3, 5},
|
||||
/* qnameID == 21: {http://www.w3.org/2001/XMLSchema}NMTOKEN */
|
||||
{3, 6},
|
||||
/* qnameID == 22: {http://www.w3.org/2001/XMLSchema}NMTOKENS */
|
||||
{3, 7},
|
||||
/* qnameID == 23: {http://www.w3.org/2001/XMLSchema}NOTATION */
|
||||
{3, 8},
|
||||
/* qnameID == 24: {http://www.w3.org/2001/XMLSchema}Name */
|
||||
{3, 9},
|
||||
/* qnameID == 25: {http://www.w3.org/2001/XMLSchema}QName */
|
||||
{3, 10},
|
||||
/* qnameID == 26: {http://www.w3.org/2001/XMLSchema}anySimpleType */
|
||||
{3, 11},
|
||||
/* qnameID == 27: {http://www.w3.org/2001/XMLSchema}anyType */
|
||||
{3, 12},
|
||||
/* qnameID == 28: {http://www.w3.org/2001/XMLSchema}anyURI */
|
||||
{3, 13},
|
||||
/* qnameID == 29: {http://www.w3.org/2001/XMLSchema}base64Binary */
|
||||
{3, 14},
|
||||
/* qnameID == 30: {http://www.w3.org/2001/XMLSchema}boolean */
|
||||
{3, 15},
|
||||
/* qnameID == 31: {http://www.w3.org/2001/XMLSchema}byte */
|
||||
{3, 16},
|
||||
/* qnameID == 32: {http://www.w3.org/2001/XMLSchema}date */
|
||||
{3, 17},
|
||||
/* qnameID == 33: {http://www.w3.org/2001/XMLSchema}dateTime */
|
||||
{3, 18},
|
||||
/* qnameID == 34: {http://www.w3.org/2001/XMLSchema}decimal */
|
||||
{3, 19},
|
||||
/* qnameID == 35: {http://www.w3.org/2001/XMLSchema}double */
|
||||
{3, 20},
|
||||
/* qnameID == 36: {http://www.w3.org/2001/XMLSchema}duration */
|
||||
{3, 21},
|
||||
/* qnameID == 37: {http://www.w3.org/2001/XMLSchema}float */
|
||||
{3, 22},
|
||||
/* qnameID == 38: {http://www.w3.org/2001/XMLSchema}gDay */
|
||||
{3, 23},
|
||||
/* qnameID == 39: {http://www.w3.org/2001/XMLSchema}gMonth */
|
||||
{3, 24},
|
||||
/* qnameID == 40: {http://www.w3.org/2001/XMLSchema}gMonthDay */
|
||||
{3, 25},
|
||||
/* qnameID == 41: {http://www.w3.org/2001/XMLSchema}gYear */
|
||||
{3, 26},
|
||||
/* qnameID == 42: {http://www.w3.org/2001/XMLSchema}gYearMonth */
|
||||
{3, 27},
|
||||
/* qnameID == 43: {http://www.w3.org/2001/XMLSchema}hexBinary */
|
||||
{3, 28},
|
||||
/* qnameID == 44: {http://www.w3.org/2001/XMLSchema}int */
|
||||
{3, 29},
|
||||
/* qnameID == 45: {http://www.w3.org/2001/XMLSchema}integer */
|
||||
{3, 30},
|
||||
/* qnameID == 46: {http://www.w3.org/2001/XMLSchema}language */
|
||||
{3, 31},
|
||||
/* qnameID == 47: {http://www.w3.org/2001/XMLSchema}long */
|
||||
{3, 32},
|
||||
/* qnameID == 48: {http://www.w3.org/2001/XMLSchema}negativeInteger */
|
||||
{3, 33},
|
||||
/* qnameID == 49: {http://www.w3.org/2001/XMLSchema}nonNegativeInteger */
|
||||
{3, 34},
|
||||
/* qnameID == 50: {http://www.w3.org/2001/XMLSchema}nonPositiveInteger */
|
||||
{3, 35},
|
||||
/* qnameID == 51: {http://www.w3.org/2001/XMLSchema}normalizedString */
|
||||
{3, 36},
|
||||
/* qnameID == 52: {http://www.w3.org/2001/XMLSchema}positiveInteger */
|
||||
{3, 37},
|
||||
/* qnameID == 53: {http://www.w3.org/2001/XMLSchema}short */
|
||||
{3, 38},
|
||||
/* qnameID == 54: {http://www.w3.org/2001/XMLSchema}string */
|
||||
{3, 39},
|
||||
/* qnameID == 55: {http://www.w3.org/2001/XMLSchema}time */
|
||||
{3, 40},
|
||||
/* qnameID == 56: {http://www.w3.org/2001/XMLSchema}token */
|
||||
{3, 41},
|
||||
/* qnameID == 57: {http://www.w3.org/2001/XMLSchema}unsignedByte */
|
||||
{3, 42},
|
||||
/* qnameID == 58: {http://www.w3.org/2001/XMLSchema}unsignedInt */
|
||||
{3, 43},
|
||||
/* qnameID == 59: {http://www.w3.org/2001/XMLSchema}unsignedLong */
|
||||
{3, 44},
|
||||
/* qnameID == 60: {http://www.w3.org/2001/XMLSchema}unsignedShort */
|
||||
{3, 45},
|
||||
/* qnameID == 61: {http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod */
|
||||
{4, 0},
|
||||
/* qnameID == 62: {http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethodType */
|
||||
{4, 1},
|
||||
/* qnameID == 63: {http://www.w3.org/2000/09/xmldsig#}CryptoBinary */
|
||||
{4, 2},
|
||||
/* qnameID == 64: {http://www.w3.org/2000/09/xmldsig#}DSAKeyValue */
|
||||
{4, 3},
|
||||
/* qnameID == 65: {http://www.w3.org/2000/09/xmldsig#}DSAKeyValueType */
|
||||
{4, 4},
|
||||
/* qnameID == 66: {http://www.w3.org/2000/09/xmldsig#}DigestMethod */
|
||||
{4, 5},
|
||||
/* qnameID == 67: {http://www.w3.org/2000/09/xmldsig#}DigestMethodType */
|
||||
{4, 6},
|
||||
/* qnameID == 68: {http://www.w3.org/2000/09/xmldsig#}DigestValue */
|
||||
{4, 7},
|
||||
/* qnameID == 69: {http://www.w3.org/2000/09/xmldsig#}DigestValueType */
|
||||
{4, 8},
|
||||
/* qnameID == 70: {http://www.w3.org/2000/09/xmldsig#}Exponent */
|
||||
{4, 9},
|
||||
/* qnameID == 71: {http://www.w3.org/2000/09/xmldsig#}G */
|
||||
{4, 10},
|
||||
/* qnameID == 72: {http://www.w3.org/2000/09/xmldsig#}HMACOutputLength */
|
||||
{4, 11},
|
||||
/* qnameID == 73: {http://www.w3.org/2000/09/xmldsig#}HMACOutputLengthType */
|
||||
{4, 12},
|
||||
/* qnameID == 74: {http://www.w3.org/2000/09/xmldsig#}J */
|
||||
{4, 13},
|
||||
/* qnameID == 75: {http://www.w3.org/2000/09/xmldsig#}KeyInfo */
|
||||
{4, 14},
|
||||
/* qnameID == 76: {http://www.w3.org/2000/09/xmldsig#}KeyInfoType */
|
||||
{4, 15},
|
||||
/* qnameID == 77: {http://www.w3.org/2000/09/xmldsig#}KeyName */
|
||||
{4, 16},
|
||||
/* qnameID == 78: {http://www.w3.org/2000/09/xmldsig#}KeyValue */
|
||||
{4, 17},
|
||||
/* qnameID == 79: {http://www.w3.org/2000/09/xmldsig#}KeyValueType */
|
||||
{4, 18},
|
||||
/* qnameID == 80: {http://www.w3.org/2000/09/xmldsig#}Manifest */
|
||||
{4, 19},
|
||||
/* qnameID == 81: {http://www.w3.org/2000/09/xmldsig#}ManifestType */
|
||||
{4, 20},
|
||||
/* qnameID == 82: {http://www.w3.org/2000/09/xmldsig#}MgmtData */
|
||||
{4, 21},
|
||||
/* qnameID == 83: {http://www.w3.org/2000/09/xmldsig#}Modulus */
|
||||
{4, 22},
|
||||
/* qnameID == 84: {http://www.w3.org/2000/09/xmldsig#}Object */
|
||||
{4, 23},
|
||||
/* qnameID == 85: {http://www.w3.org/2000/09/xmldsig#}ObjectType */
|
||||
{4, 24},
|
||||
/* qnameID == 86: {http://www.w3.org/2000/09/xmldsig#}P */
|
||||
{4, 25},
|
||||
/* qnameID == 87: {http://www.w3.org/2000/09/xmldsig#}PGPData */
|
||||
{4, 26},
|
||||
/* qnameID == 88: {http://www.w3.org/2000/09/xmldsig#}PGPDataType */
|
||||
{4, 27},
|
||||
/* qnameID == 89: {http://www.w3.org/2000/09/xmldsig#}PGPKeyID */
|
||||
{4, 28},
|
||||
/* qnameID == 90: {http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket */
|
||||
{4, 29},
|
||||
/* qnameID == 91: {http://www.w3.org/2000/09/xmldsig#}PgenCounter */
|
||||
{4, 30},
|
||||
/* qnameID == 92: {http://www.w3.org/2000/09/xmldsig#}Q */
|
||||
{4, 31},
|
||||
/* qnameID == 93: {http://www.w3.org/2000/09/xmldsig#}RSAKeyValue */
|
||||
{4, 32},
|
||||
/* qnameID == 94: {http://www.w3.org/2000/09/xmldsig#}RSAKeyValueType */
|
||||
{4, 33},
|
||||
/* qnameID == 95: {http://www.w3.org/2000/09/xmldsig#}Reference */
|
||||
{4, 34},
|
||||
/* qnameID == 96: {http://www.w3.org/2000/09/xmldsig#}ReferenceType */
|
||||
{4, 35},
|
||||
/* qnameID == 97: {http://www.w3.org/2000/09/xmldsig#}RetrievalMethod */
|
||||
{4, 36},
|
||||
/* qnameID == 98: {http://www.w3.org/2000/09/xmldsig#}RetrievalMethodType */
|
||||
{4, 37},
|
||||
/* qnameID == 99: {http://www.w3.org/2000/09/xmldsig#}SPKIData */
|
||||
{4, 38},
|
||||
/* qnameID == 100: {http://www.w3.org/2000/09/xmldsig#}SPKIDataType */
|
||||
{4, 39},
|
||||
/* qnameID == 101: {http://www.w3.org/2000/09/xmldsig#}SPKISexp */
|
||||
{4, 40},
|
||||
/* qnameID == 102: {http://www.w3.org/2000/09/xmldsig#}Seed */
|
||||
{4, 41},
|
||||
/* qnameID == 103: {http://www.w3.org/2000/09/xmldsig#}Signature */
|
||||
{4, 42},
|
||||
/* qnameID == 104: {http://www.w3.org/2000/09/xmldsig#}SignatureMethod */
|
||||
{4, 43},
|
||||
/* qnameID == 105: {http://www.w3.org/2000/09/xmldsig#}SignatureMethodType */
|
||||
{4, 44},
|
||||
/* qnameID == 106: {http://www.w3.org/2000/09/xmldsig#}SignatureProperties */
|
||||
{4, 45},
|
||||
/* qnameID == 107: {http://www.w3.org/2000/09/xmldsig#}SignaturePropertiesType */
|
||||
{4, 46},
|
||||
/* qnameID == 108: {http://www.w3.org/2000/09/xmldsig#}SignatureProperty */
|
||||
{4, 47},
|
||||
/* qnameID == 109: {http://www.w3.org/2000/09/xmldsig#}SignaturePropertyType */
|
||||
{4, 48},
|
||||
/* qnameID == 110: {http://www.w3.org/2000/09/xmldsig#}SignatureType */
|
||||
{4, 49},
|
||||
/* qnameID == 111: {http://www.w3.org/2000/09/xmldsig#}SignatureValue */
|
||||
{4, 50},
|
||||
/* qnameID == 112: {http://www.w3.org/2000/09/xmldsig#}SignatureValueType */
|
||||
{4, 51},
|
||||
/* qnameID == 113: {http://www.w3.org/2000/09/xmldsig#}SignedInfo */
|
||||
{4, 52},
|
||||
/* qnameID == 114: {http://www.w3.org/2000/09/xmldsig#}SignedInfoType */
|
||||
{4, 53},
|
||||
/* qnameID == 115: {http://www.w3.org/2000/09/xmldsig#}Transform */
|
||||
{4, 54},
|
||||
/* qnameID == 116: {http://www.w3.org/2000/09/xmldsig#}TransformType */
|
||||
{4, 55},
|
||||
/* qnameID == 117: {http://www.w3.org/2000/09/xmldsig#}Transforms */
|
||||
{4, 56},
|
||||
/* qnameID == 118: {http://www.w3.org/2000/09/xmldsig#}TransformsType */
|
||||
{4, 57},
|
||||
/* qnameID == 119: {http://www.w3.org/2000/09/xmldsig#}X509CRL */
|
||||
{4, 58},
|
||||
/* qnameID == 120: {http://www.w3.org/2000/09/xmldsig#}X509Certificate */
|
||||
{4, 59},
|
||||
/* qnameID == 121: {http://www.w3.org/2000/09/xmldsig#}X509Data */
|
||||
{4, 60},
|
||||
/* qnameID == 122: {http://www.w3.org/2000/09/xmldsig#}X509DataType */
|
||||
{4, 61},
|
||||
/* qnameID == 123: {http://www.w3.org/2000/09/xmldsig#}X509IssuerName */
|
||||
{4, 62},
|
||||
/* qnameID == 124: {http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial */
|
||||
{4, 63},
|
||||
/* qnameID == 125: {http://www.w3.org/2000/09/xmldsig#}X509IssuerSerialType */
|
||||
{4, 64},
|
||||
/* qnameID == 126: {http://www.w3.org/2000/09/xmldsig#}X509SKI */
|
||||
{4, 65},
|
||||
/* qnameID == 127: {http://www.w3.org/2000/09/xmldsig#}X509SerialNumber */
|
||||
{4, 66},
|
||||
/* qnameID == 128: {http://www.w3.org/2000/09/xmldsig#}X509SubjectName */
|
||||
{4, 67},
|
||||
/* qnameID == 129: {http://www.w3.org/2000/09/xmldsig#}XPath */
|
||||
{4, 68},
|
||||
/* qnameID == 130: {http://www.w3.org/2000/09/xmldsig#}Y */
|
||||
{4, 69},
|
||||
/* qnameID == 131: {urn:iso:15118:2:2010:MsgBody}AC_EVSEStatus */
|
||||
{5, 0},
|
||||
/* qnameID == 132: {urn:iso:15118:2:2010:MsgBody}BulkChargingComplete */
|
||||
{5, 1},
|
||||
/* qnameID == 133: {urn:iso:15118:2:2010:MsgBody}CableCheckReq */
|
||||
{5, 2},
|
||||
/* qnameID == 134: {urn:iso:15118:2:2010:MsgBody}CableCheckReqType */
|
||||
{5, 3},
|
||||
/* qnameID == 135: {urn:iso:15118:2:2010:MsgBody}CableCheckRes */
|
||||
{5, 4},
|
||||
/* qnameID == 136: {urn:iso:15118:2:2010:MsgBody}CableCheckResType */
|
||||
{5, 5},
|
||||
/* qnameID == 137: {urn:iso:15118:2:2010:MsgBody}CertificateInstallationReq */
|
||||
{5, 6},
|
||||
/* qnameID == 138: {urn:iso:15118:2:2010:MsgBody}CertificateInstallationReqType */
|
||||
{5, 7},
|
||||
/* qnameID == 139: {urn:iso:15118:2:2010:MsgBody}CertificateInstallationRes */
|
||||
{5, 8},
|
||||
/* qnameID == 140: {urn:iso:15118:2:2010:MsgBody}CertificateInstallationResType */
|
||||
{5, 9},
|
||||
/* qnameID == 141: {urn:iso:15118:2:2010:MsgBody}CertificateUpdateReq */
|
||||
{5, 10},
|
||||
/* qnameID == 142: {urn:iso:15118:2:2010:MsgBody}CertificateUpdateReqType */
|
||||
{5, 11},
|
||||
/* qnameID == 143: {urn:iso:15118:2:2010:MsgBody}CertificateUpdateRes */
|
||||
{5, 12},
|
||||
/* qnameID == 144: {urn:iso:15118:2:2010:MsgBody}CertificateUpdateResType */
|
||||
{5, 13},
|
||||
/* qnameID == 145: {urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryReq */
|
||||
{5, 14},
|
||||
/* qnameID == 146: {urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryReqType */
|
||||
{5, 15},
|
||||
/* qnameID == 147: {urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryRes */
|
||||
{5, 16},
|
||||
/* qnameID == 148: {urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryResType */
|
||||
{5, 17},
|
||||
/* qnameID == 149: {urn:iso:15118:2:2010:MsgBody}ChargeService */
|
||||
{5, 18},
|
||||
/* qnameID == 150: {urn:iso:15118:2:2010:MsgBody}ChargingComplete */
|
||||
{5, 19},
|
||||
/* qnameID == 151: {urn:iso:15118:2:2010:MsgBody}ChargingProfile */
|
||||
{5, 20},
|
||||
/* qnameID == 152: {urn:iso:15118:2:2010:MsgBody}ChargingStatusReq */
|
||||
{5, 21},
|
||||
/* qnameID == 153: {urn:iso:15118:2:2010:MsgBody}ChargingStatusReqType */
|
||||
{5, 22},
|
||||
/* qnameID == 154: {urn:iso:15118:2:2010:MsgBody}ChargingStatusRes */
|
||||
{5, 23},
|
||||
/* qnameID == 155: {urn:iso:15118:2:2010:MsgBody}ChargingStatusResType */
|
||||
{5, 24},
|
||||
/* qnameID == 156: {urn:iso:15118:2:2010:MsgBody}ContractAuthenticationReq */
|
||||
{5, 25},
|
||||
/* qnameID == 157: {urn:iso:15118:2:2010:MsgBody}ContractAuthenticationReqType */
|
||||
{5, 26},
|
||||
/* qnameID == 158: {urn:iso:15118:2:2010:MsgBody}ContractAuthenticationRes */
|
||||
{5, 27},
|
||||
/* qnameID == 159: {urn:iso:15118:2:2010:MsgBody}ContractAuthenticationResType */
|
||||
{5, 28},
|
||||
/* qnameID == 160: {urn:iso:15118:2:2010:MsgBody}ContractID */
|
||||
{5, 29},
|
||||
/* qnameID == 161: {urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain */
|
||||
{5, 30},
|
||||
/* qnameID == 162: {urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey */
|
||||
{5, 31},
|
||||
/* qnameID == 163: {urn:iso:15118:2:2010:MsgBody}CurrentDemandReq */
|
||||
{5, 32},
|
||||
/* qnameID == 164: {urn:iso:15118:2:2010:MsgBody}CurrentDemandReqType */
|
||||
{5, 33},
|
||||
/* qnameID == 165: {urn:iso:15118:2:2010:MsgBody}CurrentDemandRes */
|
||||
{5, 34},
|
||||
/* qnameID == 166: {urn:iso:15118:2:2010:MsgBody}CurrentDemandResType */
|
||||
{5, 35},
|
||||
/* qnameID == 167: {urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus */
|
||||
{5, 36},
|
||||
/* qnameID == 168: {urn:iso:15118:2:2010:MsgBody}DC_EVStatus */
|
||||
{5, 37},
|
||||
/* qnameID == 169: {urn:iso:15118:2:2010:MsgBody}DHParams */
|
||||
{5, 38},
|
||||
/* qnameID == 170: {urn:iso:15118:2:2010:MsgBody}DateTimeNow */
|
||||
{5, 39},
|
||||
/* qnameID == 171: {urn:iso:15118:2:2010:MsgBody}EVCCID */
|
||||
{5, 40},
|
||||
/* qnameID == 172: {urn:iso:15118:2:2010:MsgBody}EVMaximumCurrentLimit */
|
||||
{5, 41},
|
||||
/* qnameID == 173: {urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit */
|
||||
{5, 42},
|
||||
/* qnameID == 174: {urn:iso:15118:2:2010:MsgBody}EVMaximumVoltageLimit */
|
||||
{5, 43},
|
||||
/* qnameID == 175: {urn:iso:15118:2:2010:MsgBody}EVRequestedEnergyTransferType */
|
||||
{5, 44},
|
||||
/* qnameID == 176: {urn:iso:15118:2:2010:MsgBody}EVSECurrentLimitAchieved */
|
||||
{5, 45},
|
||||
/* qnameID == 177: {urn:iso:15118:2:2010:MsgBody}EVSEID */
|
||||
{5, 46},
|
||||
/* qnameID == 178: {urn:iso:15118:2:2010:MsgBody}EVSEMaxCurrent */
|
||||
{5, 47},
|
||||
/* qnameID == 179: {urn:iso:15118:2:2010:MsgBody}EVSEMaximumCurrentLimit */
|
||||
{5, 48},
|
||||
/* qnameID == 180: {urn:iso:15118:2:2010:MsgBody}EVSEMaximumPowerLimit */
|
||||
{5, 49},
|
||||
/* qnameID == 181: {urn:iso:15118:2:2010:MsgBody}EVSEMaximumVoltageLimit */
|
||||
{5, 50},
|
||||
/* qnameID == 182: {urn:iso:15118:2:2010:MsgBody}EVSEPowerLimitAchieved */
|
||||
{5, 51},
|
||||
/* qnameID == 183: {urn:iso:15118:2:2010:MsgBody}EVSEPresentCurrent */
|
||||
{5, 52},
|
||||
/* qnameID == 184: {urn:iso:15118:2:2010:MsgBody}EVSEPresentVoltage */
|
||||
{5, 53},
|
||||
/* qnameID == 185: {urn:iso:15118:2:2010:MsgBody}EVSEProcessing */
|
||||
{5, 54},
|
||||
/* qnameID == 186: {urn:iso:15118:2:2010:MsgBody}EVSEVoltageLimitAchieved */
|
||||
{5, 55},
|
||||
/* qnameID == 187: {urn:iso:15118:2:2010:MsgBody}EVTargetCurrent */
|
||||
{5, 56},
|
||||
/* qnameID == 188: {urn:iso:15118:2:2010:MsgBody}EVTargetVoltage */
|
||||
{5, 57},
|
||||
/* qnameID == 189: {urn:iso:15118:2:2010:MsgBody}GenChallenge */
|
||||
{5, 58},
|
||||
/* qnameID == 190: {urn:iso:15118:2:2010:MsgBody}ListOfRootCertificateIDs */
|
||||
{5, 59},
|
||||
/* qnameID == 191: {urn:iso:15118:2:2010:MsgBody}MeterInfo */
|
||||
{5, 60},
|
||||
/* qnameID == 192: {urn:iso:15118:2:2010:MsgBody}MeteringReceiptReq */
|
||||
{5, 61},
|
||||
/* qnameID == 193: {urn:iso:15118:2:2010:MsgBody}MeteringReceiptReqType */
|
||||
{5, 62},
|
||||
/* qnameID == 194: {urn:iso:15118:2:2010:MsgBody}MeteringReceiptRes */
|
||||
{5, 63},
|
||||
/* qnameID == 195: {urn:iso:15118:2:2010:MsgBody}MeteringReceiptResType */
|
||||
{5, 64},
|
||||
/* qnameID == 196: {urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert */
|
||||
{5, 65},
|
||||
/* qnameID == 197: {urn:iso:15118:2:2010:MsgBody}PaymentDetailsReq */
|
||||
{5, 66},
|
||||
/* qnameID == 198: {urn:iso:15118:2:2010:MsgBody}PaymentDetailsReqType */
|
||||
{5, 67},
|
||||
/* qnameID == 199: {urn:iso:15118:2:2010:MsgBody}PaymentDetailsRes */
|
||||
{5, 68},
|
||||
/* qnameID == 200: {urn:iso:15118:2:2010:MsgBody}PaymentDetailsResType */
|
||||
{5, 69},
|
||||
/* qnameID == 201: {urn:iso:15118:2:2010:MsgBody}PaymentOptions */
|
||||
{5, 70},
|
||||
/* qnameID == 202: {urn:iso:15118:2:2010:MsgBody}PowerDeliveryReq */
|
||||
{5, 71},
|
||||
/* qnameID == 203: {urn:iso:15118:2:2010:MsgBody}PowerDeliveryReqType */
|
||||
{5, 72},
|
||||
/* qnameID == 204: {urn:iso:15118:2:2010:MsgBody}PowerDeliveryRes */
|
||||
{5, 73},
|
||||
/* qnameID == 205: {urn:iso:15118:2:2010:MsgBody}PowerDeliveryResType */
|
||||
{5, 74},
|
||||
/* qnameID == 206: {urn:iso:15118:2:2010:MsgBody}PreChargeReq */
|
||||
{5, 75},
|
||||
/* qnameID == 207: {urn:iso:15118:2:2010:MsgBody}PreChargeReqType */
|
||||
{5, 76},
|
||||
/* qnameID == 208: {urn:iso:15118:2:2010:MsgBody}PreChargeRes */
|
||||
{5, 77},
|
||||
/* qnameID == 209: {urn:iso:15118:2:2010:MsgBody}PreChargeResType */
|
||||
{5, 78},
|
||||
/* qnameID == 210: {urn:iso:15118:2:2010:MsgBody}ReadyToChargeState */
|
||||
{5, 79},
|
||||
/* qnameID == 211: {urn:iso:15118:2:2010:MsgBody}ReceiptRequired */
|
||||
{5, 80},
|
||||
/* qnameID == 212: {urn:iso:15118:2:2010:MsgBody}RemainingTimeToBulkSoC */
|
||||
{5, 81},
|
||||
/* qnameID == 213: {urn:iso:15118:2:2010:MsgBody}RemainingTimeToFullSoC */
|
||||
{5, 82},
|
||||
/* qnameID == 214: {urn:iso:15118:2:2010:MsgBody}ResponseCode */
|
||||
{5, 83},
|
||||
/* qnameID == 215: {urn:iso:15118:2:2010:MsgBody}RetryCounter */
|
||||
{5, 84},
|
||||
/* qnameID == 216: {urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID */
|
||||
{5, 85},
|
||||
/* qnameID == 217: {urn:iso:15118:2:2010:MsgBody}SelectedPaymentOption */
|
||||
{5, 86},
|
||||
/* qnameID == 218: {urn:iso:15118:2:2010:MsgBody}SelectedServiceList */
|
||||
{5, 87},
|
||||
/* qnameID == 219: {urn:iso:15118:2:2010:MsgBody}ServiceCategory */
|
||||
{5, 88},
|
||||
/* qnameID == 220: {urn:iso:15118:2:2010:MsgBody}ServiceDetailReq */
|
||||
{5, 89},
|
||||
/* qnameID == 221: {urn:iso:15118:2:2010:MsgBody}ServiceDetailReqType */
|
||||
{5, 90},
|
||||
/* qnameID == 222: {urn:iso:15118:2:2010:MsgBody}ServiceDetailRes */
|
||||
{5, 91},
|
||||
/* qnameID == 223: {urn:iso:15118:2:2010:MsgBody}ServiceDetailResType */
|
||||
{5, 92},
|
||||
/* qnameID == 224: {urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryReq */
|
||||
{5, 93},
|
||||
/* qnameID == 225: {urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryReqType */
|
||||
{5, 94},
|
||||
/* qnameID == 226: {urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryRes */
|
||||
{5, 95},
|
||||
/* qnameID == 227: {urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryResType */
|
||||
{5, 96},
|
||||
/* qnameID == 228: {urn:iso:15118:2:2010:MsgBody}ServiceID */
|
||||
{5, 97},
|
||||
/* qnameID == 229: {urn:iso:15118:2:2010:MsgBody}ServiceList */
|
||||
{5, 98},
|
||||
/* qnameID == 230: {urn:iso:15118:2:2010:MsgBody}ServiceParameterList */
|
||||
{5, 99},
|
||||
/* qnameID == 231: {urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionReq */
|
||||
{5, 100},
|
||||
/* qnameID == 232: {urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionReqType */
|
||||
{5, 101},
|
||||
/* qnameID == 233: {urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionRes */
|
||||
{5, 102},
|
||||
/* qnameID == 234: {urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionResType */
|
||||
{5, 103},
|
||||
/* qnameID == 235: {urn:iso:15118:2:2010:MsgBody}ServiceScope */
|
||||
{5, 104},
|
||||
/* qnameID == 236: {urn:iso:15118:2:2010:MsgBody}SessionID */
|
||||
{5, 105},
|
||||
/* qnameID == 237: {urn:iso:15118:2:2010:MsgBody}SessionSetupReq */
|
||||
{5, 106},
|
||||
/* qnameID == 238: {urn:iso:15118:2:2010:MsgBody}SessionSetupReqType */
|
||||
{5, 107},
|
||||
/* qnameID == 239: {urn:iso:15118:2:2010:MsgBody}SessionSetupRes */
|
||||
{5, 108},
|
||||
/* qnameID == 240: {urn:iso:15118:2:2010:MsgBody}SessionSetupResType */
|
||||
{5, 109},
|
||||
/* qnameID == 241: {urn:iso:15118:2:2010:MsgBody}SessionStopReq */
|
||||
{5, 110},
|
||||
/* qnameID == 242: {urn:iso:15118:2:2010:MsgBody}SessionStopRes */
|
||||
{5, 111},
|
||||
/* qnameID == 243: {urn:iso:15118:2:2010:MsgBody}SessionStopResType */
|
||||
{5, 112},
|
||||
/* qnameID == 244: {urn:iso:15118:2:2010:MsgBody}SessionStopType */
|
||||
{5, 113},
|
||||
/* qnameID == 245: {urn:iso:15118:2:2010:MsgBody}WeldingDetectionReq */
|
||||
{5, 114},
|
||||
/* qnameID == 246: {urn:iso:15118:2:2010:MsgBody}WeldingDetectionReqType */
|
||||
{5, 115},
|
||||
/* qnameID == 247: {urn:iso:15118:2:2010:MsgBody}WeldingDetectionRes */
|
||||
{5, 116},
|
||||
/* qnameID == 248: {urn:iso:15118:2:2010:MsgBody}WeldingDetectionResType */
|
||||
{5, 117},
|
||||
/* qnameID == 249: {urn:iso:15118:2:2010:MsgDataTypes}AC_EVChargeParameter */
|
||||
{6, 0},
|
||||
/* qnameID == 250: {urn:iso:15118:2:2010:MsgDataTypes}AC_EVChargeParameterType */
|
||||
{6, 1},
|
||||
/* qnameID == 251: {urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEChargeParameter */
|
||||
{6, 2},
|
||||
/* qnameID == 252: {urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEChargeParameterType */
|
||||
{6, 3},
|
||||
/* qnameID == 253: {urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatus */
|
||||
{6, 4},
|
||||
/* qnameID == 254: {urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatusType */
|
||||
{6, 5},
|
||||
/* qnameID == 255: {urn:iso:15118:2:2010:MsgDataTypes}BulkChargingComplete */
|
||||
{6, 6},
|
||||
/* qnameID == 256: {urn:iso:15118:2:2010:MsgDataTypes}BulkSOC */
|
||||
{6, 7},
|
||||
/* qnameID == 257: {urn:iso:15118:2:2010:MsgDataTypes}Certificate */
|
||||
{6, 8},
|
||||
/* qnameID == 258: {urn:iso:15118:2:2010:MsgDataTypes}CertificateChainType */
|
||||
{6, 9},
|
||||
/* qnameID == 259: {urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete */
|
||||
{6, 10},
|
||||
/* qnameID == 260: {urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryMaxPower */
|
||||
{6, 11},
|
||||
/* qnameID == 261: {urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryStart */
|
||||
{6, 12},
|
||||
/* qnameID == 262: {urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileType */
|
||||
{6, 13},
|
||||
/* qnameID == 263: {urn:iso:15118:2:2010:MsgDataTypes}ConsumptionCost */
|
||||
{6, 14},
|
||||
/* qnameID == 264: {urn:iso:15118:2:2010:MsgDataTypes}ConsumptionCostType */
|
||||
{6, 15},
|
||||
/* qnameID == 265: {urn:iso:15118:2:2010:MsgDataTypes}Cost */
|
||||
{6, 16},
|
||||
/* qnameID == 266: {urn:iso:15118:2:2010:MsgDataTypes}CostType */
|
||||
{6, 17},
|
||||
/* qnameID == 267: {urn:iso:15118:2:2010:MsgDataTypes}DC_EVChargeParameter */
|
||||
{6, 18},
|
||||
/* qnameID == 268: {urn:iso:15118:2:2010:MsgDataTypes}DC_EVChargeParameterType */
|
||||
{6, 19},
|
||||
/* qnameID == 269: {urn:iso:15118:2:2010:MsgDataTypes}DC_EVErrorCodeType */
|
||||
{6, 20},
|
||||
/* qnameID == 270: {urn:iso:15118:2:2010:MsgDataTypes}DC_EVPowerDeliveryParameter */
|
||||
{6, 21},
|
||||
/* qnameID == 271: {urn:iso:15118:2:2010:MsgDataTypes}DC_EVPowerDeliveryParameterType */
|
||||
{6, 22},
|
||||
/* qnameID == 272: {urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEChargeParameter */
|
||||
{6, 23},
|
||||
/* qnameID == 273: {urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEChargeParameterType */
|
||||
{6, 24},
|
||||
/* qnameID == 274: {urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatus */
|
||||
{6, 25},
|
||||
/* qnameID == 275: {urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatusCodeType */
|
||||
{6, 26},
|
||||
/* qnameID == 276: {urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatusType */
|
||||
{6, 27},
|
||||
/* qnameID == 277: {urn:iso:15118:2:2010:MsgDataTypes}DC_EVStatus */
|
||||
{6, 28},
|
||||
/* qnameID == 278: {urn:iso:15118:2:2010:MsgDataTypes}DC_EVStatusType */
|
||||
{6, 29},
|
||||
/* qnameID == 279: {urn:iso:15118:2:2010:MsgDataTypes}DepartureTime */
|
||||
{6, 30},
|
||||
/* qnameID == 280: {urn:iso:15118:2:2010:MsgDataTypes}EAmount */
|
||||
{6, 31},
|
||||
/* qnameID == 281: {urn:iso:15118:2:2010:MsgDataTypes}EPriceLevel */
|
||||
{6, 32},
|
||||
/* qnameID == 282: {urn:iso:15118:2:2010:MsgDataTypes}EVCabinConditioning */
|
||||
{6, 33},
|
||||
/* qnameID == 283: {urn:iso:15118:2:2010:MsgDataTypes}EVChargeParameter */
|
||||
{6, 34},
|
||||
/* qnameID == 284: {urn:iso:15118:2:2010:MsgDataTypes}EVChargeParameterType */
|
||||
{6, 35},
|
||||
/* qnameID == 285: {urn:iso:15118:2:2010:MsgDataTypes}EVEnergyCapacity */
|
||||
{6, 36},
|
||||
/* qnameID == 286: {urn:iso:15118:2:2010:MsgDataTypes}EVEnergyRequest */
|
||||
{6, 37},
|
||||
/* qnameID == 287: {urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode */
|
||||
{6, 38},
|
||||
/* qnameID == 288: {urn:iso:15118:2:2010:MsgDataTypes}EVMaxCurrent */
|
||||
{6, 39},
|
||||
/* qnameID == 289: {urn:iso:15118:2:2010:MsgDataTypes}EVMaxVoltage */
|
||||
{6, 40},
|
||||
/* qnameID == 290: {urn:iso:15118:2:2010:MsgDataTypes}EVMaximumCurrentLimit */
|
||||
{6, 41},
|
||||
/* qnameID == 291: {urn:iso:15118:2:2010:MsgDataTypes}EVMaximumPowerLimit */
|
||||
{6, 42},
|
||||
/* qnameID == 292: {urn:iso:15118:2:2010:MsgDataTypes}EVMaximumVoltageLimit */
|
||||
{6, 43},
|
||||
/* qnameID == 293: {urn:iso:15118:2:2010:MsgDataTypes}EVMinCurrent */
|
||||
{6, 44},
|
||||
/* qnameID == 294: {urn:iso:15118:2:2010:MsgDataTypes}EVPowerDeliveryParameter */
|
||||
{6, 45},
|
||||
/* qnameID == 295: {urn:iso:15118:2:2010:MsgDataTypes}EVPowerDeliveryParameterType */
|
||||
{6, 46},
|
||||
/* qnameID == 296: {urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning */
|
||||
{6, 47},
|
||||
/* qnameID == 297: {urn:iso:15118:2:2010:MsgDataTypes}EVRESSSOC */
|
||||
{6, 48},
|
||||
/* qnameID == 298: {urn:iso:15118:2:2010:MsgDataTypes}EVReady */
|
||||
{6, 49},
|
||||
/* qnameID == 299: {urn:iso:15118:2:2010:MsgDataTypes}EVRequestedEnergyTransferType */
|
||||
{6, 50},
|
||||
/* qnameID == 300: {urn:iso:15118:2:2010:MsgDataTypes}EVSEChargeParameter */
|
||||
{6, 51},
|
||||
/* qnameID == 301: {urn:iso:15118:2:2010:MsgDataTypes}EVSEChargeParameterType */
|
||||
{6, 52},
|
||||
/* qnameID == 302: {urn:iso:15118:2:2010:MsgDataTypes}EVSECurrentRegulationTolerance */
|
||||
{6, 53},
|
||||
/* qnameID == 303: {urn:iso:15118:2:2010:MsgDataTypes}EVSEEnergyToBeDelivered */
|
||||
{6, 54},
|
||||
/* qnameID == 304: {urn:iso:15118:2:2010:MsgDataTypes}EVSEIsolationStatus */
|
||||
{6, 55},
|
||||
/* qnameID == 305: {urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxCurrent */
|
||||
{6, 56},
|
||||
/* qnameID == 306: {urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxVoltage */
|
||||
{6, 57},
|
||||
/* qnameID == 307: {urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumCurrentLimit */
|
||||
{6, 58},
|
||||
/* qnameID == 308: {urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumPowerLimit */
|
||||
{6, 59},
|
||||
/* qnameID == 309: {urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumVoltageLimit */
|
||||
{6, 60},
|
||||
/* qnameID == 310: {urn:iso:15118:2:2010:MsgDataTypes}EVSEMinCurrent */
|
||||
{6, 61},
|
||||
/* qnameID == 311: {urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumCurrentLimit */
|
||||
{6, 62},
|
||||
/* qnameID == 312: {urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumVoltageLimit */
|
||||
{6, 63},
|
||||
/* qnameID == 313: {urn:iso:15118:2:2010:MsgDataTypes}EVSENotification */
|
||||
{6, 64},
|
||||
/* qnameID == 314: {urn:iso:15118:2:2010:MsgDataTypes}EVSENotificationType */
|
||||
{6, 65},
|
||||
/* qnameID == 315: {urn:iso:15118:2:2010:MsgDataTypes}EVSEPeakCurrentRipple */
|
||||
{6, 66},
|
||||
/* qnameID == 316: {urn:iso:15118:2:2010:MsgDataTypes}EVSEProcessingType */
|
||||
{6, 67},
|
||||
/* qnameID == 317: {urn:iso:15118:2:2010:MsgDataTypes}EVSEStatus */
|
||||
{6, 68},
|
||||
/* qnameID == 318: {urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode */
|
||||
{6, 69},
|
||||
/* qnameID == 319: {urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusType */
|
||||
{6, 70},
|
||||
/* qnameID == 320: {urn:iso:15118:2:2010:MsgDataTypes}EVSESupportedEnergyTransferType */
|
||||
{6, 71},
|
||||
/* qnameID == 321: {urn:iso:15118:2:2010:MsgDataTypes}EVStatus */
|
||||
{6, 72},
|
||||
/* qnameID == 322: {urn:iso:15118:2:2010:MsgDataTypes}EVStatusType */
|
||||
{6, 73},
|
||||
/* qnameID == 323: {urn:iso:15118:2:2010:MsgDataTypes}EnergyTransferType */
|
||||
{6, 74},
|
||||
/* qnameID == 324: {urn:iso:15118:2:2010:MsgDataTypes}Entry */
|
||||
{6, 75},
|
||||
/* qnameID == 325: {urn:iso:15118:2:2010:MsgDataTypes}EntryType */
|
||||
{6, 76},
|
||||
/* qnameID == 326: {urn:iso:15118:2:2010:MsgDataTypes}FaultCode */
|
||||
{6, 77},
|
||||
/* qnameID == 327: {urn:iso:15118:2:2010:MsgDataTypes}FaultMsg */
|
||||
{6, 78},
|
||||
/* qnameID == 328: {urn:iso:15118:2:2010:MsgDataTypes}FreeService */
|
||||
{6, 79},
|
||||
/* qnameID == 329: {urn:iso:15118:2:2010:MsgDataTypes}FullSOC */
|
||||
{6, 80},
|
||||
/* qnameID == 330: {urn:iso:15118:2:2010:MsgDataTypes}IntervalType */
|
||||
{6, 81},
|
||||
/* qnameID == 331: {urn:iso:15118:2:2010:MsgDataTypes}ListOfRootCertificateIDsType */
|
||||
{6, 82},
|
||||
/* qnameID == 332: {urn:iso:15118:2:2010:MsgDataTypes}MeterID */
|
||||
{6, 83},
|
||||
/* qnameID == 333: {urn:iso:15118:2:2010:MsgDataTypes}MeterInfoType */
|
||||
{6, 84},
|
||||
/* qnameID == 334: {urn:iso:15118:2:2010:MsgDataTypes}MeterReading */
|
||||
{6, 85},
|
||||
/* qnameID == 335: {urn:iso:15118:2:2010:MsgDataTypes}MeterStatus */
|
||||
{6, 86},
|
||||
/* qnameID == 336: {urn:iso:15118:2:2010:MsgDataTypes}Multiplier */
|
||||
{6, 87},
|
||||
/* qnameID == 337: {urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay */
|
||||
{6, 88},
|
||||
/* qnameID == 338: {urn:iso:15118:2:2010:MsgDataTypes}NotificationType */
|
||||
{6, 89},
|
||||
/* qnameID == 339: {urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels */
|
||||
{6, 90},
|
||||
/* qnameID == 340: {urn:iso:15118:2:2010:MsgDataTypes}PMax */
|
||||
{6, 91},
|
||||
/* qnameID == 341: {urn:iso:15118:2:2010:MsgDataTypes}PMaxSchedule */
|
||||
{6, 92},
|
||||
/* qnameID == 342: {urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleEntry */
|
||||
{6, 93},
|
||||
/* qnameID == 343: {urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleEntryType */
|
||||
{6, 94},
|
||||
/* qnameID == 344: {urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleID */
|
||||
{6, 95},
|
||||
/* qnameID == 345: {urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleType */
|
||||
{6, 96},
|
||||
/* qnameID == 346: {urn:iso:15118:2:2010:MsgDataTypes}PMaxType */
|
||||
{6, 97},
|
||||
/* qnameID == 347: {urn:iso:15118:2:2010:MsgDataTypes}Parameter */
|
||||
{6, 98},
|
||||
/* qnameID == 348: {urn:iso:15118:2:2010:MsgDataTypes}ParameterSet */
|
||||
{6, 99},
|
||||
/* qnameID == 349: {urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID */
|
||||
{6, 100},
|
||||
/* qnameID == 350: {urn:iso:15118:2:2010:MsgDataTypes}ParameterSetType */
|
||||
{6, 101},
|
||||
/* qnameID == 351: {urn:iso:15118:2:2010:MsgDataTypes}ParameterType */
|
||||
{6, 102},
|
||||
/* qnameID == 352: {urn:iso:15118:2:2010:MsgDataTypes}PaymentOption */
|
||||
{6, 103},
|
||||
/* qnameID == 353: {urn:iso:15118:2:2010:MsgDataTypes}PaymentOptionsType */
|
||||
{6, 104},
|
||||
/* qnameID == 354: {urn:iso:15118:2:2010:MsgDataTypes}PhysicalValueType */
|
||||
{6, 105},
|
||||
/* qnameID == 355: {urn:iso:15118:2:2010:MsgDataTypes}PowerSwitchClosed */
|
||||
{6, 106},
|
||||
/* qnameID == 356: {urn:iso:15118:2:2010:MsgDataTypes}ProfileEntry */
|
||||
{6, 107},
|
||||
/* qnameID == 357: {urn:iso:15118:2:2010:MsgDataTypes}ProfileEntryType */
|
||||
{6, 108},
|
||||
/* qnameID == 358: {urn:iso:15118:2:2010:MsgDataTypes}RCD */
|
||||
{6, 109},
|
||||
/* qnameID == 359: {urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval */
|
||||
{6, 110},
|
||||
/* qnameID == 360: {urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeIntervalType */
|
||||
{6, 111},
|
||||
/* qnameID == 361: {urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID */
|
||||
{6, 112},
|
||||
/* qnameID == 362: {urn:iso:15118:2:2010:MsgDataTypes}SAIDType */
|
||||
{6, 113},
|
||||
/* qnameID == 363: {urn:iso:15118:2:2010:MsgDataTypes}SAScheduleList */
|
||||
{6, 114},
|
||||
/* qnameID == 364: {urn:iso:15118:2:2010:MsgDataTypes}SAScheduleListType */
|
||||
{6, 115},
|
||||
/* qnameID == 365: {urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTuple */
|
||||
{6, 116},
|
||||
/* qnameID == 366: {urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID */
|
||||
{6, 117},
|
||||
/* qnameID == 367: {urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleType */
|
||||
{6, 118},
|
||||
/* qnameID == 368: {urn:iso:15118:2:2010:MsgDataTypes}SASchedules */
|
||||
{6, 119},
|
||||
/* qnameID == 369: {urn:iso:15118:2:2010:MsgDataTypes}SASchedulesType */
|
||||
{6, 120},
|
||||
/* qnameID == 370: {urn:iso:15118:2:2010:MsgDataTypes}SalesTariff */
|
||||
{6, 121},
|
||||
/* qnameID == 371: {urn:iso:15118:2:2010:MsgDataTypes}SalesTariffDescription */
|
||||
{6, 122},
|
||||
/* qnameID == 372: {urn:iso:15118:2:2010:MsgDataTypes}SalesTariffEntry */
|
||||
{6, 123},
|
||||
/* qnameID == 373: {urn:iso:15118:2:2010:MsgDataTypes}SalesTariffEntryType */
|
||||
{6, 124},
|
||||
/* qnameID == 374: {urn:iso:15118:2:2010:MsgDataTypes}SalesTariffID */
|
||||
{6, 125},
|
||||
/* qnameID == 375: {urn:iso:15118:2:2010:MsgDataTypes}SalesTariffType */
|
||||
{6, 126},
|
||||
/* qnameID == 376: {urn:iso:15118:2:2010:MsgDataTypes}SelectedService */
|
||||
{6, 127},
|
||||
/* qnameID == 377: {urn:iso:15118:2:2010:MsgDataTypes}SelectedServiceListType */
|
||||
{6, 128},
|
||||
/* qnameID == 378: {urn:iso:15118:2:2010:MsgDataTypes}SelectedServiceType */
|
||||
{6, 129},
|
||||
/* qnameID == 379: {urn:iso:15118:2:2010:MsgDataTypes}Service */
|
||||
{6, 130},
|
||||
/* qnameID == 380: {urn:iso:15118:2:2010:MsgDataTypes}ServiceCategory */
|
||||
{6, 131},
|
||||
/* qnameID == 381: {urn:iso:15118:2:2010:MsgDataTypes}ServiceCharge */
|
||||
{6, 132},
|
||||
/* qnameID == 382: {urn:iso:15118:2:2010:MsgDataTypes}ServiceChargeType */
|
||||
{6, 133},
|
||||
/* qnameID == 383: {urn:iso:15118:2:2010:MsgDataTypes}ServiceID */
|
||||
{6, 134},
|
||||
/* qnameID == 384: {urn:iso:15118:2:2010:MsgDataTypes}ServiceName */
|
||||
{6, 135},
|
||||
/* qnameID == 385: {urn:iso:15118:2:2010:MsgDataTypes}ServiceParameterListType */
|
||||
{6, 136},
|
||||
/* qnameID == 386: {urn:iso:15118:2:2010:MsgDataTypes}ServiceScope */
|
||||
{6, 137},
|
||||
/* qnameID == 387: {urn:iso:15118:2:2010:MsgDataTypes}ServiceTag */
|
||||
{6, 138},
|
||||
/* qnameID == 388: {urn:iso:15118:2:2010:MsgDataTypes}ServiceTagListType */
|
||||
{6, 139},
|
||||
/* qnameID == 389: {urn:iso:15118:2:2010:MsgDataTypes}ServiceTagType */
|
||||
{6, 140},
|
||||
/* qnameID == 390: {urn:iso:15118:2:2010:MsgDataTypes}ServiceType */
|
||||
{6, 141},
|
||||
/* qnameID == 391: {urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading */
|
||||
{6, 142},
|
||||
/* qnameID == 392: {urn:iso:15118:2:2010:MsgDataTypes}SubCertificates */
|
||||
{6, 143},
|
||||
/* qnameID == 393: {urn:iso:15118:2:2010:MsgDataTypes}SubCertificatesType */
|
||||
{6, 144},
|
||||
/* qnameID == 394: {urn:iso:15118:2:2010:MsgDataTypes}TMeter */
|
||||
{6, 145},
|
||||
/* qnameID == 395: {urn:iso:15118:2:2010:MsgDataTypes}TimeInterval */
|
||||
{6, 146},
|
||||
/* qnameID == 396: {urn:iso:15118:2:2010:MsgDataTypes}Unit */
|
||||
{6, 147},
|
||||
/* qnameID == 397: {urn:iso:15118:2:2010:MsgDataTypes}Value */
|
||||
{6, 148},
|
||||
/* qnameID == 398: {urn:iso:15118:2:2010:MsgDataTypes}amount */
|
||||
{6, 149},
|
||||
/* qnameID == 399: {urn:iso:15118:2:2010:MsgDataTypes}amountMultiplier */
|
||||
{6, 150},
|
||||
/* qnameID == 400: {urn:iso:15118:2:2010:MsgDataTypes}boolValue */
|
||||
{6, 151},
|
||||
/* qnameID == 401: {urn:iso:15118:2:2010:MsgDataTypes}byteValue */
|
||||
{6, 152},
|
||||
/* qnameID == 402: {urn:iso:15118:2:2010:MsgDataTypes}certificateType */
|
||||
{6, 153},
|
||||
/* qnameID == 403: {urn:iso:15118:2:2010:MsgDataTypes}contractIDType */
|
||||
{6, 154},
|
||||
/* qnameID == 404: {urn:iso:15118:2:2010:MsgDataTypes}costKind */
|
||||
{6, 155},
|
||||
/* qnameID == 405: {urn:iso:15118:2:2010:MsgDataTypes}costKindType */
|
||||
{6, 156},
|
||||
/* qnameID == 406: {urn:iso:15118:2:2010:MsgDataTypes}dHParamsType */
|
||||
{6, 157},
|
||||
/* qnameID == 407: {urn:iso:15118:2:2010:MsgDataTypes}duration */
|
||||
{6, 158},
|
||||
/* qnameID == 408: {urn:iso:15118:2:2010:MsgDataTypes}evccIDType */
|
||||
{6, 159},
|
||||
/* qnameID == 409: {urn:iso:15118:2:2010:MsgDataTypes}evseIDType */
|
||||
{6, 160},
|
||||
/* qnameID == 410: {urn:iso:15118:2:2010:MsgDataTypes}faultCodeType */
|
||||
{6, 161},
|
||||
/* qnameID == 411: {urn:iso:15118:2:2010:MsgDataTypes}faultMsgType */
|
||||
{6, 162},
|
||||
/* qnameID == 412: {urn:iso:15118:2:2010:MsgDataTypes}genChallengeType */
|
||||
{6, 163},
|
||||
/* qnameID == 413: {urn:iso:15118:2:2010:MsgDataTypes}intValue */
|
||||
{6, 164},
|
||||
/* qnameID == 414: {urn:iso:15118:2:2010:MsgDataTypes}isolationLevelType */
|
||||
{6, 165},
|
||||
/* qnameID == 415: {urn:iso:15118:2:2010:MsgDataTypes}meterIDType */
|
||||
{6, 166},
|
||||
/* qnameID == 416: {urn:iso:15118:2:2010:MsgDataTypes}meterStatusType */
|
||||
{6, 167},
|
||||
/* qnameID == 417: {urn:iso:15118:2:2010:MsgDataTypes}paymentOptionType */
|
||||
{6, 168},
|
||||
/* qnameID == 418: {urn:iso:15118:2:2010:MsgDataTypes}percentValueType */
|
||||
{6, 169},
|
||||
/* qnameID == 419: {urn:iso:15118:2:2010:MsgDataTypes}physicalValue */
|
||||
{6, 170},
|
||||
/* qnameID == 420: {urn:iso:15118:2:2010:MsgDataTypes}privateKeyType */
|
||||
{6, 171},
|
||||
/* qnameID == 421: {urn:iso:15118:2:2010:MsgDataTypes}responseCodeType */
|
||||
{6, 172},
|
||||
/* qnameID == 422: {urn:iso:15118:2:2010:MsgDataTypes}rootCertificateIDType */
|
||||
{6, 173},
|
||||
/* qnameID == 423: {urn:iso:15118:2:2010:MsgDataTypes}serviceCategoryType */
|
||||
{6, 174},
|
||||
/* qnameID == 424: {urn:iso:15118:2:2010:MsgDataTypes}serviceIDType */
|
||||
{6, 175},
|
||||
/* qnameID == 425: {urn:iso:15118:2:2010:MsgDataTypes}serviceNameType */
|
||||
{6, 176},
|
||||
/* qnameID == 426: {urn:iso:15118:2:2010:MsgDataTypes}serviceScopeType */
|
||||
{6, 177},
|
||||
/* qnameID == 427: {urn:iso:15118:2:2010:MsgDataTypes}sessionIDType */
|
||||
{6, 178},
|
||||
/* qnameID == 428: {urn:iso:15118:2:2010:MsgDataTypes}shortValue */
|
||||
{6, 179},
|
||||
/* qnameID == 429: {urn:iso:15118:2:2010:MsgDataTypes}sigMeterReadingType */
|
||||
{6, 180},
|
||||
/* qnameID == 430: {urn:iso:15118:2:2010:MsgDataTypes}start */
|
||||
{6, 181},
|
||||
/* qnameID == 431: {urn:iso:15118:2:2010:MsgDataTypes}startValue */
|
||||
{6, 182},
|
||||
/* qnameID == 432: {urn:iso:15118:2:2010:MsgDataTypes}stringValue */
|
||||
{6, 183},
|
||||
/* qnameID == 433: {urn:iso:15118:2:2010:MsgDataTypes}tariffDescriptionType */
|
||||
{6, 184},
|
||||
/* qnameID == 434: {urn:iso:15118:2:2010:MsgDataTypes}unitMultiplierType */
|
||||
{6, 185},
|
||||
/* qnameID == 435: {urn:iso:15118:2:2010:MsgDataTypes}unitSymbolType */
|
||||
{6, 186},
|
||||
/* qnameID == 436: {urn:iso:15118:2:2010:MsgDataTypes}valueType */
|
||||
{6, 187},
|
||||
/* qnameID == 437: {urn:iso:15118:2:2010:MsgDef}Body */
|
||||
{7, 0},
|
||||
/* qnameID == 438: {urn:iso:15118:2:2010:MsgDef}BodyBaseType */
|
||||
{7, 1},
|
||||
/* qnameID == 439: {urn:iso:15118:2:2010:MsgDef}BodyElement */
|
||||
{7, 2},
|
||||
/* qnameID == 440: {urn:iso:15118:2:2010:MsgDef}BodyType */
|
||||
{7, 3},
|
||||
/* qnameID == 441: {urn:iso:15118:2:2010:MsgDef}Header */
|
||||
{7, 4},
|
||||
/* qnameID == 442: {urn:iso:15118:2:2010:MsgDef}V2G_Message */
|
||||
{7, 5},
|
||||
/* qnameID == 443: {urn:iso:15118:2:2010:MsgHeader}MessageHeaderType */
|
||||
{8, 0},
|
||||
/* qnameID == 444: {urn:iso:15118:2:2010:MsgHeader}Notification */
|
||||
{8, 1},
|
||||
/* qnameID == 445: {urn:iso:15118:2:2010:MsgHeader}SessionID */
|
||||
{8, 2}
|
||||
|
||||
};
|
||||
|
||||
|
||||
int exiGetEQName(exi_state_t* state, uint16_t qnameID, uint16_t* namespaceURI, uint16_t* localPart) {
|
||||
int errn = 0;
|
||||
/* EXI_NUMBER_OF_QNAMES */
|
||||
if (qnameID < state->nextQNameID) {
|
||||
*namespaceURI = qnames[qnameID].namespaceURI;
|
||||
*localPart = qnames[qnameID].localPart;
|
||||
} else {
|
||||
errn = EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
return errn;
|
||||
}
|
||||
|
||||
|
||||
int exiGetQNameID(exi_state_t* state, uint16_t namespaceURI, uint16_t localPart, uint16_t* qnameID) {
|
||||
uint16_t i;
|
||||
/* TODO Do something more efficient than just walk over the entire list */
|
||||
/* EXI_NUMBER_OF_QNAMES */
|
||||
for(i=0; i<state->nextQNameID; i++) {
|
||||
if(qnames[i].localPart == localPart && qnames[i].namespaceURI == namespaceURI) {
|
||||
*qnameID = i;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
|
||||
|
||||
int exiAddEQName(exi_state_t* state, uint16_t* qnameID, uint16_t namespaceURI, uint16_t localPart) {
|
||||
int errn = 0;
|
||||
if(state->nextQNameID < (EXI_MAX_NUMBER_OF_QNAMES -1)) {
|
||||
/* store IDs */
|
||||
qnames[state->nextQNameID].namespaceURI = namespaceURI;
|
||||
qnames[state->nextQNameID].localPart = localPart;
|
||||
/* increment counter */
|
||||
*qnameID = state->nextQNameID++;
|
||||
} else {
|
||||
errn = EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
|
||||
|
||||
return errn;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
74
src/codec/QNames.h
Normal file
74
src/codec/QNames.h
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
||||
|
144
src/codec/StringTable.c
Normal file
144
src/codec/StringTable.c
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef STRING_TABLE_C
|
||||
#define STRING_TABLE_C
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#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
|
||||
|
116
src/codec/StringTable.h
Normal file
116
src/codec/StringTable.h
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
||||
|
67
src/codec/UCSString.c
Normal file
67
src/codec/UCSString.c
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#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; i<s->len; 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; i<string->len; i++) {
|
||||
outASCII[i] = (char)string->codepoints[i];
|
||||
}
|
||||
outASCII[string->len] = '\0';
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
74
src/codec/UCSString.h
Normal file
74
src/codec/UCSString.h
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
862
src/codec/appHandCodec/appHandEXICoder.c
Normal file
862
src/codec/appHandCodec/appHandEXICoder.c
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef EXI_appHand_CODER_C
|
||||
#define EXI_appHand_CODER_C
|
||||
|
||||
#include "appHandEXICoder.h"
|
||||
|
||||
#include "EXITypes.h"
|
||||
#include "EXIOptions.h"
|
||||
#include "BitInputStream.h"
|
||||
#include "DecoderChannel.h"
|
||||
#include "ErrorCodes.h"
|
||||
|
||||
|
||||
#ifndef __GNUC__
|
||||
#pragma warning( disable : 4100 ) /* warning unreferenced parameter 'qnameID' */
|
||||
#endif /* __GNUC__ */
|
||||
int exi_appHand_IncrementStringValueCount(exi_state_t* state, uint16_t qnameID) {
|
||||
int errn = 0;
|
||||
#if EXI_appHandVALUE_PARTITION_CAPACITY != 0
|
||||
#if EXI_appHandVALUE_MAX_LENGTH != 0
|
||||
/* increment global string count */
|
||||
#if EXI_appHandVALUE_PARTITION_CAPACITY < 0
|
||||
state->stringTable.numberOfGlobalStrings++;
|
||||
#else /* EXI_appHandVALUE_PARTITION_CAPACITY < 0 */
|
||||
if (state->stringTable.numberOfGlobalStrings < EXI_appHandVALUE_PARTITION_CAPACITY) {
|
||||
state->stringTable.numberOfGlobalStrings++;
|
||||
}
|
||||
#endif /* EXI_appHandVALUE_PARTITION_CAPACITY < 0 */
|
||||
/* increment local string count */
|
||||
if (qnameID < state->stringTable.sizeLocalStrings) {
|
||||
state->stringTable.numberOfLocalStrings[qnameID]++;
|
||||
/* printf("\tSV %d: lv=%d and gv=%d \n", qnameID, state->numberOfLocalStrings[qnameID], state->numberOfGlobalStrings);*/
|
||||
} else {
|
||||
/* currently we do support a set of qnames only */
|
||||
errn = EXI_ERROR_OUT_OF_QNAMES;
|
||||
}
|
||||
#endif /* EXI_appHandVALUE_MAX_LENGTH != 0 */
|
||||
#endif /* EXI_appHandVALUE_PARTITION_CAPACITY != 0 */
|
||||
|
||||
return errn;
|
||||
}
|
||||
#ifndef __GNUC__
|
||||
#pragma warning( default : 4100 ) /* warning unreferenced parameter 'qnameID' */
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
|
||||
int exi_appHand_PushStack(exi_state_t* state, int16_t newState, uint16_t qnameID) {
|
||||
/* eqname_t* eqn*/
|
||||
if ((state->stackIndex + 1) < EXI_ELEMENT_STACK_SIZE) {
|
||||
state->grammarStack[++state->stackIndex] = newState;
|
||||
/* qname */
|
||||
state->elementStack[state->stackIndex] = qnameID;
|
||||
|
||||
/*if (eqn == NULL) {
|
||||
// generic SE, UCD profile
|
||||
} else {
|
||||
// copy IDs
|
||||
state->elementStack[state->stackIndex].localPart = eqn->localPart;
|
||||
state->elementStack[state->stackIndex].namespaceURI = eqn->namespaceURI;
|
||||
}*/
|
||||
return 0;
|
||||
} else {
|
||||
return EXI_ERROR_OUT_OF_GRAMMAR_STACK;
|
||||
}
|
||||
}
|
||||
|
||||
int exi_appHand_PopStack(exi_state_t* state) {
|
||||
if (state->stackIndex >= 1) {
|
||||
state->stackIndex--;
|
||||
return 0;
|
||||
} else {
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
}
|
||||
|
||||
int exi_appHand_HandleXsiNilTrue(exi_state_t* state) {
|
||||
switch (state->grammarStack[state->stackIndex]) {
|
||||
|
||||
}
|
||||
|
||||
return EXI_ERROR_UNEXPECTED_ATTRIBUTE_XSI_NIL;
|
||||
}
|
||||
|
||||
int exi_appHand_HandleXsiType(exi_state_t* state, exi_eqname_t* xsiType) {
|
||||
switch(xsiType->namespaceURI) {
|
||||
case 0:
|
||||
switch(xsiType->localPart) {
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
switch(xsiType->localPart) {
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
switch(xsiType->localPart) {
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
switch(xsiType->localPart) {
|
||||
case 0:
|
||||
/* {3}0,ENTITIES */
|
||||
state->grammarStack[state->stackIndex] = 144;
|
||||
break;
|
||||
case 1:
|
||||
/* {3}1,ENTITY */
|
||||
state->grammarStack[state->stackIndex] = 10;
|
||||
break;
|
||||
case 2:
|
||||
/* {3}2,ID */
|
||||
state->grammarStack[state->stackIndex] = 141;
|
||||
break;
|
||||
case 3:
|
||||
/* {3}3,IDREF */
|
||||
state->grammarStack[state->stackIndex] = 79;
|
||||
break;
|
||||
case 4:
|
||||
/* {3}4,IDREFS */
|
||||
state->grammarStack[state->stackIndex] = 29;
|
||||
break;
|
||||
case 5:
|
||||
/* {3}5,NCName */
|
||||
state->grammarStack[state->stackIndex] = 98;
|
||||
break;
|
||||
case 6:
|
||||
/* {3}6,NMTOKEN */
|
||||
state->grammarStack[state->stackIndex] = 36;
|
||||
break;
|
||||
case 7:
|
||||
/* {3}7,NMTOKENS */
|
||||
state->grammarStack[state->stackIndex] = 25;
|
||||
break;
|
||||
case 8:
|
||||
/* {3}8,NOTATION */
|
||||
state->grammarStack[state->stackIndex] = 78;
|
||||
break;
|
||||
case 9:
|
||||
/* {3}9,Name */
|
||||
state->grammarStack[state->stackIndex] = 101;
|
||||
break;
|
||||
case 10:
|
||||
/* {3}10,QName */
|
||||
state->grammarStack[state->stackIndex] = 106;
|
||||
break;
|
||||
case 11:
|
||||
/* {3}11,anySimpleType */
|
||||
state->grammarStack[state->stackIndex] = 48;
|
||||
break;
|
||||
case 12:
|
||||
/* {3}12,anyType */
|
||||
state->grammarStack[state->stackIndex] = 50;
|
||||
break;
|
||||
case 13:
|
||||
/* {3}13,anyURI */
|
||||
state->grammarStack[state->stackIndex] = 142;
|
||||
break;
|
||||
case 14:
|
||||
/* {3}14,base64Binary */
|
||||
state->grammarStack[state->stackIndex] = 111;
|
||||
break;
|
||||
case 15:
|
||||
/* {3}15,boolean */
|
||||
state->grammarStack[state->stackIndex] = 80;
|
||||
break;
|
||||
case 16:
|
||||
/* {3}16,byte */
|
||||
state->grammarStack[state->stackIndex] = 134;
|
||||
break;
|
||||
case 17:
|
||||
/* {3}17,date */
|
||||
state->grammarStack[state->stackIndex] = 133;
|
||||
break;
|
||||
case 18:
|
||||
/* {3}18,dateTime */
|
||||
state->grammarStack[state->stackIndex] = 104;
|
||||
break;
|
||||
case 19:
|
||||
/* {3}19,decimal */
|
||||
state->grammarStack[state->stackIndex] = 53;
|
||||
break;
|
||||
case 20:
|
||||
/* {3}20,double */
|
||||
state->grammarStack[state->stackIndex] = 11;
|
||||
break;
|
||||
case 21:
|
||||
/* {3}21,duration */
|
||||
state->grammarStack[state->stackIndex] = 55;
|
||||
break;
|
||||
case 22:
|
||||
/* {3}22,float */
|
||||
state->grammarStack[state->stackIndex] = 130;
|
||||
break;
|
||||
case 23:
|
||||
/* {3}23,gDay */
|
||||
state->grammarStack[state->stackIndex] = 135;
|
||||
break;
|
||||
case 24:
|
||||
/* {3}24,gMonth */
|
||||
state->grammarStack[state->stackIndex] = 64;
|
||||
break;
|
||||
case 25:
|
||||
/* {3}25,gMonthDay */
|
||||
state->grammarStack[state->stackIndex] = 100;
|
||||
break;
|
||||
case 26:
|
||||
/* {3}26,gYear */
|
||||
state->grammarStack[state->stackIndex] = 99;
|
||||
break;
|
||||
case 27:
|
||||
/* {3}27,gYearMonth */
|
||||
state->grammarStack[state->stackIndex] = 74;
|
||||
break;
|
||||
case 28:
|
||||
/* {3}28,hexBinary */
|
||||
state->grammarStack[state->stackIndex] = 132;
|
||||
break;
|
||||
case 29:
|
||||
/* {3}29,int */
|
||||
state->grammarStack[state->stackIndex] = 76;
|
||||
break;
|
||||
case 30:
|
||||
/* {3}30,integer */
|
||||
state->grammarStack[state->stackIndex] = 138;
|
||||
break;
|
||||
case 31:
|
||||
/* {3}31,language */
|
||||
state->grammarStack[state->stackIndex] = 20;
|
||||
break;
|
||||
case 32:
|
||||
/* {3}32,long */
|
||||
state->grammarStack[state->stackIndex] = 93;
|
||||
break;
|
||||
case 33:
|
||||
/* {3}33,negativeInteger */
|
||||
state->grammarStack[state->stackIndex] = 89;
|
||||
break;
|
||||
case 34:
|
||||
/* {3}34,nonNegativeInteger */
|
||||
state->grammarStack[state->stackIndex] = 57;
|
||||
break;
|
||||
case 35:
|
||||
/* {3}35,nonPositiveInteger */
|
||||
state->grammarStack[state->stackIndex] = 69;
|
||||
break;
|
||||
case 36:
|
||||
/* {3}36,normalizedString */
|
||||
state->grammarStack[state->stackIndex] = 86;
|
||||
break;
|
||||
case 37:
|
||||
/* {3}37,positiveInteger */
|
||||
state->grammarStack[state->stackIndex] = 49;
|
||||
break;
|
||||
case 38:
|
||||
/* {3}38,short */
|
||||
state->grammarStack[state->stackIndex] = 68;
|
||||
break;
|
||||
case 39:
|
||||
/* {3}39,string */
|
||||
state->grammarStack[state->stackIndex] = 24;
|
||||
break;
|
||||
case 40:
|
||||
/* {3}40,time */
|
||||
state->grammarStack[state->stackIndex] = 112;
|
||||
break;
|
||||
case 41:
|
||||
/* {3}41,token */
|
||||
state->grammarStack[state->stackIndex] = 143;
|
||||
break;
|
||||
case 42:
|
||||
/* {3}42,unsignedByte */
|
||||
state->grammarStack[state->stackIndex] = 122;
|
||||
break;
|
||||
case 43:
|
||||
/* {3}43,unsignedInt */
|
||||
state->grammarStack[state->stackIndex] = 102;
|
||||
break;
|
||||
case 44:
|
||||
/* {3}44,unsignedLong */
|
||||
state->grammarStack[state->stackIndex] = 21;
|
||||
break;
|
||||
case 45:
|
||||
/* {3}45,unsignedShort */
|
||||
state->grammarStack[state->stackIndex] = 7;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
switch(xsiType->localPart) {
|
||||
case 0:
|
||||
/* {4}0,AppProtocolType */
|
||||
state->grammarStack[state->stackIndex] = 5;
|
||||
break;
|
||||
case 1:
|
||||
/* {4}1,idType */
|
||||
state->grammarStack[state->stackIndex] = 45;
|
||||
break;
|
||||
case 2:
|
||||
/* {4}2,priorityType */
|
||||
state->grammarStack[state->stackIndex] = 43;
|
||||
break;
|
||||
case 3:
|
||||
/* {4}3,protocolNameType */
|
||||
state->grammarStack[state->stackIndex] = 58;
|
||||
break;
|
||||
case 4:
|
||||
/* {4}4,protocolNamespaceType */
|
||||
state->grammarStack[state->stackIndex] = 18;
|
||||
break;
|
||||
case 5:
|
||||
/* {4}5,responseCodeType */
|
||||
state->grammarStack[state->stackIndex] = 44;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int exi_appHand_RetrieveAndPushGlobalGrammar(exi_state_t* state, uint16_t qnameID) {
|
||||
int errn = EXI_ERROR_OUT_OF_RUNTIME_GRAMMAR_STACK;
|
||||
int16_t i;
|
||||
|
||||
/* schema-informed global element --> Stack ID */
|
||||
switch(qnameID) {
|
||||
case 65:
|
||||
return exi_appHand_PushStack(state, 15, 65);
|
||||
case 66:
|
||||
return exi_appHand_PushStack(state, 16, 66);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* retrieve existing grammar for qname if any available */
|
||||
for(i=0; i<state->numberOfRuntimeGrammars; i+=2) {
|
||||
if( state->runtimeGrammars[i].qnameID == qnameID ) {
|
||||
/* runtime grammar exists already */
|
||||
|
||||
/* push element stack */
|
||||
errn = exi_appHand_PushStack(state, ((i+1) * (-1)), qnameID);
|
||||
return errn;
|
||||
}
|
||||
}
|
||||
|
||||
/* create new runtime grammars if possible */
|
||||
if((state->numberOfRuntimeGrammars + 2) < (MAX_NUMBER_OF_RUNTIME_ELEMENTS * 2) ) {
|
||||
/* StartTagContent StackIds: -1, -3, -5, ... */
|
||||
state->runtimeGrammars[state->numberOfRuntimeGrammars].qnameID = qnameID;
|
||||
state->runtimeGrammars[state->numberOfRuntimeGrammars].numberOfProductions = 0;
|
||||
state->runtimeGrammars[state->numberOfRuntimeGrammars].hasXsiType = 0;
|
||||
state->runtimeGrammars[state->numberOfRuntimeGrammars].hasEE = 0;
|
||||
/* ElementContent StackIds: -2, -4, -6, ... */
|
||||
state->runtimeGrammars[state->numberOfRuntimeGrammars+1].qnameID = qnameID;
|
||||
state->runtimeGrammars[state->numberOfRuntimeGrammars+1].numberOfProductions = 1;
|
||||
state->runtimeGrammars[state->numberOfRuntimeGrammars+1].hasXsiType = 0;
|
||||
state->runtimeGrammars[state->numberOfRuntimeGrammars+1].hasEE = 1;
|
||||
|
||||
/* push element stack */
|
||||
errn = exi_appHand_PushStack(state, ((state->numberOfRuntimeGrammars+1) * (-1)), qnameID);
|
||||
|
||||
state->numberOfRuntimeGrammars+=2;
|
||||
}
|
||||
|
||||
return errn;
|
||||
}
|
||||
|
||||
#ifndef __GNUC__
|
||||
#pragma warning( disable : 4100 ) /* warning unreferenced parameter 'qnameID' */
|
||||
#endif /* __GNUC__ */
|
||||
int exi_appHand_LearnAttribute(exi_state_t* state, uint16_t qnameID, uint16_t uriID, uint16_t localID) {
|
||||
int errn = 0;
|
||||
int16_t currentID = state->grammarStack[state->stackIndex];
|
||||
int16_t runtimeID;
|
||||
|
||||
if (currentID < 0) {
|
||||
runtimeID = (currentID+1)*(-1);
|
||||
|
||||
if (uriID == 2 && localID == 1 ) {
|
||||
/* xsi:type: learned just once */
|
||||
if(!state->runtimeGrammars[runtimeID].hasXsiType) {
|
||||
/* hasXsiType stores production position PLUS 1 (one) */
|
||||
state->runtimeGrammars[runtimeID].hasXsiType = ++state->runtimeGrammars[runtimeID].numberOfProductions;
|
||||
}
|
||||
} else {
|
||||
/* increment production count */
|
||||
++state->runtimeGrammars[runtimeID].numberOfProductions;
|
||||
/* TODO store production information. Note: not necessary in restricted profile */
|
||||
}
|
||||
} else {
|
||||
/* schema-informed grammar do no evolve */
|
||||
}
|
||||
|
||||
return errn;
|
||||
}
|
||||
#ifndef __GNUC__
|
||||
#pragma warning( default : 4100 ) /* warning unreferenced parameter 'qnameID' */
|
||||
#endif /* __GNUC__ */
|
||||
|
||||
/*
|
||||
* RUNTIME RULES
|
||||
* each rule has 2 ids and counts backwards from -1, -2, ...
|
||||
* 1) StartTagContent (e.g., -1, -3, -5, ...)
|
||||
* 2) ElementContent (e.g., -2, -4, -6)
|
||||
*
|
||||
*/
|
||||
|
||||
int exi_appHand_IsStartContent(int16_t ruleID) {
|
||||
return (ruleID % 2 != 0);
|
||||
}
|
||||
|
||||
int exi_appHand_MoveToElementContentRule(exi_state_t* state) {
|
||||
int16_t currentID = state->grammarStack[state->stackIndex];
|
||||
switch (currentID) {
|
||||
case 100:
|
||||
/* FirstStartTag[CHARACTERS[DATETIME]] --> Element[CHARACTERS[DATETIME]] */
|
||||
state->grammarStack[state->stackIndex] = 139;
|
||||
return 0;
|
||||
case 143:
|
||||
/* FirstStartTag[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
state->grammarStack[state->stackIndex] = 40;
|
||||
return 0;
|
||||
case 86:
|
||||
/* FirstStartTag[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
state->grammarStack[state->stackIndex] = 38;
|
||||
return 0;
|
||||
case 134:
|
||||
/* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] --> Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
|
||||
state->grammarStack[state->stackIndex] = 56;
|
||||
return 0;
|
||||
case 24:
|
||||
/* FirstStartTag[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
state->grammarStack[state->stackIndex] = 118;
|
||||
return 0;
|
||||
case 132:
|
||||
/* FirstStartTag[CHARACTERS[BINARY_HEX]] --> Element[CHARACTERS[BINARY_HEX]] */
|
||||
state->grammarStack[state->stackIndex] = 28;
|
||||
return 0;
|
||||
case 98:
|
||||
/* FirstStartTag[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
state->grammarStack[state->stackIndex] = 131;
|
||||
return 0;
|
||||
case 133:
|
||||
/* FirstStartTag[CHARACTERS[DATETIME]] --> Element[CHARACTERS[DATETIME]] */
|
||||
state->grammarStack[state->stackIndex] = 121;
|
||||
return 0;
|
||||
case 89:
|
||||
/* FirstStartTag[CHARACTERS[INTEGER]] --> Element[CHARACTERS[INTEGER]] */
|
||||
state->grammarStack[state->stackIndex] = 107;
|
||||
return 0;
|
||||
case 78:
|
||||
/* FirstStartTag[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
state->grammarStack[state->stackIndex] = 137;
|
||||
return 0;
|
||||
case 101:
|
||||
/* FirstStartTag[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
state->grammarStack[state->stackIndex] = 70;
|
||||
return 0;
|
||||
case 50:
|
||||
/* FirstStartTag[ATTRIBUTE_GENERIC, START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] --> Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
|
||||
state->grammarStack[state->stackIndex] = 51;
|
||||
return 0;
|
||||
case 142:
|
||||
/* FirstStartTag[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
state->grammarStack[state->stackIndex] = 12;
|
||||
return 0;
|
||||
case 5:
|
||||
/* FirstStartTag[START_ELEMENT(ProtocolNamespace)] --> Element[START_ELEMENT(ProtocolNamespace)] */
|
||||
state->grammarStack[state->stackIndex] = 30;
|
||||
return 0;
|
||||
case 104:
|
||||
/* FirstStartTag[CHARACTERS[DATETIME]] --> Element[CHARACTERS[DATETIME]] */
|
||||
state->grammarStack[state->stackIndex] = 88;
|
||||
return 0;
|
||||
case 7:
|
||||
/* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] --> Element[CHARACTERS[UNSIGNED_INTEGER]] */
|
||||
state->grammarStack[state->stackIndex] = 119;
|
||||
return 0;
|
||||
case 16:
|
||||
/* FirstStartTag[START_ELEMENT(ResponseCode)] --> Element[START_ELEMENT(ResponseCode)] */
|
||||
state->grammarStack[state->stackIndex] = 117;
|
||||
return 0;
|
||||
case 53:
|
||||
/* FirstStartTag[CHARACTERS[DECIMAL]] --> Element[CHARACTERS[DECIMAL]] */
|
||||
state->grammarStack[state->stackIndex] = 116;
|
||||
return 0;
|
||||
case 106:
|
||||
/* FirstStartTag[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
state->grammarStack[state->stackIndex] = 67;
|
||||
return 0;
|
||||
case 44:
|
||||
/* FirstStartTag[CHARACTERS[ENUMERATION]] --> Element[CHARACTERS[ENUMERATION]] */
|
||||
state->grammarStack[state->stackIndex] = 71;
|
||||
return 0;
|
||||
case 93:
|
||||
/* FirstStartTag[CHARACTERS[INTEGER]] --> Element[CHARACTERS[INTEGER]] */
|
||||
state->grammarStack[state->stackIndex] = 47;
|
||||
return 0;
|
||||
case 135:
|
||||
/* FirstStartTag[CHARACTERS[DATETIME]] --> Element[CHARACTERS[DATETIME]] */
|
||||
state->grammarStack[state->stackIndex] = 63;
|
||||
return 0;
|
||||
case 64:
|
||||
/* FirstStartTag[CHARACTERS[DATETIME]] --> Element[CHARACTERS[DATETIME]] */
|
||||
state->grammarStack[state->stackIndex] = 82;
|
||||
return 0;
|
||||
case 29:
|
||||
/* FirstStartTag[CHARACTERS[LIST]] --> Element[CHARACTERS[LIST]] */
|
||||
state->grammarStack[state->stackIndex] = 140;
|
||||
return 0;
|
||||
case 1:
|
||||
/* Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] --> Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
|
||||
case 3:
|
||||
/* Element[START_ELEMENT(AppProtocol), END_ELEMENT] --> Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
|
||||
case 8:
|
||||
/* Element[START_ELEMENT(AppProtocol), END_ELEMENT] --> Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
|
||||
case 12:
|
||||
/* Element[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
case 13:
|
||||
/* DocContent[START_ELEMENT({urn:iso:15118:2:2010:AppProtocol}supportedAppProtocolReq), START_ELEMENT({urn:iso:15118:2:2010:AppProtocol}supportedAppProtocolRes), START_ELEMENT_GENERIC] --> DocContent[START_ELEMENT({urn:iso:15118:2:2010:AppProtocol}supportedAppProtocolReq), START_ELEMENT({urn:iso:15118:2:2010:AppProtocol}supportedAppProtocolRes), START_ELEMENT_GENERIC] */
|
||||
case 17:
|
||||
/* Element[CHARACTERS[INTEGER]] --> Element[CHARACTERS[INTEGER]] */
|
||||
case 19:
|
||||
/* Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] --> Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
|
||||
case 2:
|
||||
/* Element[END_ELEMENT] --> Element[END_ELEMENT] */
|
||||
case 26:
|
||||
/* Element[START_ELEMENT(AppProtocol), END_ELEMENT] --> Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
|
||||
case 0:
|
||||
/* Document[START_DOCUMENT] --> Document[START_DOCUMENT] */
|
||||
case 28:
|
||||
/* Element[CHARACTERS[BINARY_HEX]] --> Element[CHARACTERS[BINARY_HEX]] */
|
||||
case 30:
|
||||
/* Element[START_ELEMENT(ProtocolNamespace)] --> Element[START_ELEMENT(ProtocolNamespace)] */
|
||||
case 32:
|
||||
/* Element[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
case 33:
|
||||
/* Element[START_ELEMENT(VersionNumberMinor)] --> Element[START_ELEMENT(VersionNumberMinor)] */
|
||||
case 37:
|
||||
/* Element[CHARACTERS[BOOLEAN]] --> Element[CHARACTERS[BOOLEAN]] */
|
||||
case 39:
|
||||
/* Element[END_ELEMENT] --> Element[END_ELEMENT] */
|
||||
case 38:
|
||||
/* Element[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
case 40:
|
||||
/* Element[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
case 41:
|
||||
/* Element[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
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] --> 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] */
|
||||
case 47:
|
||||
/* Element[CHARACTERS[INTEGER]] --> Element[CHARACTERS[INTEGER]] */
|
||||
case 52:
|
||||
/* Element[CHARACTERS[BINARY_BASE64]] --> Element[CHARACTERS[BINARY_BASE64]] */
|
||||
case 54:
|
||||
/* Element[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
case 56:
|
||||
/* Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] --> Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
|
||||
case 59:
|
||||
/* Element[CHARACTERS[UNSIGNED_INTEGER]] --> Element[CHARACTERS[UNSIGNED_INTEGER]] */
|
||||
case 60:
|
||||
/* Element[START_ELEMENT(AppProtocol), END_ELEMENT] --> Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
|
||||
case 31:
|
||||
/* Element[START_ELEMENT(VersionNumberMajor)] --> Element[START_ELEMENT(VersionNumberMajor)] */
|
||||
case 62:
|
||||
/* Element[CHARACTERS[FLOAT]] --> Element[CHARACTERS[FLOAT]] */
|
||||
case 63:
|
||||
/* Element[CHARACTERS[DATETIME]] --> Element[CHARACTERS[DATETIME]] */
|
||||
case 65:
|
||||
/* Element[CHARACTERS[LIST]] --> Element[CHARACTERS[LIST]] */
|
||||
case 67:
|
||||
/* Element[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
case 70:
|
||||
/* Element[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
case 71:
|
||||
/* Element[CHARACTERS[ENUMERATION]] --> Element[CHARACTERS[ENUMERATION]] */
|
||||
case 72:
|
||||
/* Element[START_ELEMENT(AppProtocol), END_ELEMENT] --> Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
|
||||
case 75:
|
||||
/* Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] --> Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
|
||||
case 23:
|
||||
/* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] --> Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
|
||||
case 77:
|
||||
/* Element[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
case 81:
|
||||
/* Element[CHARACTERS[UNSIGNED_INTEGER]] --> Element[CHARACTERS[UNSIGNED_INTEGER]] */
|
||||
case 82:
|
||||
/* Element[CHARACTERS[DATETIME]] --> Element[CHARACTERS[DATETIME]] */
|
||||
case 83:
|
||||
/* Element[CHARACTERS[INTEGER]] --> Element[CHARACTERS[INTEGER]] */
|
||||
case 84:
|
||||
/* Element[CHARACTERS[DATETIME]] --> Element[CHARACTERS[DATETIME]] */
|
||||
case 85:
|
||||
/* Element[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
case 87:
|
||||
/* Element[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
case 88:
|
||||
/* Element[CHARACTERS[DATETIME]] --> Element[CHARACTERS[DATETIME]] */
|
||||
case 34:
|
||||
/* Element[START_ELEMENT(SchemaID)] --> Element[START_ELEMENT(SchemaID)] */
|
||||
case 9:
|
||||
/* Element[START_ELEMENT(AppProtocol), END_ELEMENT] --> Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
|
||||
case 91:
|
||||
/* Element[CHARACTERS[INTEGER]] --> Element[CHARACTERS[INTEGER]] */
|
||||
case 94:
|
||||
/* Element[START_ELEMENT(AppProtocol)] --> Element[START_ELEMENT(AppProtocol)] */
|
||||
case 95:
|
||||
/* Element[CHARACTERS[LIST]] --> Element[CHARACTERS[LIST]] */
|
||||
case 96:
|
||||
/* Element[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
case 97:
|
||||
/* Element[START_ELEMENT(AppProtocol), END_ELEMENT] --> Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
|
||||
case 6:
|
||||
/* Element[] --> Element[] */
|
||||
case 103:
|
||||
/* Element[CHARACTERS[FLOAT]] --> Element[CHARACTERS[FLOAT]] */
|
||||
case 105:
|
||||
/* Fragment[START_DOCUMENT] --> Fragment[START_DOCUMENT] */
|
||||
case 107:
|
||||
/* Element[CHARACTERS[INTEGER]] --> Element[CHARACTERS[INTEGER]] */
|
||||
case 109:
|
||||
/* Element[START_ELEMENT(AppProtocol), END_ELEMENT] --> Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
|
||||
case 108:
|
||||
/* Element[CHARACTERS[UNSIGNED_INTEGER]] --> Element[CHARACTERS[UNSIGNED_INTEGER]] */
|
||||
case 92:
|
||||
/* Element[START_ELEMENT(AppProtocol), END_ELEMENT] --> Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
|
||||
case 114:
|
||||
/* Element[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
case 115:
|
||||
/* Element[START_ELEMENT(AppProtocol), END_ELEMENT] --> Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
|
||||
case 116:
|
||||
/* Element[CHARACTERS[DECIMAL]] --> Element[CHARACTERS[DECIMAL]] */
|
||||
case 117:
|
||||
/* Element[START_ELEMENT(ResponseCode)] --> Element[START_ELEMENT(ResponseCode)] */
|
||||
case 118:
|
||||
/* Element[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
case 119:
|
||||
/* Element[CHARACTERS[UNSIGNED_INTEGER]] --> Element[CHARACTERS[UNSIGNED_INTEGER]] */
|
||||
case 120:
|
||||
/* Element[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
case 121:
|
||||
/* Element[CHARACTERS[DATETIME]] --> Element[CHARACTERS[DATETIME]] */
|
||||
case 124:
|
||||
/* Element[START_ELEMENT(AppProtocol), END_ELEMENT] --> Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
|
||||
case 123:
|
||||
/* Element[CHARACTERS[DATETIME]] --> Element[CHARACTERS[DATETIME]] */
|
||||
case 27:
|
||||
/* Element[START_ELEMENT(AppProtocol), END_ELEMENT] --> Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
|
||||
case 126:
|
||||
/* Element[CHARACTERS[DATETIME]] --> Element[CHARACTERS[DATETIME]] */
|
||||
case 90:
|
||||
/* Element[START_ELEMENT(Priority)] --> Element[START_ELEMENT(Priority)] */
|
||||
case 51:
|
||||
/* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] --> Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
|
||||
case 128:
|
||||
/* Element[START_ELEMENT(AppProtocol), END_ELEMENT] --> Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
|
||||
case 66:
|
||||
/* Element[START_ELEMENT(SchemaID), END_ELEMENT] --> Element[START_ELEMENT(SchemaID), END_ELEMENT] */
|
||||
case 131:
|
||||
/* Element[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
case 110:
|
||||
/* Element[START_ELEMENT(AppProtocol), END_ELEMENT] --> Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
|
||||
case 61:
|
||||
/* Element[START_ELEMENT(AppProtocol), END_ELEMENT] --> Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
|
||||
case 127:
|
||||
/* Element[END_ELEMENT] --> Element[END_ELEMENT] */
|
||||
case 14:
|
||||
/* DocEnd[END_DOCUMENT] --> DocEnd[END_DOCUMENT] */
|
||||
case 136:
|
||||
/* Element[CHARACTERS[INTEGER]] --> Element[CHARACTERS[INTEGER]] */
|
||||
case 113:
|
||||
/* Element[START_ELEMENT(AppProtocol), END_ELEMENT] --> Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
|
||||
case 4:
|
||||
/* Element[START_ELEMENT(AppProtocol), END_ELEMENT] --> Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
|
||||
case 137:
|
||||
/* Element[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
case 125:
|
||||
/* Element[START_ELEMENT(AppProtocol), END_ELEMENT] --> Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
|
||||
case 140:
|
||||
/* Element[CHARACTERS[LIST]] --> Element[CHARACTERS[LIST]] */
|
||||
case 139:
|
||||
/* Element[CHARACTERS[DATETIME]] --> Element[CHARACTERS[DATETIME]] */
|
||||
case 145:
|
||||
/* Element[CHARACTERS[UNSIGNED_INTEGER]] --> Element[CHARACTERS[UNSIGNED_INTEGER]] */
|
||||
case 129:
|
||||
/* Element[END_ELEMENT] --> Element[END_ELEMENT] */
|
||||
case 73:
|
||||
/* Element[START_ELEMENT(AppProtocol), END_ELEMENT] --> Element[START_ELEMENT(AppProtocol), END_ELEMENT] */
|
||||
return 0;
|
||||
case 68:
|
||||
/* FirstStartTag[CHARACTERS[INTEGER]] --> Element[CHARACTERS[INTEGER]] */
|
||||
state->grammarStack[state->stackIndex] = 136;
|
||||
return 0;
|
||||
case 79:
|
||||
/* FirstStartTag[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
state->grammarStack[state->stackIndex] = 54;
|
||||
return 0;
|
||||
case 43:
|
||||
/* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] --> Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
|
||||
state->grammarStack[state->stackIndex] = 19;
|
||||
return 0;
|
||||
case 49:
|
||||
/* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] --> Element[CHARACTERS[UNSIGNED_INTEGER]] */
|
||||
state->grammarStack[state->stackIndex] = 59;
|
||||
return 0;
|
||||
case 111:
|
||||
/* FirstStartTag[CHARACTERS[BINARY_BASE64]] --> Element[CHARACTERS[BINARY_BASE64]] */
|
||||
state->grammarStack[state->stackIndex] = 52;
|
||||
return 0;
|
||||
case 11:
|
||||
/* FirstStartTag[CHARACTERS[FLOAT]] --> Element[CHARACTERS[FLOAT]] */
|
||||
state->grammarStack[state->stackIndex] = 62;
|
||||
return 0;
|
||||
case 21:
|
||||
/* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] --> Element[CHARACTERS[UNSIGNED_INTEGER]] */
|
||||
state->grammarStack[state->stackIndex] = 108;
|
||||
return 0;
|
||||
case 25:
|
||||
/* FirstStartTag[CHARACTERS[LIST]] --> Element[CHARACTERS[LIST]] */
|
||||
state->grammarStack[state->stackIndex] = 95;
|
||||
return 0;
|
||||
case 112:
|
||||
/* FirstStartTag[CHARACTERS[DATETIME]] --> Element[CHARACTERS[DATETIME]] */
|
||||
state->grammarStack[state->stackIndex] = 126;
|
||||
return 0;
|
||||
case 57:
|
||||
/* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] --> Element[CHARACTERS[UNSIGNED_INTEGER]] */
|
||||
state->grammarStack[state->stackIndex] = 145;
|
||||
return 0;
|
||||
case 22:
|
||||
/* FirstStartTag[ATTRIBUTE_GENERIC, START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] --> Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
|
||||
state->grammarStack[state->stackIndex] = 23;
|
||||
return 0;
|
||||
case 45:
|
||||
/* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] --> Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
|
||||
state->grammarStack[state->stackIndex] = 75;
|
||||
return 0;
|
||||
case 15:
|
||||
/* FirstStartTag[START_ELEMENT(AppProtocol)] --> Element[START_ELEMENT(AppProtocol)] */
|
||||
state->grammarStack[state->stackIndex] = 94;
|
||||
return 0;
|
||||
case 76:
|
||||
/* FirstStartTag[CHARACTERS[INTEGER]] --> Element[CHARACTERS[INTEGER]] */
|
||||
state->grammarStack[state->stackIndex] = 83;
|
||||
return 0;
|
||||
case 138:
|
||||
/* FirstStartTag[CHARACTERS[INTEGER]] --> Element[CHARACTERS[INTEGER]] */
|
||||
state->grammarStack[state->stackIndex] = 91;
|
||||
return 0;
|
||||
case 122:
|
||||
/* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] --> Element[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
|
||||
state->grammarStack[state->stackIndex] = 1;
|
||||
return 0;
|
||||
case 48:
|
||||
/* FirstStartTag[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
state->grammarStack[state->stackIndex] = 96;
|
||||
return 0;
|
||||
case 80:
|
||||
/* FirstStartTag[CHARACTERS[BOOLEAN]] --> Element[CHARACTERS[BOOLEAN]] */
|
||||
state->grammarStack[state->stackIndex] = 37;
|
||||
return 0;
|
||||
case 55:
|
||||
/* FirstStartTag[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
state->grammarStack[state->stackIndex] = 41;
|
||||
return 0;
|
||||
case 10:
|
||||
/* FirstStartTag[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
state->grammarStack[state->stackIndex] = 87;
|
||||
return 0;
|
||||
case 20:
|
||||
/* FirstStartTag[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
state->grammarStack[state->stackIndex] = 32;
|
||||
return 0;
|
||||
case 36:
|
||||
/* FirstStartTag[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
state->grammarStack[state->stackIndex] = 120;
|
||||
return 0;
|
||||
case 130:
|
||||
/* FirstStartTag[CHARACTERS[FLOAT]] --> Element[CHARACTERS[FLOAT]] */
|
||||
state->grammarStack[state->stackIndex] = 103;
|
||||
return 0;
|
||||
case 141:
|
||||
/* FirstStartTag[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
state->grammarStack[state->stackIndex] = 114;
|
||||
return 0;
|
||||
case 144:
|
||||
/* FirstStartTag[CHARACTERS[LIST]] --> Element[CHARACTERS[LIST]] */
|
||||
state->grammarStack[state->stackIndex] = 65;
|
||||
return 0;
|
||||
case 58:
|
||||
/* FirstStartTag[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
state->grammarStack[state->stackIndex] = 85;
|
||||
return 0;
|
||||
case 69:
|
||||
/* FirstStartTag[CHARACTERS[INTEGER]] --> Element[CHARACTERS[INTEGER]] */
|
||||
state->grammarStack[state->stackIndex] = 17;
|
||||
return 0;
|
||||
case 46:
|
||||
/* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] --> Element[CHARACTERS[UNSIGNED_INTEGER]] */
|
||||
case 35:
|
||||
/* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] --> Element[CHARACTERS[UNSIGNED_INTEGER]] */
|
||||
case 102:
|
||||
/* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] --> Element[CHARACTERS[UNSIGNED_INTEGER]] */
|
||||
state->grammarStack[state->stackIndex] = 81;
|
||||
return 0;
|
||||
case 74:
|
||||
/* FirstStartTag[CHARACTERS[DATETIME]] --> Element[CHARACTERS[DATETIME]] */
|
||||
state->grammarStack[state->stackIndex] = 123;
|
||||
return 0;
|
||||
case 99:
|
||||
/* FirstStartTag[CHARACTERS[DATETIME]] --> Element[CHARACTERS[DATETIME]] */
|
||||
state->grammarStack[state->stackIndex] = 84;
|
||||
return 0;
|
||||
case 18:
|
||||
/* FirstStartTag[CHARACTERS[STRING]] --> Element[CHARACTERS[STRING]] */
|
||||
state->grammarStack[state->stackIndex] = 77;
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
if (currentID < 0) {
|
||||
if( exi_appHand_IsStartContent(currentID) ) {
|
||||
state->grammarStack[state->stackIndex] = currentID - 1;
|
||||
}
|
||||
} else {
|
||||
return EXI_ERROR_UNEXPECTED_ATTRIBUTE_MOVE_TO_CONTENT_RULE;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
70
src/codec/appHandCodec/appHandEXICoder.h
Normal file
70
src/codec/appHandCodec/appHandEXICoder.h
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
||||
|
2219
src/codec/appHandCodec/appHandEXIDecoder.c
Normal file
2219
src/codec/appHandCodec/appHandEXIDecoder.c
Normal file
File diff suppressed because it is too large
Load diff
222
src/codec/appHandCodec/appHandEXIDecoder.h
Normal file
222
src/codec/appHandCodec/appHandEXIDecoder.h
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
||||
|
File diff suppressed because it is too large
Load diff
271
src/codec/appHandCodec/appHandEXIEncoder.h
Normal file
271
src/codec/appHandCodec/appHandEXIEncoder.h
Normal file
|
@ -0,0 +1,271 @@
|
|||
/*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
||||
|
98
src/codec/appHandCodec/appHandNameTableEntries.c
Normal file
98
src/codec/appHandCodec/appHandNameTableEntries.c
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef EXI_appHand_NAME_TABLE_ENTRIES_C
|
||||
#define EXI_appHand_NAME_TABLE_ENTRIES_C
|
||||
|
||||
#include "appHandNameTableEntries.h"
|
||||
|
||||
|
||||
|
||||
/* ==================================== */
|
||||
/* String Table Population */
|
||||
|
||||
/* localName entries for URI '', id = 0 */
|
||||
/*
|
||||
"AppProtocol", "Priority", "ProtocolNamespace", "ResponseCode", "SchemaID",
|
||||
"VersionNumberMajor", "VersionNumberMinor"
|
||||
*/
|
||||
|
||||
/* localName entries for URI 'http://www.w3.org/XML/1998/namespace', id = 1 */
|
||||
/*
|
||||
"base", "id", "lang", "space"
|
||||
*/
|
||||
|
||||
/* localName entries for URI 'http://www.w3.org/2001/XMLSchema-instance', id = 2 */
|
||||
/*
|
||||
"nil", "type"
|
||||
*/
|
||||
|
||||
/* localName entries for URI 'http://www.w3.org/2001/XMLSchema', id = 3 */
|
||||
/*
|
||||
"ENTITIES", "ENTITY", "ID", "IDREF", "IDREFS",
|
||||
"NCName", "NMTOKEN", "NMTOKENS", "NOTATION", "Name",
|
||||
"QName", "anySimpleType", "anyType", "anyURI", "base64Binary",
|
||||
"boolean", "byte", "date", "dateTime", "decimal",
|
||||
"double", "duration", "float", "gDay", "gMonth",
|
||||
"gMonthDay", "gYear", "gYearMonth", "hexBinary", "int",
|
||||
"integer", "language", "long", "negativeInteger", "nonNegativeInteger",
|
||||
"nonPositiveInteger", "normalizedString", "positiveInteger", "short", "string",
|
||||
"time", "token", "unsignedByte", "unsignedInt", "unsignedLong",
|
||||
"unsignedShort"
|
||||
*/
|
||||
|
||||
/* localName entries for URI 'urn:iso:15118:2:2010:AppProtocol', id = 4 */
|
||||
/*
|
||||
"AppProtocolType", "idType", "priorityType", "protocolNameType", "protocolNamespaceType",
|
||||
"responseCodeType", "supportedAppProtocolReq", "supportedAppProtocolRes"
|
||||
*/
|
||||
|
||||
|
||||
/* number of local-name entries per URI */
|
||||
static uint16_t localNames[5] = {
|
||||
/* '' */
|
||||
7,
|
||||
/* 'http://www.w3.org/XML/1998/namespace' */
|
||||
4,
|
||||
/* 'http://www.w3.org/2001/XMLSchema-instance' */
|
||||
2,
|
||||
/* 'http://www.w3.org/2001/XMLSchema' */
|
||||
46,
|
||||
/* 'urn:iso:15118:2:2010:AppProtocol' */
|
||||
8
|
||||
};
|
||||
|
||||
|
||||
exi_name_table_prepopulated_t exiappHandNameTablePrepopulated = { 5, localNames };
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
|
@ -19,10 +19,10 @@
|
|||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.6
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer</p>
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
51
src/codec/appHandCodec/appHandQNameDefines.h
Normal file
51
src/codec/appHandCodec/appHandQNameDefines.h
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
223
src/codec/appHandCodec/appHandQNames.c
Normal file
223
src/codec/appHandCodec/appHandQNames.c
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifndef EXI_appHand_QNAMES_C
|
||||
#define EXI_appHand_QNAMES_C
|
||||
|
||||
#include "EXITypes.h"
|
||||
#include "ErrorCodes.h"
|
||||
#include "appHandQNameDefines.h"
|
||||
|
||||
/* qname is a composition of namespaceURI(ID) and localPart(ID) */
|
||||
static exi_eqname_t qnames[EXI_appHandMAX_NUMBER_OF_QNAMES] = {
|
||||
/* qnameID == 0: AppProtocol */
|
||||
{0, 0},
|
||||
/* qnameID == 1: Priority */
|
||||
{0, 1},
|
||||
/* qnameID == 2: ProtocolNamespace */
|
||||
{0, 2},
|
||||
/* qnameID == 3: ResponseCode */
|
||||
{0, 3},
|
||||
/* qnameID == 4: SchemaID */
|
||||
{0, 4},
|
||||
/* qnameID == 5: VersionNumberMajor */
|
||||
{0, 5},
|
||||
/* qnameID == 6: VersionNumberMinor */
|
||||
{0, 6},
|
||||
/* qnameID == 7: {http://www.w3.org/XML/1998/namespace}base */
|
||||
{1, 0},
|
||||
/* qnameID == 8: {http://www.w3.org/XML/1998/namespace}id */
|
||||
{1, 1},
|
||||
/* qnameID == 9: {http://www.w3.org/XML/1998/namespace}lang */
|
||||
{1, 2},
|
||||
/* qnameID == 10: {http://www.w3.org/XML/1998/namespace}space */
|
||||
{1, 3},
|
||||
/* qnameID == 11: {http://www.w3.org/2001/XMLSchema-instance}nil */
|
||||
{2, 0},
|
||||
/* qnameID == 12: {http://www.w3.org/2001/XMLSchema-instance}type */
|
||||
{2, 1},
|
||||
/* qnameID == 13: {http://www.w3.org/2001/XMLSchema}ENTITIES */
|
||||
{3, 0},
|
||||
/* qnameID == 14: {http://www.w3.org/2001/XMLSchema}ENTITY */
|
||||
{3, 1},
|
||||
/* qnameID == 15: {http://www.w3.org/2001/XMLSchema}ID */
|
||||
{3, 2},
|
||||
/* qnameID == 16: {http://www.w3.org/2001/XMLSchema}IDREF */
|
||||
{3, 3},
|
||||
/* qnameID == 17: {http://www.w3.org/2001/XMLSchema}IDREFS */
|
||||
{3, 4},
|
||||
/* qnameID == 18: {http://www.w3.org/2001/XMLSchema}NCName */
|
||||
{3, 5},
|
||||
/* qnameID == 19: {http://www.w3.org/2001/XMLSchema}NMTOKEN */
|
||||
{3, 6},
|
||||
/* qnameID == 20: {http://www.w3.org/2001/XMLSchema}NMTOKENS */
|
||||
{3, 7},
|
||||
/* qnameID == 21: {http://www.w3.org/2001/XMLSchema}NOTATION */
|
||||
{3, 8},
|
||||
/* qnameID == 22: {http://www.w3.org/2001/XMLSchema}Name */
|
||||
{3, 9},
|
||||
/* qnameID == 23: {http://www.w3.org/2001/XMLSchema}QName */
|
||||
{3, 10},
|
||||
/* qnameID == 24: {http://www.w3.org/2001/XMLSchema}anySimpleType */
|
||||
{3, 11},
|
||||
/* qnameID == 25: {http://www.w3.org/2001/XMLSchema}anyType */
|
||||
{3, 12},
|
||||
/* qnameID == 26: {http://www.w3.org/2001/XMLSchema}anyURI */
|
||||
{3, 13},
|
||||
/* qnameID == 27: {http://www.w3.org/2001/XMLSchema}base64Binary */
|
||||
{3, 14},
|
||||
/* qnameID == 28: {http://www.w3.org/2001/XMLSchema}boolean */
|
||||
{3, 15},
|
||||
/* qnameID == 29: {http://www.w3.org/2001/XMLSchema}byte */
|
||||
{3, 16},
|
||||
/* qnameID == 30: {http://www.w3.org/2001/XMLSchema}date */
|
||||
{3, 17},
|
||||
/* qnameID == 31: {http://www.w3.org/2001/XMLSchema}dateTime */
|
||||
{3, 18},
|
||||
/* qnameID == 32: {http://www.w3.org/2001/XMLSchema}decimal */
|
||||
{3, 19},
|
||||
/* qnameID == 33: {http://www.w3.org/2001/XMLSchema}double */
|
||||
{3, 20},
|
||||
/* qnameID == 34: {http://www.w3.org/2001/XMLSchema}duration */
|
||||
{3, 21},
|
||||
/* qnameID == 35: {http://www.w3.org/2001/XMLSchema}float */
|
||||
{3, 22},
|
||||
/* qnameID == 36: {http://www.w3.org/2001/XMLSchema}gDay */
|
||||
{3, 23},
|
||||
/* qnameID == 37: {http://www.w3.org/2001/XMLSchema}gMonth */
|
||||
{3, 24},
|
||||
/* qnameID == 38: {http://www.w3.org/2001/XMLSchema}gMonthDay */
|
||||
{3, 25},
|
||||
/* qnameID == 39: {http://www.w3.org/2001/XMLSchema}gYear */
|
||||
{3, 26},
|
||||
/* qnameID == 40: {http://www.w3.org/2001/XMLSchema}gYearMonth */
|
||||
{3, 27},
|
||||
/* qnameID == 41: {http://www.w3.org/2001/XMLSchema}hexBinary */
|
||||
{3, 28},
|
||||
/* qnameID == 42: {http://www.w3.org/2001/XMLSchema}int */
|
||||
{3, 29},
|
||||
/* qnameID == 43: {http://www.w3.org/2001/XMLSchema}integer */
|
||||
{3, 30},
|
||||
/* qnameID == 44: {http://www.w3.org/2001/XMLSchema}language */
|
||||
{3, 31},
|
||||
/* qnameID == 45: {http://www.w3.org/2001/XMLSchema}long */
|
||||
{3, 32},
|
||||
/* qnameID == 46: {http://www.w3.org/2001/XMLSchema}negativeInteger */
|
||||
{3, 33},
|
||||
/* qnameID == 47: {http://www.w3.org/2001/XMLSchema}nonNegativeInteger */
|
||||
{3, 34},
|
||||
/* qnameID == 48: {http://www.w3.org/2001/XMLSchema}nonPositiveInteger */
|
||||
{3, 35},
|
||||
/* qnameID == 49: {http://www.w3.org/2001/XMLSchema}normalizedString */
|
||||
{3, 36},
|
||||
/* qnameID == 50: {http://www.w3.org/2001/XMLSchema}positiveInteger */
|
||||
{3, 37},
|
||||
/* qnameID == 51: {http://www.w3.org/2001/XMLSchema}short */
|
||||
{3, 38},
|
||||
/* qnameID == 52: {http://www.w3.org/2001/XMLSchema}string */
|
||||
{3, 39},
|
||||
/* qnameID == 53: {http://www.w3.org/2001/XMLSchema}time */
|
||||
{3, 40},
|
||||
/* qnameID == 54: {http://www.w3.org/2001/XMLSchema}token */
|
||||
{3, 41},
|
||||
/* qnameID == 55: {http://www.w3.org/2001/XMLSchema}unsignedByte */
|
||||
{3, 42},
|
||||
/* qnameID == 56: {http://www.w3.org/2001/XMLSchema}unsignedInt */
|
||||
{3, 43},
|
||||
/* qnameID == 57: {http://www.w3.org/2001/XMLSchema}unsignedLong */
|
||||
{3, 44},
|
||||
/* qnameID == 58: {http://www.w3.org/2001/XMLSchema}unsignedShort */
|
||||
{3, 45},
|
||||
/* qnameID == 59: {urn:iso:15118:2:2010:AppProtocol}AppProtocolType */
|
||||
{4, 0},
|
||||
/* qnameID == 60: {urn:iso:15118:2:2010:AppProtocol}idType */
|
||||
{4, 1},
|
||||
/* qnameID == 61: {urn:iso:15118:2:2010:AppProtocol}priorityType */
|
||||
{4, 2},
|
||||
/* qnameID == 62: {urn:iso:15118:2:2010:AppProtocol}protocolNameType */
|
||||
{4, 3},
|
||||
/* qnameID == 63: {urn:iso:15118:2:2010:AppProtocol}protocolNamespaceType */
|
||||
{4, 4},
|
||||
/* qnameID == 64: {urn:iso:15118:2:2010:AppProtocol}responseCodeType */
|
||||
{4, 5},
|
||||
/* qnameID == 65: {urn:iso:15118:2:2010:AppProtocol}supportedAppProtocolReq */
|
||||
{4, 6},
|
||||
/* qnameID == 66: {urn:iso:15118:2:2010:AppProtocol}supportedAppProtocolRes */
|
||||
{4, 7}
|
||||
|
||||
};
|
||||
|
||||
|
||||
int exiappHandGetEQName(exi_state_t* state, uint16_t qnameID, uint16_t* namespaceURI, uint16_t* localPart) {
|
||||
int errn = 0;
|
||||
/* EXI_appHandNUMBER_OF_QNAMES */
|
||||
if (qnameID < state->nextQNameID) {
|
||||
*namespaceURI = qnames[qnameID].namespaceURI;
|
||||
*localPart = qnames[qnameID].localPart;
|
||||
} else {
|
||||
errn = EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
return errn;
|
||||
}
|
||||
|
||||
|
||||
int exiappHandGetQNameID(exi_state_t* state, uint16_t namespaceURI, uint16_t localPart, uint16_t* qnameID) {
|
||||
uint16_t i;
|
||||
/* TODO Do something more efficient than just walk over the entire list */
|
||||
/* EXI_appHandNUMBER_OF_QNAMES */
|
||||
for(i=0; i<state->nextQNameID; i++) {
|
||||
if(qnames[i].localPart == localPart && qnames[i].namespaceURI == namespaceURI) {
|
||||
*qnameID = i;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
|
||||
|
||||
int exiappHandAddEQName(exi_state_t* state, uint16_t* qnameID, uint16_t namespaceURI, uint16_t localPart) {
|
||||
int errn = 0;
|
||||
if(state->nextQNameID < (EXI_appHandMAX_NUMBER_OF_QNAMES -1)) {
|
||||
/* store IDs */
|
||||
qnames[state->nextQNameID].namespaceURI = namespaceURI;
|
||||
qnames[state->nextQNameID].localPart = localPart;
|
||||
/* increment counter */
|
||||
*qnameID = state->nextQNameID++;
|
||||
} else {
|
||||
errn = EXI_ERROR_OUT_OF_BOUNDS;
|
||||
}
|
||||
|
||||
|
||||
return errn;
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
74
src/codec/appHandCodec/appHandQNames.h
Normal file
74
src/codec/appHandCodec/appHandQNames.h
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
||||
|
File diff suppressed because it is too large
Load diff
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.6
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
||||
|
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.6
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef EXI_appHand_ENCODER_H
|
||||
#define EXI_appHand_ENCODER_H
|
||||
|
||||
#include "EXITypes.h"
|
||||
|
||||
int exiappHandInitEncoder(bitstream_t* stream, exi_state_t* state,
|
||||
exi_name_table_runtime_t runtimeTable);
|
||||
|
||||
int exiappHandEncodeStartDocument(bitstream_t* stream,
|
||||
exi_state_t* state);
|
||||
|
||||
int exiappHandEncodeEndDocument(bitstream_t* stream,
|
||||
exi_state_t* state);
|
||||
|
||||
int
|
||||
exiappHandEncodeStartElement(bitstream_t* stream,
|
||||
exi_state_t* state, eqname_t* se);
|
||||
|
||||
int exiappHandEncodeStartElementGeneric(bitstream_t* stream,
|
||||
exi_state_t* state, string_ascii_t* namespaceURI,
|
||||
string_ascii_t* localName);
|
||||
|
||||
int exiappHandEncodeEndElement(bitstream_t* stream,
|
||||
exi_state_t* state);
|
||||
|
||||
int exiappHandEncodeCharacters(bitstream_t* stream,
|
||||
exi_state_t* state, exi_value_t* val);
|
||||
|
||||
int exiappHandEncodeAttribute(bitstream_t* stream,
|
||||
exi_state_t* state, eqname_t* at, exi_value_t* val);
|
||||
|
||||
int exiappHandEncodeAttributeXsiNil(bitstream_t* stream,
|
||||
exi_state_t* state, exi_value_t* val);
|
||||
|
||||
int exiappHandEncodeAttributeXsiType(bitstream_t* stream,
|
||||
exi_state_t* state, exi_value_t* val);
|
||||
|
||||
int exiappHandEncodeListValue(bitstream_t* stream, exi_value_t* val,
|
||||
list_t lt);
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
/*******************************************************************
|
||||
*
|
||||
* @author Sebastian.Kaebisch.EXT@siemens.com
|
||||
* @version 0.6
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXISeGen</p>
|
||||
|
@ -28,7 +28,7 @@
|
|||
|
||||
|
||||
#include "EXITypes.h"
|
||||
#include "v2g_serviceDataTypes.h"
|
||||
#include "v2g_dataTypes.h"
|
||||
|
||||
|
||||
static void init_sessionIDType(struct sessionIDType* type)
|
||||
|
@ -95,24 +95,18 @@ static void init_ReferenceType(struct ReferenceType* type)
|
|||
|
||||
static void init_SignedInfoType(struct SignedInfoType* type)
|
||||
{
|
||||
int i_loop;
|
||||
|
||||
init_service_string(&(type->attr_Id));
|
||||
type->isused.attr_Id=0;
|
||||
init_CanonicalizationMethodType(&(type->CanonicalizationMethod));
|
||||
init_SignatureMethodType(&(type->SignatureMethod));
|
||||
for(i_loop=0; i_loop<1;i_loop++)
|
||||
{
|
||||
init_ReferenceType(&(type->Reference[i_loop]));
|
||||
}
|
||||
init_ReferenceType(&(type->Reference[0]));
|
||||
|
||||
type->arraylen.Reference=0;
|
||||
|
||||
}
|
||||
|
||||
static void init_SignatureValueType(struct SignatureValueType* type)
|
||||
{
|
||||
|
||||
type->arraylen.data=0;
|
||||
|
||||
}
|
||||
|
||||
|
@ -208,7 +202,6 @@ static void init_ServiceDiscoveryReqType(struct ServiceDiscoveryReqType* type)
|
|||
static void init_PaymentOptionsType(struct PaymentOptionsType* type)
|
||||
{
|
||||
|
||||
|
||||
type->arraylen.PaymentOption=0;
|
||||
|
||||
}
|
||||
|
@ -223,7 +216,6 @@ static void init_ServiceTagType(struct ServiceTagType* type)
|
|||
{
|
||||
init_serviceNameType(&(type->ServiceName));
|
||||
type->isused.ServiceName=0;
|
||||
type->isused.ServiceCategory=0;
|
||||
init_serviceScopeType(&(type->ServiceScope));
|
||||
type->isused.ServiceScope=0;
|
||||
|
||||
|
@ -245,7 +237,7 @@ static void init_ServiceTagListType(struct ServiceTagListType* type)
|
|||
{
|
||||
int i_loop;
|
||||
|
||||
for(i_loop=0; i_loop<2;i_loop++)
|
||||
for(i_loop=0; i_loop<3;i_loop++)
|
||||
{
|
||||
init_ServiceType(&(type->Service[i_loop]));
|
||||
}
|
||||
|
@ -254,7 +246,7 @@ static void init_ServiceTagListType(struct ServiceTagListType* type)
|
|||
|
||||
}
|
||||
|
||||
static void init_ServiceDiscoveryResType(struct ServiceDiscoveryResType* type)
|
||||
static void init_ServiceDiscoveryResType(struct ServiceDiscoveryResType* type)
|
||||
{
|
||||
init_PaymentOptionsType(&(type->PaymentOptions));
|
||||
init_ServiceChargeType(&(type->ChargeService));
|
||||
|
@ -352,7 +344,7 @@ static void init_SubCertificatesType(struct SubCertificatesType* type)
|
|||
{
|
||||
int i_loop;
|
||||
|
||||
for(i_loop=0; i_loop<2;i_loop++)
|
||||
for(i_loop=0; i_loop<4;i_loop++)
|
||||
{
|
||||
init_certificateType(&(type->Certificate[i_loop]));
|
||||
}
|
||||
|
@ -391,7 +383,9 @@ static void init_PaymentDetailsResType(struct PaymentDetailsResType* type)
|
|||
static void init_ContractAuthenticationReqType(struct ContractAuthenticationReqType* type)
|
||||
{
|
||||
init_service_string(&(type->attr_Id));
|
||||
type->isused.attr_Id=0;
|
||||
init_genChallengeType(&(type->GenChallenge));
|
||||
type->isused.GenChallenge=0;
|
||||
|
||||
}
|
||||
|
||||
|
@ -507,7 +501,7 @@ static void init_SalesTariffType(struct SalesTariffType* type)
|
|||
init_service_string(&(type->attr_Id));
|
||||
init_tariffDescriptionType(&(type->SalesTariffDescription));
|
||||
type->isused.SalesTariffDescription=0;
|
||||
for(i_loop=0; i_loop<2;i_loop++)
|
||||
for(i_loop=0; i_loop<12;i_loop++)
|
||||
{
|
||||
init_SalesTariffEntryType(&(type->SalesTariffEntry[i_loop]));
|
||||
}
|
||||
|
@ -569,7 +563,7 @@ static void init_DC_EVSEChargeParameterType(struct DC_EVSEChargeParameterType*
|
|||
|
||||
static void init_ChargeParameterDiscoveryResType(struct ChargeParameterDiscoveryResType* type)
|
||||
{
|
||||
type->isused.SAScheduleList=0;
|
||||
init_SAScheduleListType(&(type->SAScheduleList));
|
||||
type->isused.AC_EVSEChargeParameter=0;
|
||||
type->isused.DC_EVSEChargeParameter=0;
|
||||
|
||||
|
@ -631,7 +625,6 @@ static void init_MeterInfoType(struct MeterInfoType* type)
|
|||
static void init_ChargingStatusResType(struct ChargingStatusResType* type)
|
||||
{
|
||||
init_evseIDType(&(type->EVSEID));
|
||||
type->isused.SAScheduleTupleID=0;
|
||||
init_PhysicalValueType(&(type->EVSEMaxCurrent));
|
||||
type->isused.EVSEMaxCurrent=0;
|
||||
init_MeterInfoType(&(type->MeterInfo));
|
||||
|
@ -664,7 +657,7 @@ static void init_ListOfRootCertificateIDsType(struct ListOfRootCertificateIDsTy
|
|||
{
|
||||
int i_loop;
|
||||
|
||||
for(i_loop=0; i_loop<2;i_loop++)
|
||||
for(i_loop=0; i_loop<20;i_loop++)
|
||||
{
|
||||
init_rootCertificateIDType(&(type->RootCertificateID[i_loop]));
|
||||
}
|
||||
|
@ -844,7 +837,7 @@ static void init_AnonType_V2G_Message(struct AnonType_V2G_Message* type)
|
|||
|
||||
}
|
||||
|
||||
static void init_EXIDocumentType(struct EXIDocumentType* type)
|
||||
static void init_EXIDocumentType(struct EXIDocumentType* type)
|
||||
{
|
||||
init_AnonType_V2G_Message(&(type->V2G_Message));
|
||||
|
|
@ -19,7 +19,7 @@
|
|||
/*******************************************************************
|
||||
*
|
||||
* @author Sebastian.Kaebisch.EXT@siemens.com
|
||||
* @version 0.6
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXISeGen</p>
|
||||
|
@ -42,146 +42,160 @@ extern "C" {
|
|||
|
||||
enum faultCodeType
|
||||
{
|
||||
ParsingError_faultCodeType,
|
||||
NoTLSRootCertificatAvailable_faultCodeType,
|
||||
UnknownError_faultCodeType
|
||||
ParsingError_faultCodeType=0,
|
||||
NoTLSRootCertificatAvailable_faultCodeType=1,
|
||||
UnknownError_faultCodeType=2
|
||||
|
||||
};
|
||||
|
||||
enum responseCodeType
|
||||
{
|
||||
OK_responseCodeType,
|
||||
OK_NewSessionEstablished_responseCodeType,
|
||||
OK_OldSessionJoined_responseCodeType,
|
||||
OK_CertificateExpiresSoon_responseCodeType,
|
||||
FAILED_responseCodeType,
|
||||
FAILED_SequenceError_responseCodeType,
|
||||
FAILED_ServiceIDInvalid_responseCodeType,
|
||||
FAILED_UnknownSession_responseCodeType,
|
||||
FAILED_ServiceSelectionInvalid_responseCodeType,
|
||||
FAILED_PaymentSelectionInvalid_responseCodeType,
|
||||
FAILED_CertificateExpired_responseCodeType,
|
||||
FAILED_SignatureError_responseCodeType,
|
||||
FAILED_NoCertificateAvailable_responseCodeType,
|
||||
FAILED_CertChainError_responseCodeType,
|
||||
FAILED_ChallengeInvalid_responseCodeType,
|
||||
FAILED_ContractCanceled_responseCodeType,
|
||||
FAILED_WrongChargeParameter_responseCodeType,
|
||||
FAILED_PowerDeliveryNotApplied_responseCodeType,
|
||||
FAILED_TariffSelectionInvalid_responseCodeType,
|
||||
FAILED_ChargingProfileInvalid_responseCodeType,
|
||||
FAILED_EVSEPresentVoltageToLow_responseCodeType,
|
||||
FAILED_MeteringSignatureNotValid_responseCodeType,
|
||||
FAILED_WrongEnergyTransferType_responseCodeType
|
||||
OK_responseCodeType=0,
|
||||
OK_NewSessionEstablished_responseCodeType=1,
|
||||
OK_OldSessionJoined_responseCodeType=2,
|
||||
OK_CertificateExpiresSoon_responseCodeType=3,
|
||||
FAILED_responseCodeType=4,
|
||||
FAILED_SequenceError_responseCodeType=5,
|
||||
FAILED_ServiceIDInvalid_responseCodeType=6,
|
||||
FAILED_UnknownSession_responseCodeType=7,
|
||||
FAILED_ServiceSelectionInvalid_responseCodeType=8,
|
||||
FAILED_PaymentSelectionInvalid_responseCodeType=9,
|
||||
FAILED_CertificateExpired_responseCodeType=10,
|
||||
FAILED_SignatureError_responseCodeType=11,
|
||||
FAILED_NoCertificateAvailable_responseCodeType=12,
|
||||
FAILED_CertChainError_responseCodeType=13,
|
||||
FAILED_ChallengeInvalid_responseCodeType=14,
|
||||
FAILED_ContractCanceled_responseCodeType=15,
|
||||
FAILED_WrongChargeParameter_responseCodeType=16,
|
||||
FAILED_PowerDeliveryNotApplied_responseCodeType=17,
|
||||
FAILED_TariffSelectionInvalid_responseCodeType=18,
|
||||
FAILED_ChargingProfileInvalid_responseCodeType=19,
|
||||
FAILED_EVSEPresentVoltageToLow_responseCodeType=20,
|
||||
FAILED_MeteringSignatureNotValid_responseCodeType=21,
|
||||
FAILED_WrongEnergyTransferType_responseCodeType=22
|
||||
|
||||
};
|
||||
|
||||
enum serviceCategoryType
|
||||
{
|
||||
EVCharging_serviceCategoryType,
|
||||
Internet_serviceCategoryType,
|
||||
ContractCertificate_serviceCategoryType,
|
||||
OtherCustom_serviceCategoryType
|
||||
EVCharging_serviceCategoryType=0,
|
||||
Internet_serviceCategoryType=1,
|
||||
ContractCertificate_serviceCategoryType=2,
|
||||
OtherCustom_serviceCategoryType=3
|
||||
|
||||
};
|
||||
|
||||
enum paymentOptionType
|
||||
{
|
||||
Contract_paymentOptionType,
|
||||
ExternalPayment_paymentOptionType
|
||||
Contract_paymentOptionType=0,
|
||||
ExternalPayment_paymentOptionType=1
|
||||
|
||||
};
|
||||
|
||||
enum EVSESupportedEnergyTransferType
|
||||
{
|
||||
AC_single_phase_core_EVSESupportedEnergyTransferType,
|
||||
AC_three_phase_core_EVSESupportedEnergyTransferType,
|
||||
DC_core_EVSESupportedEnergyTransferType,
|
||||
DC_extended_EVSESupportedEnergyTransferType,
|
||||
DC_combo_core_EVSESupportedEnergyTransferType,
|
||||
DC_dual_EVSESupportedEnergyTransferType,
|
||||
AC_core1p_DC_extended_EVSESupportedEnergyTransferType,
|
||||
AC_single_DC_core_EVSESupportedEnergyTransferType,
|
||||
AC_single_phase_three_phase_core_DC_extended_EVSESupportedEnergyTransferType,
|
||||
AC_core3p_DC_extended_EVSESupportedEnergyTransferType
|
||||
AC_single_phase_core_EVSESupportedEnergyTransferType=0,
|
||||
AC_three_phase_core_EVSESupportedEnergyTransferType=1,
|
||||
DC_core_EVSESupportedEnergyTransferType=2,
|
||||
DC_extended_EVSESupportedEnergyTransferType=3,
|
||||
DC_combo_core_EVSESupportedEnergyTransferType=4,
|
||||
DC_dual_EVSESupportedEnergyTransferType=5,
|
||||
AC_core1p_DC_extended_EVSESupportedEnergyTransferType=6,
|
||||
AC_single_DC_core_EVSESupportedEnergyTransferType=7,
|
||||
AC_single_phase_three_phase_core_DC_extended_EVSESupportedEnergyTransferType=8,
|
||||
AC_core3p_DC_extended_EVSESupportedEnergyTransferType=9
|
||||
|
||||
};
|
||||
|
||||
enum unitSymbolType
|
||||
{
|
||||
h_unitSymbolType,
|
||||
m_unitSymbolType,
|
||||
s_unitSymbolType,
|
||||
A_unitSymbolType,
|
||||
Ah_unitSymbolType,
|
||||
V_unitSymbolType,
|
||||
VA_unitSymbolType,
|
||||
W_unitSymbolType,
|
||||
W_s_unitSymbolType,
|
||||
Wh_unitSymbolType
|
||||
h_unitSymbolType=0,
|
||||
m_unitSymbolType=1,
|
||||
s_unitSymbolType=2,
|
||||
A_unitSymbolType=3,
|
||||
Ah_unitSymbolType=4,
|
||||
V_unitSymbolType=5,
|
||||
VA_unitSymbolType=6,
|
||||
W_unitSymbolType=7,
|
||||
W_s_unitSymbolType=8,
|
||||
Wh_unitSymbolType=9
|
||||
|
||||
};
|
||||
|
||||
enum EVSEProcessingType
|
||||
{
|
||||
Finished_EVSEProcessingType=0,
|
||||
Ongoing_EVSEProcessingType=1
|
||||
|
||||
};
|
||||
|
||||
enum EVRequestedEnergyTransferType
|
||||
{
|
||||
AC_single_phase_core_EVRequestedEnergyTransferType,
|
||||
AC_three_phase_core_EVRequestedEnergyTransferType,
|
||||
DC_core_EVRequestedEnergyTransferType,
|
||||
DC_extended_EVRequestedEnergyTransferType,
|
||||
DC_combo_core_EVRequestedEnergyTransferType,
|
||||
DC_unique_EVRequestedEnergyTransferType
|
||||
AC_single_phase_core_EVRequestedEnergyTransferType=0,
|
||||
AC_three_phase_core_EVRequestedEnergyTransferType=1,
|
||||
DC_core_EVRequestedEnergyTransferType=2,
|
||||
DC_extended_EVRequestedEnergyTransferType=3,
|
||||
DC_combo_core_EVRequestedEnergyTransferType=4,
|
||||
DC_unique_EVRequestedEnergyTransferType=5
|
||||
|
||||
};
|
||||
|
||||
enum DC_EVErrorCodeType
|
||||
{
|
||||
NO_ERROR_DC_EVErrorCodeType,
|
||||
FAILED_RESSTemperatureInhibit_DC_EVErrorCodeType,
|
||||
FAILED_EVShiftPosition_DC_EVErrorCodeType,
|
||||
FAILED_ChargerConnectorLockFault_DC_EVErrorCodeType,
|
||||
FAILED_EVRESSMalfunction_DC_EVErrorCodeType,
|
||||
FAILED_ChargingCurrentdifferential_DC_EVErrorCodeType,
|
||||
FAILED_ChargingVoltageOutOfRange_DC_EVErrorCodeType,
|
||||
Reserved_A_DC_EVErrorCodeType,
|
||||
Reserved_B_DC_EVErrorCodeType,
|
||||
Reserved_C_DC_EVErrorCodeType,
|
||||
FAILED_ChargingSystemIncompatibility_DC_EVErrorCodeType,
|
||||
NoData_DC_EVErrorCodeType
|
||||
NO_ERROR_DC_EVErrorCodeType=0,
|
||||
FAILED_RESSTemperatureInhibit_DC_EVErrorCodeType=1,
|
||||
FAILED_EVShiftPosition_DC_EVErrorCodeType=2,
|
||||
FAILED_ChargerConnectorLockFault_DC_EVErrorCodeType=3,
|
||||
FAILED_EVRESSMalfunction_DC_EVErrorCodeType=4,
|
||||
FAILED_ChargingCurrentdifferential_DC_EVErrorCodeType=5,
|
||||
FAILED_ChargingVoltageOutOfRange_DC_EVErrorCodeType=6,
|
||||
Reserved_A_DC_EVErrorCodeType=7,
|
||||
Reserved_B_DC_EVErrorCodeType=8,
|
||||
Reserved_C_DC_EVErrorCodeType=9,
|
||||
FAILED_ChargingSystemIncompatibility_DC_EVErrorCodeType=10,
|
||||
NoData_DC_EVErrorCodeType=11
|
||||
|
||||
};
|
||||
|
||||
enum costKindType
|
||||
{
|
||||
relativePricePercentage_costKindType,
|
||||
RenewableGenerationPercentage_costKindType,
|
||||
CarbonDioxideEmission_costKindType
|
||||
relativePricePercentage_costKindType=0,
|
||||
RenewableGenerationPercentage_costKindType=1,
|
||||
CarbonDioxideEmission_costKindType=2
|
||||
|
||||
};
|
||||
|
||||
enum EVSENotificationType
|
||||
{
|
||||
None_EVSENotificationType=0,
|
||||
StopCharging_EVSENotificationType=1,
|
||||
ReNegotiation_EVSENotificationType=2
|
||||
|
||||
};
|
||||
|
||||
enum isolationLevelType
|
||||
{
|
||||
Invalid_isolationLevelType,
|
||||
Safe_isolationLevelType,
|
||||
Warning_isolationLevelType,
|
||||
Fault_isolationLevelType
|
||||
Invalid_isolationLevelType=0,
|
||||
Valid_isolationLevelType=1,
|
||||
Warning_isolationLevelType=2,
|
||||
Fault_isolationLevelType=3
|
||||
|
||||
};
|
||||
|
||||
enum DC_EVSEStatusCodeType
|
||||
{
|
||||
EVSE_NotReady_DC_EVSEStatusCodeType,
|
||||
EVSE_Ready_DC_EVSEStatusCodeType,
|
||||
EVSE_Shutdown_DC_EVSEStatusCodeType,
|
||||
EVSE_UtilityInterruptEvent_DC_EVSEStatusCodeType,
|
||||
EVSE_Precharge_DC_EVSEStatusCodeType,
|
||||
EVSE_IsolationMonitoringActive_DC_EVSEStatusCodeType,
|
||||
EVSE_EmergencyShutdown_DC_EVSEStatusCodeType,
|
||||
EVSE_Malfunction_DC_EVSEStatusCodeType,
|
||||
Reserved_8_DC_EVSEStatusCodeType,
|
||||
Reserved_9_DC_EVSEStatusCodeType,
|
||||
Reserved_A_DC_EVSEStatusCodeType,
|
||||
Reserved_B_DC_EVSEStatusCodeType,
|
||||
Reserved_C_DC_EVSEStatusCodeType
|
||||
EVSE_NotReady_DC_EVSEStatusCodeType=0,
|
||||
EVSE_Ready_DC_EVSEStatusCodeType=1,
|
||||
EVSE_Shutdown_DC_EVSEStatusCodeType=2,
|
||||
EVSE_UtilityInterruptEvent_DC_EVSEStatusCodeType=3,
|
||||
EVSE_IsolationMonitoringActive_DC_EVSEStatusCodeType=4,
|
||||
EVSE_EmergencyShutdown_DC_EVSEStatusCodeType=5,
|
||||
EVSE_Malfunction_DC_EVSEStatusCodeType=6,
|
||||
Reserved_8_DC_EVSEStatusCodeType=7,
|
||||
Reserved_9_DC_EVSEStatusCodeType=8,
|
||||
Reserved_A_DC_EVSEStatusCodeType=9,
|
||||
Reserved_B_DC_EVSEStatusCodeType=10,
|
||||
Reserved_C_DC_EVSEStatusCodeType=11
|
||||
|
||||
};
|
||||
|
||||
|
@ -349,11 +363,10 @@ struct arraylen_SignatureValueType
|
|||
|
||||
struct SignatureValueType
|
||||
{
|
||||
|
||||
|
||||
uint8_t data[128];
|
||||
struct arraylen_SignatureValueType arraylen;
|
||||
|
||||
|
||||
};
|
||||
|
||||
struct selection_KeyInfoType
|
||||
|
@ -575,7 +588,6 @@ struct serviceNameType
|
|||
struct selection_ServiceTagType
|
||||
{
|
||||
unsigned int ServiceName:1;
|
||||
unsigned int ServiceCategory:1;
|
||||
unsigned int ServiceScope:1;
|
||||
|
||||
|
||||
|
@ -617,7 +629,7 @@ struct arraylen_ServiceTagListType
|
|||
|
||||
struct ServiceTagListType
|
||||
{
|
||||
struct ServiceType Service[2];
|
||||
struct ServiceType Service[3];
|
||||
struct arraylen_ServiceTagListType arraylen;
|
||||
|
||||
};
|
||||
|
@ -851,19 +863,28 @@ struct PaymentDetailsResType
|
|||
int64_t DateTimeNow;
|
||||
|
||||
|
||||
};
|
||||
|
||||
struct selection_ContractAuthenticationReqType
|
||||
{
|
||||
unsigned int attr_Id:1;
|
||||
unsigned int GenChallenge:1;
|
||||
|
||||
|
||||
};
|
||||
|
||||
struct ContractAuthenticationReqType
|
||||
{
|
||||
struct service_string attr_Id;
|
||||
struct genChallengeType GenChallenge;
|
||||
|
||||
struct selection_ContractAuthenticationReqType isused;
|
||||
|
||||
};
|
||||
|
||||
struct ContractAuthenticationResType
|
||||
{
|
||||
enum responseCodeType ResponseCode;
|
||||
enum EVSEProcessingType EVSEProcessing;
|
||||
|
||||
|
||||
};
|
||||
|
@ -1055,7 +1076,7 @@ struct SalesTariffEntryType
|
|||
{
|
||||
struct RelativeTimeIntervalType RelativeTimeInterval;
|
||||
uint8_t EPriceLevel;
|
||||
struct ConsumptionCostType ConsumptionCost[3];
|
||||
struct ConsumptionCostType ConsumptionCost[2];
|
||||
struct selection_SalesTariffEntryType isused; struct arraylen_SalesTariffEntryType arraylen;
|
||||
|
||||
};
|
||||
|
@ -1074,7 +1095,8 @@ struct SalesTariffType
|
|||
struct tariffDescriptionType SalesTariffDescription;
|
||||
uint8_t NumEPriceLevels;
|
||||
struct SalesTariffEntryType SalesTariffEntry[12];
|
||||
struct selection_SalesTariffType isused; struct arraylen_SalesTariffType arraylen;
|
||||
struct selection_SalesTariffType isused;
|
||||
struct arraylen_SalesTariffType arraylen;
|
||||
|
||||
};
|
||||
|
||||
|
@ -1108,21 +1130,12 @@ struct SAScheduleListType
|
|||
|
||||
};
|
||||
|
||||
struct selection_ChargeParameterDiscoveryResType
|
||||
{
|
||||
unsigned int SAScheduleList:1;
|
||||
unsigned int AC_EVSEChargeParameter:1;
|
||||
unsigned int DC_EVSEChargeParameter:1;
|
||||
|
||||
|
||||
};
|
||||
|
||||
struct AC_EVSEStatusType
|
||||
{
|
||||
int PowerSwitchClosed;
|
||||
int RCD;
|
||||
uint32_t ShutDownTime;
|
||||
int StopCharging;
|
||||
uint32_t NotificationMaxDelay;
|
||||
enum EVSENotificationType EVSENotification;
|
||||
|
||||
|
||||
};
|
||||
|
@ -1135,6 +1148,14 @@ struct AC_EVSEChargeParameterType
|
|||
struct PhysicalValueType EVSEMinCurrent;
|
||||
|
||||
|
||||
};
|
||||
|
||||
struct selection_ChargeParameterDiscoveryResType
|
||||
{
|
||||
unsigned int AC_EVSEChargeParameter:1;
|
||||
unsigned int DC_EVSEChargeParameter:1;
|
||||
|
||||
|
||||
};
|
||||
|
||||
struct selection_DC_EVSEStatusType
|
||||
|
@ -1148,6 +1169,8 @@ struct DC_EVSEStatusType
|
|||
{
|
||||
enum isolationLevelType EVSEIsolationStatus;
|
||||
enum DC_EVSEStatusCodeType EVSEStatusCode;
|
||||
uint32_t NotificationMaxDelay;
|
||||
enum EVSENotificationType EVSENotification;
|
||||
struct selection_DC_EVSEStatusType isused;
|
||||
|
||||
};
|
||||
|
@ -1179,7 +1202,8 @@ struct DC_EVSEChargeParameterType
|
|||
struct ChargeParameterDiscoveryResType
|
||||
{
|
||||
enum responseCodeType ResponseCode;
|
||||
struct SAScheduleListType* SAScheduleList;
|
||||
enum EVSEProcessingType EVSEProcessing;
|
||||
struct SAScheduleListType SAScheduleList;
|
||||
struct AC_EVSEChargeParameterType* AC_EVSEChargeParameter;
|
||||
struct DC_EVSEChargeParameterType* DC_EVSEChargeParameter;
|
||||
struct selection_ChargeParameterDiscoveryResType isused;
|
||||
|
@ -1269,7 +1293,6 @@ struct ChargingStatusReqType
|
|||
|
||||
struct selection_ChargingStatusResType
|
||||
{
|
||||
unsigned int SAScheduleTupleID:1;
|
||||
unsigned int EVSEMaxCurrent:1;
|
||||
unsigned int MeterInfo:1;
|
||||
|
||||
|
@ -1506,6 +1529,7 @@ struct CableCheckResType
|
|||
{
|
||||
enum responseCodeType ResponseCode;
|
||||
struct DC_EVSEStatusType DC_EVSEStatus;
|
||||
enum EVSEProcessingType EVSEProcessing;
|
||||
|
||||
|
||||
};
|
||||
|
@ -1652,27 +1676,10 @@ struct EXIDocumentType
|
|||
|
||||
};
|
||||
|
||||
enum responseMessages
|
||||
{
|
||||
SESSIONSETUPRES,
|
||||
SERVICEDISCOVERYRES,
|
||||
SERVICEDETAILRES,
|
||||
SERVICEPAYMENTSELECTIONRES,
|
||||
PAYMENTDETAILSRES,
|
||||
CONTRACTAUTHENTICATIONRES,
|
||||
CHARGEPARAMETERDISCOVERYRES,
|
||||
POWERDELIVERYRES,
|
||||
CHARGINGSTATUSRES,
|
||||
METERINGRECEIPTRES,
|
||||
SESSIONSTOPRES,
|
||||
CERTIFICATEUPDATERES,
|
||||
CERTIFICATEINSTALLATIONRES,
|
||||
CABLECHECKRES,
|
||||
PRECHARGERES,
|
||||
CURRENTDEMANDRES,
|
||||
WELDINGDETECTIONRES
|
||||
};
|
||||
|
||||
/* init methods */
|
||||
/*void init_EXIDocumentType(struct EXIDocumentType* type);
|
||||
void init_ServiceDiscoveryResType(struct ServiceDiscoveryResType* type);
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
File diff suppressed because it is too large
Load diff
|
@ -1,268 +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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Sebastian.Kaebisch.EXT@siemens.com
|
||||
* @version 0.6
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXISeGen</p>
|
||||
*
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
#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
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,87 +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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Sebastian.Kaebisch.EXT@siemens.com
|
||||
* @version 0.6
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXISeGen</p>
|
||||
*
|
||||
********************************************************************/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef SERVICEMETHODS_H
|
||||
#define SERVICEMETHODS_H
|
||||
|
||||
#include "v2g_serviceDataTypes.h"
|
||||
#include "EXITypes.h"
|
||||
|
||||
/* This service methods has to be implemented by the EVSE server */
|
||||
int sessionSetup(struct MessageHeaderType* header, struct SessionSetupReqType* param, struct SessionSetupResType* result);
|
||||
|
||||
int serviceDiscovery(struct MessageHeaderType* header, struct ServiceDiscoveryReqType* param, struct ServiceDiscoveryResType* result);
|
||||
|
||||
int serviceDetail(struct MessageHeaderType* header, struct ServiceDetailReqType* param, struct ServiceDetailResType* result);
|
||||
|
||||
int servicePaymentSelection(struct MessageHeaderType* header, struct ServicePaymentSelectionReqType* param, struct ServicePaymentSelectionResType* result);
|
||||
|
||||
int paymentDetails(struct MessageHeaderType* header, struct PaymentDetailsReqType* param, struct PaymentDetailsResType* result);
|
||||
|
||||
int contractAuthentication(struct MessageHeaderType* header, struct ContractAuthenticationReqType* param, struct ContractAuthenticationResType* result);
|
||||
|
||||
int chargeParameterDiscovery(struct MessageHeaderType* header, struct ChargeParameterDiscoveryReqType* param, struct ChargeParameterDiscoveryResType* result);
|
||||
|
||||
int powerDelivery(struct MessageHeaderType* header, struct PowerDeliveryReqType* param, struct PowerDeliveryResType* result);
|
||||
|
||||
int chargingStatus(struct MessageHeaderType* header, struct ChargingStatusReqType* param, struct ChargingStatusResType* result);
|
||||
|
||||
int meteringReceipt(struct MessageHeaderType* header, struct MeteringReceiptReqType* param, struct MeteringReceiptResType* result);
|
||||
|
||||
int sessionStop(struct MessageHeaderType* header, struct SessionStopType* param, struct SessionStopResType* result);
|
||||
|
||||
int certificateUpdate(struct MessageHeaderType* header, struct CertificateUpdateReqType* param, struct CertificateUpdateResType* result);
|
||||
|
||||
int certificateInstallation(struct MessageHeaderType* header, struct CertificateInstallationReqType* param, struct CertificateInstallationResType* result);
|
||||
|
||||
int cableCheck(struct MessageHeaderType* header, struct CableCheckReqType* param, struct CableCheckResType* result);
|
||||
|
||||
int preCharge(struct MessageHeaderType* header, struct PreChargeReqType* param, struct PreChargeResType* result);
|
||||
|
||||
int currentDemand(struct MessageHeaderType* header, struct CurrentDemandReqType* param, struct CurrentDemandResType* result);
|
||||
|
||||
int weldingDetection(struct MessageHeaderType* header, struct WeldingDetectionReqType* param, struct WeldingDetectionResType* result);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
188
src/test/evse_server.c
Normal file
188
src/test/evse_server.c
Normal file
|
@ -0,0 +1,188 @@
|
|||
/*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Sebastian.Kaebisch.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
/* includes for the application handshake protocol */
|
||||
#include "appHand_service.h"
|
||||
#include "appHand_dataTypes.h"
|
||||
#include "v2g_service.h"
|
||||
#include "v2gtp.h"
|
||||
#include "evse_server.h"
|
||||
|
||||
#include "v2g_serviceDispatcher.h"
|
||||
|
||||
|
||||
#define MAX_BYTE_SIZE 64
|
||||
#define MAX_STRING_SIZE 64
|
||||
#define MAX_STREAM_SIZE 100
|
||||
|
||||
static int appHandshakeHandler(struct EXIDatabinder* appHandService, uint8_t* inStream, uint32_t sizeInStream, uint8_t* outStream, uint32_t* outStreamLength);
|
||||
static void printASCIIString(uint32_t* string, uint32_t len);
|
||||
|
||||
int testV2GService(uint8_t* inStream, uint16_t inStreamLength, uint8_t* outStream, uint32_t* outStreamLength)
|
||||
{
|
||||
static uint8_t byte_array[MAX_BYTE_SIZE]; /* define MAX_BYTE_SIZE before*/
|
||||
static uint32_t string_array[MAX_STRING_SIZE]; /* define MAX_STRING_SIZE before*/
|
||||
uint32_t exiMsgLength;
|
||||
|
||||
struct EXIDatabinder appHandService;
|
||||
struct EXIService service;
|
||||
|
||||
static uint8_t isHandshake = 1;
|
||||
|
||||
/* BINARY memory setup */
|
||||
exi_bytes_t bytes = { MAX_BYTE_SIZE, byte_array, 0 };
|
||||
|
||||
/* STRING memory setup */
|
||||
exi_string_ucs_t string = { MAX_STRING_SIZE, string_array, 0 };
|
||||
|
||||
/**********************************************
|
||||
* Init V2G server and initialize array types *
|
||||
* for the EXI decoding as well as the offset *
|
||||
* for the transportation header *
|
||||
**********************************************/
|
||||
|
||||
init_v2gservice(&service, bytes, string, V2GTP_HEADER_LENGTH);
|
||||
|
||||
/* check, if the DoIP header is correct and determine payload */
|
||||
if(read_v2gtpHeader(inStream,inStreamLength, &exiMsgLength))
|
||||
{
|
||||
/* v2gtp header not correct */
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Here, it is assumed the first message is always the application handshake protocol.
|
||||
* The successor messages are 15118 charging based messages and handled by the message
|
||||
* dispatcher. */
|
||||
|
||||
if(isHandshake)
|
||||
{
|
||||
|
||||
|
||||
|
||||
/* init the de- / serializer */
|
||||
init_appHandDeserializer(&appHandService,bytes,string,V2GTP_HEADER_LENGTH);
|
||||
init_appHandSerializer(&appHandService,bytes,string,MAX_STREAM_SIZE,V2GTP_HEADER_LENGTH);
|
||||
|
||||
if(appHandshakeHandler(&appHandService, inStream,inStreamLength,outStream,outStreamLength))
|
||||
{
|
||||
return -1; /* an error occured */
|
||||
}
|
||||
|
||||
isHandshake = 0; /* here: next time a charging message is expected */
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Pass the received EXI message stream (inStream + exiMsgLength) to the *
|
||||
* v2g message dispatcher. The outStream contains the response message *
|
||||
* stream. *
|
||||
****************************************************************************/
|
||||
|
||||
if(messageDispatcher(&service, inStream, exiMsgLength, outStream, MAX_STREAM_SIZE, outStreamLength))
|
||||
{
|
||||
|
||||
/* an error occurred */
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* write v2gtp header */
|
||||
write_v2gtpHeader(outStream, outStreamLength, V2GTP_EXI_TYPE);
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
/** Example implementation of the app handshake protocol for the EVSE side */
|
||||
static int appHandshakeHandler(struct EXIDatabinder* appHandService, uint8_t* inStream, uint32_t sizeInStream, uint8_t* outStream, uint32_t* outStreamLength)
|
||||
{
|
||||
struct EXIDocumentType_appHand exiDoc;
|
||||
struct AnonType_supportedAppProtocolReq handshake;
|
||||
struct AnonType_supportedAppProtocolRes resultHandshake;
|
||||
size_t i;
|
||||
|
||||
init_AnonType_supportedAppProtocolReq(&handshake);
|
||||
init_EXIDocumentType_appHand(&exiDoc);
|
||||
|
||||
/* we expect a supportedAppProtocolReq */
|
||||
exiDoc.supportedAppProtocolReq = &handshake;
|
||||
|
||||
|
||||
if(deserialize_appHand(appHandService,inStream,sizeInStream,&exiDoc))
|
||||
{
|
||||
/* an error occured */
|
||||
return -1;
|
||||
}
|
||||
|
||||
printf("EVSE side: List of application handshake protocols of the EV \n");
|
||||
|
||||
for(i=0;i<handshake.arraylen.AppProtocol;i++)
|
||||
{
|
||||
printf("\tProtocol entry #=%d\n",(i+1));
|
||||
printf("\t\tProtocolNamespace=");
|
||||
printASCIIString(handshake.AppProtocol[i].ProtocolNamespace.data,handshake.AppProtocol[i].ProtocolNamespace.arraylen.data);
|
||||
printf("\t\tVersion=%d.%d\n", handshake.AppProtocol[i].VersionNumberMajor,handshake.AppProtocol[i].VersionNumberMinor);
|
||||
printf("\t\tSchemaID=%d\n", handshake.AppProtocol[i].SchemaID);
|
||||
printf("\t\tPriority=%d\n", handshake.AppProtocol[i].Priority);
|
||||
}
|
||||
|
||||
/* prepare response handshake response:
|
||||
* it is assumed, we support the 15118 1.0 version :-) */
|
||||
resultHandshake.ResponseCode=OK_SuccessfulNegotiation_responseCodeType;
|
||||
resultHandshake.SchemaID=handshake.AppProtocol[0].SchemaID; /* signal the protocol by the provided schema id*/
|
||||
resultHandshake.isused.SchemaID=1;
|
||||
|
||||
/* assign the response message to the exiDoc */
|
||||
init_EXIDocumentType_appHand(&exiDoc);
|
||||
exiDoc.supportedAppProtocolRes=&resultHandshake;
|
||||
exiDoc.isused.supportedAppProtocolRes=1;
|
||||
|
||||
if(serialize_appHand(appHandService, outStream,outStreamLength, &exiDoc))
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void printASCIIString(uint32_t* string, uint32_t len) {
|
||||
unsigned int i;
|
||||
for(i=0; i<len; i++) {
|
||||
printf("%c",(char)string[i]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
|
33
src/test/evse_server.h
Normal file
33
src/test/evse_server.h
Normal file
|
@ -0,0 +1,33 @@
|
|||
/*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Sebastian.Kaebisch.EXT@siemens.com
|
||||
* @@version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
********************************************************************/
|
||||
|
||||
#ifndef V2G_SERVER_H_
|
||||
#define V2G_SERVER_H_
|
||||
|
||||
#include "EXITypes.h"
|
||||
|
||||
int testV2GService(uint8_t* inStream, uint16_t inStreamLength, uint8_t* outStream,uint32_t* outStreamLength);
|
||||
|
||||
#endif /* V2G_SERVER_H_ */
|
721
src/test/evse_serviceMethods.c
Normal file
721
src/test/evse_serviceMethods.c
Normal file
|
@ -0,0 +1,721 @@
|
|||
/*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Sebastian.Kaebisch.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
********************************************************************/
|
||||
|
||||
#include "v2g_serviceMethods.h"
|
||||
#include "v2g_dataTypes.h"
|
||||
#include <stdio.h>
|
||||
|
||||
static void printBinaryArray(uint8_t* byte, uint32_t len);
|
||||
|
||||
int sessionSetup(struct MessageHeaderType* header, struct SessionSetupReqType* param, struct SessionSetupResType* result)
|
||||
{
|
||||
|
||||
|
||||
|
||||
printf("EVSE side: sessionSetup called\n" );
|
||||
printf("\tReceived data:\n");
|
||||
printf("\tHeader SessionID=");
|
||||
printBinaryArray(header->SessionID.data,header->SessionID.arraylen.data );
|
||||
printf("\t\t EVCCID=%d\n",param->EVCCID.data[0]);
|
||||
|
||||
/* generate an unique sessionID */
|
||||
header->SessionID.data[0] = 12;
|
||||
header->SessionID.data[1] = 3;
|
||||
header->SessionID.data[2] = 12;
|
||||
header->SessionID.data[3] = 42;
|
||||
header->SessionID.data[4] = 12;
|
||||
header->SessionID.data[5] = 1;
|
||||
header->SessionID.data[6] = 2;
|
||||
header->SessionID.data[7] = 10;
|
||||
header->SessionID.arraylen.data=8;
|
||||
|
||||
/* Prepare data for EV */
|
||||
result->ResponseCode = OK_responseCodeType;
|
||||
result->EVSEID.data[0]=1;
|
||||
result->EVSEID.arraylen.data=1;
|
||||
result->DateTimeNow=123456789;
|
||||
result->isused.DateTimeNow=1;
|
||||
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
int serviceDiscovery(struct MessageHeaderType* header, struct ServiceDiscoveryReqType* param, struct ServiceDiscoveryResType* result)
|
||||
{
|
||||
printf("EVSE side: serviceDiscovery called\n" );
|
||||
printf("\tReceived data:\n");
|
||||
printf("\tHeader SessionID=");
|
||||
printBinaryArray(header->SessionID.data,header->SessionID.arraylen.data );
|
||||
|
||||
printf("\t\t ServiceCategory=%d\n", param->ServiceCategory);
|
||||
|
||||
/* generate an unique sessionID */
|
||||
header->SessionID.data[0] = 1;
|
||||
header->SessionID.data[1] = 2;
|
||||
header->SessionID.data[2] = 3;
|
||||
header->SessionID.data[3] = 4;
|
||||
header->SessionID.data[4] = 5;
|
||||
header->SessionID.data[5] = 6;
|
||||
header->SessionID.data[6] = 7;
|
||||
header->SessionID.data[7] = 8;
|
||||
header->SessionID.arraylen.data=8;
|
||||
|
||||
result->isused.ServiceList=0; /* we do not provide VAS */
|
||||
result->ResponseCode= OK_responseCodeType;
|
||||
|
||||
|
||||
result->ChargeService.EnergyTransferType = AC_single_DC_core_EVSESupportedEnergyTransferType;
|
||||
result->ChargeService.ServiceTag.ServiceID=1; /* ID of the charge service */
|
||||
result->ChargeService.ServiceTag.ServiceName.data[0]='A';
|
||||
result->ChargeService.ServiceTag.ServiceName.data[1]='C';
|
||||
result->ChargeService.ServiceTag.ServiceName.data[2]='_';
|
||||
result->ChargeService.ServiceTag.ServiceName.data[3]='D';
|
||||
result->ChargeService.ServiceTag.ServiceName.data[4]='C';
|
||||
result->ChargeService.ServiceTag.ServiceName.arraylen.data=5;
|
||||
result->ChargeService.ServiceTag.isused.ServiceName=1;
|
||||
result->ChargeService.ServiceTag.isused.ServiceScope=0;
|
||||
|
||||
result->ChargeService.FreeService = 1;
|
||||
result->PaymentOptions.PaymentOption[0] = ExternalPayment_paymentOptionType; /* EVSE handles the payment */
|
||||
result->PaymentOptions.arraylen.PaymentOption=1;
|
||||
|
||||
if(param->ServiceCategory==Internet_serviceCategoryType || param->ServiceCategory==OtherCustom_serviceCategoryType || param->isused.ServiceCategory==0)
|
||||
{
|
||||
result->ServiceList.Service[0].FreeService=1;
|
||||
result->ServiceList.Service[0].ServiceTag.ServiceID=22; /* ID of the charge service */
|
||||
result->ServiceList.Service[0].ServiceTag.ServiceName.data[0]='W';
|
||||
result->ServiceList.Service[0].ServiceTag.ServiceName.data[1]='W';
|
||||
result->ServiceList.Service[0].ServiceTag.ServiceName.data[2]='W';
|
||||
result->ServiceList.Service[0].ServiceTag.ServiceName.arraylen.data=3;
|
||||
result->ServiceList.Service[0].ServiceTag.ServiceCategory=Internet_serviceCategoryType;
|
||||
result->ServiceList.Service[0].ServiceTag.isused.ServiceName=1;
|
||||
result->ServiceList.Service[0].ServiceTag.isused.ServiceScope=0;
|
||||
|
||||
result->ServiceList.arraylen.Service=1;
|
||||
result->isused.ServiceList=1;
|
||||
|
||||
} else {
|
||||
result->isused.ServiceList=0; /* no value added service requested */
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int servicePaymentSelection(struct MessageHeaderType* header, struct ServicePaymentSelectionReqType* param, struct ServicePaymentSelectionResType* result)
|
||||
{
|
||||
printf("EVSE side: servicePaymentSelection called\n" );
|
||||
printf("\tReceived data:\n");
|
||||
printf("\tHeader SessionID=");
|
||||
printBinaryArray(header->SessionID.data,header->SessionID.arraylen.data );
|
||||
|
||||
if(param->SelectedPaymentOption == ExternalPayment_paymentOptionType)
|
||||
printf("\t\t SelectedPaymentOption=ExternalPayment\n");
|
||||
|
||||
printf("\t\t ServiceID=%d\n",param->SelectedServiceList.SelectedService[0].ServiceID);
|
||||
|
||||
result->ResponseCode = OK_responseCodeType;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int paymentDetails(struct MessageHeaderType* header, struct PaymentDetailsReqType* param, struct PaymentDetailsResType* result)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int chargeParameterDiscovery(struct MessageHeaderType* header, struct ChargeParameterDiscoveryReqType* param, struct ChargeParameterDiscoveryResType* result)
|
||||
{
|
||||
struct PhysicalValueType f;
|
||||
|
||||
printf("EVSE side: chargeParameterDiscovery called\n" );
|
||||
printf("\tReceived data:\n");
|
||||
printf("\t\t EVRequestedEnergyTransferType=%d\n",param->EVRequestedEnergyTransferType);
|
||||
|
||||
/* check,if DC or AC is requested */
|
||||
if(param->EVRequestedEnergyTransferType==DC_core_EVRequestedEnergyTransferType || param->isused.DC_EVChargeParameter==1)
|
||||
{
|
||||
|
||||
printf("\t\t EVStatus:\n");
|
||||
printf("\t\t\t EVReady=%d\n", param->DC_EVChargeParameter->DC_EVStatus.EVReady);
|
||||
printf("\t\t\t EVRESSSOC=%d\n", param->DC_EVChargeParameter->DC_EVStatus.EVRESSSOC);
|
||||
printf("\t\t\t EVErrorCode=%d\n", param->DC_EVChargeParameter->DC_EVStatus.EVErrorCode);
|
||||
printf("\t\t\t EVRESSConditioning=%d\n", param->DC_EVChargeParameter->DC_EVStatus.EVRESSConditioning);
|
||||
printf("\t\t\t EVCabinConditioning=%d\n", param->DC_EVChargeParameter->DC_EVStatus.EVCabinConditioning);
|
||||
|
||||
|
||||
printf("\t\t EVMaximumCurrentLimit=%d\n", param->DC_EVChargeParameter->EVMaximumCurrentLimit.Value);
|
||||
printf("\t\t EVMaximumPowerLimit=%d\n", param->DC_EVChargeParameter->EVMaximumPowerLimit.Value);
|
||||
printf("\t\t EVMaximumVoltageLimit=%d\n", param->DC_EVChargeParameter->EVMaximumVoltageLimit.Value);
|
||||
printf("\t\t EVEnergyCapacity=%d\n", param->DC_EVChargeParameter->EVEnergyCapacity.Value);
|
||||
printf("\t\t EVEnergyRequest=%d\n", param->DC_EVChargeParameter->EVEnergyRequest.Value);
|
||||
printf("\t\t FullSOC=%d\n", param->DC_EVChargeParameter->FullSOC);
|
||||
printf("\t\t BulkSOC=%d\n", param->DC_EVChargeParameter->BulkSOC);
|
||||
|
||||
result->ResponseCode = OK_responseCodeType;
|
||||
result->EVSEProcessing = Finished_EVSEProcessingType;
|
||||
|
||||
result->isused.DC_EVSEChargeParameter = 1;
|
||||
result->isused.AC_EVSEChargeParameter = 0;
|
||||
result->DC_EVSEChargeParameter->DC_EVSEStatus.EVSEStatusCode = EVSE_Ready_DC_EVSEStatusCodeType;
|
||||
result->DC_EVSEChargeParameter->DC_EVSEStatus.EVSEIsolationStatus = Valid_isolationLevelType;
|
||||
result->DC_EVSEChargeParameter->DC_EVSEStatus.isused.EVSEIsolationStatus = 1;
|
||||
result->DC_EVSEChargeParameter->DC_EVSEStatus.EVSENotification = None_EVSENotificationType;
|
||||
result->DC_EVSEChargeParameter->DC_EVSEStatus.NotificationMaxDelay = 0;
|
||||
|
||||
f.Multiplier = 0;
|
||||
f.Unit = A_unitSymbolType;
|
||||
f.isused.Unit=1;
|
||||
f.Value = 50;
|
||||
|
||||
result->DC_EVSEChargeParameter->EVSEMaximumCurrentLimit=f;
|
||||
|
||||
f.Unit = W_unitSymbolType;
|
||||
f.Value = 20000;
|
||||
|
||||
result->DC_EVSEChargeParameter->EVSEMaximumPowerLimit=f;
|
||||
result->DC_EVSEChargeParameter->isused.EVSEMaximumPowerLimit=1;
|
||||
|
||||
f.Unit = V_unitSymbolType;
|
||||
f.Value = 400;
|
||||
|
||||
result->DC_EVSEChargeParameter->EVSEMaximumVoltageLimit=f;
|
||||
|
||||
f.Unit = A_unitSymbolType;
|
||||
f.Value = 5;
|
||||
|
||||
result->DC_EVSEChargeParameter->EVSEMinimumCurrentLimit=f;
|
||||
|
||||
f.Unit = V_unitSymbolType;
|
||||
f.Value = 200;
|
||||
|
||||
result->DC_EVSEChargeParameter->EVSEMinimumVoltageLimit=f;
|
||||
|
||||
f.Unit = A_unitSymbolType;
|
||||
f.Value = 2;
|
||||
|
||||
result->DC_EVSEChargeParameter->EVSECurrentRegulationTolerance=f;
|
||||
result->DC_EVSEChargeParameter->isused.EVSECurrentRegulationTolerance=1;
|
||||
|
||||
f.Unit = A_unitSymbolType;
|
||||
f.Value = 1;
|
||||
|
||||
result->DC_EVSEChargeParameter->EVSEPeakCurrentRipple=f;
|
||||
|
||||
f.Unit = W_unitSymbolType;
|
||||
f.Value = 5000;
|
||||
|
||||
result->DC_EVSEChargeParameter->EVSEEnergyToBeDelivered=f;
|
||||
result->DC_EVSEChargeParameter->isused.EVSEEnergyToBeDelivered=1;
|
||||
|
||||
/* set up a PMax schedule */
|
||||
result->SAScheduleList.SAScheduleTuple[0].SAScheduleTupleID=10;
|
||||
result->SAScheduleList.SAScheduleTuple[0].isused.SalesTariff=0; /* no tariffs */
|
||||
|
||||
/* set up two PMax entries */
|
||||
result->SAScheduleList.SAScheduleTuple[0].PMaxSchedule.PMaxScheduleID=20;
|
||||
result->SAScheduleList.SAScheduleTuple[0].PMaxSchedule.PMaxScheduleEntry[0].PMax=20000;
|
||||
result->SAScheduleList.SAScheduleTuple[0].PMaxSchedule.PMaxScheduleEntry[0].RelativeTimeInterval.start=0;
|
||||
|
||||
result->SAScheduleList.SAScheduleTuple[0].PMaxSchedule.PMaxScheduleEntry[1].PMax=0;
|
||||
result->SAScheduleList.SAScheduleTuple[0].PMaxSchedule.PMaxScheduleEntry[1].RelativeTimeInterval.start=1200; /* 20 min */
|
||||
|
||||
result->SAScheduleList.SAScheduleTuple[0].PMaxSchedule.arraylen.PMaxScheduleEntry=2; /* we set up two time entries */
|
||||
|
||||
|
||||
/* set up two PMax entries */
|
||||
result->SAScheduleList.SAScheduleTuple[1].SAScheduleTupleID=15;
|
||||
result->SAScheduleList.SAScheduleTuple[1].PMaxSchedule.PMaxScheduleID=30;
|
||||
result->SAScheduleList.SAScheduleTuple[1].PMaxSchedule.PMaxScheduleEntry[0].PMax=10000;
|
||||
result->SAScheduleList.SAScheduleTuple[1].PMaxSchedule.PMaxScheduleEntry[0].RelativeTimeInterval.start=0;
|
||||
|
||||
result->SAScheduleList.SAScheduleTuple[1].PMaxSchedule.PMaxScheduleEntry[1].PMax=0;
|
||||
result->SAScheduleList.SAScheduleTuple[1].PMaxSchedule.PMaxScheduleEntry[1].RelativeTimeInterval.start=1800; /* 30 min */
|
||||
|
||||
result->SAScheduleList.SAScheduleTuple[1].PMaxSchedule.arraylen.PMaxScheduleEntry=2; /* we set up two time entries */
|
||||
|
||||
result->SAScheduleList.arraylen.SAScheduleTuple=2; /* we used 2 tuple */
|
||||
|
||||
|
||||
|
||||
|
||||
} else { /* AC related */
|
||||
|
||||
printf("\t\t DepartureTime=%d\n", param->AC_EVChargeParameter->DepartureTime);
|
||||
printf("\t\t EAmount=%d\n", param->AC_EVChargeParameter->EAmount.Value);
|
||||
printf("\t\t EVMaxCurrent=%d\n", param->AC_EVChargeParameter->EVMaxCurrent.Value);
|
||||
printf("\t\t EVMaxVoltage=%d\n", param->AC_EVChargeParameter->EVMaxVoltage.Value);
|
||||
printf("\t\t EVMinCurrent=%d\n", param->AC_EVChargeParameter->EVMinCurrent.Value);
|
||||
|
||||
|
||||
result->ResponseCode = OK_responseCodeType;
|
||||
result->EVSEProcessing = Finished_EVSEProcessingType;
|
||||
|
||||
result->isused.AC_EVSEChargeParameter = 1;
|
||||
result->isused.DC_EVSEChargeParameter = 0;
|
||||
|
||||
result->AC_EVSEChargeParameter->AC_EVSEStatus.PowerSwitchClosed=1;
|
||||
result->AC_EVSEChargeParameter->AC_EVSEStatus.RCD=1;
|
||||
result->AC_EVSEChargeParameter->AC_EVSEStatus.EVSENotification=None_EVSENotificationType;
|
||||
result->AC_EVSEChargeParameter->AC_EVSEStatus.NotificationMaxDelay=123;
|
||||
|
||||
|
||||
f.Multiplier = 0;
|
||||
f.Unit = A_unitSymbolType;
|
||||
f.isused.Unit=1;
|
||||
f.Value = 100;
|
||||
|
||||
result->AC_EVSEChargeParameter->EVSEMaxCurrent=f;
|
||||
|
||||
f.Unit = V_unitSymbolType;
|
||||
f.Value = 200;
|
||||
result->AC_EVSEChargeParameter->EVSEMaxVoltage=f;
|
||||
|
||||
f.Unit = A_unitSymbolType;
|
||||
f.Value = 300;
|
||||
result->AC_EVSEChargeParameter->EVSEMinCurrent=f;
|
||||
|
||||
/* set up a sales schedule */
|
||||
result->SAScheduleList.SAScheduleTuple[0].SAScheduleTupleID=10;
|
||||
result->SAScheduleList.SAScheduleTuple[0].isused.SalesTariff=1;
|
||||
|
||||
/* set up PMax entries */
|
||||
result->SAScheduleList.SAScheduleTuple[0].PMaxSchedule.PMaxScheduleID=20;
|
||||
result->SAScheduleList.SAScheduleTuple[0].PMaxSchedule.PMaxScheduleEntry[0].PMax=20000;
|
||||
result->SAScheduleList.SAScheduleTuple[0].PMaxSchedule.PMaxScheduleEntry[0].RelativeTimeInterval.start=0;
|
||||
|
||||
result->SAScheduleList.SAScheduleTuple[0].PMaxSchedule.PMaxScheduleEntry[1].PMax=0;
|
||||
result->SAScheduleList.SAScheduleTuple[0].PMaxSchedule.PMaxScheduleEntry[1].RelativeTimeInterval.start=1200; /* 20 min */
|
||||
|
||||
result->SAScheduleList.SAScheduleTuple[0].PMaxSchedule.arraylen.PMaxScheduleEntry=2; /* we set up two time entries */
|
||||
|
||||
/* set up sale entries */
|
||||
result->SAScheduleList.SAScheduleTuple[0].SalesTariff->NumEPriceLevels=2;
|
||||
result->SAScheduleList.SAScheduleTuple[0].SalesTariff->SalesTariffID=20;
|
||||
result->SAScheduleList.SAScheduleTuple[0].SalesTariff->attr_Id.data[0]=100;
|
||||
result->SAScheduleList.SAScheduleTuple[0].SalesTariff->attr_Id.arraylen.data=1;
|
||||
result->SAScheduleList.SAScheduleTuple[0].SalesTariff->SalesTariffEntry[0].EPriceLevel=2;
|
||||
result->SAScheduleList.SAScheduleTuple[0].SalesTariff->SalesTariffEntry[0].RelativeTimeInterval.start=0;
|
||||
result->SAScheduleList.SAScheduleTuple[0].SalesTariff->SalesTariffEntry[0].RelativeTimeInterval.duration=10;
|
||||
result->SAScheduleList.SAScheduleTuple[0].SalesTariff->SalesTariffEntry[0].RelativeTimeInterval.isused.duration=1;
|
||||
result->SAScheduleList.SAScheduleTuple[0].SalesTariff->SalesTariffEntry[0].arraylen.ConsumptionCost=0;
|
||||
result->SAScheduleList.SAScheduleTuple[0].SalesTariff->SalesTariffEntry[0].isused.ConsumptionCost=0;
|
||||
result->SAScheduleList.SAScheduleTuple[0].SalesTariff->arraylen.SalesTariffEntry=1;
|
||||
|
||||
|
||||
result->SAScheduleList.SAScheduleTuple[0].SalesTariff->isused.SalesTariffDescription=0;
|
||||
result->SAScheduleList.arraylen.SAScheduleTuple=1;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int powerDelivery(struct MessageHeaderType* header, struct PowerDeliveryReqType* param, struct PowerDeliveryResType* result)
|
||||
{
|
||||
|
||||
size_t i;
|
||||
|
||||
printf("EVSE side: powerDelivery called\n" );
|
||||
printf("\tReceived data:\n");
|
||||
printf("\t\t\t ReadyToChargeState=%d\n", param->ReadyToChargeState);
|
||||
|
||||
|
||||
|
||||
if(param->isused.DC_EVPowerDeliveryParameter)
|
||||
{
|
||||
|
||||
printf("\t\t EVStatus:\n");
|
||||
printf("\t\t\t EVReady=%d\n", param->DC_EVPowerDeliveryParameter->DC_EVStatus.EVReady);
|
||||
printf("\t\t\t EVRESSSOC=%d\n", param->DC_EVPowerDeliveryParameter->DC_EVStatus.EVRESSSOC);
|
||||
printf("\t\t\t EVErrorCode=%d\n", param->DC_EVPowerDeliveryParameter->DC_EVStatus.EVErrorCode);
|
||||
printf("\t\t\t EVRESSConditioning=%d\n", param->DC_EVPowerDeliveryParameter->DC_EVStatus.EVRESSConditioning);
|
||||
printf("\t\t\t EVCabinConditioning=%d\n", param->DC_EVPowerDeliveryParameter->DC_EVStatus.EVCabinConditioning);
|
||||
|
||||
|
||||
if(param->isused.ChargingProfile)
|
||||
{
|
||||
printf("\t\t\tChargingProfile:\n");
|
||||
printf("\t\t\t SAScheduleTupleID=%d\n",param->ChargingProfile.SAScheduleTupleID );
|
||||
for(i=0;i<param->ChargingProfile.arraylen.ProfileEntry;i++)
|
||||
{
|
||||
printf("\t\t\t Entry#%d\n",i);
|
||||
printf("\t\t\t\t ChargingProfileEntryMaxPower=%d\n", param->ChargingProfile.ProfileEntry[i].ChargingProfileEntryMaxPower);
|
||||
printf("\t\t\t\t ChargingProfileEntryStart=%d\n", param->ChargingProfile.ProfileEntry[i].ChargingProfileEntryStart);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
result->ResponseCode = OK_responseCodeType;
|
||||
result->DC_EVSEStatus->EVSEIsolationStatus =1;
|
||||
result->DC_EVSEStatus->isused.EVSEIsolationStatus = 1;
|
||||
result->DC_EVSEStatus->EVSEStatusCode = EVSE_Ready_DC_EVSEStatusCodeType;
|
||||
result->DC_EVSEStatus->EVSENotification=None_EVSENotificationType;
|
||||
result->DC_EVSEStatus->NotificationMaxDelay=123;
|
||||
|
||||
result->isused.DC_EVSEStatus=1;
|
||||
result->isused.AC_EVSEStatus=0;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
result->ResponseCode = OK_responseCodeType;
|
||||
result->AC_EVSEStatus->PowerSwitchClosed=1;
|
||||
result->AC_EVSEStatus->RCD=1;
|
||||
result->AC_EVSEStatus->EVSENotification=None_EVSENotificationType;
|
||||
result->AC_EVSEStatus->NotificationMaxDelay=123;
|
||||
|
||||
|
||||
result->isused.AC_EVSEStatus=1;
|
||||
result->isused.DC_EVSEStatus=0;
|
||||
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int chargingStatus(struct MessageHeaderType* header, struct ChargingStatusReqType* param, struct ChargingStatusResType* result)
|
||||
{
|
||||
printf("EVSE side: chargingStatus called\n" );
|
||||
|
||||
|
||||
|
||||
result->ResponseCode=OK_responseCodeType;
|
||||
result->EVSEID.data[0]=1;
|
||||
result->EVSEID.arraylen.data=1;
|
||||
result->AC_EVSEStatus.PowerSwitchClosed=1;
|
||||
result->AC_EVSEStatus.RCD=1;
|
||||
result->AC_EVSEStatus.EVSENotification=None_EVSENotificationType;
|
||||
result->AC_EVSEStatus.NotificationMaxDelay=123;
|
||||
result->ReceiptRequired=0;
|
||||
result->EVSEMaxCurrent.Multiplier = 2;
|
||||
result->EVSEMaxCurrent.Unit = A_unitSymbolType;
|
||||
result->EVSEMaxCurrent.isused.Unit=1;
|
||||
result->EVSEMaxCurrent.Value = 400;
|
||||
result->isused.EVSEMaxCurrent=1;
|
||||
result->SAScheduleTupleID=10;
|
||||
|
||||
result->isused.MeterInfo=1;
|
||||
result->MeterInfo.MeterID.arraylen.data=1;
|
||||
result->MeterInfo.MeterID.data[0]=2;
|
||||
result->MeterInfo.MeterReading.Multiplier = 0;
|
||||
result->MeterInfo.MeterReading.Unit = A_unitSymbolType;
|
||||
result->MeterInfo.MeterReading.Value = 500;
|
||||
result->MeterInfo.MeterStatus = 4321;
|
||||
result->MeterInfo.TMeter =123456789;
|
||||
result->MeterInfo.isused.MeterReading = 1;
|
||||
result->MeterInfo.isused.MeterStatus=1;
|
||||
result->MeterInfo.isused.TMeter=1;
|
||||
result->MeterInfo.isused.SigMeterReading=0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int meteringReceipt(struct MessageHeaderType* header, struct MeteringReceiptReqType* param, struct MeteringReceiptResType* result)
|
||||
{
|
||||
|
||||
printf("EVSE side: meteringReceipt called\n" );
|
||||
printf("\tReceived data:\n");
|
||||
|
||||
printf("\t\t SAScheduleTupleID=%d\n", param->SAScheduleTupleID);
|
||||
printf("\t\t MeterInfo.MeterStatus=%d\n", param->MeterInfo.MeterStatus);
|
||||
printf("\t\t MeterInfo.MeterID=%d\n", param->MeterInfo.MeterID.data[0]);
|
||||
printf("\t\t MeterInfo.isused.MeterReading=%d\n", param->MeterInfo.isused.MeterReading);
|
||||
printf("\t\t MeterReading.Value=%d\n", param->MeterInfo.MeterReading.Value);
|
||||
printf("\t\t MeterInfo.TMeter=%lld\n", param->MeterInfo.TMeter);
|
||||
|
||||
result->ResponseCode = OK_responseCodeType;
|
||||
|
||||
result->AC_EVSEStatus.PowerSwitchClosed=1;
|
||||
result->AC_EVSEStatus.RCD=1;
|
||||
result->AC_EVSEStatus.EVSENotification=None_EVSENotificationType;
|
||||
result->AC_EVSEStatus.NotificationMaxDelay=123;
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int cableCheck(struct MessageHeaderType* header, struct CableCheckReqType* param, struct CableCheckResType* result)
|
||||
{
|
||||
printf("EVSE side: cableCheck called\n" );
|
||||
printf("\tReceived data:\n");
|
||||
|
||||
|
||||
printf("\t\t EVStatus:\n");
|
||||
printf("\t\t\t EVReady=%d\n", param->DC_EVStatus.EVReady);
|
||||
printf("\t\t\t EVRESSSOC=%d\n", param->DC_EVStatus.EVRESSSOC);
|
||||
printf("\t\t\t EVErrorCode=%d\n", param->DC_EVStatus.EVErrorCode);
|
||||
printf("\t\t\t EVRESSConditioning=%d\n", param->DC_EVStatus.EVRESSConditioning);
|
||||
printf("\t\t\t EVCabinConditioning=%d\n", param->DC_EVStatus.EVCabinConditioning);
|
||||
|
||||
|
||||
result->ResponseCode = OK_responseCodeType;
|
||||
result->EVSEProcessing = Ongoing_EVSEProcessingType;
|
||||
result->DC_EVSEStatus.EVSEIsolationStatus= Valid_isolationLevelType;
|
||||
result->DC_EVSEStatus.isused.EVSEIsolationStatus = 1;
|
||||
result->DC_EVSEStatus.EVSEStatusCode = EVSE_Ready_DC_EVSEStatusCodeType;
|
||||
result->DC_EVSEStatus.EVSENotification=None_EVSENotificationType;
|
||||
result->DC_EVSEStatus.NotificationMaxDelay=123;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int preCharge(struct MessageHeaderType* header, struct PreChargeReqType* param, struct PreChargeResType* result)
|
||||
{
|
||||
struct PhysicalValueType float_type;
|
||||
|
||||
|
||||
printf("EVSE side: preCharge called\n" );
|
||||
printf("\tReceived data:\n");
|
||||
printf("\t\t EVStatus:\n");
|
||||
printf("\t\t\t EVReady=%d\n", param->DC_EVStatus.EVReady);
|
||||
printf("\t\t\t EVRESSSOC=%d\n", param->DC_EVStatus.EVRESSSOC);
|
||||
printf("\t\t\t EVErrorCode=%d\n", param->DC_EVStatus.EVErrorCode);
|
||||
printf("\t\t\t EVRESSConditioning=%d\n", param->DC_EVStatus.EVRESSConditioning);
|
||||
printf("\t\t\t EVCabinConditioning=%d\n", param->DC_EVStatus.EVCabinConditioning);
|
||||
|
||||
result->ResponseCode = OK_responseCodeType;
|
||||
result->DC_EVSEStatus.EVSEIsolationStatus= Valid_isolationLevelType;
|
||||
result->DC_EVSEStatus.isused.EVSEIsolationStatus = 1;
|
||||
result->DC_EVSEStatus.EVSEStatusCode = EVSE_Ready_DC_EVSEStatusCodeType;
|
||||
result->DC_EVSEStatus.EVSENotification=None_EVSENotificationType;
|
||||
result->DC_EVSEStatus.NotificationMaxDelay=123;
|
||||
|
||||
float_type.Multiplier = 0;
|
||||
float_type.Unit = V_unitSymbolType;
|
||||
float_type.isused.Unit=1;
|
||||
float_type.Value = 100;
|
||||
result->EVSEPresentVoltage = float_type;
|
||||
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
|
||||
|
||||
}
|
||||
|
||||
int currentDemand(struct MessageHeaderType* header, struct CurrentDemandReqType* param, struct CurrentDemandResType* result)
|
||||
{
|
||||
|
||||
struct PhysicalValueType f;
|
||||
|
||||
printf("EVSE side: currentDemand called\n" );
|
||||
printf("\tReceived data:\n");
|
||||
printf("\t\t EVStatus:\n");
|
||||
printf("\t\t\t EVReady=%d\n", param->DC_EVStatus.EVReady);
|
||||
printf("\t\t\t EVRESSSOC=%d\n", param->DC_EVStatus.EVRESSSOC);
|
||||
printf("\t\t\t EVErrorCode=%d\n", param->DC_EVStatus.EVErrorCode);
|
||||
printf("\t\t\t EVRESSConditioning=%d\n", param->DC_EVStatus.EVRESSConditioning);
|
||||
printf("\t\t\t EVCabinConditioning=%d\n", param->DC_EVStatus.EVCabinConditioning);
|
||||
|
||||
printf("\t\t EVTargetCurrent=%d\n", param->EVTargetCurrent.Value);
|
||||
printf("\t\t EVMaximumVoltageLimit=%d\n", param->EVMaximumVoltageLimit.Value);
|
||||
printf("\t\t EVMaximumPowerLimit=%d\n", param->EVMaximumPowerLimit.Value);
|
||||
printf("\t\t EVMaximumCurrentLimit=%d\n", param->EVMaximumCurrentLimit.Value);
|
||||
printf("\t\t BulkChargingComplete=%d\n", param->BulkChargingComplete);
|
||||
printf("\t\t ChargingComplete=%d\n", param->ChargingComplete);
|
||||
printf("\t\t RemainingTimeToFullSoC=%d\n", param->RemainingTimeToFullSoC.Value);
|
||||
printf("\t\t RemainingTimeToBulkSoC=%d\n", param->RemainingTimeToBulkSoC.Value);
|
||||
|
||||
printf("\t\t EVTargetVoltage=%d\n", param->EVTargetVoltage.Value);
|
||||
|
||||
|
||||
result->ResponseCode = OK_responseCodeType;
|
||||
result->DC_EVSEStatus.EVSEIsolationStatus= Valid_isolationLevelType;
|
||||
result->DC_EVSEStatus.isused.EVSEIsolationStatus = 1;
|
||||
result->DC_EVSEStatus.EVSEStatusCode = EVSE_Ready_DC_EVSEStatusCodeType;
|
||||
result->DC_EVSEStatus.EVSENotification=None_EVSENotificationType;
|
||||
result->DC_EVSEStatus.NotificationMaxDelay=123;
|
||||
|
||||
f.Multiplier = 0;
|
||||
f.Unit = V_unitSymbolType;
|
||||
f.isused.Unit=1;
|
||||
f.Value = 400;
|
||||
|
||||
result->EVSEPresentVoltage=f;
|
||||
|
||||
f.Unit = A_unitSymbolType;
|
||||
f.Value = 45;
|
||||
|
||||
result->EVSEPresentCurrent=f;
|
||||
|
||||
result->EVSECurrentLimitAchieved=0;
|
||||
|
||||
result->EVSEVoltageLimitAchieved=1;
|
||||
|
||||
result->EVSEPowerLimitAchieved=0;
|
||||
|
||||
f.Unit = V_unitSymbolType;
|
||||
f.Value = 400;
|
||||
|
||||
result->EVSEMaximumVoltageLimit=f;
|
||||
result->isused.EVSEMaximumVoltageLimit=1;
|
||||
|
||||
f.Unit = A_unitSymbolType;
|
||||
f.Value = 50;
|
||||
|
||||
result->EVSEMaximumCurrentLimit=f;
|
||||
result->isused.EVSEMaximumCurrentLimit=1;
|
||||
|
||||
f.Unit = W_unitSymbolType;
|
||||
f.Value = 20000;
|
||||
|
||||
result->EVSEMaximumPowerLimit=f;
|
||||
result->isused.EVSEMaximumPowerLimit=1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int weldingDetection(struct MessageHeaderType* header, struct WeldingDetectionReqType* param, struct WeldingDetectionResType* result)
|
||||
{
|
||||
|
||||
printf("EVSE side: weldingDetection called\n" );
|
||||
printf("\tReceived data:\n");
|
||||
printf("\t\t EVStatus:\n");
|
||||
printf("\t\t\t EVReady=%d\n", param->DC_EVStatus.EVReady);
|
||||
printf("\t\t\t EVRESSSOC=%d\n", param->DC_EVStatus.EVRESSSOC);
|
||||
printf("\t\t\t EVErrorCode=%d\n", param->DC_EVStatus.EVErrorCode);
|
||||
printf("\t\t\t EVRESSConditioning=%d\n", param->DC_EVStatus.EVRESSConditioning);
|
||||
printf("\t\t\t EVCabinConditioning=%d\n", param->DC_EVStatus.EVCabinConditioning);
|
||||
|
||||
result->ResponseCode = OK_responseCodeType;
|
||||
result->DC_EVSEStatus.EVSEIsolationStatus= Valid_isolationLevelType;
|
||||
result->DC_EVSEStatus.isused.EVSEIsolationStatus = 1;
|
||||
result->DC_EVSEStatus.EVSEStatusCode = EVSE_Ready_DC_EVSEStatusCodeType;
|
||||
result->DC_EVSEStatus.EVSENotification=None_EVSENotificationType;
|
||||
result->DC_EVSEStatus.NotificationMaxDelay=1234;
|
||||
result->EVSEPresentVoltage.Value = 123;
|
||||
result->EVSEPresentVoltage.Unit = V_unitSymbolType;
|
||||
result->EVSEPresentVoltage.Multiplier = 0;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sessionStop(struct MessageHeaderType* header, struct SessionStopType* param, struct SessionStopResType* result)
|
||||
{
|
||||
|
||||
|
||||
printf("EVSE side: sessionStop called\n" );
|
||||
|
||||
|
||||
result->ResponseCode = OK_responseCodeType;
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
|
||||
}
|
||||
|
||||
int serviceDetail(struct MessageHeaderType* header, struct ServiceDetailReqType* param, struct ServiceDetailResType* result)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int contractAuthentication(struct MessageHeaderType* header, struct ContractAuthenticationReqType* param, struct ContractAuthenticationResType* result)
|
||||
{
|
||||
|
||||
printf("EVSE: contractAuthentication called\n" );
|
||||
printf("\tReceived data:\n");
|
||||
|
||||
if(param->isused.GenChallenge)
|
||||
printf("\t\t\t GenChallenge=%d\n", param->GenChallenge.data[0]);
|
||||
|
||||
result->ResponseCode=OK_responseCodeType;
|
||||
result->EVSEProcessing=Ongoing_EVSEProcessingType;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int certificateUpdate(struct MessageHeaderType* header, struct CertificateUpdateReqType* param, struct CertificateUpdateResType* result)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
int certificateInstallation(struct MessageHeaderType* header, struct CertificateInstallationReqType* param, struct CertificateInstallationResType* result)
|
||||
{
|
||||
|
||||
printf("EVSE: certificateInstallation called\n" );
|
||||
printf("\tReceived data:\n");
|
||||
printf("\t\t\t OEMProvisioningCert=%d\n", param->OEMProvisioningCert.data[0]);
|
||||
printf("\t\t\t RootCertificateID[0]=%d\n", param->ListOfRootCertificateIDs.RootCertificateID[0].data[0]);
|
||||
printf("\t\t\t DHParams[0]=%d\n", param->DHParams.data[0]);
|
||||
|
||||
|
||||
|
||||
|
||||
/* result->ContractEncryptionEncryptedPrivateKey.data[0]=200;
|
||||
result->ContractEncryptionEncryptedPrivateKey.arraylen.data=1;
|
||||
*/
|
||||
|
||||
result->ContractID.data[0]=50;
|
||||
result->ContractID.arraylen.data=1;
|
||||
|
||||
result->ContractSignatureEncryptedPrivateKey.data[0]=12;
|
||||
result->ContractSignatureEncryptedPrivateKey.arraylen.data=1;
|
||||
|
||||
|
||||
|
||||
result->ContractSignatureCertChain.Certificate.data[0]=40;
|
||||
result->ContractSignatureCertChain.Certificate.arraylen.data=1;
|
||||
|
||||
result->ContractSignatureCertChain.SubCertificates.arraylen.Certificate=2;
|
||||
result->ContractSignatureCertChain.SubCertificates.Certificate[0].data[0]=20;
|
||||
result->ContractSignatureCertChain.SubCertificates.Certificate[0].arraylen.data=1;
|
||||
result->ContractSignatureCertChain.SubCertificates.Certificate[1].data[0]=80;
|
||||
result->ContractSignatureCertChain.SubCertificates.Certificate[1].arraylen.data=1;
|
||||
result->ContractSignatureCertChain.isused.SubCertificates=1;
|
||||
|
||||
result->DHParams.data[0]=99;
|
||||
result->DHParams.arraylen.data=1;
|
||||
|
||||
result->attr_Id.data[0]=33;
|
||||
result->attr_Id.arraylen.data=1;
|
||||
|
||||
result->ResponseCode = OK_responseCodeType;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void printBinaryArray(uint8_t* byte, uint32_t len) {
|
||||
unsigned int i;
|
||||
for(i=0; i<len; i++) {
|
||||
printf("%d ",byte[i]);
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
|
||||
|
|
@ -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
|
||||
*
|
||||
* <p>Switch for sample programs: EXI codec only or for entire V2G service</p>
|
||||
|
|
|
@ -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
|
||||
*
|
||||
*
|
||||
|
|
462
src/test/main_codec.c
Normal file
462
src/test/main_codec.c
Normal file
|
@ -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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Daniel.Peintner.EXT@siemens.com
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
* <p>Code generated by EXIdizer.com</p>
|
||||
********************************************************************/
|
||||
|
||||
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* <p>Sample program to illustrate how to read an EXI stream and
|
||||
* directly write it again to an output</p>
|
||||
*
|
||||
* <p>e.g., <executable> in.exi out.exi</p>
|
||||
********************************************************************/
|
||||
|
||||
/* 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 <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "EXIDecoder.h"
|
||||
#include "StringTable.h"
|
||||
#include "EXIEncoder.h"
|
||||
#include "EXITypes.h"
|
||||
#include "ByteStream.h"
|
||||
#include "ErrorCodes.h"
|
||||
#include "QNameDefines.h"
|
||||
|
||||
|
||||
/** EXI Debug mode */
|
||||
#define EXI_DEBUG 1
|
||||
|
||||
|
||||
#if EXI_STREAM == BYTE_ARRAY
|
||||
/* 64 kilobytes = 65 536 bytes */
|
||||
/* 1 megabyte = 1 048 576 bytes*/
|
||||
#define BUFFER_SIZE 1048576
|
||||
uint8_t bufferIn[BUFFER_SIZE];
|
||||
uint8_t bufferOut[BUFFER_SIZE];
|
||||
#endif /* EXI_STREAM == BYTE_ARRAY */
|
||||
|
||||
/* avoids warning: initializer element is not computable at load time */
|
||||
#define ARRAY_SIZE_BYTES 300
|
||||
uint8_t bytesData[ARRAY_SIZE_BYTES];
|
||||
#define ARRAY_SIZE_STRINGS 30000
|
||||
uint32_t codepoints[ARRAY_SIZE_STRINGS];
|
||||
#define ARRAY_SIZE_STRINGS_ASCII 150
|
||||
char charsNamespaceURI[ARRAY_SIZE_STRINGS_ASCII];
|
||||
char charsLocalName[ARRAY_SIZE_STRINGS_ASCII];
|
||||
|
||||
/* String table memory setup */
|
||||
uint16_t numberOfLocalStringsDecode[EXI_MAX_NUMBER_OF_QNAMES];
|
||||
uint16_t numberOfLocalStringsEncode[EXI_MAX_NUMBER_OF_QNAMES];
|
||||
|
||||
#if EXI_DEBUG == 1
|
||||
# define DEBUG_PRINTF(x) printf x
|
||||
#else
|
||||
# define DEBUG_PRINTF(x) do {} while (0)
|
||||
#endif
|
||||
|
||||
static void debugValue(exi_value_t* val);
|
||||
|
||||
|
||||
int main_codec(int argc, char *argv[]) {
|
||||
|
||||
int errn = 0;
|
||||
|
||||
unsigned int k;
|
||||
|
||||
bitstream_t iStream, oStream;
|
||||
uint32_t posDecode;
|
||||
uint32_t posEncode;
|
||||
|
||||
/* EXI set-up */
|
||||
exi_state_t stateDecode;
|
||||
exi_state_t stateEncode;
|
||||
exi_event_t event;
|
||||
uint16_t qnameID = 0; /* qname */
|
||||
uint16_t lastKnownQNameID = EXI_NUMBER_OF_PREPOPULATED_QNAMES - 1;
|
||||
exi_qname_t* qname;
|
||||
exi_value_t val;
|
||||
|
||||
exi_name_table_runtime_t runtimeTableDecode;
|
||||
exi_name_table_runtime_t runtimeTableEncode;
|
||||
|
||||
exi_string_table_t stringTableDecode = { 0, EXI_MAX_NUMBER_OF_QNAMES, numberOfLocalStringsDecode};
|
||||
exi_string_table_t stringTableEncode = { 0, EXI_MAX_NUMBER_OF_QNAMES, numberOfLocalStringsEncode};
|
||||
|
||||
/* BINARY memory setup */
|
||||
exi_bytes_t bytes = { ARRAY_SIZE_BYTES, bytesData, 0 };
|
||||
|
||||
int noEndOfDocument = 1; /* true */
|
||||
|
||||
/* STRING miss memory setup */
|
||||
exi_string_ucs_t string = { ARRAY_SIZE_STRINGS, codepoints, 0 };
|
||||
|
||||
#if EXI_DEBUG == 1
|
||||
/* The Eclipse console has buffering problems on Windows e.g, Debug mode */
|
||||
setvbuf(stdout, NULL, _IONBF, 0);
|
||||
setvbuf(stderr, NULL, _IONBF, 0);
|
||||
#endif /*EXI_DEBUG*/
|
||||
|
||||
if (argc != 3) {
|
||||
printf("Usage: %s exiInput exiOutput\n", argv[0]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* input pos */
|
||||
posDecode = 0;
|
||||
|
||||
#if EXI_STREAM == BYTE_ARRAY
|
||||
/* parse EXI stream to internal byte structures */
|
||||
errn = readBytesFromFile(argv[1], bufferIn, BUFFER_SIZE, posDecode);
|
||||
if (errn < 0) {
|
||||
printf("Problems while reading file into buffer\n");
|
||||
return errn;
|
||||
}
|
||||
#endif /* EXI_STREAM == BYTE_ARRAY */
|
||||
|
||||
/* setup input stream */
|
||||
#if EXI_STREAM == BYTE_ARRAY
|
||||
iStream.size = BUFFER_SIZE;
|
||||
iStream.data = bufferIn;
|
||||
iStream.pos = &posDecode;
|
||||
#endif /* EXI_STREAM == BYTE_ARRAY */
|
||||
#if EXI_STREAM == FILE_STREAM
|
||||
iStream.file = fopen(argv[1], "rb");
|
||||
#endif /* EXI_STREAM == FILE_STREAM */
|
||||
|
||||
iStream.buffer = 0;
|
||||
iStream.capacity = 0;
|
||||
|
||||
/* setup output stream */
|
||||
posEncode = 0;
|
||||
#if EXI_STREAM == BYTE_ARRAY
|
||||
oStream.size = BUFFER_SIZE;
|
||||
oStream.data = bufferOut;
|
||||
oStream.pos = &posEncode;
|
||||
#endif
|
||||
#if EXI_STREAM == FILE_STREAM
|
||||
oStream.file = fopen(argv[2], "wb");
|
||||
#endif /* EXI_STREAM == FILE_STREAM */
|
||||
oStream.buffer = 0;
|
||||
oStream.capacity = 8;
|
||||
|
||||
val.binary = bytes;
|
||||
val.str.type = EXI_STRING_VALUE_MISS;
|
||||
val.str.miss = string;
|
||||
|
||||
/* init decoder (read header, set initial state) */
|
||||
/* init runtime table */
|
||||
errn = exiInitNameTableRuntime(&runtimeTableDecode);
|
||||
exiInitDecoder(&iStream, &stateDecode, runtimeTableDecode, stringTableDecode);
|
||||
|
||||
/* init encoder (write header, set initial state) */
|
||||
errn = exiInitNameTableRuntime(&runtimeTableEncode);
|
||||
exiInitEncoder(&oStream, &stateEncode, runtimeTableEncode, stringTableEncode);
|
||||
|
||||
DEBUG_PRINTF(("[DECODE] >>> EXI >>> [ENCODE] \n"));
|
||||
|
||||
do {
|
||||
if (errn) {
|
||||
DEBUG_PRINTF(("[Encode-ERROR] %d \n", errn));
|
||||
return errn;
|
||||
}
|
||||
|
||||
errn = exiDecodeNextEvent(&iStream, &stateDecode,
|
||||
&event);
|
||||
if (errn) {
|
||||
DEBUG_PRINTF(("[Decode-ERROR] %d \n", errn));
|
||||
return errn;
|
||||
}
|
||||
|
||||
switch (event) {
|
||||
case EXI_EVENT_START_DOCUMENT:
|
||||
/* decode */
|
||||
errn = exiDecodeStartDocument(&iStream,
|
||||
&stateDecode);
|
||||
if (errn) {
|
||||
DEBUG_PRINTF(("[Decode-ERROR-SD] %d \n", errn));
|
||||
return errn;
|
||||
}
|
||||
DEBUG_PRINTF((">> START_DOCUMENT \n"));
|
||||
/* encode */
|
||||
errn = exiEncodeStartDocument(&oStream,
|
||||
&stateEncode);
|
||||
break;
|
||||
case EXI_EVENT_END_DOCUMENT:
|
||||
/* decode */
|
||||
errn = exiDecodeEndDocument(&iStream,
|
||||
&stateDecode);
|
||||
if (errn) {
|
||||
DEBUG_PRINTF(("[Decode-ERROR-ED] %d \n", errn));
|
||||
return errn;
|
||||
}
|
||||
DEBUG_PRINTF((">> END_DOCUMENT \n"));
|
||||
/* encode */
|
||||
errn = exiEncodeEndDocument(&oStream,
|
||||
&stateEncode);
|
||||
/* signalize end of document */
|
||||
noEndOfDocument = 0; /* false */
|
||||
break;
|
||||
case EXI_EVENT_START_ELEMENT:
|
||||
case EXI_EVENT_START_ELEMENT_GENERIC:
|
||||
case EXI_EVENT_START_ELEMENT_GENERIC_UNDECLARED:
|
||||
/* decode */
|
||||
errn = exiDecodeStartElement(&iStream,
|
||||
&stateDecode, &qnameID);
|
||||
if (errn) {
|
||||
DEBUG_PRINTF(("[Decode-ERROR-SE] %d \n", errn));
|
||||
return errn;
|
||||
}
|
||||
DEBUG_PRINTF((">> SE (%d) \n", qnameID));
|
||||
/* encode */
|
||||
if(qnameID > lastKnownQNameID) {
|
||||
/* new qname */
|
||||
lastKnownQNameID = qnameID;
|
||||
/* URI or LocalName known ? */
|
||||
errn = exiGetLastQName(&qname);
|
||||
if(qname->uri.type == EXI_NAME_ENTRY_TYPE_ID) {
|
||||
/* local name only new */
|
||||
errn = exiEncodeStartElementNS(&oStream,
|
||||
&stateEncode, qname->uri.id, &qname->localName.str);
|
||||
} else {
|
||||
/* both, uri and localname new */
|
||||
errn = exiEncodeStartElementGeneric(&oStream,
|
||||
&stateEncode, &qname->uri.str, &qname->localName.str);
|
||||
}
|
||||
} else {
|
||||
errn = exiEncodeStartElement(&oStream,
|
||||
&stateEncode, qnameID);
|
||||
}
|
||||
break;
|
||||
case EXI_EVENT_END_ELEMENT:
|
||||
case EXI_EVENT_END_ELEMENT_UNDECLARED:
|
||||
/* decode */
|
||||
errn = exiDecodeEndElement(&iStream,
|
||||
&stateDecode, &qnameID);
|
||||
if (errn) {
|
||||
DEBUG_PRINTF(("[Decode-ERROR-EE] %d \n", errn));
|
||||
return errn;
|
||||
}
|
||||
DEBUG_PRINTF(("<< EE \n"));
|
||||
/* encode */
|
||||
errn = exiEncodeEndElement(&oStream,
|
||||
&stateEncode);
|
||||
break;
|
||||
case EXI_EVENT_CHARACTERS:
|
||||
case EXI_EVENT_CHARACTERS_GENERIC:
|
||||
case EXI_EVENT_CHARACTERS_GENERIC_UNDECLARED:
|
||||
/* decode */
|
||||
errn = exiDecodeCharacters(&iStream,
|
||||
&stateDecode, &val);
|
||||
if (errn) {
|
||||
DEBUG_PRINTF(("[Decode-ERROR-CH] %d \n", errn));
|
||||
return errn;
|
||||
}
|
||||
DEBUG_PRINTF((" CH: "));
|
||||
debugValue(&val);
|
||||
/* encode */
|
||||
errn = exiEncodeCharacters(&oStream,
|
||||
&stateEncode, &val);
|
||||
|
||||
/* list value: special behavior */
|
||||
if (val.type == EXI_DATATYPE_LIST) {
|
||||
for(k=0; k<val.list.len; k++) {
|
||||
errn = exiDecodeListValue(&iStream, &stateDecode, qnameID, &val, val.list);
|
||||
if (errn) {
|
||||
DEBUG_PRINTF(("[Decode-ERROR-CH_LIST] %d \n", errn));
|
||||
return errn;
|
||||
}
|
||||
DEBUG_PRINTF((" CH: "));
|
||||
debugValue(&val);
|
||||
/* encode list value */
|
||||
errn = exiEncodeListValue(&oStream, &stateEncode, qnameID,
|
||||
&val, val.list);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case EXI_EVENT_ATTRIBUTE:
|
||||
case EXI_EVENT_ATTRIBUTE_GENERIC:
|
||||
case EXI_EVENT_ATTRIBUTE_GENERIC_UNDECLARED:
|
||||
case EXI_EVENT_ATTRIBUTE_INVALID_VALUE:
|
||||
/* decode */
|
||||
errn = exiDecodeAttribute(&iStream, &stateDecode,
|
||||
&qnameID, &val);
|
||||
if (errn) {
|
||||
DEBUG_PRINTF(("[Decode-ERROR-AT] %d \n", errn));
|
||||
return errn;
|
||||
}
|
||||
DEBUG_PRINTF((" AT (%d): ", qnameID));
|
||||
debugValue(&val);
|
||||
/* encode */
|
||||
if(qnameID > lastKnownQNameID) {
|
||||
/* new qname */
|
||||
lastKnownQNameID = qnameID;
|
||||
/* URI or LocalName known ? */
|
||||
errn = exiGetLastQName(&qname);
|
||||
if(qname->uri.type == EXI_NAME_ENTRY_TYPE_ID) {
|
||||
/* local name only new */
|
||||
errn = exiEncodeAttributeNS(&oStream,
|
||||
&stateEncode, qname->uri.id, &qname->localName.str, &val);
|
||||
} else {
|
||||
/* both, uri and localname new */
|
||||
errn = exiEncodeAttributeGeneric(&oStream,
|
||||
&stateEncode, &qname->uri.str, &qname->localName.str, &val);
|
||||
}
|
||||
} else {
|
||||
errn = exiEncodeAttribute(&oStream, &stateEncode,
|
||||
qnameID, &val);
|
||||
}
|
||||
break;
|
||||
case EXI_EVENT_ATTRIBUTE_XSI_NIL:
|
||||
/* decode */
|
||||
errn = exiDecodeAttributeXsiNil(&iStream,
|
||||
&stateDecode, &val);
|
||||
if (errn) {
|
||||
DEBUG_PRINTF(("[Decode-ERROR-AT-NIL] %d \n", errn));
|
||||
return errn;
|
||||
}
|
||||
DEBUG_PRINTF((" AT {xsi}nil == %i \n", val.boolean));
|
||||
/* encode */
|
||||
errn = exiEncodeAttributeXsiNil(&oStream,
|
||||
&stateEncode, &val);
|
||||
break;
|
||||
case EXI_EVENT_ATTRIBUTE_XSI_TYPE:
|
||||
/* decode */
|
||||
errn = exiDecodeAttributeXsiType(&iStream,
|
||||
&stateDecode, &val);
|
||||
if (errn) {
|
||||
DEBUG_PRINTF(("[Decode-ERROR-AT-TYPE] %d \n", errn));
|
||||
return errn;
|
||||
}
|
||||
DEBUG_PRINTF((" AT {type}type == {%d}%d \n", val.eqname.namespaceURI, val.eqname.localPart));
|
||||
/* encode */
|
||||
errn = exiEncodeAttributeXsiType(&oStream,
|
||||
&stateEncode, &val);
|
||||
break;
|
||||
default:
|
||||
/* ERROR */
|
||||
DEBUG_PRINTF(("[Unknown-Event] %d \n", event));
|
||||
return EXI_ERROR_UNKOWN_EVENT;
|
||||
}
|
||||
|
||||
} while (noEndOfDocument);
|
||||
|
||||
#if EXI_STREAM == BYTE_ARRAY
|
||||
/* write to file */
|
||||
writeBytesToFile(oStream.data, posEncode, argv[2]);
|
||||
#endif
|
||||
#if EXI_STREAM == FILE_STREAM
|
||||
fclose(iStream.file);
|
||||
fclose(oStream.file);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void debugValue(exi_value_t* val) {
|
||||
#if EXI_DEBUG == 1
|
||||
int i;
|
||||
switch (val->type) {
|
||||
case EXI_DATATYPE_INTEGER:
|
||||
switch (val->integer.type) {
|
||||
/* Unsigned Integer */
|
||||
case EXI_UNSIGNED_INTEGER_8:
|
||||
printf("uint8 : %d \n", val->integer.val.uint8);
|
||||
break;
|
||||
case EXI_UNSIGNED_INTEGER_16:
|
||||
printf("uint16 : %d \n", val->integer.val.uint16);
|
||||
break;
|
||||
case EXI_UNSIGNED_INTEGER_32:
|
||||
printf("uint32 : %d \n", val->integer.val.uint32);
|
||||
break;
|
||||
case EXI_UNSIGNED_INTEGER_64:
|
||||
printf("uint64 : %ld \n",
|
||||
(long unsigned int) val->integer.val.uint64);
|
||||
break;
|
||||
/* (Signed) Integer */
|
||||
case EXI_INTEGER_8:
|
||||
printf("int8 : %d \n", val->integer.val.int8);
|
||||
break;
|
||||
case EXI_INTEGER_16:
|
||||
printf("int16 : %d \n", val->integer.val.int16);
|
||||
break;
|
||||
case EXI_INTEGER_32:
|
||||
printf("int32 : %d \n", val->integer.val.int32);
|
||||
break;
|
||||
case EXI_INTEGER_64:
|
||||
printf("int64 : %ld \n", (long int) val->integer.val.int64);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case EXI_DATATYPE_BINARY_BASE64:
|
||||
case EXI_DATATYPE_BINARY_HEX:
|
||||
printf("Binary (len == %d) : ", val->binary.len);
|
||||
for (i = 0; i < val->binary.len; i++) {
|
||||
printf(" [%d]", val->binary.data[i]);
|
||||
}
|
||||
printf("\n");
|
||||
break;
|
||||
case EXI_DATATYPE_BOOLEAN:
|
||||
printf("Boolean : %d \n", val->boolean);
|
||||
break;
|
||||
case EXI_DATATYPE_STRING:
|
||||
switch(val->str.type) {
|
||||
case EXI_STRING_VALUE_MISS:
|
||||
printf("String Miss (len==%d) : '", val->str.miss.len);
|
||||
for (i = 0; i < val->str.miss.len; i++) {
|
||||
printf("%c", (char) val->str.miss.codepoints[i]);
|
||||
}
|
||||
printf("'\n");
|
||||
break;
|
||||
case EXI_STRING_VALUE_LOCAL_HIT:
|
||||
printf("String LocalHit: %d \n", val->str.localID);
|
||||
break;
|
||||
case EXI_STRING_VALUE_GLOBAL_HIT:
|
||||
printf("String GlobalHit: %d \n", val->str.globalID);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case EXI_DATATYPE_LIST:
|
||||
printf("List (len==%d) \n", val->list.len);
|
||||
break;
|
||||
case EXI_DATATYPE_QNAME:
|
||||
printf("QName (uri==%d, localName=%d) \n", val->eqname.namespaceURI, val->eqname.localPart);
|
||||
break;
|
||||
default:
|
||||
printf(" ?Value-Type? \n");
|
||||
break;
|
||||
}
|
||||
#endif /*EXI_DEBUG*/
|
||||
}
|
||||
|
||||
|
1615
src/test/pev_service.c
Normal file
1615
src/test/pev_service.c
Normal file
File diff suppressed because it is too large
Load diff
76
src/test/serviceClientDataTransmitter.c
Normal file
76
src/test/serviceClientDataTransmitter.c
Normal file
|
@ -0,0 +1,76 @@
|
|||
/*
|
||||
* 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Sebastian.Kaebisch.EXT@siemens.com
|
||||
* @@version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
********************************************************************/
|
||||
|
||||
#include "v2g_serviceClientDataTransmitter.h"
|
||||
#include "evse_server.h"
|
||||
#include "v2gtp.h"
|
||||
|
||||
|
||||
|
||||
void binaryToBits(uint8_t x)
|
||||
{
|
||||
uint8_t cnt, mask = 1 << 7;
|
||||
|
||||
for(cnt=1;cnt<=8;++cnt)
|
||||
{
|
||||
printf("%c",((x & mask) == 0) ? '0' : '1');
|
||||
x <<= 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Send EXI stream (outStream) to EVSE and receive a response stream (inStream)*/
|
||||
int serviceDataTransmitter(uint8_t* outStream, uint32_t outStreamLength, uint8_t* inStream)
|
||||
{
|
||||
/* send output stream to the underlying network to the EVSE and wait for response
|
||||
* --> here provide data to the V2G server directly*/
|
||||
|
||||
uint32_t inStreamLength = 0;
|
||||
uint32_t payloadLength = 0;
|
||||
|
||||
printf("\nEXI request message size=%d bytes\n",outStreamLength);
|
||||
|
||||
|
||||
|
||||
/* setup v2gtp header information; outStreamLength==payloadLength*/
|
||||
write_v2gtpHeader(outStream,&outStreamLength,V2GTP_EXI_TYPE);
|
||||
|
||||
|
||||
/* uint8_t* outStream2 = {1,254,128,1,0,0,0,33,128,154,2,2,192,0,0,0,0,0,0,16,209,64,22,64,200,8,1,146,64,12,3,32,40,128,50,50,8,201,208,4,0};*/
|
||||
/* uint8_t outStream2[] = {0x01, 0xFE, 0x80, 0x01, 0x00, 0x00, 0x00, 0x21, 0x80, 0x9A, 0x02, 0x02, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0xD1, 0x40, 0x16, 0x40, 0xC8, 0x08, 0x01, 0x92, 0x40, 0x0C, 0x03, 0x20, 0x28, 0x80, 0x32, 0x32, 0x08, 0xC9, 0xD0, 0x04, 0x00};
|
||||
outStreamLength = 41;
|
||||
*/
|
||||
|
||||
|
||||
/* send data to EVSE server (add v2g offset)*/
|
||||
testV2GService(outStream, outStreamLength, inStream, &inStreamLength);
|
||||
|
||||
read_v2gtpHeader(inStream,inStreamLength, &payloadLength);
|
||||
|
||||
printf("\nEXI response message size=%d bytes\n",payloadLength);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -19,7 +19,7 @@
|
|||
/*******************************************************************
|
||||
*
|
||||
* @author Sebastian.Kaebisch.EXT@siemens.com
|
||||
* @version 0.6
|
||||
* @version 0.7
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
********************************************************************/
|
||||
|
@ -35,7 +35,7 @@ extern "C" {
|
|||
|
||||
/* This method has to be implemented!
|
||||
* This method sends EXI stream (outStream) to the EVSE and receives response stream (inStream)*/
|
||||
int serviceDataTransmitter(uint8_t* outStream, uint16_t outStreamLength, uint8_t* inStream);
|
||||
int serviceDataTransmitter(uint8_t* outStream, uint32_t outStreamLength, uint8_t* inStream);
|
||||
|
||||
#endif /* V2G_SERVICECLIENTDATATRANSMITTER_H_ */
|
||||
|
|
@ -1,97 +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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*******************************************************************
|
||||
*
|
||||
* @author Sebastian.Kaebisch.EXT@siemens.com
|
||||
* @version 0.6
|
||||
* @contact Joerg.Heuer@siemens.com
|
||||
*
|
||||
********************************************************************/
|
||||
|
||||
/*
|
||||
* This file implements the v2gtp header writer and reader.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "v2gtp.h"
|
||||
|
||||
|
||||
int write_v2gtpHeader(uint8_t* outStream, uint16_t* outStreamLength, uint16_t payloadType)
|
||||
{
|
||||
|
||||
/* write v2gtp version number 1=byte */
|
||||
outStream[0]=V2GTP_VERSION;
|
||||
|
||||
/* write inverse v2gtp version */
|
||||
outStream[1]=V2GTP_VERSION_INV;
|
||||
|
||||
|
||||
/* write payload type */
|
||||
outStream[3] = (uint8_t)(payloadType & 0xFF);
|
||||
outStream[2] = (uint8_t)(payloadType >> 8 & 0xFF);
|
||||
|
||||
/* write payload length */
|
||||
outStream[7] = (uint8_t)(*outStreamLength & 0xFF);
|
||||
outStream[6] = (uint8_t)(*outStreamLength>>8 & 0xFF);
|
||||
outStream[5] = (uint8_t)(*outStreamLength>>16 & 0xFF);
|
||||
outStream[4] = (uint8_t)(*outStreamLength>>24 & 0xFF);
|
||||
|
||||
/* here, the outStream length have to be resized by the v2gtp offset*/
|
||||
*outStreamLength += V2GTP_HEADER_LENGTH;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int read_v2gtpHeader(uint8_t* inStream, uint16_t inStreamLength, uint16_t* payloadLength)
|
||||
{
|
||||
uint16_t payloadType=0;
|
||||
|
||||
|
||||
/* check, if we support this v2gtp version */
|
||||
if(inStream[0]!=V2GTP_VERSION && inStream[1]!=V2GTP_VERSION_INV)
|
||||
return -1;
|
||||
|
||||
|
||||
/* check, if we support this payload type*/
|
||||
payloadType = inStream[2];
|
||||
payloadType = (payloadType << 8 | inStream[3]);
|
||||
|
||||
if(payloadType != V2GTP_EXI_TYPE)
|
||||
return -1;
|
||||
|
||||
|
||||
/* determine payload length*/
|
||||
*payloadLength = inStream[4];
|
||||
*payloadLength = (*payloadLength << 8 | inStream[5]);
|
||||
*payloadLength = (*payloadLength << 16 | inStream[6]);
|
||||
*payloadLength = (*payloadLength << 24 | inStream[7]);
|
||||
|
||||
if((*payloadLength+V2GTP_HEADER_LENGTH)!=inStreamLength)
|
||||
return -1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in a new issue