init
authorJeonghoon Park <jh1979.park@samsung.com>
Mon, 9 Jul 2018 05:22:12 +0000 (14:22 +0900)
committerJeonghoon Park <jh1979.park@samsung.com>
Mon, 9 Jul 2018 05:22:12 +0000 (14:22 +0900)
20 files changed:
.cproject [new file with mode: 0644]
.exportMap [new file with mode: 0644]
.project [new file with mode: 0644]
.smartthingsapp [new file with mode: 0644]
.tproject [new file with mode: 0644]
inc/co2.h [new file with mode: 0644]
inc/log.h [new file with mode: 0644]
inc/st_things.h [new file with mode: 0644]
inc/st_things_types.h [new file with mode: 0644]
inc/thing.h [new file with mode: 0644]
lib/liboicdastack.so [new file with mode: 0644]
lib/libsdkapi.so [new file with mode: 0644]
project_def.prop [new file with mode: 0644]
res/device_def.json [new file with mode: 0644]
shared/res/co2.png [new file with mode: 0644]
src/co2.c [new file with mode: 0644]
src/common_handlers.c [new file with mode: 0644]
src/resource_capability_airqualitysensor_main_0.c [new file with mode: 0644]
src/thing.c [new file with mode: 0644]
tizen-manifest.xml [new file with mode: 0644]

diff --git a/.cproject b/.cproject
new file mode 100644 (file)
index 0000000..170c0f1
--- /dev/null
+++ b/.cproject
@@ -0,0 +1,368 @@
+<?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="org.tizen.nativecore.config.sbi.gcc45.app.debug.1684968043">
+                       <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.tizen.nativecore.config.sbi.gcc45.app.debug.1684968043" moduleId="org.eclipse.cdt.core.settings" name="Debug">
+                               <externalSettings/>
+                               <extensions>
+                                       <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+                                       <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.tizen.nativecore.NativeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                               </extensions>
+                       </storageModule>
+                       <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+                               <configuration artifactName="co2" buildArtefactType="org.tizen.nativecore.buildArtefactType.app" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.tizen.nativecore.buildArtefactType.app,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.debug" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" id="org.tizen.nativecore.config.sbi.gcc45.app.debug.1684968043" name="Debug" parent="org.tizen.nativecore.config.sbi.gcc45.app.debug">
+                                       <folderInfo id="org.tizen.nativecore.config.sbi.gcc45.app.debug.1684968043." name="/" resourcePath="">
+                                               <toolChain id="org.tizen.nativecore.toolchain.sbi.gcc45.app.debug.401771083" name="Tizen Native Toolchain" superClass="org.tizen.nativecore.toolchain.sbi.gcc45.app.debug">
+                                                       <targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.tizen.nativeide.target.sbi.gnu.platform.base.10790367" osList="linux,win32" superClass="org.tizen.nativeide.target.sbi.gnu.platform.base"/>
+                                                       <builder autoBuildTarget="all" buildPath="${workspace_loc:/co2}/Debug" enableAutoBuild="true" id="org.tizen.nativecore.target.sbi.gnu.builder.327093003" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Tizen Application Builder" superClass="org.tizen.nativecore.target.sbi.gnu.builder"/>
+                                                       <tool command="arm-linux-gnueabi-ar" id="org.tizen.nativecore.tool.sbi.gnu.archiver.111989657" name="Archiver" superClass="org.tizen.nativecore.tool.sbi.gnu.archiver"/>
+                                                       <tool command="clang++" id="org.tizen.nativecore.tool.sbi.gnu.cpp.compiler.1495701674" name="C++ Compiler" superClass="org.tizen.nativecore.tool.sbi.gnu.cpp.compiler">
+                                                               <option id="gnu.cpp.compiler.option.optimization.level.927516291" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.none" valueType="enumerated"/>
+                                                               <option defaultValue="gnu.cpp.compiler.debugging.level.max" id="sbi.gnu.cpp.compiler.option.debugging.level.core.1484656362" name="Debug level" superClass="sbi.gnu.cpp.compiler.option.debugging.level.core" valueType="enumerated"/>
+                                                               <option defaultValue="false" id="sbi.gnu.cpp.compiler.option.misc.pic.core.1001060053" name="-fPIC option" superClass="sbi.gnu.cpp.compiler.option.misc.pic.core" valueType="boolean"/>
+                                                               <option id="sbi.gnu.cpp.compiler.option.1984987106" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs">
+                                                                       <listOptionValue builtIn="false" value="iot-headless-4.0-device.core_llvm40.armel"/>
+                                                               </option>
+                                                               <option id="sbi.gnu.cpp.compiler.option.frameworks_inc.core.1624204045" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.core" valueType="includePath">
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/libxml2&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore-agent&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appfw&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/base&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ckm&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dbus-1.0&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/device&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dlog&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efl-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eina-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eina-1/eina&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eo-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/gio-unix-2.0&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/glib-2.0&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/iotcon&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/json-glib-1.0&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/media&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/minizip&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/network&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/storage&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/system&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/lib/dbus-1.0/include&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/lib/glib-2.0/include&quot;"/>
+                                                               </option>
+                                                               <option id="sbi.gnu.cpp.compiler.option.frameworks_cflags.core.1846312411" superClass="sbi.gnu.cpp.compiler.option.frameworks_cflags.core" valueType="stringList">
+                                                                       <listOptionValue builtIn="false" value="${TC_COMPILER_MISC}"/>
+                                                                       <listOptionValue builtIn="false" value="${RS_COMPILER_MISC}"/>
+                                                                       <listOptionValue builtIn="false" value=" -fPIE"/>
+                                                                       <listOptionValue builtIn="false" value="--sysroot=&quot;${SBI_SYSROOT}&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="-mthumb"/>
+                                                               </option>
+                                                               <option id="gnu.cpp.compiler.option.include.paths.2094434401" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/inc}&quot;"/>
+                                                               </option>
+                                                               <option id="sbi.gnu.cpp.compiler.option.frameworks.core.186594478" superClass="sbi.gnu.cpp.compiler.option.frameworks.core" valueType="userObjs">
+                                                                       <listOptionValue builtIn="false" value="Native_API"/>
+                                                                       <listOptionValue builtIn="false" value="iot-things"/>
+                                                               </option>
+                                                               <option id="sbi.gnu.cpp.compiler.option.preprocessor.def.deprecation.830943794" superClass="sbi.gnu.cpp.compiler.option.preprocessor.def.deprecation" valueType="definedSymbols">
+                                                                       <listOptionValue builtIn="false" value="TIZEN_DEPRECATION"/>
+                                                                       <listOptionValue builtIn="false" value="DEPRECATION_WARNING"/>
+                                                                       <listOptionValue builtIn="false" value="_DEBUG"/>
+                                                               </option>
+                                                               <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1893389969" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+                                                       </tool>
+                                                       <tool command="clang" id="org.tizen.nativecore.tool.sbi.gnu.c.compiler.655028722" name="C Compiler" superClass="org.tizen.nativecore.tool.sbi.gnu.c.compiler">
+                                                               <option defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.1280615976" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
+                                                               <option defaultValue="gnu.c.debugging.level.max" id="sbi.gnu.c.compiler.option.debugging.level.core.440810614" name="Debug level" superClass="sbi.gnu.c.compiler.option.debugging.level.core" valueType="enumerated"/>
+                                                               <option defaultValue="false" id="sbi.gnu.c.compiler.option.misc.pic.core.25875162" name="-fPIC option" superClass="sbi.gnu.c.compiler.option.misc.pic.core" valueType="boolean"/>
+                                                               <option id="sbi.gnu.c.compiler.option.1831929903" superClass="sbi.gnu.c.compiler.option" valueType="userObjs">
+                                                                       <listOptionValue builtIn="false" value="iot-headless-4.0-device.core_llvm40.armel"/>
+                                                               </option>
+                                                               <option id="sbi.gnu.c.compiler.option.frameworks_inc.core.921921189" superClass="sbi.gnu.c.compiler.option.frameworks_inc.core" valueType="includePath">
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/libxml2&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore-agent&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appfw&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/base&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ckm&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dbus-1.0&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/device&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dlog&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efl-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eina-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eina-1/eina&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eo-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/gio-unix-2.0&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/glib-2.0&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/iotcon&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/json-glib-1.0&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/media&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/minizip&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/network&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/storage&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/system&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/lib/dbus-1.0/include&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/lib/glib-2.0/include&quot;"/>
+                                                               </option>
+                                                               <option id="sbi.gnu.c.compiler.option.frameworks_cflags.core.462486155" superClass="sbi.gnu.c.compiler.option.frameworks_cflags.core" valueType="stringList">
+                                                                       <listOptionValue builtIn="false" value="${TC_COMPILER_MISC}"/>
+                                                                       <listOptionValue builtIn="false" value="${RS_COMPILER_MISC}"/>
+                                                                       <listOptionValue builtIn="false" value=" -fPIE"/>
+                                                                       <listOptionValue builtIn="false" value="--sysroot=&quot;${SBI_SYSROOT}&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="-mthumb"/>
+                                                               </option>
+                                                               <option id="gnu.c.compiler.option.include.paths.1172694974" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/inc}&quot;"/>
+                                                               </option>
+                                                               <option id="sbi.gnu.c.compiler.option.frameworks.core.966161326" superClass="sbi.gnu.c.compiler.option.frameworks.core" valueType="userObjs">
+                                                                       <listOptionValue builtIn="false" value="Native_API"/>
+                                                                       <listOptionValue builtIn="false" value="iot-things"/>
+                                                               </option>
+                                                               <option id="sbi.gnu.c.compiler.option.preprocessor.def.symbols.deprecation.39569337" superClass="sbi.gnu.c.compiler.option.preprocessor.def.symbols.deprecation" valueType="definedSymbols">
+                                                                       <listOptionValue builtIn="false" value="TIZEN_DEPRECATION"/>
+                                                                       <listOptionValue builtIn="false" value="DEPRECATION_WARNING"/>
+                                                                       <listOptionValue builtIn="false" value="_DEBUG"/>
+                                                               </option>
+                                                               <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1767616947" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+                                                       </tool>
+                                                       <tool id="org.tizen.nativeide.tool.sbi.gnu.c.linker.base.1177668982" name="C Linker" superClass="org.tizen.nativeide.tool.sbi.gnu.c.linker.base"/>
+                                                       <tool command="clang++" id="org.tizen.nativecore.tool.sbi.gnu.cpp.linker.352176959" name="C++ Linker" superClass="org.tizen.nativecore.tool.sbi.gnu.cpp.linker">
+                                                               <option defaultValue="false" id="sbi.gnu.cpp.link.option.strip.726351699" name="Omit all symbol information (-s)" superClass="sbi.gnu.cpp.link.option.strip" valueType="boolean"/>
+                                                               <option defaultValue="false" id="sbi.gnu.cpp.linker.option.shared_flag.core.995372830" name="Linker.Shared" superClass="sbi.gnu.cpp.linker.option.shared_flag.core" valueType="boolean"/>
+                                                               <option defaultValue="false" id="sbi.gnu.cpp.linker.option.noundefined.core.757485109" name="Report unresolved symbol references (-Wl,--no-undefined)" superClass="sbi.gnu.cpp.linker.option.noundefined.core" valueType="boolean"/>
+                                                               <option id="sbi.gnu.cpp.linker.option.frameworks_lflags.core.1818548756" superClass="sbi.gnu.cpp.linker.option.frameworks_lflags.core" valueType="stringList">
+                                                                       <listOptionValue builtIn="false" value="${TC_LINKER_MISC}"/>
+                                                                       <listOptionValue builtIn="false" value="${RS_LINKER_MISC}"/>
+                                                                       <listOptionValue builtIn="false" value="-pie -lpthread "/>
+                                                                       <listOptionValue builtIn="false" value="--sysroot=&quot;${SBI_SYSROOT}&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="-Xlinker --version-script=&quot;${PROJ_PATH}/.exportMap&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="-L&quot;${SBI_SYSROOT}/usr/lib&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="-L&quot;${SBI_SYSROOT}/../iot-things-4.0-device.core/usr/lib&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="$(RS_LIBRARIES)"/>
+                                                               </option>
+                                                               <option id="gnu.cpp.link.option.paths.2003092378" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lib}&quot;"/>
+                                                               </option>
+                                                               <option id="gnu.cpp.link.option.libs.895938900" superClass="gnu.cpp.link.option.libs" valueType="libs">
+                                                                       <listOptionValue builtIn="false" value="oicdastack"/>
+                                                                       <listOptionValue builtIn="false" value="sdkapi"/>
+                                                               </option>
+                                                               <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.416514610" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
+                                                                       <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+                                                                       <additionalInput kind="additionalinput" paths="$(LIBS)"/>
+                                                               </inputType>
+                                                       </tool>
+                                                       <tool command="#{PLATFORM_DEFAULT_GCC_PREFIX}as" id="org.tizen.nativeapp.tool.sbi.gnu.assembler.base.1305330268" name="Assembler" superClass="org.tizen.nativeapp.tool.sbi.gnu.assembler.base">
+                                                               <inputType id="cdt.managedbuild.tool.gnu.assembler.input.315327703" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+                                                       </tool>
+                                                       <tool id="org.tizen.nativecore.tool.fnmapgen.852701578" name="C FN-Map Generator" superClass="org.tizen.nativecore.tool.fnmapgen"/>
+                                                       <tool id="org.tizen.nativecore.tool.fnmapgen.cpp.1287435170" name="C++ FN-Map Generator" superClass="org.tizen.nativecore.tool.fnmapgen.cpp"/>
+                                                       <tool id="org.tizen.nativecore.tool.ast.2092789826" name="C Static Analyzer" superClass="org.tizen.nativecore.tool.ast"/>
+                                                       <tool id="org.tizen.nativecore.tool.ast.cpp.684602459" name="C++ Static Analyzer" superClass="org.tizen.nativecore.tool.ast.cpp"/>
+                                                       <tool id="org.tizen.nativecore.tool.sbi.gnu.archiver.mergelib.2103598812" name="Archive Generator" superClass="org.tizen.nativecore.tool.sbi.gnu.archiver.mergelib"/>
+                                                       <tool id="org.tizen.nativecore.tool.sbi.po.compiler.1376941442" name="PO Resource Compiler" superClass="org.tizen.nativecore.tool.sbi.po.compiler"/>
+                                                       <tool id="org.tizen.nativecore.tool.sbi.edc.compiler.929720447" name="EDC Resource Compiler" superClass="org.tizen.nativecore.tool.sbi.edc.compiler"/>
+                                               </toolChain>
+                                       </folderInfo>
+                                       <sourceEntries>
+                                               <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="inc"/>
+                                               <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="res"/>
+                                               <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="shared"/>
+                                               <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
+                                       </sourceEntries>
+                               </configuration>
+                       </storageModule>
+                       <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+               </cconfiguration>
+               <cconfiguration id="org.tizen.nativecore.config.sbi.gcc45.app.release.1935466489">
+                       <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.tizen.nativecore.config.sbi.gcc45.app.release.1935466489" moduleId="org.eclipse.cdt.core.settings" name="Release">
+                               <externalSettings/>
+                               <extensions>
+                                       <extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
+                                       <extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.GmakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.MakeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.CWDLocator" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.tizen.nativecore.NativeErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                                       <extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
+                               </extensions>
+                       </storageModule>
+                       <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+                               <configuration artifactName="co2" buildArtefactType="org.tizen.nativecore.buildArtefactType.app" buildProperties="org.eclipse.cdt.build.core.buildArtefactType=org.tizen.nativecore.buildArtefactType.app,org.eclipse.cdt.build.core.buildType=org.eclipse.cdt.build.core.buildType.release" description="" errorParsers="org.eclipse.cdt.core.MakeErrorParser;org.eclipse.cdt.core.GCCErrorParser;" id="org.tizen.nativecore.config.sbi.gcc45.app.release.1935466489" name="Release" parent="org.tizen.nativecore.config.sbi.gcc45.app.release">
+                                       <folderInfo id="org.tizen.nativecore.config.sbi.gcc45.app.release.1935466489." name="/" resourcePath="">
+                                               <toolChain id="org.tizen.nativecore.toolchain.sbi.gcc45.app.release.971305695" name="Tizen Native Toolchain" superClass="org.tizen.nativecore.toolchain.sbi.gcc45.app.release">
+                                                       <targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.tizen.nativeide.target.sbi.gnu.platform.base.119382938" osList="linux,win32" superClass="org.tizen.nativeide.target.sbi.gnu.platform.base"/>
+                                                       <builder buildPath="${workspace_loc:/co2}/Release" id="org.tizen.nativecore.target.sbi.gnu.builder.1611287494" keepEnvironmentInBuildfile="false" managedBuildOn="true" name="Tizen Application Builder" superClass="org.tizen.nativecore.target.sbi.gnu.builder"/>
+                                                       <tool command="arm-linux-gnueabi-ar" id="org.tizen.nativecore.tool.sbi.gnu.archiver.697364366" name="Archiver" superClass="org.tizen.nativecore.tool.sbi.gnu.archiver"/>
+                                                       <tool command="clang++" id="org.tizen.nativecore.tool.sbi.gnu.cpp.compiler.2058269282" name="C++ Compiler" superClass="org.tizen.nativecore.tool.sbi.gnu.cpp.compiler">
+                                                               <option id="gnu.cpp.compiler.option.optimization.level.264877893" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" value="gnu.cpp.compiler.optimization.level.most" valueType="enumerated"/>
+                                                               <option defaultValue="gnu.cpp.compiler.debugging.level.none" id="sbi.gnu.cpp.compiler.option.debugging.level.core.1710555417" name="Debug level" superClass="sbi.gnu.cpp.compiler.option.debugging.level.core" valueType="enumerated"/>
+                                                               <option defaultValue="false" id="sbi.gnu.cpp.compiler.option.misc.pic.core.44092032" name="-fPIC option" superClass="sbi.gnu.cpp.compiler.option.misc.pic.core" valueType="boolean"/>
+                                                               <option id="sbi.gnu.cpp.compiler.option.415554586" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs">
+                                                                       <listOptionValue builtIn="false" value="iot-headless-4.0-device.core_llvm40.armel"/>
+                                                               </option>
+                                                               <option id="sbi.gnu.cpp.compiler.option.frameworks_inc.core.1881040319" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.core" valueType="includePath">
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/libxml2&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore-agent&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appfw&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/base&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ckm&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dbus-1.0&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/device&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dlog&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efl-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eina-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eina-1/eina&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eo-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/gio-unix-2.0&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/glib-2.0&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/iotcon&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/json-glib-1.0&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/media&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/minizip&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/network&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/storage&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/system&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/lib/dbus-1.0/include&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/lib/glib-2.0/include&quot;"/>
+                                                               </option>
+                                                               <option id="sbi.gnu.cpp.compiler.option.frameworks_cflags.core.919896027" superClass="sbi.gnu.cpp.compiler.option.frameworks_cflags.core" valueType="stringList">
+                                                                       <listOptionValue builtIn="false" value="${TC_COMPILER_MISC}"/>
+                                                                       <listOptionValue builtIn="false" value="${RS_COMPILER_MISC}"/>
+                                                                       <listOptionValue builtIn="false" value=" -fPIE"/>
+                                                                       <listOptionValue builtIn="false" value="--sysroot=&quot;${SBI_SYSROOT}&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="-mthumb"/>
+                                                               </option>
+                                                               <option id="gnu.cpp.compiler.option.include.paths.948468903" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/inc}&quot;"/>
+                                                               </option>
+                                                               <option id="sbi.gnu.cpp.compiler.option.frameworks.core.1876042437" superClass="sbi.gnu.cpp.compiler.option.frameworks.core" valueType="userObjs">
+                                                                       <listOptionValue builtIn="false" value="Native_API"/>
+                                                                       <listOptionValue builtIn="false" value="iot-things"/>
+                                                               </option>
+                                                               <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1699332162" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
+                                                       </tool>
+                                                       <tool command="clang" id="org.tizen.nativecore.tool.sbi.gnu.c.compiler.380226457" name="C Compiler" superClass="org.tizen.nativecore.tool.sbi.gnu.c.compiler">
+                                                               <option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.option.optimization.level.217049521" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" valueType="enumerated"/>
+                                                               <option defaultValue="gnu.c.debugging.level.none" id="sbi.gnu.c.compiler.option.debugging.level.core.8066054" name="Debug level" superClass="sbi.gnu.c.compiler.option.debugging.level.core" valueType="enumerated"/>
+                                                               <option defaultValue="false" id="sbi.gnu.c.compiler.option.misc.pic.core.1612101856" name="-fPIC option" superClass="sbi.gnu.c.compiler.option.misc.pic.core" valueType="boolean"/>
+                                                               <option id="sbi.gnu.c.compiler.option.765401613" superClass="sbi.gnu.c.compiler.option" valueType="userObjs">
+                                                                       <listOptionValue builtIn="false" value="iot-headless-4.0-device.core_llvm40.armel"/>
+                                                               </option>
+                                                               <option id="sbi.gnu.c.compiler.option.frameworks_inc.core.1310261364" superClass="sbi.gnu.c.compiler.option.frameworks_inc.core" valueType="includePath">
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/libxml2&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appcore-agent&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/appfw&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/base&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ckm&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dbus-1.0&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/device&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/dlog&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/ecore-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/efl-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eina-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eina-1/eina&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/eo-1&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/gio-unix-2.0&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/glib-2.0&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/iotcon&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/json-glib-1.0&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/media&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/minizip&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/network&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/storage&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/include/system&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/lib/dbus-1.0/include&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="&quot;${SBI_SYSROOT}/usr/lib/glib-2.0/include&quot;"/>
+                                                               </option>
+                                                               <option id="sbi.gnu.c.compiler.option.frameworks_cflags.core.240608328" superClass="sbi.gnu.c.compiler.option.frameworks_cflags.core" valueType="stringList">
+                                                                       <listOptionValue builtIn="false" value="${TC_COMPILER_MISC}"/>
+                                                                       <listOptionValue builtIn="false" value="${RS_COMPILER_MISC}"/>
+                                                                       <listOptionValue builtIn="false" value=" -fPIE"/>
+                                                                       <listOptionValue builtIn="false" value="--sysroot=&quot;${SBI_SYSROOT}&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="-mthumb"/>
+                                                               </option>
+                                                               <option id="gnu.c.compiler.option.include.paths.191249342" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/inc}&quot;"/>
+                                                               </option>
+                                                               <option id="sbi.gnu.c.compiler.option.frameworks.core.520200633" superClass="sbi.gnu.c.compiler.option.frameworks.core" valueType="userObjs">
+                                                                       <listOptionValue builtIn="false" value="Native_API"/>
+                                                                       <listOptionValue builtIn="false" value="iot-things"/>
+                                                               </option>
+                                                               <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1222425051" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
+                                                       </tool>
+                                                       <tool id="org.tizen.nativeide.tool.sbi.gnu.c.linker.base.365872581" name="C Linker" superClass="org.tizen.nativeide.tool.sbi.gnu.c.linker.base"/>
+                                                       <tool command="clang++" id="org.tizen.nativecore.tool.sbi.gnu.cpp.linker.1312122827" name="C++ Linker" superClass="org.tizen.nativecore.tool.sbi.gnu.cpp.linker">
+                                                               <option defaultValue="true" id="sbi.gnu.cpp.link.option.strip.1882225898" name="Omit all symbol information (-s)" superClass="sbi.gnu.cpp.link.option.strip" valueType="boolean"/>
+                                                               <option defaultValue="false" id="sbi.gnu.cpp.linker.option.shared_flag.core.1932892694" name="Linker.Shared" superClass="sbi.gnu.cpp.linker.option.shared_flag.core" valueType="boolean"/>
+                                                               <option defaultValue="false" id="sbi.gnu.cpp.linker.option.noundefined.core.1192546854" name="Report unresolved symbol references (-Wl,--no-undefined)" superClass="sbi.gnu.cpp.linker.option.noundefined.core" valueType="boolean"/>
+                                                               <option id="sbi.gnu.cpp.linker.option.frameworks_lflags.core.1508340608" superClass="sbi.gnu.cpp.linker.option.frameworks_lflags.core" valueType="stringList">
+                                                                       <listOptionValue builtIn="false" value="${TC_LINKER_MISC}"/>
+                                                                       <listOptionValue builtIn="false" value="${RS_LINKER_MISC}"/>
+                                                                       <listOptionValue builtIn="false" value="-pie -lpthread "/>
+                                                                       <listOptionValue builtIn="false" value="--sysroot=&quot;${SBI_SYSROOT}&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="-Xlinker --version-script=&quot;${PROJ_PATH}/.exportMap&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="-L&quot;${SBI_SYSROOT}/usr/lib&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="-L&quot;${SBI_SYSROOT}/../iot-things-4.0-device.core/usr/lib&quot;"/>
+                                                                       <listOptionValue builtIn="false" value="$(RS_LIBRARIES)"/>
+                                                               </option>
+                                                               <option id="gnu.cpp.link.option.paths.1696497436" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
+                                                                       <listOptionValue builtIn="false" value="&quot;${workspace_loc:/${ProjName}/lib}&quot;"/>
+                                                               </option>
+                                                               <option id="gnu.cpp.link.option.libs.627922936" superClass="gnu.cpp.link.option.libs" valueType="libs">
+                                                                       <listOptionValue builtIn="false" value="oicdastack"/>
+                                                                       <listOptionValue builtIn="false" value="sdkapi"/>
+                                                               </option>
+                                                               <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1873516416" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
+                                                                       <additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
+                                                                       <additionalInput kind="additionalinput" paths="$(LIBS)"/>
+                                                               </inputType>
+                                                       </tool>
+                                                       <tool command="#{PLATFORM_DEFAULT_GCC_PREFIX}as" id="org.tizen.nativeapp.tool.sbi.gnu.assembler.base.1104785016" name="Assembler" superClass="org.tizen.nativeapp.tool.sbi.gnu.assembler.base">
+                                                               <inputType id="cdt.managedbuild.tool.gnu.assembler.input.1550184112" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
+                                                       </tool>
+                                                       <tool id="org.tizen.nativecore.tool.fnmapgen.990723863" name="C FN-Map Generator" superClass="org.tizen.nativecore.tool.fnmapgen"/>
+                                                       <tool id="org.tizen.nativecore.tool.fnmapgen.cpp.2088866111" name="C++ FN-Map Generator" superClass="org.tizen.nativecore.tool.fnmapgen.cpp"/>
+                                                       <tool id="org.tizen.nativecore.tool.ast.882812246" name="C Static Analyzer" superClass="org.tizen.nativecore.tool.ast"/>
+                                                       <tool id="org.tizen.nativecore.tool.ast.cpp.1800255051" name="C++ Static Analyzer" superClass="org.tizen.nativecore.tool.ast.cpp"/>
+                                                       <tool id="org.tizen.nativecore.tool.sbi.gnu.archiver.mergelib.1697850482" name="Archive Generator" superClass="org.tizen.nativecore.tool.sbi.gnu.archiver.mergelib"/>
+                                                       <tool id="org.tizen.nativecore.tool.sbi.po.compiler.76565439" name="PO Resource Compiler" superClass="org.tizen.nativecore.tool.sbi.po.compiler"/>
+                                                       <tool id="org.tizen.nativecore.tool.sbi.edc.compiler.375751107" name="EDC Resource Compiler" superClass="org.tizen.nativecore.tool.sbi.edc.compiler"/>
+                                               </toolChain>
+                                       </folderInfo>
+                                       <sourceEntries>
+                                               <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="inc"/>
+                                               <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="res"/>
+                                               <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="shared"/>
+                                               <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="src"/>
+                                       </sourceEntries>
+                               </configuration>
+                       </storageModule>
+                       <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
+               </cconfiguration>
+       </storageModule>
+       <storageModule moduleId="cdtBuildSystem" version="4.0.0">
+               <project id="co2.org.tizen.nativecore.target.sbi.gcc45.app.253664086" name="Tizen Native Application" projectType="org.tizen.nativecore.target.sbi.gcc45.app"/>
+       </storageModule>
+       <storageModule moduleId="scannerConfiguration">
+               <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+               <scannerConfigBuildInfo instanceId="org.tizen.nativecore.config.sbi.gcc45.app.debug.1684968043">
+                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+               </scannerConfigBuildInfo>
+               <scannerConfigBuildInfo instanceId="org.tizen.nativecore.config.sbi.gcc45.app.release.1935466489">
+                       <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
+               </scannerConfigBuildInfo>
+       </storageModule>
+       <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
+</cproject>
diff --git a/.exportMap b/.exportMap
new file mode 100644 (file)
index 0000000..de30516
--- /dev/null
@@ -0,0 +1,5 @@
+{
+       global: main;
+       _IO_*;
+       local: *;
+};
diff --git a/.project b/.project
new file mode 100644 (file)
index 0000000..b8898b8
--- /dev/null
+++ b/.project
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>co2</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder</name>
+                       <triggers>full,incremental,</triggers>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.cdt.core.cnature</nature>
+               <nature>org.eclipse.cdt.core.ccnature</nature>
+               <nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
+               <nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
+       </natures>
+       <filteredResources>
+               <filter>
+                       <id>1530864635124</id>
+                       <name></name>
+                       <type>26</type>
+                       <matcher>
+                               <id>org.eclipse.ui.ide.multiFilter</id>
+                               <arguments>1.0-projectRelativePath-matches-false-false-*/.tpk</arguments>
+                       </matcher>
+               </filter>
+               <filter>
+                       <id>1530864635125</id>
+                       <name></name>
+                       <type>6</type>
+                       <matcher>
+                               <id>org.eclipse.ui.ide.multiFilter</id>
+                               <arguments>1.0-name-matches-false-false-project_def.prop</arguments>
+                       </matcher>
+               </filter>
+       </filteredResources>
+</projectDescription>
diff --git a/.smartthingsapp b/.smartthingsapp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/.tproject b/.tproject
new file mode 100644 (file)
index 0000000..f857534
--- /dev/null
+++ b/.tproject
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<tproject xmlns="http://www.tizen.org/tproject">
+    <platforms>
+        <platform>
+            <name>iot-headless-4.0</name>
+        </platform>
+    </platforms>
+    <package>
+        <blacklist/>
+        <resFallback autoGen="true"/>
+    </package>
+</tproject>
diff --git a/inc/co2.h b/inc/co2.h
new file mode 100644 (file)
index 0000000..093ba48
--- /dev/null
+++ b/inc/co2.h
@@ -0,0 +1,12 @@
+#ifndef __co2_H__
+#define __co2_H__
+
+#include <dlog.h>
+
+#ifdef  LOG_TAG
+#undef  LOG_TAG
+#endif
+#define LOG_TAG "co2"
+
+
+#endif /* __co2_H__ */
diff --git a/inc/log.h b/inc/log.h
new file mode 100644 (file)
index 0000000..ea01cc7
--- /dev/null
+++ b/inc/log.h
@@ -0,0 +1,34 @@
+/*
+ * log.h
+ *
+ *  Created on: Jul 6, 2018
+ *      Author: jpark
+ */
+
+#ifndef __LOG_H__
+#define  __LOG_H__
+
+#include <dlog.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef LOG_TAG
+#undef LOG_TAG
+#endif
+#define LOG_TAG "ST-THINGS-APP"
+
+#define ERR(fmt, args...) dlog_print(DLOG_ERROR, LOG_TAG, "%s : %s(%d) > "fmt"\n", rindex(__FILE__, '/') + 1, __func__, __LINE__, ##args)
+#define WARN(fmt, args...) dlog_print(DLOG_WARN, LOG_TAG, "%s : %s(%d) > "fmt"\n", rindex(__FILE__, '/') + 1, __func__, __LINE__, ##args)
+#define INFO(fmt, args...)  dlog_print(DLOG_INFO, LOG_TAG, "%s : %s(%d) > "fmt"\n", rindex(__FILE__, '/') + 1, __func__, __LINE__, ##args)
+#define DBG(fmt, args...) dlog_print(DLOG_DEBUG, LOG_TAG, "%s : %s(%d) > "fmt"\n", rindex(__FILE__, '/') + 1, __func__, __LINE__, ##args)
+
+#define FN_CALL dlog_print(DLOG_DEBUG, LOG_TAG, ">>>>>>>> called")
+#define FN_END dlog_print(DLOG_DEBUG, LOG_TAG, "<<<<<<<< ended")
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* __LOG_H__ */
diff --git a/inc/st_things.h b/inc/st_things.h
new file mode 100644 (file)
index 0000000..92015d7
--- /dev/null
@@ -0,0 +1,299 @@
+/* ****************************************************************
+ *
+ * Copyright 2017 Samsung Electronics All Rights Reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************/
+
+#ifndef __ST_THINGS_H__
+#define __ST_THINGS_H__
+
+#include <stdint.h>
+#include <stdbool.h>
+
+#ifdef __ST_THINGS_RTOS__
+#include <st_things/st_things_types.h>
+#else
+#include "st_things_types.h"
+#endif // __ST_THINGS_RTOS__
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * @brief Set prefix paths (ReadOnly and ReadWrite) for configuration files for the device.
+ *            This is Optional API, and should be used if relative location is used in
+ *            filePath variable in JSON Configuration file.
+ * @param[in] ro_path Prefix Path for Read Only directory location.
+ * @param[in] rw_path Prefix Path for Read Write directory location.
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #ST_THINGS_ERROR_NONE Successful
+ * @retval #ST_THINGS_ERROR_INVALID_PARAMETER Invalid parameter(both ro_path and rw_path are NULL).
+ * @retval #ST_THINGS_ERROR_OPERATION_FAILED Operation failed
+ * @retval #ST_THINGS_ERROR_STACK_ALREADY_INITIALIZED Stack already initialized.
+ *         To set Prefix Paths, stack should be deinitilized first by calling st_things_deinitialize().
+ * @retval #ST_THINGS_ERROR_STACK_RUNNING Stack is currently running.
+ *         To set Prefix Paths, stack should be stopped first by calling st_things_stop()
+ *         and then deinitialized by calling st_things_deinitialize().
+ */
+int st_things_set_configuration_prefix_path(const char* ro_path, const char* rw_path);
+
+/**
+ * @brief Initializes things stack and returns whether easy-setup is completed or not.
+ *            Easy-setup enable users to acquire the ownership of things and to connect the things with the cloud.
+ *            After performing easy-setup, users can access things from anywhere through the cloud.
+ *            In things stack, easy-setup is a primary and the first operation to be performed on the thing.
+ *            Application running on the thing can know whether easy-setup is done already or not.
+ *            If easy-setup is done, app can start the things stack by calling st_things_start().
+ *            If easy-setup is not done, app can either wait for the user interaction before starting the things stack or
+ *            start the things stack directly without waiting for any events(This case is for those things which doesn't
+ *            support input capability and for all other unknown cases).
+ *            To use a new json file after initialization, stack should be deinitialized
+ *            and stopped(if its started already).
+ * @param[in] json_path Path to Json file which defines a thing. Definition includes the device information,
+ *                                       resources and their properties, configuration info for connectivity and easy-setup, etc.
+ * @param[out] easysetup_complete Indicates whether easysetup is completed already or not.
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #ST_THINGS_ERROR_NONE Successful
+ * @retval #ST_THINGS_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #ST_THINGS_ERROR_OPERATION_FAILED Operation failed
+ * @retval #ST_THINGS_ERROR_STACK_ALREADY_INITIALIZED Stack already initialized.
+ *         To initialize again, stack should be deinitilized first by calling st_things_deinitialize().
+ * @retval #ST_THINGS_ERROR_STACK_RUNNING Stack is currently running.
+ *         To initialize again, stack should be stopped first by calling st_things_stop()
+ *         and then deinitialized by calling st_things_deinitialize().
+ */
+int st_things_initialize(const char *json_path, bool *easysetup_complete);
+
+/**
+ * @brief Deinitializes things stack.
+ *        Stack should have been initialized before calling this API.
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #ST_THINGS_ERROR_NONE Successful
+ * @retval #ST_THINGS_ERROR_OPERATION_FAILED Operation failed
+ * @retval #ST_THINGS_ERROR_STACK_NOT_INITIALIZED Stack is not initialized.
+ *         Initialize the stack by calling st_things_initialize().
+ * @retval #ST_THINGS_ERROR_STACK_RUNNING Stack is currently running.
+ *         Before deinitialize, stack needs to be stopped by calling st_things_stop().
+ */
+int st_things_deinitialize(void);
+
+/**
+ * @brief Callback for handling GET request.
+ * @param[in]  req_msg GET request message.
+ * @param[out] resp_rep Representation that will be set to payload of response.
+ * @return @c true in case of success, otherwise @c false
+ */
+typedef bool (*st_things_get_request_cb)(st_things_get_request_message_s *req_msg, st_things_representation_s *resp_rep);
+
+/**
+ * @brief Callback for handling SET(POST) request.
+ * @param[in]  req_msg SET request message.
+ * @param[out] resp_rep Representation that will be set to payload of response.
+ * @return @c true in case of success, otherwise @c false
+ */
+typedef bool (*st_things_set_request_cb)(st_things_set_request_message_s *req_msg, st_things_representation_s *resp_rep);
+
+/**
+ * @brief Callback registration function for handling request messages.
+ * @details The callbacks ensure that a request message will be carried with one of the resource uris from json file of st_things_start().
+ * @remarks Only one callback function can be set with this API.\n
+ *          If multiple callbacks are set, the last one is registered only.\n
+ *          And the callbacks are called in the internal thread, which is not detached,\n
+ *          so application should return it to get the next callbacks.
+ * @param[in] get_cb Reference of the callback function to handle GET request.
+ * @param[in] set_cb Reference of the callback function to handle SET(POST) request.
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #ST_THINGS_ERROR_NONE Successful
+ * @retval #ST_THINGS_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #ST_THINGS_ERROR_OPERATION_FAILED Operation failed
+ */
+int st_things_register_request_cb(st_things_get_request_cb get_cb, st_things_set_request_cb set_cb);
+
+/**
+ * @brief Starts things stack.
+ *            Parses the thing definition(whose path is passed to st_things_initialize(), configures the thing,
+ *            creates the resources and prepares it for easy-setup.
+ *            If easy-setup is not done yet, onboarding will be started using either SoftAP or BLE connection.
+ *                Onboarding creates an ad-hoc network between the thing and the client for performing easy-setup.
+ *            If easy-setup is already done, thing will be connected with the cloud.
+ *            Application can know whether easy-setup is done or not through st_things_initialize API.
+ *            Stack should have been initialized before calling this API.
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #ST_THINGS_ERROR_NONE Successful.
+ *         It is also used for the case that the stack is started already.
+ * @retval #ST_THINGS_ERROR_OPERATION_FAILED Operation failed
+ * @retval #ST_THINGS_ERROR_STACK_NOT_INITIALIZED Stack is not initialized.
+ *         Initialize the stack by calling st_things_initialize().
+ */
+int st_things_start(void);
+
+/**
+ * @brief Stops things stack.
+ *            Removes all the data being used internally and releases all the memory allocated for the stack.
+ *            Stack should have been initialized and started before calling this API.
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #ST_THINGS_ERROR_NONE Successful
+ * @retval #ST_THINGS_ERROR_OPERATION_FAILED Operation failed
+ * @retval #ST_THINGS_ERROR_STACK_NOT_INITIALIZED Stack is not initialized.
+ *         Initialize the stack by calling st_things_initialize().
+ * @retval #ST_THINGS_ERROR_STACK_NOT_STARTED Stack is not started.
+ *         Start the stack by calling st_things_start().
+ */
+int st_things_stop(void);
+
+/**
+ * @brief Callback for getting user's opinion regarding device reset.
+ * @return @c true to confirm, otherwise @c to deny
+ */
+typedef bool (*st_things_reset_confirm_cb)(void);
+
+/**
+ * @brief Callback for carrying the result of reset.
+ * @param[in] is_success Result of Stack-reset. (true : success, false : failure)
+ */
+typedef void (*st_things_reset_result_cb)(bool is_success);
+
+/**
+ * @brief Callback registration function for Reset-Confirmation and Reset-Result functions.
+ * @remarks Only one callback function can be set with this API.\n
+ *          If multiple callbacks are set, the last one is registered only.\n
+            And the callbacks are called in the internal thread, which is not detached,\n
+ *          so application should return it to get the next callbacks.
+ * @param[in] confirm_cb Callback function that will be called to get the user's input when reset is triggered.
+ * @param[in] result_cb Callback function that will be called after the reset process is done.
+ *                      This parameter can be NULL if notification for result of reset is not needed.
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #ST_THINGS_ERROR_NONE Successful
+ * @retval #ST_THINGS_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #ST_THINGS_ERROR_OPERATION_FAILED Operation failed
+ */
+int st_things_register_reset_cb(st_things_reset_confirm_cb confirm_cb, st_things_reset_result_cb result_cb);
+
+/**
+ * @brief Reset all the data related to security and cloud being used in the stack.
+ *        Stack should have been initialized and started before calling this API.
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #ST_THINGS_ERROR_NONE Successful
+ * @retval #ST_THINGS_ERROR_OPERATION_FAILED Operation failed
+ * @retval #ST_THINGS_ERROR_STACK_NOT_INITIALIZED Stack is not intialized.
+ *         Initialize the stack by calling st_things_initialize().
+ * @retval #ST_THINGS_ERROR_STACK_NOT_STARTED Stack is not started.
+ *         Start the stack by calling st_things_start().
+ */
+int st_things_reset(void);
+
+/**
+ * @brief Callback for carrying the randomly generated PIN info.
+ * @details Device should show the PIN on display.
+ * @param[in] pin_data PIN data in string format.
+ * @param[in] pin_size Length of the PIN String.
+ */
+typedef void (*st_things_pin_generated_cb)(const char *pin_data, const size_t pin_size);
+
+/**
+ * @brief Callback for informing the application to close the PIN display.
+ */
+typedef void (*st_things_pin_display_close_cb)(void);
+
+/**
+ * @brief Callback registration function for getting randomly generated PIN for the PIN-Based Ownership Transfer Request.
+ * @remarks Only one callback function can be set with this API.\n
+ *          If multiple callbacks are set, the last one is registered only.\n
+ *          And the callbacks are called in the internal thread, which is not detached,\n
+ *          so application should return it to get the next callbacks.
+ * @param[in] generated_cb Callback function that will be called when device receives a Ownership Transfer request from client.
+ * @param[in] close_cb Callback function that will be called when Ownership Transfer is done so device can stop showing PIN on display.
+ *                     This parameter can be NULL if stop triggering is not needed.
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #ST_THINGS_ERROR_NONE Successful
+ * @retval #ST_THINGS_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #ST_THINGS_ERROR_OPERATION_FAILED Operation failed
+ */
+int st_things_register_pin_handling_cb(st_things_pin_generated_cb generated_cb, st_things_pin_display_close_cb close_cb);
+
+/**
+ * @brief Callback for getting user's input regarding mutual verification.
+ * @return @c true true in cse of confirmed, otherwise @c false
+ */
+typedef bool (*st_things_user_confirm_cb)(void);
+
+/**
+ * @brief Callback registration function for getting user confirmation for MUTUAL VERIFICATION BASED JUST WORK Ownership transfer.
+ * @remarks Only one callback function can be set with this API.\n
+ *          If multiple callbacks are set, the last one is registered only.\n
+ *          And the callbacks are called in the internal thread, which is not detached,\n
+ *          so application should return it to get the next callbacks.
+ * @param[in] confirm_cb Callback function that will be called when device receives a confirm request from client.
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #ST_THINGS_ERROR_NONE Successful
+ * @retval #ST_THINGS_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #ST_THINGS_ERROR_OPERATION_FAILED Operation failed
+ */
+int st_things_register_user_confirm_cb(st_things_user_confirm_cb confirm_cb);
+
+/**
+ * @brief Callback for getting the current state of ST Things.
+ * @param[in]  things_status ST Things State
+ */
+typedef void (*st_things_status_change_cb)(st_things_status_e things_status);
+
+/**
+ * @brief Callback registration function for getting notified when ST Things state changes.
+ * @remarks Only one callback function can be set with this API.\n
+ *          If multiple callbacks are set, the last one is registered only.\n
+ *          And the callbacks are called in the internal thread, which is not detached,\n
+ *          so application should return it to get the next callbacks.
+ * @param[in] status_cb Refernce of the callback function to get ST Things status
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #ST_THINGS_ERROR_NONE Successful
+ * @retval #ST_THINGS_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #ST_THINGS_ERROR_OPERATION_FAILED Operation failed
+ */
+int st_things_register_things_status_change_cb(st_things_status_change_cb status_cb);
+
+/**
+ * @brief Notify the observers of a specific resource.
+ *        Stack should have been initialized and started before calling this API.
+ * @param[in]  resource_uri Resource URI of the resource which will be notified to observers.
+ * @return @c 0 on success, otherwise a negative error value
+ * @retval #ST_THINGS_ERROR_NONE Successful
+ * @retval #ST_THINGS_ERROR_INVALID_PARAMETER Invalid parameter
+ * @retval #ST_THINGS_ERROR_OPERATION_FAILED Operation failed
+  * @retval #ST_THINGS_ERROR_STACK_NOT_INITIALIZED Stack is not intialized.
+ *         Initialize the stack by calling st_things_initialize().
+ * @retval #ST_THINGS_ERROR_STACK_NOT_STARTED Stack is not started.
+ *         Start the stack by calling st_things_start().
+ */
+int st_things_notify_observers(const char *resource_uri);
+
+/**
+ * @brief Create an instance of representation.
+ * @remarks To destroy an instance, st_things_destroy_representation_inst() should be used.
+ * @return a pointer of the created representation, otherwise a null pointer if the memory is insufficient.
+ */
+st_things_representation_s *st_things_create_representation_inst(void);
+
+/**
+ * @brief Destroy an instance of representation.
+ * @param[in]  rep Representation that will be destroyed.
+ */
+void st_things_destroy_representation_inst(st_things_representation_s *rep);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* __ST_THINGS_H__ */
diff --git a/inc/st_things_types.h b/inc/st_things_types.h
new file mode 100644 (file)
index 0000000..58f75b2
--- /dev/null
@@ -0,0 +1,321 @@
+/* ****************************************************************
+ *
+ * Copyright 2017 Samsung Electronics All Rights Reserved.
+ *
+ *
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ ******************************************************************/
+
+#ifndef __ST_THINGS_TYPES_H__
+#define __ST_THINGS_TYPES_H__
+
+#include <stdint.h>
+#include <stdlib.h>
+#include <stdbool.h>
+
+/**
+ * @brief Enumeration for ST Things error code.
+ */
+typedef enum {
+    ST_THINGS_ERROR_NONE                         =  0, /**< Successful */
+    ST_THINGS_ERROR_INVALID_PARAMETER            = -1, /**< Invalid parameter (If parameter is null or empty)*/
+    ST_THINGS_ERROR_OPERATION_FAILED             = -2, /**< Operation Failed */
+    ST_THINGS_ERROR_STACK_NOT_INITIALIZED        = -3, /**< Stack is not yet initialized*/
+    ST_THINGS_ERROR_STACK_ALREADY_INITIALIZED    = -4, /**< Stack is already initialized*/
+    ST_THINGS_ERROR_STACK_NOT_STARTED            = -5, /**< Stack is not yet started*/
+    ST_THINGS_ERROR_STACK_RUNNING                = -6, /**< Stack is currently running*/
+} st_things_error_e;
+
+/**
+ * @brief Enumeration for ST Things status.
+ */
+typedef enum {
+    ST_THINGS_STATUS_INIT = 0,                         /**< Initial state of ST Things */
+    ST_THINGS_STATUS_ES_STARTED,                       /**< Easy-setup is started */
+    ST_THINGS_STATUS_ES_DONE,                          /**< Easy-setup is done */
+    ST_THINGS_STATUS_ES_FAILED_ON_OWNERSHIP_TRANSFER,  /**< Easy-setup failed due to Ownership-Transfer failure */
+    ST_THINGS_STATUS_CONNECTING_TO_AP,                 /**< Connecting to target Wi-Fi access point */
+    ST_THINGS_STATUS_CONNECTED_TO_AP,                  /**< Connected to target Wi-Fi access point */
+    ST_THINGS_STATUS_CONNECTING_TO_AP_FAILED,          /**< Failed to connect to target Wi-Fi access point */
+    ST_THINGS_STATUS_REGISTERING_TO_CLOUD,             /**< Trying to Sign-up/Sign-in/Publish-Resource(s) to Cloud */
+    ST_THINGS_STATUS_REGISTERED_TO_CLOUD,              /**< Publish resource(s) to cloud is complete. Now the Thing is ready to be controlled via Cloud */
+    ST_THINGS_STATUS_REGISTERING_FAILED_ON_SIGN_IN,    /**< Failed to sign-in to Cloud */
+    ST_THINGS_STATUS_REGISTERING_FAILED_ON_PUB_RES     /**< Failed to publish resources to Cloud */
+} st_things_status_e;
+
+/**
+ * @brief Structure for Representation.
+ */
+typedef struct _st_things_representation
+{
+    void*   payload; /**< Payload of representation */
+
+    /**
+     * @brief API for getting the value of string type property with a key.
+     * @remarks This API will return deep-copied string value as out parameter, so application must free it after use.
+     * @param[in]  rep Instance of Representation.
+     * @param[in]  key Property Name which represents the value.
+     * @param[out] value String value
+     * @return @c true if value exist, otherwise @c false
+     */
+    bool    (*get_str_value)            (struct _st_things_representation* rep, const char* key, char** value);
+
+    /**
+     * @brief API for getting the value of boolean type property with a key.
+     * @param[in]  rep Instance of Representation.
+     * @param[in]  key Property Name which represents the value.
+     * @param[out] value Bool value
+     * @return @c true if value exist, otherwise @c false
+     */
+    bool    (*get_bool_value)           (struct _st_things_representation* rep, const char* key, bool* value);
+
+    /**
+     * @brief API for getting the value of integer type property with a key.
+     * @param[in]  rep Instance of Representation.
+     * @param[in]  key Property Name which represents the value.
+     * @param[out] value Integer value
+     * @return @c true if value exist, otherwise @c false
+     */
+    bool    (*get_int_value)            (struct _st_things_representation* rep, const char* key, int64_t* value);
+
+    /**
+     * @brief API for getting the value of double type property with a key.
+     * @param[in]  rep Instance of Representation.
+     * @param[in]  key Property Name which represents the value.
+     * @param[out] value Double value
+     * @return @c true if value exist, otherwise @c false
+     */
+    bool    (*get_double_value)         (struct _st_things_representation* rep, const char* key, double* value);
+
+    /**
+     * @brief API for getting the value of byte array type property with a key.
+     * @remarks This API will return deep-copied byte value as out parameter, so application must free it after use.
+     * @param[in]  rep Instance of Representation.
+     * @param[in]  key Property Name which represents the value.
+     * @param[out] value Byte value
+     * @param[out] size Size of Byte value
+     * @return @c true if value exist, otherwise @c false
+     */
+    bool    (*get_byte_value)           (struct _st_things_representation* rep, const char* key, uint8_t** value, size_t* size);
+
+    /**
+     * @brief API for getting the value of object type property with a key.
+     * @remarks This API will return deep-copied object value as out parameter, so application must free it after use.\n
+     *          To free an object, st_things_destroy_representation_inst() in st_things.h should be used.
+     * @param[in]  rep Instance of Representation.
+     * @param[in]  key Property Name which represents the value.
+     * @param[out] value Object value
+     * @return @c true if value exist, otherwise @c false
+     */
+    bool    (*get_object_value)         (struct _st_things_representation* rep, const char* key, struct _st_things_representation** value);
+
+    /**
+     * @brief API for setting the value of string type property with a key.
+     * @remarks This API will deep-copy the string value inside, so application still has an ownership of memory for the string value.
+     * @param[in]  rep Instance of Representation.
+     * @param[in]  key Property Name which will represent the value.
+     * @param[in]  value String value.
+     * @return @c true if setting value is successful, otherwise @c false
+     */
+    bool    (*set_str_value)            (struct _st_things_representation* rep, const char* key, const char* value);
+
+    /**
+     * @brief API for setting the value of boolean type property with a key.
+     * @param[in]  rep Instance of Representation.
+     * @param[in]  key Property Name which will represent the value.
+     * @param[in]  value Bool value.
+     * @return @c true if setting value is successful, otherwise @c false
+     */
+    bool    (*set_bool_value)           (struct _st_things_representation* rep, const char* key, bool value);
+
+    /**
+     * @brief API for setting the value of integer type property with a key.
+     * @param[in]  rep Instance of Representation.
+     * @param[in]  key Property Name which will represent the value.
+     * @param[in]  value Integer value.
+     * @return @c true if setting value is successful, otherwise @c false
+     */
+    bool    (*set_int_value)            (struct _st_things_representation* rep, const char* key, int64_t value);
+
+    /**
+     * @brief API for setting the value of double type property with a key.
+     * @param[in]  rep Instance of Representation.
+     * @param[in]  key Property Name which will represent the value.
+     * @param[in]  value Double value.
+     * @return @c true if setting value is successful, otherwise @c false
+     */
+    bool    (*set_double_value)         (struct _st_things_representation* rep, const char* key, double value);
+
+    /**
+     * @brief API for setting the value of byte array type property with a key.
+     * @remarks This API will deep-copy the byte value inside, so application still has an ownership of memory for the byte value.
+     * @param[in]  rep Instance of Representation.
+     * @param[in]  key Property Name which will represent the value.
+     * @param[in]  value Byte value.
+     * @param[in]  size Size of Byte value.
+     * @return @c true if setting value is successful, otherwise @c false
+     */
+    bool    (*set_byte_value)           (struct _st_things_representation* rep, const char* key, const uint8_t* value, size_t size);
+
+    /**
+     * @brief API for setting the value of object type property with a key.
+     * @remarks This API will deep-copy the object value inside, so application still has an ownership of memory for the object value.
+     * @param[in]  rep Instance of Representation.
+     * @param[in]  key Property Name which will represent the value.
+     * @param[in]  value Object value.
+     * @return @c true if value exist, otherwise @c false
+     */
+    bool    (*set_object_value)         (struct _st_things_representation* rep, const char* key, const struct _st_things_representation* value);
+
+    /**
+     * @brief API for getting the value of string array type property with a key.
+     * @remarks This API will return deep-copied array value as out parameter, so application must free it after use.
+     * @param[in]  rep Instance of Representation.
+     * @param[in]  key Property Name which will represent the array type of value.
+     * @param[out] array Reference of the string array to where the value will be copied.
+     * @param[out] length Total number of elements in the array.
+     * @return @c true if value exist, otherwise @c false
+     */
+    bool    (*get_str_array_value)      (struct _st_things_representation* rep, const char* key, char*** array, size_t* length);
+
+    /**
+     * @brief API for getting the value of integer array type property with a key.
+     * @remarks This API will return deep-copied array value as out parameter, so application must free it after use.
+     * @param[in]  rep Instance of Representation.
+     * @param[in]  key Property Name which will represent the array type of value.
+     * @param[out] array Reference of the integer array where the value will be copied.
+     * @param[out] length Total number of elements in the array.
+     * @return @c true if value exist, otherwise @c false
+     */
+    bool    (*get_int_array_value)      (struct _st_things_representation* rep, const char* key, int64_t** array, size_t* length);
+
+    /**
+     * @brief API for getting the value of double array type property with a key.
+     * @remarks This API will return deep-copied array value as out parameter, so application must free it after use.
+     * @param[in]  rep Instance of Representation.
+     * @param[in]  key Property Name which will represent the array type of value.
+     * @param[out] array Reference of the double array where the value will be copied.
+     * @param[out] length Total number of elements in the array.
+     * @return @c true if value exist, otherwise @c false
+     */
+    bool    (*get_double_array_value)   (struct _st_things_representation* rep, const char* key, double** array, size_t* length);
+
+    /**
+     * @brief API for getting the value of object array type property with a key.
+     * @remarks This API will return deep-copied array value as out parameter, so application must free it after use.\n
+     *          To free each object in array, st_things_destroy_representation_inst() in st_things.h should be used.
+     * @param[in]  rep Instance of Representation.
+     * @param[in]  key Property Name which represents the array type of value.
+     * @param[out] array Reference of the object array where the value will be copied.
+     * @param[out] length Total number of elements in the array.
+     * @return @c true if value exist, otherwise @c false
+     */
+    bool    (*get_object_array_value)   (struct _st_things_representation* rep, const char* key, struct _st_things_representation*** array, size_t* length);
+
+    /**
+     * @brief API for setting the value of string array type property with a key.
+     * @remarks This API will deep-copy the array value inside, so application still has an ownership of memory for the array value.
+     * @param[in]  rep Instance of Representation.
+     * @param[in]  key Property Name which represents the value.
+     * @param[in]  array String array type value.
+     * @param[in]  length Total number of elements in the array.
+     * @return @c true if setting value is successful, otherwise @c false
+     */
+    bool    (*set_str_array_value)      (struct _st_things_representation* rep, const char* key, const char** array, size_t length);
+
+    /**
+     * @brief API for setting the value of integer array type property with a key.
+     * @remarks This API will deep-copy the array value inside, so application still has an ownership of memory for the array value.
+     * @param[in]  rep Instance of Representation.
+     * @param[in]  key Property Name which represents the value.
+     * @param[in]  array Integer array type value.
+     * @param[in]  length Total number of elements in the array.
+     * @return @c true if setting value is successful, otherwise @c false
+     */
+    bool    (*set_int_array_value)      (struct _st_things_representation* rep, const char* key, const int64_t* array, size_t length);
+
+    /**
+     * @brief API for setting the value of double array type property with a key.
+     * @remarks This API will deep-copy the array value inside, so application still has an ownership of memory for the array value.
+     * @param[in]  rep Instance of Representation.
+     * @param[in]  key Property Name which represents the value.
+     * @param[in]  array Double array type value.
+     * @param[in]  length Total number of elements in the array.
+     * @return @c true if setting value is successful, otherwise @c false
+     */
+    bool    (*set_double_array_value)   (struct _st_things_representation* rep, const char* key, const double* array, size_t length);
+
+    /**
+     * @brief API for setting the value of object array type property with a key.
+     * @remarks This API will deep-copy the array value inside, so application still has an ownership of memory for the array value.
+     * @param[in]  rep Instance of Representation.
+     * @param[in]  key Property Name which represents the value.
+     * @param[in]  array Object array type value.
+     * @param[in]  length Total number of elements in the array.
+     * @return @c true if setting value is successful, otherwise @c false
+     */
+    bool    (*set_object_array_value)   (struct _st_things_representation* rep, const char* key, const struct _st_things_representation** array, size_t length);
+
+} st_things_representation_s;
+
+/**
+ * @brief Structure for representing the Get Request Message.
+ */
+typedef struct _st_things_get_request_message
+{
+    char*                               resource_uri;   /**< Resource URI */
+    char*                               query;          /**< One or more query parameters of the request message. Ex: key1=value1;key2=value2;... */
+    char*                               property_key;   /**< One or more property key that application needs to set a value for response. Ex: key1;key2;... */
+
+    /**
+     * @brief API for getting the value of a specific query from the query parameters of the request.
+     * @param[in]  req_msg Instance of get request message.
+     * @param[in]  key Name of the query.(ex: key1, key2, etc)
+     * @param[out] value Value of the query.(value1, value2, etc)
+     * @return @c true if query exist, otherwise @c false
+     */
+    bool    (*get_query_value)          (struct _st_things_get_request_message* req_msg, const char* key, char** value);
+
+    /**
+     * @brief API for checking whether the request has a specific property key or not.
+     * @param[in]  req_msg Instance of get request message.
+     * @param[in]  key Name of the property.
+     * @return @c true if the property key exists, otherwise @c false
+     */
+    bool    (*has_property_key)         (struct _st_things_get_request_message* req_msg, const char* key);
+
+} st_things_get_request_message_s;
+
+/**
+ * @brief Structure for representing the Set Request Message.
+ */
+typedef struct _st_things_set_request_message
+{
+    char*                               resource_uri;   /**< Resource URI */
+    char*                               query;          /**< One or more query parameters of the request message. Ex: key1=value1?key2=value2?... */
+    struct _st_things_representation*   rep;            /**< Representation of the set request message */
+
+    /**
+     * @brief API for getting the value of a specific query from the query parameters of the request.
+     * @param[in]  req_msg Instance of request message.
+     * @param[in]  key Name of the query.(ex: key1, key2, etc)
+     * @param[out] value Value of the query.(value1, value2, etc)
+     * @return @c true if query exist, otherwise @c false
+     */
+    bool    (*get_query_value)          (struct _st_things_set_request_message* req_msg, const char* key, char** value);
+
+} st_things_set_request_message_s;
+
+#endif /* __ST_THINGS_TYPES_H__ */
diff --git a/inc/thing.h b/inc/thing.h
new file mode 100644 (file)
index 0000000..76a935a
--- /dev/null
@@ -0,0 +1,16 @@
+/*
+ * thing.h
+ *
+ *  Created on: Jul 6, 2018
+ *      Author: jpark
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+void init_thing();
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
diff --git a/lib/liboicdastack.so b/lib/liboicdastack.so
new file mode 100644 (file)
index 0000000..4a5cc91
Binary files /dev/null and b/lib/liboicdastack.so differ
diff --git a/lib/libsdkapi.so b/lib/libsdkapi.so
new file mode 100644 (file)
index 0000000..47ca354
Binary files /dev/null and b/lib/libsdkapi.so differ
diff --git a/project_def.prop b/project_def.prop
new file mode 100644 (file)
index 0000000..e96a36c
--- /dev/null
@@ -0,0 +1,11 @@
+APPNAME = co2
+
+type = app
+profile = iot-headless-4.0
+
+USER_SRCS = src/co2.c
+USER_DEFS =
+USER_INC_DIRS = inc, inc/sdk
+USER_OBJS =
+USER_LIBS = lib/liboicdastack.so, lib/libsdkapi.so
+USER_EDCS =
diff --git a/res/device_def.json b/res/device_def.json
new file mode 100644 (file)
index 0000000..4efc17c
--- /dev/null
@@ -0,0 +1,81 @@
+{
+  "device": [
+    {
+      "specification": {
+        "device": {
+          "deviceType": "x.wwst.d.basic",
+          "deviceName": "Basic",
+          "specVersion": "core.1.1.0",
+          "dataModelVersion": "res.1.1.0"
+        },
+        "platform": {
+          "manufacturerName": "fAbr",
+          "manufacturerUrl": "http://",
+          "manufacturingDate": "2017-11-29",
+          "modelNumber": "NWSP-01",
+          "platformVersion": "1.0",
+          "osVersion": "1.0",
+          "hardwareVersion": "1.0",
+          "firmwareVersion": "1.0",
+          "vendorId": "co2_test"
+        }
+      },
+      "resources": {
+        "single": [
+          {
+            "uri": "/capability/airQualitySensor/main/0",
+            "types": [
+              "x.com.st.airqualitylevel"
+            ],
+            "interfaces": [
+              "oic.if.s",
+              "oic.if.baseline"
+            ],
+            "policy": 3
+          }
+        ]
+      }
+    }
+  ],
+  "resourceTypes": [
+    {
+      "type": "x.com.st.airqualitylevel",
+      "properties": [
+        {
+          "key": "airQuality",
+          "type": 2,
+          "mandatory": true,
+          "rw": 1
+        },
+        {
+          "key": "range",
+          "type": 7,
+          "mandatory": true,
+          "rw": 1
+        }
+      ]
+    }
+  ],
+  "configuration": {
+    "easySetup": {
+      "connectivity": {
+        "type": 1,
+        "softAP": {
+          "setupId": "001",
+          "artik": false
+        }
+      },
+      "ownershipTransferMethod": 2
+    },
+    "wifi": {
+      "interfaces": 15,
+      "frequency": 1
+    },
+    "filePath": {
+      "svrdb": "artikserversecured.dat",
+      "provisioning": "provisioning.dat",
+      "certificate": "certificate.pem",
+      "privateKey": "privatekey.der"
+    }
+  }
+}
\ No newline at end of file
diff --git a/shared/res/co2.png b/shared/res/co2.png
new file mode 100644 (file)
index 0000000..9765b1b
Binary files /dev/null and b/shared/res/co2.png differ
diff --git a/src/co2.c b/src/co2.c
new file mode 100644 (file)
index 0000000..9a9ae5c
--- /dev/null
+++ b/src/co2.c
@@ -0,0 +1,55 @@
+#include <tizen.h>
+#include <service_app.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "st_things.h"
+#include "thing.h"
+#include "log.h"
+
+static bool service_app_create(void *user_data)
+{
+       FN_CALL;
+
+       return true;
+}
+
+static void service_app_terminate(void *user_data)
+{
+       FN_CALL;
+}
+
+static void service_app_control(app_control_h app_control, void *user_data)
+{
+       FN_CALL;
+       if (app_control == NULL) {
+               ERR("app_control is NULL");
+               return;
+       }
+
+       int ret;
+       char *value = NULL;
+       ret = app_control_get_extra_data(app_control, "cmd", &value);
+       DBG("value: [%s]", value);
+       if (value == NULL)
+               init_thing();
+       else
+               ERR("Unknown command");
+
+       free(value);
+}
+
+int main(int argc, char *argv[])
+{
+       FN_CALL;
+
+       char ad[50] = {0,};
+       service_app_lifecycle_callback_s event_callback;
+
+       event_callback.create = service_app_create;
+       event_callback.terminate = service_app_terminate;
+       event_callback.app_control = service_app_control;
+
+       return service_app_main(argc, argv, &event_callback, ad);
+}
diff --git a/src/common_handlers.c b/src/common_handlers.c
new file mode 100644 (file)
index 0000000..29b6c9d
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * common_handlers.c
+ *
+ *  Created on: Jul 6, 2018
+ *      Author: jpark
+ */
+
+#include <unistd.h>
+#include <stdio.h>
+#include <stdbool.h>
+#include "st_things.h"
+#include "log.h"
+
+/* callback functions */
+bool handle_reset_request(void)
+{
+    DBG("Received a request for RESET.");
+
+    // TODO: Write your implementation in this section.
+    return false;  // FIXME: Modify this line with the appropriate return value.
+}
+
+void handle_reset_result(bool result)
+{
+    DBG("Reset %s.\n", result ? "succeeded" : "failed");
+
+    // TODO: Write your implementation in this section.
+}
+
+bool handle_ownership_transfer_request(void)
+{
+    DBG("Received a request for Ownership-transfer.");
+
+    // TODO: Write your implementation in this section.
+    return true;  // FIXME: Modify this line with the appropriate return value.
+}
+
+void handle_things_status_change(st_things_status_e things_status)
+{
+    DBG("Things status is changed: %d\n", things_status);
+
+    // TODO: Write your implementation in this section.
+}
+
+bool init_user() {
+       FN_CALL;
+
+       bool ret = false;
+
+       // TODO: Write your implementation in this section.
+       return ret;  // FIXME: Modify this line with the appropriate return value.
+}
diff --git a/src/resource_capability_airqualitysensor_main_0.c b/src/resource_capability_airqualitysensor_main_0.c
new file mode 100644 (file)
index 0000000..c2ac876
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+ * resource_capability_airqualitysensor_main_0.c
+ *
+ *  Created on: Jul 6, 2018
+ *      Author: jpark
+ */
+
+#include <stdio.h>
+#include <stdbool.h>
+#include "st_things.h"
+#include "log.h"
+
+
+static const char* PROP_AIRQUALITY = "airQuality";
+static const char* PROP_RANGE = "range";
+
+bool handle_get_request_on_resource_capability_airqualitysensor_main_0(st_things_get_request_message_s* req_msg, st_things_representation_s* resp_rep)
+{
+    DBG("Received a GET request on %s\n", req_msg->resource_uri);
+
+    if (req_msg->has_property_key(req_msg, PROP_AIRQUALITY)) {
+        // TODO: Write your implementation in this section.
+    }
+    if (req_msg->has_property_key(req_msg, PROP_RANGE)) {
+        // TODO: Write your implementation in this section.
+    }
+    return false;  // FIXME: Modify this line with the appropriate return value.
+}
diff --git a/src/thing.c b/src/thing.c
new file mode 100644 (file)
index 0000000..72a6d02
--- /dev/null
@@ -0,0 +1,114 @@
+/*
+ * thing.c
+ *
+ *  Created on: Jul 6, 2018
+ *      Author: jpark
+ */
+
+
+#include <stdio.h>
+#include <string.h>
+#include <stdbool.h>
+#include <app_common.h>
+#include "st_things.h"
+#include "thing.h"
+#include "log.h"
+
+#define JSON_PATH "device_def.json"
+
+static const char* RES_CAPABILITY_AIRQUALITYSENSOR_MAIN_0 = "/capability/airQualitySensor/main/0";
+
+/* OCF callback functions */
+extern bool handle_reset_request(void);
+extern void handle_reset_result(bool result);
+extern bool handle_ownership_transfer_request(void);
+extern void handle_things_status_change(st_things_status_e things_status);
+
+/* get and set request handlers */
+extern bool handle_get_request_on_resource_capability_airqualitysensor_main_0(st_things_get_request_message_s* req_msg, st_things_representation_s* resp_rep);
+
+extern bool init_user();
+
+/* handle : for getting request on resources */
+bool handle_get_request(st_things_get_request_message_s* req_msg, st_things_representation_s* resp_rep)
+{
+       DBG("resource_uri [%s]", req_msg->resource_uri);
+
+    if (0 == strcmp(req_msg->resource_uri, RES_CAPABILITY_AIRQUALITYSENSOR_MAIN_0)) {
+        return handle_get_request_on_resource_capability_airqualitysensor_main_0(req_msg, resp_rep);
+    }
+
+    ERR("not supported uri");
+    return false;
+}
+
+/* handle : for setting request on resources */
+bool handle_set_request(st_things_set_request_message_s* req_msg, st_things_representation_s* resp_rep)
+{
+       DBG("resource_uri [%s]", req_msg->resource_uri);
+
+
+    ERR("not supported uri");
+    return false;
+}
+
+/* initialize */
+void init_thing()
+{
+       FN_CALL;
+       static bool binitialized = false;
+       if (binitialized) {
+               DBG("Already initialized!!");
+               return;
+       }
+
+       bool easysetup_complete = false;
+
+       char app_json_path[128] = {0,};
+       char *app_res_path = NULL;
+       char *app_data_path = NULL;
+
+       app_res_path = app_get_resource_path();
+       if (!app_res_path) {
+               ERR("app_res_path is NULL!!");
+               return;
+       }
+
+       app_data_path = app_get_data_path();
+       if (!app_data_path) {
+               ERR("app_data_path is NULL!!");
+               free(app_res_path);
+               return;
+       }
+
+       snprintf(app_json_path, sizeof(app_json_path), "%s/%s", app_res_path, JSON_PATH);
+
+       if (0 != st_things_set_configuration_prefix_path((const char *)app_res_path, (const char *)app_data_path)) {
+               ERR("st_things_set_configuration_prefix_path() failed!!");
+               free(app_res_path);
+               free(app_data_path);
+               return;
+       }
+
+       free(app_res_path);
+       free(app_data_path);
+
+       if (0 != st_things_initialize(app_json_path, &easysetup_complete)) {
+               ERR("st_things_initialize() failed!!");
+               return;
+       }
+
+       binitialized = true;
+       init_user();
+
+       DBG("easysetup_complete:[%d] ", easysetup_complete);
+
+       st_things_register_request_cb(handle_get_request, handle_set_request);
+       st_things_register_reset_cb(handle_reset_request, handle_reset_result);
+       st_things_register_user_confirm_cb(handle_ownership_transfer_request);
+       st_things_register_things_status_change_cb(handle_things_status_change);
+
+       st_things_start();
+
+       FN_END;
+}
diff --git a/tizen-manifest.xml b/tizen-manifest.xml
new file mode 100644 (file)
index 0000000..4ce172a
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="4.0" package="org.example.co2" version="1.0.0">
+    <profile name="iot-headless"/>
+    <service-application appid="org.example.co2" exec="co2" multiple="false" nodisplay="true" on-boot="true" taskmanage="false" type="capp">
+        <label>co2</label>
+        <icon>co2.png</icon>
+        <background-category value="background-network"/>
+    </service-application>
+    <privileges>
+        <privilege>http://tizen.org/privilege/network.get</privilege>
+        <privilege>http://tizen.org/privilege/network.set</privilege>
+        <privilege>http://tizen.org/privilege/internet</privilege>
+        <privilege>http://tizen.org/privilege/alarm.set</privilege>
+        <privilege>http://tizen.org/privilege/network.profile</privilege>
+    </privileges>
+</manifest>