* first code check-in (support for EXI stream)

git-svn-id: https://svn.code.sf.net/p/openv2g/code/trunk@2 d9f2db14-54d0-4bde-b00c-16405c910529
This commit is contained in:
daniel_peintner 2010-09-17 09:48:32 +00:00
parent 5f032498c0
commit 9a9835ad3d
31 changed files with 19987 additions and 0 deletions

936
.cproject Normal file
View file

@ -0,0 +1,936 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<?fileVersion 4.0.0?>
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
<storageModule moduleId="org.eclipse.cdt.core.settings">
<cconfiguration id="cdt.managedbuild.config.gnu.mingw.exe.debug.181718907">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.exe.debug.181718907" moduleId="org.eclipse.cdt.core.settings" name="Debug">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="OpenV2G" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.exe.debug.181718907" name="Debug" parent="cdt.managedbuild.config.gnu.mingw.exe.debug">
<folderInfo id="cdt.managedbuild.config.gnu.mingw.exe.debug.181718907." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.mingw.exe.debug.876485680" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.exe.debug">
<targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.exe.debug.457244346" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.exe.debug"/>
<builder buildPath="${workspace_loc:/OpenV2G/Debug}" id="cdt.managedbuild.tool.gnu.builder.mingw.base.312232103" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" superClass="cdt.managedbuild.tool.gnu.builder.mingw.base"/>
<tool id="cdt.managedbuild.tool.gnu.assembler.mingw.exe.debug.1400631881" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.exe.debug">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1072508302" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.archiver.mingw.base.1769540501" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug.1144566927" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.debug">
<option id="gnu.cpp.compiler.mingw.exe.debug.option.optimization.level.1036013605" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.exe.debug.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
<option id="gnu.cpp.compiler.mingw.exe.debug.option.debugging.level.1326060222" name="Debug Level" superClass="gnu.cpp.compiler.mingw.exe.debug.option.debugging.level" value="gnu.cpp.compiler.debugging.level.max" valueType="enumerated"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.113647340" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug">
<option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.mingw.exe.debug.option.optimization.level.1898653479" name="Optimization Level" superClass="gnu.c.compiler.mingw.exe.debug.option.optimization.level" valueType="enumerated"/>
<option id="gnu.c.compiler.mingw.exe.debug.option.debugging.level.294845555" name="Debug Level" superClass="gnu.c.compiler.mingw.exe.debug.option.debugging.level" value="gnu.c.debugging.level.max" valueType="enumerated"/>
<option id="gnu.c.compiler.option.include.paths.773068816" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/OpenV2G/src/codec}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/OpenV2G/src/service}&quot;"/>
<listOptionValue builtIn="false" value="&quot;${workspace_loc:/OpenV2G/src/test}&quot;"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.67299528" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug.867726048" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.debug">
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.343385996" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.debug.895012244" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.debug"/>
</toolChain>
</folderInfo>
<sourceEntries>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="src/codec"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="src/test"/>
<entry flags="VALUE_WORKSPACE_PATH" kind="sourcePath" name="src/service"/>
</sourceEntries>
</configuration>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.release.681614450;cdt.managedbuild.config.gnu.mingw.exe.release.681614450.;cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.release.150928873;cdt.managedbuild.tool.gnu.c.compiler.input.2117635578">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.181718907;cdt.managedbuild.config.gnu.mingw.exe.debug.181718907.;cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.113647340;cdt.managedbuild.tool.gnu.c.compiler.input.67299528">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.1536681007;cdt.managedbuild.config.gnu.mingw.exe.debug.1536681007.;cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.1257453970;cdt.managedbuild.tool.gnu.c.compiler.input.1901507773">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.release.1091708379;cdt.managedbuild.config.gnu.mingw.exe.release.1091708379.;cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.release.1844784508;cdt.managedbuild.tool.gnu.c.compiler.input.1276057383">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
</cconfiguration>
<cconfiguration id="cdt.managedbuild.config.gnu.mingw.exe.release.681614450">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.config.gnu.mingw.exe.release.681614450" moduleId="org.eclipse.cdt.core.settings" name="Release">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.PE" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="OpenV2G" buildArtefactType="org.eclipse.cdt.build.core.buildArtefactType.exe" buildProperties="org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release,org.eclipse.cdt.build.core.buildArtefactType=org.eclipse.cdt.build.core.buildArtefactType.exe" cleanCommand="rm -rf" description="" id="cdt.managedbuild.config.gnu.mingw.exe.release.681614450" name="Release" parent="cdt.managedbuild.config.gnu.mingw.exe.release">
<folderInfo id="cdt.managedbuild.config.gnu.mingw.exe.release.681614450." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.mingw.exe.release.2035335846" name="MinGW GCC" superClass="cdt.managedbuild.toolchain.gnu.mingw.exe.release">
<targetPlatform id="cdt.managedbuild.target.gnu.platform.mingw.exe.release.123106486" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.mingw.exe.release"/>
<builder buildPath="${workspace_loc:/OpenV2G/Release}" id="cdt.managedbuild.tool.gnu.builder.mingw.base.660697414" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="CDT Internal Builder" superClass="cdt.managedbuild.tool.gnu.builder.mingw.base"/>
<tool id="cdt.managedbuild.tool.gnu.assembler.mingw.exe.release.495179675" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.mingw.exe.release">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1609271173" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.archiver.mingw.base.1798958359" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.mingw.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.release.1816121644" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.mingw.exe.release">
<option id="gnu.cpp.compiler.mingw.exe.release.option.optimization.level.1885785748" name="Optimization Level" superClass="gnu.cpp.compiler.mingw.exe.release.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
<option id="gnu.cpp.compiler.mingw.exe.release.option.debugging.level.1323278871" name="Debug Level" superClass="gnu.cpp.compiler.mingw.exe.release.option.debugging.level" value="gnu.cpp.compiler.debugging.level.none" valueType="enumerated"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.release.150928873" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.release">
<option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.mingw.exe.release.option.optimization.level.939780170" name="Optimization Level" superClass="gnu.c.compiler.mingw.exe.release.option.optimization.level" valueType="enumerated"/>
<option id="gnu.c.compiler.mingw.exe.release.option.debugging.level.8158262" name="Debug Level" superClass="gnu.c.compiler.mingw.exe.release.option.debugging.level" value="gnu.c.debugging.level.none" valueType="enumerated"/>
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.2117635578" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.release.891155820" name="MinGW C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.mingw.exe.release">
<inputType id="cdt.managedbuild.tool.gnu.c.linker.input.1593270687" superClass="cdt.managedbuild.tool.gnu.c.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.release.1711492373" name="MinGW C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.mingw.exe.release"/>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="scannerConfiguration">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.release.681614450;cdt.managedbuild.config.gnu.mingw.exe.release.681614450.;cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.release.150928873;cdt.managedbuild.tool.gnu.c.compiler.input.2117635578">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.181718907;cdt.managedbuild.config.gnu.mingw.exe.debug.181718907.;cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.113647340;cdt.managedbuild.tool.gnu.c.compiler.input.67299528">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.debug.1536681007;cdt.managedbuild.config.gnu.mingw.exe.debug.1536681007.;cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.debug.1257453970;cdt.managedbuild.tool.gnu.c.compiler.input.1901507773">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
<scannerConfigBuildInfo instanceId="cdt.managedbuild.config.gnu.mingw.exe.release.1091708379;cdt.managedbuild.config.gnu.mingw.exe.release.1091708379.;cdt.managedbuild.tool.gnu.c.compiler.mingw.exe.release.1844784508;cdt.managedbuild.tool.gnu.c.compiler.input.1276057383">
<autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC"/>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.make.core.GCCStandardMakePerFileProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="makefileGenerator">
<runAction arguments="-f ${project_name}_scd.mk" command="make" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/${specs_file}" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.cpp" command="g++" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-E -P -v -dD ${plugin_state_location}/specs.c" command="gcc" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfile">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/${specs_file}&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileCPP">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'g++ -E -P -v -dD &quot;${plugin_state_location}/specs.cpp&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
<profile id="org.eclipse.cdt.managedbuilder.core.GCCWinManagedMakePerProjectProfileC">
<buildOutputProvider>
<openAction enabled="true" filePath=""/>
<parser enabled="true"/>
</buildOutputProvider>
<scannerInfoProvider id="specsFile">
<runAction arguments="-c 'gcc -E -P -v -dD &quot;${plugin_state_location}/specs.c&quot;'" command="sh" useDefault="true"/>
<parser enabled="true"/>
</scannerInfoProvider>
</profile>
</scannerConfigBuildInfo>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="OpenV2G.cdt.managedbuild.target.gnu.mingw.exe.1420366407" name="Executable" projectType="cdt.managedbuild.target.gnu.mingw.exe"/>
</storageModule>
</cproject>

69
.project Normal file
View file

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>OpenV2G</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
<triggers>clean,full,incremental,</triggers>
<arguments>
<dictionary>
<key>?name?</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.append_environment</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildArguments</key>
<value></value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildCommand</key>
<value>make</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.buildLocation</key>
<value>${workspace_loc:/OpenV2G/Debug}</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.contents</key>
<value>org.eclipse.cdt.make.core.activeConfigSettings</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
<value>false</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableCleanBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.enableFullBuild</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.stopOnError</key>
<value>true</value>
</dictionary>
<dictionary>
<key>org.eclipse.cdt.make.core.useDefaultBuildCmd</key>
<value>true</value>
</dictionary>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
</natures>
</projectDescription>

165
LICENSE.txt Normal file
View file

@ -0,0 +1,165 @@
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<ns3:V2G_Message xmlns:ns1="urn:iso:15118:2:2010:MsgBody"
xmlns:ns2="urn:iso:15118:2:2010:MsgDataTypes"
xmlns:ns3="urn:iso:15118:2:2010:MsgDef"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:iso:15118:2:2010:MsgDef V2G_CI_MsgDef.xsd">
<ns3:Header>
<ns3:SessionInformation>
<ns2:SessionID>3031323334353637</ns2:SessionID>
<ns2:ProtocolVersion>1</ns2:ProtocolVersion>
</ns3:SessionInformation>
</ns3:Header>
<ns3:Body>
<ns1:SessionSetupReq>
<ns1:PEVStatus>
<ns2:ConnectorLocked>0</ns2:ConnectorLocked>
<ns2:ChargerStandby>1</ns2:ChargerStandby>
</ns1:PEVStatus>
</ns1:SessionSetupReq>
</ns3:Body>
</ns3:V2G_Message>

View file

@ -0,0 +1 @@
<EFBFBD>˜A<EFBFBD>™¡©±ºcF€

View file

@ -0,0 +1,251 @@
/*
* Copyright (C) 2007-2010 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 Daniel.Peintner.EXT@siemens.com
* @version 0.1
* @contact Joerg.Heuer@siemens.com
*
* Bit decoding functionalities
*
********************************************************************/
#include <stdlib.h>
#include <stdint.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#include "BitDecoderChannel.h"
#include "BitInputStream.h"
#include "EXITypes.h"
#ifndef BIT_DECODER_CHANNEL_C
#define BIT_DECODER_CHANNEL_C
int decode(bitstream_t* stream, uint8_t* b) {
return readBits(stream, 8, b);
}
int decodeBoolean(bitstream_t* stream, int* b) {
uint8_t ub;
int errn = readBits(stream, 1, &ub);
*b = (ub == 0) ? 0 : 1;
return errn;
}
int decodeNBitUnsignedInteger(bitstream_t* stream, size_t nbits, uint8_t* b) {
if (nbits == 0) {
*b = 0;
return 0;
} else {
return readBits(stream, nbits, b);
}
}
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 */
errno = 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 errno;
}
/**
* 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 {
errno = decode(stream, &b);
*uint64 += ((uint64_t) (b & 127)) << mShift;
mShift += 7;
} while (errn >= 0 && (b >> 7) == 1);
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;
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, int32);
*int32 = -(*int32 + 1);
return errn;
} else {
/* positive */
return decodeUnsignedInteger32(stream, int32);
}
}
/**
* 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;
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, int64);
*int64 = -(*int64 + 1);
return errn;
} else {
/* positive */
return decodeUnsignedInteger64(stream, int64);
}
}
/**
* 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, float_me_t* f) {
int errn = decodeInteger64(stream, &f->mantissa);
if (errn < 0) {
return errn;
}
return decodeInteger32(stream, &f->exponent);
}
/**
* Decode a sequence of characters for a given length.
*/
int decodeStringOnly(bitstream_t* stream, size_t len, string_ucs_t* s) {
decodeCharacters(stream, len, s->codepoints);
s->len = len;
return 0;
}
/**
* Decode a length prefixed sequence of characters.
*/
int decodeString(bitstream_t* stream, string_ucs_t* s) {
int errn = decodeUnsignedInteger32(stream, &s->len);
if (errn < 0) {
return errn;
}
return decodeStringOnly(stream, s->len, s);
}
int decodeStringValue(bitstream_t* stream, string_ucs_t* s) {
int errn = decodeUnsignedInteger32(stream, &s->len);
if (errn < 0) {
return errn;
}
switch (s->len) {
case 0:
/* local value partition */
printf("[ERROR] String local value partition hit not supported \n");
return -2;
case 1:
/* found in global value partition */
printf("[ERROR] String global value partition hit not supported \n");
return -3;
default:
/* not found in global value (and local value) partition
* ==> string literal is encoded as a String with the length
* incremented by two */
return decodeStringOnly(stream, ((s->len) - 2), s);
/* After encoding the string value, it is added to both the
* associated "local" value string table partition and the global
* value string table partition */
/* addValue(context, value); */
}
}
/**
* 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, size_t len, uint32_t* chars) {
unsigned int i;
int errn = 0;
for (i = 0; i < len && errn >= 0; i++) {
errn = decodeUnsignedInteger32(stream, &chars[i]);
}
return errn;
}
/**
* Decode a binary value as a length-prefixed sequence of octets.
*/
int decodeBinary(bitstream_t* stream, bytes_t* bytes) {
unsigned int i;
int errn = decodeUnsignedInteger32(stream, &bytes->len);
if (errn < 0) {
return errn;
}
for (i = 0; i < bytes->len && errn >= 0; i++) {
errn = decode(stream, &bytes->data[i]);
}
return errn;
}
#endif

View file

@ -0,0 +1,117 @@
/*
* Copyright (C) 2007-2010 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 Daniel.Peintner.EXT@siemens.com
* @version 0.1
* @contact Joerg.Heuer@siemens.com
*
********************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
#include "EXITypes.h"
#ifndef BIT_DECODER_CHANNEL_H
#define BIT_DECODER_CHANNEL_H
/**
* Decode a single boolean value. The value false is represented by the bit
* 0, and the value true is represented by the bit 1.
*/
int decodeBoolean(bitstream_t* stream, int* b);
/**
* Decodes and returns an n-bit unsigned integer.
*/
int decodeNBitUnsignedInteger(bitstream_t* stream, size_t nbits, uint8_t* uint8 );
/**
* 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 decodeUnsignedInteger32(bitstream_t* stream, uint32_t* uint32);
/**
* 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);
/**
* 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);
/**
* 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);
/**
* 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, float_me_t* f);
/**
* Decode a length prefixed sequence of characters.
*/
int decodeString(bitstream_t* stream, string_ucs_t* s);
/**
* 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
* --> string literal is encoded as a String with the length incremented by two
*/
int decodeStringValue(bitstream_t* stream, string_ucs_t* s);
/**
* Decode a sequence of characters according to a given length.
*/
int decodeCharacters(bitstream_t* stream, size_t len, uint32_t* chars);
/**
* Decode a binary value as a length-prefixed sequence of octets.
*/
int decodeBinary(bitstream_t* stream, bytes_t* bytes);
#endif
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,298 @@
/*
* Copyright (C) 2007-2010 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 Daniel.Peintner.EXT@siemens.com
* @version 0.1
* @contact Joerg.Heuer@siemens.com
*
********************************************************************/
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include "BitEncoderChannel.h"
#include "BitOutputStream.h"
#include "EXITypes.h"
#ifndef BIT_ENCODER_CHANNEL_C
#define BIT_ENCODER_CHANNEL_C
/**
* Returns the least number of 7 bit-blocks that is needed to represent the
* int <param>n</param>. Returns 1 if <param>n</param> is 0.
*
* @param n
* integer value
*
*/
uint8_t numberOf7BitBlocksToRepresent(int 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;
}
}
int encode(bitstream_t* stream, uint8_t b) {
return writeBits(stream, b, 8);
}
/**
* 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, val, 1);
}
/**
* 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, uint8_t val, size_t nbits) {
return writeBits(stream, val, nbits);
}
/**
* 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;
}
case 4:
errn = encode(stream, (uint8_t)(128 | n));
n = n >> 7;
if (errn < 0) {
break;
}
case 3:
errn = encode(stream, (uint8_t)(128 | n));
n = n >> 7;
if (errn < 0) {
break;
}
case 2:
errn = encode(stream, (uint8_t)(128 | n));
n = n >> 7;
if (errn < 0) {
break;
}
case 1:
/* 0 .. 7 (last byte) */
errn = encode(stream, (uint8_t)(0 | n));
}
}
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);
}
/**
* 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, float_me_t* f) {
int errn = encodeInteger64(stream, f->mantissa);
if (errn >= 0) {
errn = encodeInteger32(stream, f->exponent);
}
return errn;
}
/**
* Encode a length prefixed sequence of characters.
*/
int encodeString(bitstream_t* stream, string_ucs_t* string) {
int errn = encodeUnsignedInteger32(stream, string->len);
if (errn >= 0) {
errn = encodeCharacters(stream, string->codepoints, string->len);
}
return errn;
}
int encodeStringValue(bitstream_t* stream, string_ucs_t* string) {
/* encode string as string table miss */
int errn = encodeUnsignedInteger32(stream, string->len+2);
if (errn >= 0) {
errn = encodeCharacters(stream, string->codepoints, string->len);
}
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 encodeCharacters(bitstream_t* stream, uint32_t* chars, size_t len) {
unsigned int i;
int errn = 0;
for(i=0; i<len && errn>=0; i++) {
errn = encodeUnsignedInteger32(stream, chars[i]);
}
return errn;
}
/**
* Encode a binary value as a length-prefixed sequence of octets.
*/
int encodeBinary(bitstream_t* stream, 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;
}
/**
* Flush underlying bit output stream.
*/
int encodeFinish(bitstream_t* stream) {
return flush(stream);
}
#endif

View file

@ -0,0 +1,133 @@
/*
* Copyright (C) 2007-2010 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 Daniel.Peintner.EXT@siemens.com
* @version 0.1
* @contact Joerg.Heuer@siemens.com
*
********************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include "EXITypes.h"
#ifndef BIT_ENCODER_CHANNEL_H
#define BIT_ENCODER_CHANNEL_H
/**
* 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);
/**
* 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, uint8_t val, size_t nbits);
/**
* 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);
/**
* 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);
/**
* 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);
/**
* 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);
/**
* 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.
*/
int encodeFloat(bitstream_t* stream, float_me_t* f);
/**
* Encode a length prefixed sequence of characters.
*/
int encodeString(bitstream_t* stream, string_ucs_t* string);
/**
* Encode a length prefixed sequence of characters in the sense of string tables
*/
int encodeStringValue(bitstream_t* stream, string_ucs_t* string);
/**
* 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 encodeCharacters(bitstream_t* stream, uint32_t* chars, size_t len);
/**
* Encode a binary value as a length-prefixed sequence of octets.
*/
int encodeBinary(bitstream_t* stream, bytes_t* bytes);
/**
* Flush underlying bit output stream
*/
int encodeFinish(bitstream_t* stream);
#endif
#ifdef __cplusplus
}
#endif

100
src/codec/BitInputStream.c Normal file
View file

@ -0,0 +1,100 @@
/*
* Copyright (C) 2007-2010 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 Daniel.Peintner.EXT@siemens.com
* @version 0.1
* @contact Joerg.Heuer@siemens.com
*
********************************************************************/
#include <stdio.h>
#include <string.h>
#include <stdint.h>
#include "EXITypes.h"
#include "BitInputStream.h"
#ifndef BIT_INPUT_STREAM_C
#define BIT_INPUT_STREAM_C
/* internal method to (re)fill buffer */
int readBuffer(bitstream_t* stream)
{
int errn = 0;
if(stream->capacity==0)
{
if ( (*stream->pos) < stream->size ) {
stream->buffer = stream->data[(*stream->pos)++];
stream->capacity = BITS_IN_BYTE;
} else {
errn = -1;
}
}
return errn;
}
int readBits(bitstream_t* stream, size_t num_bits, uint8_t* b)
{
int errn = readBuffer(stream);
if (errn < 0) {
return errn;
}
/* read the bits in one step */
if(num_bits <= stream->capacity)
{
stream->capacity -= 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 = BITS_IN_BYTE - num_bits;
}
}
return errn;
}
#endif

View file

@ -0,0 +1,44 @@
/*
* Copyright (C) 2007-2010 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 Daniel.Peintner.EXT@siemens.com
* @version 0.1
* @contact Joerg.Heuer@siemens.com
*
********************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
#include "EXITypes.h"
#ifndef BIT_INPUT_STREAM_H
#define BIT_INPUT_STREAM_H
int readBits(bitstream_t* stream, size_t num_bits, uint8_t* b);
int flush();
#endif
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,95 @@
/*
* Copyright (C) 2007-2010 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 Daniel.Peintner.EXT@siemens.com
* @version 0.1
* @contact Joerg.Heuer@siemens.com
*
********************************************************************/
#include <string.h>
#include "EXITypes.h"
#include "BitOutputStream.h"
#ifndef BIT_OUTPUT_STREAM_C
#define BIT_OUTPUT_STREAM_C
/* NOTE: nbits <= 8 */
int writeBits(bitstream_t* stream, uint8_t val, size_t nbits) {
/* 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 -= nbits;
/* if the buffer is full write it into the data */
if (stream->capacity == 0) {
if ((*stream->pos) >= stream->size) {
return -1;
}
stream->data[(*stream->pos)++] = 0xFF & stream->buffer;
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 ((*stream->pos) >= stream->size) {
return -1;
}
stream->data[(*stream->pos)++] = 0xFF & stream->buffer;
stream->buffer = 0;
/* write whole bytes */
while (nbits >= BITS_IN_BYTE) {
nbits -= BITS_IN_BYTE;
if ((*stream->pos) >= stream->size) {
return -1;
}
stream->data[(*stream->pos)++] = 0xFF & (val >> (nbits));
}
/* spared bits are kept in the buffer */
stream->buffer = val; /* Note: the high bits will be shifted out during further filling */
stream->capacity = 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, 0, stream->capacity);
}
}
#endif

View file

@ -0,0 +1,48 @@
/*
* Copyright (C) 2007-2010 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 Daniel.Peintner.EXT@siemens.com
* @version 0.1
* @contact Joerg.Heuer@siemens.com
*
********************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include "EXITypes.h"
#ifndef BIT_OUTPUT_STREAM_H
#define BIT_OUTPUT_STREAM_H
int writeBits(bitstream_t* stream, uint8_t bits, size_t nbits);
/* flush output */
int flush(bitstream_t* stream);
#endif
#ifdef __cplusplus
}
#endif

106
src/codec/BitStream.c Normal file
View file

@ -0,0 +1,106 @@
/*
* Copyright (C) 2007-2010 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 Daniel.Peintner.EXT@siemens.com
* @version 0.1
* @contact Joerg.Heuer@siemens.com
*
********************************************************************/
#define _CRT_SECURE_NO_DEPRECATE 1
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <stdint.h>
#include <stdio.h>
#include "EXITypes.h"
#ifndef BIT_STREAM_C
#define BIT_STREAM_C
int toBitstream(const char * filename, bitstream_t* bitstream) {
FILE* f;
// bitstream_t* bitstream;
int character;
size_t len = 0, pos = 0, i;
f = fopen(filename, "rb");
// bitstream = malloc(sizeof(bitstream_t));
if (f == NULL) {
printf("\n[Error] no valid file handle !\n");
return -1;
} else {
/* detect file size */
while ((character = getc(f)) != EOF) {
/* printf("%u \n", character); */
len++;
}
fclose(f);
/* printf("%u Zeichen", len); */
/* setup stream */
bitstream->data = malloc(sizeof(uint8_t) * len);
bitstream->size = len;
bitstream->pos = &pos;
bitstream->buffer = 0;
bitstream->capacity = 8;
/* read file byte per byte */
f = fopen(filename, "rb");
i = 0;
while ((character = getc(f)) != EOF) {
bitstream->data[i] = (uint8_t) character;
i++;
}
fclose(f);
}
return 0;
}
int writeBytesToFile(uint8_t* data, size_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 -1;
}
}
}
int writeBitstreamToFile(bitstream_t* bitsream, const char * filename) {
return writeBytesToFile(bitsream->data, bitsream->size, filename);
}
#endif

48
src/codec/BitStream.h Normal file
View file

@ -0,0 +1,48 @@
/*
* Copyright (C) 2007-2010 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 Daniel.Peintner.EXT@siemens.com
* @version 0.1
* @contact Joerg.Heuer@siemens.com
*
********************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include "EXITypes.h"
#ifndef BIT_STREAM_H
#define BIT_STREAM_H
int writeBytesToFile(uint8_t* data, size_t len, const char * filename);
int writeBitstreamToFile(bitstream_t* bitsream, const char * filename);
int toBitstream(const char * filename, bitstream_t* bitstream);
#endif
#ifdef __cplusplus
}
#endif

71
src/codec/EXICoder.c Normal file
View file

@ -0,0 +1,71 @@
/*
* Copyright (C) 2007-2010 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 Daniel.Peintner.EXT@siemens.com
* @version 0.1
* @contact Joerg.Heuer@siemens.com
*
********************************************************************/
#ifndef EXI_CODER_C
#define EXI_CODER_C
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "EXITypes.h"
#include "BitInputStream.h"
#include "BitDecoderChannel.h"
#include "assert.h"
#include "EXICoder.h"
#include "EXIHeader.h"
/*
size_t exiGetCurrentState(struct exiState* state) {
return state->grammarStates[state->currentStack];
// return 0;
}
*/
int exiPushStack(exi_state_t* state, size_t newState, eqname_t* eqn) {
if ((state->stackIndex + 1) < EXI_ELEMENT_STACK_SIZE) {
state->grammarStack[++state->stackIndex] = newState;
// copy qname
state->elementStack[state->stackIndex].localPart = eqn->localPart;
state->elementStack[state->stackIndex].namespaceURI = eqn->namespaceURI;
return 0;
} else {
return EXI_ERROR_OUT_OF_BOUNDS;
}
}
int exiPopStack(exi_state_t* state) {
if (state->stackIndex >= 1) {
state->stackIndex--;
return 0;
} else {
return EXI_ERROR_OUT_OF_BOUNDS;
}
}
#endif

51
src/codec/EXICoder.h Normal file
View file

@ -0,0 +1,51 @@
/*
* Copyright (C) 2007-2010 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 Daniel.Peintner.EXT@siemens.com
* @version 0.1
* @contact Joerg.Heuer@siemens.com
*
********************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
#ifndef EXI_CODER_H
#define EXI_CODER_H
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include "EXITypes.h"
// size_t exiGetCurrentState(struct exiState* state);
int exiPushStack(exi_state_t* state, size_t newState, eqname_t* eqn);
int exiPopStack(exi_state_t* state);
#endif
#ifdef __cplusplus
}
#endif

9483
src/codec/EXIDecoder.c Normal file

File diff suppressed because it is too large Load diff

61
src/codec/EXIDecoder.h Normal file
View file

@ -0,0 +1,61 @@
/*
* Copyright (C) 2007-2010 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 Daniel.Peintner.EXT@siemens.com
* @version 0.1
* @contact Joerg.Heuer@siemens.com
*
********************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
#ifndef EXI_DECODER_H
#define EXI_DECODER_H
#include "EXITypes.h"
int exiInitDecoder(bitstream_t* stream, exi_state_t* state);
int exiDecodeNextEvent(bitstream_t* stream, exi_state_t* state,
exi_event_t* nextEvent);
int exiDecodeStartDocument(bitstream_t* stream, exi_state_t* state);
int exiDecodeEndDocument(bitstream_t* stream, exi_state_t* state);
int exiDecodeStartElement(bitstream_t* stream, exi_state_t* state,
eqname_t* se);
int exiDecodeEndElement(bitstream_t* stream, exi_state_t* state,
eqname_t* ee);
int exiDecodeCharacters(bitstream_t* stream, exi_state_t* state,
exi_value_t* val);
int exiDecodeAttribute(bitstream_t* stream, exi_state_t* state,
eqname_t* at, exi_value_t* val);
#endif
#ifdef __cplusplus
}
#endif

6843
src/codec/EXIEncoder.c Normal file

File diff suppressed because it is too large Load diff

61
src/codec/EXIEncoder.h Normal file
View file

@ -0,0 +1,61 @@
/*
* Copyright (C) 2007-2010 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 Daniel.Peintner.EXT@siemens.com
* @version 0.1
* @contact Joerg.Heuer@siemens.com
*
********************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
#ifndef EXI_ENCODER_H
#define EXI_ENCODER_H
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include "EXITypes.h"
int exiInitEncoder(bitstream_t* stream, exi_state_t* state);
int exiEncodeStartDocument(bitstream_t* stream, exi_state_t* state);
int exiEncodeEndDocument(bitstream_t* stream, exi_state_t* state);
int exiEncodeStartElement(bitstream_t* stream, exi_state_t* state,
eqname_t* se);
int exiEncodeEndElement(bitstream_t* stream, exi_state_t* state, eqname_t* ee);
int exiEncodeCharacters(bitstream_t* stream, exi_state_t* state,
exi_value_t* val);
int exiEncodeAttribute(bitstream_t* stream, exi_state_t* state, eqname_t* at,
exi_value_t* val);
#endif
#ifdef __cplusplus
}
#endif

64
src/codec/EXIHeader.c Normal file
View file

@ -0,0 +1,64 @@
/*
* Copyright (C) 2007-2010 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 Daniel.Peintner.EXT@siemens.com
* @version 0.1
* @contact Joerg.Heuer@siemens.com
*
********************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include "EXIHeader.h"
#include "BitInputStream.h"
#include "BitOutputStream.h"
#include "BitDecoderChannel.h"
#include "BitEncoderChannel.h"
#ifndef EXI_HEADER_C
#define EXI_HEADER_C
int readEXIHeader(bitstream_t* stream) {
uint8_t header;
int errn = readBits(stream, 8, &header);
if (errn < 0) {
return errn;
}
if(header == '$') {
/* we do not support "EXI Cookie" */
errn = -1;
} else if ( header & 0x20 ) {
/* we do not support "Presence Bit for EXI Options" */
errn = -2;
} else {
/* Yes, a *simple* header */
errn = 0;
}
return errn;
}
int writeEXIHeader(bitstream_t* stream) {
return writeBits(stream, 144, 8);
}
#endif

46
src/codec/EXIHeader.h Normal file
View file

@ -0,0 +1,46 @@
/*
* Copyright (C) 2007-2010 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 Daniel.Peintner.EXT@siemens.com
* @version 0.1
* @contact Joerg.Heuer@siemens.com
*
********************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include "EXITypes.h"
#ifndef EXI_HEADER_H
#define EXI_HEADER_H
int readEXIHeader(bitstream_t* stream);
int writeEXIHeader(bitstream_t* stream);
#endif
#ifdef __cplusplus
}
#endif

195
src/codec/EXITypes.h Normal file
View file

@ -0,0 +1,195 @@
/*
* Copyright (C) 2007-2010 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 Daniel.Peintner.EXT@siemens.com
* @version 0.1
* @contact Joerg.Heuer@siemens.com
*
********************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
#include <string.h>
#include <stdint.h>
#ifndef EXI_TYPES_H
#define EXI_TYPES_H
#define BITS_IN_BYTE 8
#define EXI_ELEMENT_STACK_SIZE 16
/* EXI automaton methods prefixes such as "inline" etc. */
#ifndef EXI_MPFX
#define EXI_MPFX
#endif
#define FLOAT_EXPONENT_SPECIAL_VALUES -16384
#define FLOAT_MANTISSA_INFINITY 1
#define FLOAT_MANTISSA_MINUS_INFINITY -1
#define FLOAT_MANTISSA_NOT_A_NUMBER 0
typedef struct {
/* Integer Array */
size_t size; /* array size */
uint8_t* data; /* int data array */
size_t* pos; /* next position in array */
/* Current byte buffer & its remaining bit capacity */
uint8_t buffer;
size_t capacity;
} bitstream_t;
typedef struct {
/* Bytes Size and array container */
size_t size;
uint8_t* data;
/* current length (len <= size) */
size_t len;
} bytes_t;
/* Universal Character Set (UCS) strings */
typedef struct {
/* UCS size and UCS character container*/
size_t size;
uint32_t* codepoints;
/* current length == number of code-points, (len <= size) */
size_t len;
} string_ucs_t;
/* ASCII strings */
typedef struct {
size_t size;
char* ascii;
/* current length == number of characters, (len <= size) */
size_t len;
} string_ascii_t;
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 */
int32_t exponent; /* base-10 */
} float_me_t;
typedef enum
{
/* Binary */
BINARY_BASE64, BINARY_HEX,
/* Boolean */
BOOLEAN,
/* Decimal */
DECIMAL,
/* Float */
FLOAT, DOUBLE,
/* N-Bit Integer */
NBIT_INTEGER_32, NBIT_INTEGER_64, NBIT_INTEGER_BIG,
/* Unsigned Integer */
UNSIGNED_INTEGER_16, UNSIGNED_INTEGER_32, UNSIGNED_INTEGER_64, UNSIGNED_INTEGER_BIG,
/* (Signed) Integer */
INTEGER_16, INTEGER_32, INTEGER_64, INTEGER_BIG,
/* Datetime */
DATETIME,
/* String */
STRING,
/* Enumeration */
ENUMERATION,
/* List */
LIST
} exi_datatype_t;
typedef enum
{
START_DOCUMENT,
END_DOCUMENT,
START_ELEMENT,
START_ELEMENT_GENERIC, /* not supported yet */
END_ELEMENT,
CHARACTERS,
CHARACTERS_GENERIC, /* not supported yet */
ATTRIBUTE,
ATTRIBUTE_GENERIC, /* not supported yet */
/* error state */
ERROR
} exi_event_t;
/* TODO list support */
typedef struct {
/* List container with memory size */
size_t size;
uint8_t* data;
/* list item type */
exi_datatype_t type;
/* number of items */
size_t len;
} list_t;
typedef struct {
unsigned int namespaceURI;
unsigned int localPart;
} eqname_t;
typedef struct {
/* stack of grammar states and elements */
size_t grammarStack [EXI_ELEMENT_STACK_SIZE];
eqname_t elementStack [EXI_ELEMENT_STACK_SIZE];
size_t stackIndex;
/* event-code */
uint8_t eventCode;
} exi_state_t;
typedef struct {
/* union of base types */
union {
int boolean;
int8_t int8;
uint8_t uint8;
uint32_t uint32;
int32_t int32;
int64_t int64;
uint8_t enumeration;
};
/* Bytes, Strings and Lists are not base types */
bytes_t binary;
string_ucs_t string;
list_t list;
/* value datatype */
exi_datatype_t type;
} exi_value_t;
/*
* ERROR-Codes
*/
# define EXI_ERROR_OUT_OF_BOUNDS -100
# define EXI_ERROR_UNKOWN_EVENT_CODE -110
#endif
#ifdef __cplusplus
}
#endif

113
src/codec/StringTable.c Normal file
View file

@ -0,0 +1,113 @@
/*
* Copyright (C) 2007-2010 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 Daniel.Peintner.EXT@siemens.com
* @version 0.1
* @contact Joerg.Heuer@siemens.com
*
********************************************************************/
#ifndef STRING_TABLE_C
#define STRING_TABLE_C
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "StringTable.h"
#include "EXITypes.h"
#include "BitInputStream.h"
#include "BitDecoderChannel.h"
#include "StringTableEntries.h"
#include "assert.h"
int exiGetUri(size_t uriID, const char** uri) {
if ( uriID < stringTable.len ) {
*uri = stringTable.uris[uriID];
} else {
return EXI_ERROR_OUT_OF_BOUNDS;
}
return 0;
}
int exiGetUriLength(size_t* uriLength) {
*uriLength = stringTable.len;
return 0;
}
int exiGetUriID(const char* uri, size_t* uriID) {
unsigned int i;
for(i=0; i<stringTable.len; i++) {
if ( strcmp ( uri, stringTable.uris[i] ) == 0 ) {
*uriID = i;
return 0;
}
}
return -1;
}
int exiGetLocalName(size_t uriID, size_t localNameID, const char** localName) {
if ( uriID < stringTable.len ) {
if ( localNameID < stringTable.localNames[uriID].len ) {
*localName = stringTable.localNames[uriID].entries[localNameID];
// strcpy(stringTable.localNames[uriID].entries[localNameID], localName);
} else {
return EXI_ERROR_OUT_OF_BOUNDS;
}
} else {
return EXI_ERROR_OUT_OF_BOUNDS;
}
return 0;
}
int exiGetLocalNameLength(size_t uriID, size_t* localNameLength) {
if ( uriID < stringTable.len ) {
*localNameLength = stringTable.localNames[uriID].len;
} else {
return EXI_ERROR_OUT_OF_BOUNDS;
}
return 0;
}
int exiGetLocalNameID(size_t uriID, const char* localName, size_t* localNameID) {
unsigned int i;
if ( uriID < stringTable.len ) {
/* TODO binary search */
for(i=0; i<stringTable.localNames[uriID].len; i++) {
if ( strcmp ( localName, stringTable.localNames[uriID].entries[i] ) == 0 ) {
*localNameID = i;
return 0;
}
}
} else {
return EXI_ERROR_OUT_OF_BOUNDS;
}
return -1;
}
#endif

53
src/codec/StringTable.h Normal file
View file

@ -0,0 +1,53 @@
/*
* Copyright (C) 2007-2010 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 Daniel.Peintner.EXT@siemens.com
* @version 0.1
* @contact Joerg.Heuer@siemens.com
*
********************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
#ifndef STRING_TABLE_H
#define STRING_TABLE_H
#include "EXITypes.h"
int exiGetUri(size_t uriID, const char** uri);
int exiGetUriLength(size_t* uriLength);
int exiGetUriID(const char* uri, size_t* uriID);
int exiGetLocalName(size_t uriID, size_t localNameID, const char** localName);
int exiGetLocalNameLength(size_t uriID, size_t* localNameLength);
int exiGetLocalNameID(size_t uriID, const char* localName, size_t* localNameID);
#endif
#ifdef __cplusplus
}
#endif

View file

@ -0,0 +1,124 @@
/*
* Copyright (C) 2007-2010 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 Daniel.Peintner.EXT@siemens.com
* @version 0.1
* @contact Joerg.Heuer@siemens.com
*
********************************************************************/
#ifndef STRING_TABLE_ENTRIES_C
#define STRING_TABLE_ENTRIES_C
#include "StringTableEntries.h"
/* ==================================== */
/* String Table Population */
/* localName entries for URI id = 0 */
const char * localNames0[] = {
NULL
};
/* localName entries for URI id = 1 */
const char * localNames1[] = {
"base", "id", "lang", "space"
};
/* localName entries for URI id = 2 */
const char * localNames2[] = {
"nil", "type"
};
/* localName entries for URI id = 3 */
const char * localNames3[] = {
"ENTITIES", "ENTITY", "ID", "IDREF", "IDREFS",
"NCName", "NMTOKEN", "NMTOKENS", "NOTATION", "Name",
"QName", "anySimpleType", "anyType", "anyURI", "base64Binary",
"boolean", "byte", "date", "dateTime", "decimal",
"double", "duration", "float", "gDay", "gMonth",
"gMonthDay", "gYear", "gYearMonth", "hexBinary", "int",
"integer", "language", "long", "negativeInteger", "nonNegativeInteger",
"nonPositiveInteger", "normalizedString", "positiveInteger", "short", "string",
"time", "token", "unsignedByte", "unsignedInt", "unsignedLong",
"unsignedShort"
};
/* localName entries for URI id = 4 */
const char * localNames4[] = {
"ChargingProfile", "ContractID", "EAmount", "EVSEID", "EVSEIMax",
"EVSEMaxPhases", "EVSEMaxPower", "EVSEStatus", "EVSEVoltage", "EnergyProvider",
"EoC", "LineLockReq", "LineLockReqType", "LineLockRes", "LineLockResType",
"MeterInfo", "MeteringAuthPubKey", "MeteringReceiptReq", "MeteringReceiptReqType", "MeteringReceiptRes",
"MeteringReceiptResType", "MeteringStatusReq", "MeteringStatusReqType", "MeteringStatusRes", "MeteringStatusResType",
"PCurrent", "PEVID", "PEVMaxPhases", "PEVMaxPower", "PEVMaxVoltage",
"PEVMinVoltage", "PEVPubKey", "PEVStatus", "PaymentDetailsReq", "PaymentDetailsReqType",
"PaymentDetailsRes", "PaymentDetailsResType", "PowerDeliveryReq", "PowerDeliveryReqType", "PowerDeliveryRes",
"PowerDeliveryResType", "PowerDiscoveryReq", "PowerDiscoveryReqType", "PowerDiscoveryRes", "PowerDiscoveryResType",
"ReqLockStatus", "ReqSwitchStatus", "ResponseCode", "ServiceDiscoveryReq", "ServiceDiscoveryReqType",
"ServiceDiscoveryRes", "ServiceDiscoveryResType", "ServiceList", "ServicePaymentSelectionReq", "ServicePaymentSelectionReqType",
"ServicePaymentSelectionRes", "ServicePaymentSelectionResType", "ServiceScope", "ServiceType", "SessionSetupReq",
"SessionSetupReqType", "SessionSetupRes", "SessionSetupResType", "TCurrent", "Tariff",
"TariffTable"
};
/* localName entries for URI id = 5 */
const char * localNames5[] = {
"ChargerStandby", "ChargingProfileEntryMaxPower", "ChargingProfileEntryStart", "ChargingProfileType", "ConnectorLocked",
"Currency", "EPrice", "EVSEStandby", "EVSEStatusType", "Event",
"EventList", "EventListType", "FatalError", "FaultCode", "FaultMsg",
"FloatingValueType", "MeterID", "MeterInfoType", "MeterPubKey", "MeterReading",
"MeterStatus", "Multiplier", "NotificationType", "PEVStatusType", "PaymentOption",
"PowerSwitchClosed", "ProtocolVersion", "RCD", "Service", "ServiceDescriptionType",
"ServiceDetails", "ServiceID", "ServiceListType", "ServiceName", "ServiceScope",
"ServiceSessionID", "ServiceType", "SessionID", "SessionInformationType", "ShutDownTime",
"SigMeterReading", "TMeter", "Tariff", "TariffDescrType", "TariffDescription",
"TariffEntries", "TariffEntriesType", "TariffEntry", "TariffEntryType", "TariffID",
"TariffPMax", "TariffStart", "TariffTableType", "Unit", "Value",
"contractIDType", "currencyType", "energyProviderType", "eventEntryType", "evseIDType",
"fatalErrorType", "faultCodeType", "lockStatusType", "maxPhasesType", "meterIDType",
"meterStatusType", "paymentOptionListType", "paymentOptionType", "pevIDType", "protocolVersionType",
"pubKeyType", "rcdType", "responseCode_LineLockType", "responseCode_MeteringReceiptType", "responseCode_MeteringStatusType",
"responseCode_PaymentDetailsType", "responseCode_PowerDeliveryType", "responseCode_PowerDiscoveryType", "responseCode_ServiceDiscoveryType", "responseCode_ServicePaymentSelectionType",
"responseCode_SessionSetupType", "serviceDetailsType", "serviceIDType", "serviceNameType", "serviceScopeType",
"serviceTypeType", "sessionIDType", "standbyType", "switchStatusType", "tariffDescriptionType",
"tariffIDType", "tariffStartType", "timeType", "unitMultiplierType", "unitSymbolType"
};
/* localName entries for URI id = 6 */
const char * localNames6[] = {
"Body", "BodyBaseType", "BodyElement", "BodyType", "Header",
"HeaderType", "Notification", "Security", "SessionInformation", "V2G_Message"
};
struct exiPartition localNamePartitions[7] = {
{ 0, localNames0 },
{ 4, localNames1 },
{ 2, localNames2 },
{ 46, localNames3 },
{ 66, localNames4 },
{ 95, localNames5 },
{ 10, localNames6 }
};
const char * uris[] = {
"", "http://www.w3.org/XML/1998/namespace", "http://www.w3.org/2001/XMLSchema-instance", "http://www.w3.org/2001/XMLSchema", "urn:iso:15118:2:2010:MsgBody", "urn:iso:15118:2:2010:MsgDataTypes", "urn:iso:15118:2:2010:MsgDef"
};
struct exiStringTable stringTable = { 7, uris, localNamePartitions };
#endif

View file

@ -0,0 +1,60 @@
/*
* Copyright (C) 2007-2010 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 Daniel.Peintner.EXT@siemens.com
* @version 0.1
* @contact Joerg.Heuer@siemens.com
*
********************************************************************/
#ifndef STRING_TABLE_ENTRIES_H
#define STRING_TABLE_ENTRIES_H
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
/* ==================================== */
/* String Table Structures */
struct exiPartition {
/* length of array */
size_t len;
/* array of string entries */
const char** entries;
};
struct exiStringTable {
/* length of both arrays (uris & localNames) */
size_t len;
/* URI entries*/
const char** uris;
/* localName entries divided by URI */
struct exiPartition * localNames;
};
/* ==================================== */
/* String Table Population */
extern struct exiStringTable stringTable;
#endif

64
src/codec/UCSString.c Normal file
View file

@ -0,0 +1,64 @@
/*
* Copyright (C) 2007-2010 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 Daniel.Peintner.EXT@siemens.com
* @version 0.1
* @contact Joerg.Heuer@siemens.com
*
********************************************************************/
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <stdint.h>
#include "BitDecoderChannel.h"
#include "BitInputStream.h"
#include "EXITypes.h"
#ifndef UCS_STRING_C
#define UCS_STRING_C
int toUCSString(char* chars, string_ucs_t* s) {
unsigned int i;
s->len = strlen(chars);
if (s->len <= s->size) {
for(i=0; i<s->len; i++) {
s->codepoints[i] = chars[i];
}
return 0;
} else {
return -1;
}
}
/* Note: fails if string contains non ASCII characters */
int toASCIIString(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

48
src/codec/UCSString.h Normal file
View file

@ -0,0 +1,48 @@
/*
* Copyright (C) 2007-2010 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 Daniel.Peintner.EXT@siemens.com
* @version 0.1
* @contact Joerg.Heuer@siemens.com
*
********************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
#include "EXITypes.h"
// TODO utf8/cstring//wchar_t/char16_t/char32_t methods
#ifndef UCS_STRING_H
#define UCS_STRING_H
int toUCSString(char* chars, string_ucs_t* s);
// Note: fails if string contains non ASCII characters
int toASCIIString(string_ucs_t* string, char* outASCII);
#endif
#ifdef __cplusplus
}
#endif

218
src/test/main_codec.c Normal file
View file

@ -0,0 +1,218 @@
/*
* Copyright (C) 2007-2010 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 Daniel.Peintner.EXT@siemens.com
* @version 0.1
* @contact Joerg.Heuer@siemens.com
*
* <p>Sample program to illustrate how to read an EXI stream and
* directly write it again to an output</p>
*
* <p>e.g., data/test/sessionSetupReq.xml_SCHEMA.exi out/test/sessionSetupReq.xml_SCHEMA.exi</p>
********************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include "EXIDecoder.h"
#include "StringTable.h"
#include "EXIEncoder.h"
#include "EXITypes.h"
#include "Bitstream.h"
int main(int argc, char *argv[]) {
int errn = 0;
unsigned int i;
bitstream_t iStream, oStream;
size_t posDecode, posEncode;
// EXI set-up
exi_state_t stateDecode;
exi_state_t stateEncode;
exi_event_t event;
eqname_t eqn;
exi_value_t val;
// BINARY memory allocation
uint8_t data[10];
bytes_t bytes = { 10, data };
// STRING memory allocation
uint32_t codepoints[50];
string_ucs_t string = { 50, codepoints };
const char * localName;
const char * namespaceURI;
int noEndOfDocument = 1; /* true */
if (argc != 3) {
printf("Usage: %s exiInput exiOutput\n", argv[0]);
return -1;
}
/* parse EXI stream to internal byte structures */
toBitstream(argv[1], &iStream);
// input
posDecode = 0;
iStream.pos = &posDecode;
iStream.buffer = 0;
iStream.capacity = 0;
// output
posEncode = 0;
oStream.data = malloc(sizeof(uint8_t)*iStream.size);
oStream.size = iStream.size;
oStream.pos = &posEncode;
oStream.buffer = 0;
oStream.capacity = 8;
val.binary = bytes;
val.string = string;
/* init decoder (read header, set initial state) */
exiInitDecoder(&iStream, &stateDecode);
/* init encoder (write header, set initial state) */
exiInitEncoder(&oStream, &stateEncode);
printf("[DECODE] >>> EXI >>> [ENCODE] \n");
do {
if (errn < 0) {
printf("[Encode-ERROR] %d \n", errno);
return errn;
}
errn = exiDecodeNextEvent(&iStream, &stateDecode, &event);
if (errn < 0) {
printf("[Decode-ERROR] %d \n", errno);
return errn;
}
switch (event) {
case START_DOCUMENT:
// decode
errn = exiDecodeStartDocument(&iStream, &stateDecode);
if (errn < 0) {
printf("[Decode-ERROR] %d \n", errno);
return errn;
}
printf(">> START_DOCUMENT \n");
// encode
errn = exiEncodeStartDocument(&oStream, &stateEncode);
break;
case END_DOCUMENT:
// decode
errn = exiDecodeEndDocument(&iStream, &stateDecode);
if (errn < 0) {
printf("[Decode-ERROR] %d \n", errno);
return errn;
}
printf(">> END_DOCUMENT \n");
// encode
errn = exiEncodeEndDocument(&oStream, &stateEncode);
/* signalize end of document */
noEndOfDocument = 0; /* false */
break;
case START_ELEMENT:
// decode
errn = exiDecodeStartElement(&iStream, &stateDecode, &eqn);
if (errn < 0) {
printf("[Decode-ERROR] %d \n", errno);
return errn;
}
exiGetLocalName(eqn.namespaceURI, eqn.localPart, &localName);
exiGetUri(eqn.namespaceURI, &namespaceURI);
printf(">> SE {%s}%s \n", namespaceURI, localName);
// encode
errn = exiEncodeStartElement(&oStream, &stateEncode, &eqn);
break;
case END_ELEMENT:
// decode
errn = exiDecodeEndElement(&iStream, &stateDecode, &eqn);
if (errn < 0) {
printf("[Decode-ERROR] %d \n", errno);
return errn;
}
exiGetLocalName(eqn.namespaceURI, eqn.localPart, &localName);
exiGetUri(eqn.namespaceURI, &namespaceURI);
printf("<< EE {%s}%s \n", namespaceURI, localName);
// encode
errn = exiEncodeEndElement(&oStream, &stateEncode, &eqn);
break;
case CHARACTERS:
// decode
errn = exiDecodeCharacters(&iStream, &stateDecode, &val);
if (errn < 0) {
printf("[Decode-ERROR] %d \n", errno);
return errn;
}
if (val.type == INTEGER_BIG) {
printf(" CH int64 : %lld \n", val.int64);
} else if (val.type == BINARY_BASE64 || val.type == BINARY_HEX) {
printf(" CH Binary (len == %d) : ", val.binary.len);
for(i=0; i<val.binary.len; i++) {
printf(" [%d]", val.binary.data[i]);
}
printf("\n");
} else if (val.type == BOOLEAN) {
printf(" CH Boolean : %d \n", val.boolean);
} else if (val.type == STRING) {
printf(" CH String (len==%d) : '", val.string.len);
for(i=0;i<val.string.len; i++) {
printf("%c", (char)val.string.codepoints[i]);
}
printf("'\n");
} else {
printf(" CH ?? \n");
}
// encode
errn = exiEncodeCharacters(&oStream, &stateEncode, &val);
break;
case ATTRIBUTE:
// decode
errn = exiDecodeAttribute(&iStream, &stateDecode, &eqn, &val);
if (errn < 0) {
printf("[Decode-ERROR] %d \n", errno);
return errn;
}
exiGetLocalName(eqn.namespaceURI, eqn.localPart, &localName);
exiGetUri(eqn.namespaceURI, &namespaceURI);
printf(" AT {%s}%s \n", namespaceURI, localName);
// encode
errn = exiEncodeAttribute(&oStream, &stateEncode, &eqn, &val);
break;
default:
// ERROR
return -1;
}
} while (noEndOfDocument);
/* write to file */
writeBytesToFile(oStream.data, iStream.size, argv[2]);
return 0;
}