Update comments in controller.c
authorboyeon-son <bson1012@gmail.com>
Tue, 14 Aug 2018 03:10:27 +0000 (12:10 +0900)
committerboyeon-son <bson1012@gmail.com>
Tue, 14 Aug 2018 03:10:27 +0000 (12:10 +0900)
smartthings-final/.cproject [changed mode: 0755->0644]
smartthings-final/.project [changed mode: 0755->0644]
smartthings-final/src/controller.c

old mode 100755 (executable)
new mode 100644 (file)
index 428d9fe..d772106
@@ -16,7 +16,7 @@
                                </extensions>
                        </storageModule>
                        <storageModule moduleId="cdtBuildSystem" version="4.0.0">
-                               <configuration artifactName="motion-light-smarthings" 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.212678085" name="Debug" parent="org.tizen.nativecore.config.sbi.gcc45.app.debug">
+                               <configuration artifactName="motionlightst" 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.212678085" name="Debug" parent="org.tizen.nativecore.config.sbi.gcc45.app.debug">
                                        <folderInfo id="org.tizen.nativecore.config.sbi.gcc45.app.debug.212678085." name="/" resourcePath="">
                                                <toolChain id="org.tizen.nativecore.toolchain.sbi.gcc45.app.debug.1462926713" 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.226675057" osList="linux,win32" superClass="org.tizen.nativeide.target.sbi.gnu.platform.base"/>
                                                                <option id="gnu.cpp.compiler.option.optimization.level.1383957918" 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.1632407084" 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.871341268" name="-fPIC option" superClass="sbi.gnu.cpp.compiler.option.misc.pic.core" valueType="boolean"/>
-                                                               <option id="sbi.gnu.cpp.compiler.option.1304986764" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs">
+                                                               <option id="sbi.gnu.cpp.compiler.option.1304986764" name="Tizen-Target" 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.481216764" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.core" valueType="includePath">
+                                                               <option id="sbi.gnu.cpp.compiler.option.frameworks_inc.core.481216764" name="Tizen-Frameworks-Include-Path" 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/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.1495290878" superClass="sbi.gnu.cpp.compiler.option.frameworks_cflags.core" valueType="stringList">
+                                                               <option id="sbi.gnu.cpp.compiler.option.frameworks_cflags.core.1495290878" name="Tizen-Frameworks-Other-Cflags" 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.449630281" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
+                                                               <option id="gnu.cpp.compiler.option.include.paths.449630281" name="Include paths (-I)" 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.1135115511" superClass="sbi.gnu.cpp.compiler.option.frameworks.core" valueType="userObjs">
+                                                               <option id="sbi.gnu.cpp.compiler.option.frameworks.core.1135115511" name="Tizen-Frameworks" 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.1389021824" superClass="sbi.gnu.cpp.compiler.option.preprocessor.def.deprecation" valueType="definedSymbols">
+                                                               <option id="sbi.gnu.cpp.compiler.option.preprocessor.def.deprecation.1389021824" name="Defined symbols (-D)" 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 defaultValue="gnu.c.optimization.level.none" id="gnu.c.compiler.option.optimization.level.725973962" 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.1838517852" 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.743880440" name="-fPIC option" superClass="sbi.gnu.c.compiler.option.misc.pic.core" valueType="boolean"/>
-                                                               <option id="sbi.gnu.c.compiler.option.788889674" superClass="sbi.gnu.c.compiler.option" valueType="userObjs">
+                                                               <option id="sbi.gnu.c.compiler.option.788889674" name="Tizen-Target" 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.729698322" superClass="sbi.gnu.c.compiler.option.frameworks_inc.core" valueType="includePath">
+                                                               <option id="sbi.gnu.c.compiler.option.frameworks_inc.core.729698322" name="Tizen-Frameworks-Include-Path" 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/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.1921111222" superClass="sbi.gnu.c.compiler.option.frameworks_cflags.core" valueType="stringList">
+                                                               <option id="sbi.gnu.c.compiler.option.frameworks_cflags.core.1921111222" name="Tizen-Frameworks-Other-Cflags" 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.991673271" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
+                                                               <option id="gnu.c.compiler.option.include.paths.991673271" name="Include paths (-I)" 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.177782124" superClass="sbi.gnu.c.compiler.option.frameworks.core" valueType="userObjs">
+                                                               <option id="sbi.gnu.c.compiler.option.frameworks.core.177782124" name="Tizen-Frameworks" 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.1050476680" superClass="sbi.gnu.c.compiler.option.preprocessor.def.symbols.deprecation" valueType="definedSymbols">
+                                                               <option id="sbi.gnu.c.compiler.option.preprocessor.def.symbols.deprecation.1050476680" name="Defined symbols (-D)" 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 defaultValue="false" id="sbi.gnu.cpp.link.option.strip.929249314" 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.18288993" 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.1594639368" 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.1458335468" superClass="sbi.gnu.cpp.linker.option.frameworks_lflags.core" valueType="stringList">
+                                                               <option id="sbi.gnu.cpp.linker.option.frameworks_lflags.core.1458335468" name="Tizen-Frameworks-Other-Lflags" 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="-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.1238625478" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
+                                                               <option id="gnu.cpp.link.option.paths.1238625478" name="Library search path (-L)" 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.33710617" superClass="gnu.cpp.link.option.libs" valueType="libs">
+                                                               <option id="gnu.cpp.link.option.libs.33710617" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
                                                                        <listOptionValue builtIn="false" value="oicdastack"/>
                                                                        <listOptionValue builtIn="false" value="sdkapi"/>
                                                                </option>
                                                                <option id="gnu.cpp.compiler.option.optimization.level.1218735419" 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.1603503965" 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.135015916" name="-fPIC option" superClass="sbi.gnu.cpp.compiler.option.misc.pic.core" valueType="boolean"/>
-                                                               <option id="sbi.gnu.cpp.compiler.option.765373059" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs">
+                                                               <option id="sbi.gnu.cpp.compiler.option.765373059" name="Tizen-Target" 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.78271810" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.core" valueType="includePath">
+                                                               <option id="sbi.gnu.cpp.compiler.option.frameworks_inc.core.78271810" name="Tizen-Frameworks-Include-Path" 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/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.1219025028" superClass="sbi.gnu.cpp.compiler.option.frameworks_cflags.core" valueType="stringList">
+                                                               <option id="sbi.gnu.cpp.compiler.option.frameworks_cflags.core.1219025028" name="Tizen-Frameworks-Other-Cflags" 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.133149113" superClass="gnu.cpp.compiler.option.include.paths" valueType="includePath">
+                                                               <option id="gnu.cpp.compiler.option.include.paths.133149113" name="Include paths (-I)" 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.952816959" superClass="sbi.gnu.cpp.compiler.option.frameworks.core" valueType="userObjs">
+                                                               <option id="sbi.gnu.cpp.compiler.option.frameworks.core.952816959" name="Tizen-Frameworks" superClass="sbi.gnu.cpp.compiler.option.frameworks.core" valueType="userObjs">
                                                                        <listOptionValue builtIn="false" value="Native_API"/>
                                                                        <listOptionValue builtIn="false" value="iot-things"/>
                                                                </option>
                                                                <option defaultValue="gnu.c.optimization.level.most" id="gnu.c.compiler.option.optimization.level.248183276" 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.1666010430" 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.123326421" name="-fPIC option" superClass="sbi.gnu.c.compiler.option.misc.pic.core" valueType="boolean"/>
-                                                               <option id="sbi.gnu.c.compiler.option.62987079" superClass="sbi.gnu.c.compiler.option" valueType="userObjs">
+                                                               <option id="sbi.gnu.c.compiler.option.62987079" name="Tizen-Target" 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.1861841862" superClass="sbi.gnu.c.compiler.option.frameworks_inc.core" valueType="includePath">
+                                                               <option id="sbi.gnu.c.compiler.option.frameworks_inc.core.1861841862" name="Tizen-Frameworks-Include-Path" 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/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.6346726" superClass="sbi.gnu.c.compiler.option.frameworks_cflags.core" valueType="stringList">
+                                                               <option id="sbi.gnu.c.compiler.option.frameworks_cflags.core.6346726" name="Tizen-Frameworks-Other-Cflags" 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.49718267" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
+                                                               <option id="gnu.c.compiler.option.include.paths.49718267" name="Include paths (-I)" 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.981607999" superClass="sbi.gnu.c.compiler.option.frameworks.core" valueType="userObjs">
+                                                               <option id="sbi.gnu.c.compiler.option.frameworks.core.981607999" name="Tizen-Frameworks" superClass="sbi.gnu.c.compiler.option.frameworks.core" valueType="userObjs">
                                                                        <listOptionValue builtIn="false" value="Native_API"/>
                                                                        <listOptionValue builtIn="false" value="iot-things"/>
                                                                </option>
                                                                <option defaultValue="true" id="sbi.gnu.cpp.link.option.strip.406535656" 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.173516568" 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.1728174629" 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.1734977125" superClass="sbi.gnu.cpp.linker.option.frameworks_lflags.core" valueType="stringList">
+                                                               <option id="sbi.gnu.cpp.linker.option.frameworks_lflags.core.1734977125" name="Tizen-Frameworks-Other-Lflags" 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="-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.459689398" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
+                                                               <option id="gnu.cpp.link.option.paths.459689398" name="Library search path (-L)" 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.1551089630" superClass="gnu.cpp.link.option.libs" valueType="libs">
+                                                               <option id="gnu.cpp.link.option.libs.1551089630" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" valueType="libs">
                                                                        <listOptionValue builtIn="false" value="oicdastack"/>
                                                                        <listOptionValue builtIn="false" value="sdkapi"/>
                                                                </option>
old mode 100755 (executable)
new mode 100644 (file)
index 20231cf..5e2b7f8
@@ -25,7 +25,7 @@
        </natures>
        <filteredResources>
                <filter>
-                       <id>1533708423297</id>
+                       <id>0</id>
                        <name></name>
                        <type>26</type>
                        <matcher>
@@ -34,7 +34,7 @@
                        </matcher>
                </filter>
                <filter>
-                       <id>1533708423299</id>
+                       <id>0</id>
                        <name></name>
                        <type>6</type>
                        <matcher>
index 3b1404e..5a4b999 100644 (file)
 #define SENSOR_LED_KEY "power"
 #define SENSOR_LED_INIT "off"
 
-#define SENSORING_TIME_INTERVAL (1.0f)
-#define SENSOR_MOTION_PIN_NUM (46)
-#define SENSOR_LED_PIN_NUM (130)
-
 #define LED_ON "on"
 #define LED_OFF "off"
 
@@ -55,15 +51,14 @@ static Eina_Bool control_sensors_cb(void *data)
        uint32_t value = 0;
 
        /* Gets value from motion sensor */
-       int ret = resource_read_infrared_motion_sensor(SENSOR_MOTION_PIN_NUM, &value);
+       int ret = resource_read_infrared_motion_sensor(46, &value);
        if (ret != 0) _E("Cannot read sensor value");
 
        sensor_data_set_bool(g_ad->motion_data, value);
        _D("Detected motion value is: %d", value);
 
-       #ifdef USE_ST_SDK
-               st_things_notify_observers(SENSOR_MOTION_URI);
-       #endif
+       // Notify motion sensor change
+       st_things_notify_observers(SENSOR_MOTION_URI);
 
        return ECORE_CALLBACK_RENEW;
 }
@@ -76,19 +71,21 @@ static int __set_led_light(void *data, char *state) {
        retv_if(!ad->led_data, -1);
 
        if (0 == strcmp(state, LED_ON)) {
-               ret = resource_write_led(SENSOR_LED_PIN_NUM, 1);
+               ret = resource_write_led(130, 1);
        } else {
-               ret = resource_write_led(SENSOR_LED_PIN_NUM, 0);
+               ret = resource_write_led(130, 0);
        }
 
        retv_if(ret != 0, -1);
 
+       // Set LED sensor data
        sensor_data_set_string(ad->led_data, state, strlen(state));
+
+       // Log LED sensor value
        _D("Set LED to %s", state);
 
-#ifdef USE_ST_SDK
+       // Notify LED sensor change
        st_things_notify_observers(SENSOR_LED_URI);
-#endif
 
        return 0;
 }
@@ -101,7 +98,7 @@ void gathering_start(void *data)
        if (ad->getter_motion)
                ecore_timer_del(ad->getter_motion);
 
-       ad->getter_motion = ecore_timer_add(SENSORING_TIME_INTERVAL, control_sensors_cb, ad);
+       ad->getter_motion = ecore_timer_add(1.0f, control_sensors_cb, ad);
 
        if (!ad->getter_motion) {
                _E("Failed to add infrared motion getter timer");
@@ -110,7 +107,6 @@ void gathering_start(void *data)
        return;
 }
 
-#ifdef USE_ST_SDK
 static bool handle_reset_request(void)
 {
        _D("Received a request for RESET.");
@@ -146,9 +142,14 @@ static bool handle_get_request(st_things_get_request_message_s* req_msg, st_thin
 
                if (req_msg->has_property_key(req_msg, SENSOR_MOTION_KEY)) {
                        bool value = false;
+
+                       // Get Motion sensor data
                        sensor_data_get_bool(g_ad->motion_data, &value);
-                       _D("Value : %d", value);
+
+                       // Set Motion sensor value value for smart things representation
                        resp_rep->set_bool_value(resp_rep, SENSOR_MOTION_KEY, value);
+
+                       _D("Value : %d", value);
                }
 
                return true;
@@ -156,12 +157,20 @@ static bool handle_get_request(st_things_get_request_message_s* req_msg, st_thin
                _D("query : %s, property: %s", req_msg->query, req_msg->property_key);
 
                if (req_msg->has_property_key(req_msg, SENSOR_LED_KEY)) {
+                       // Set LED sensor data
                        const char *str = NULL;
+
+                       // Get LED sensor data
                        sensor_data_get_string(g_ad->led_data, &str);
+
+                       // Set initial value for LED data if data does not exist
                        if (!str) {
                                str = SENSOR_LED_INIT;
                        }
+
+                       // Set Motion sensor value value for smart things representation
                        resp_rep->set_str_value(resp_rep, SENSOR_LED_KEY, str);
+
                        _D("Power : %s", str);
                }
                return true;
@@ -184,8 +193,13 @@ static bool handle_set_request(st_things_set_request_message_s* req_msg, st_thin
                                retv_if(!str, false);
                                _D("set [%s:%s] == %s", SENSOR_LED_URI, SENSOR_LED_KEY, str);
 
+                               // Set LED sensor data
                                sensor_data_set_string(g_ad->led_data, str, strlen(str));
+
+                               // Set Motion sensor value value for smart things representation
                                resp_rep->set_str_value(resp_rep, SENSOR_LED_KEY, str);
+
+                               // Turn on LED light with __set_led_light()
                                ret = __set_led_light(g_ad, strdup(str));
 
                                retv_if(ret != 0, false);
@@ -264,59 +278,59 @@ static int __things_stop(void)
        st_things_stop();
        return 0;
 }
-#endif /* USE_ST_SDK */
 
 static bool service_app_create(void *user_data)
 {
        app_data *ad = user_data;
 
+       // Declare new sensor data for Motion data
        ad->motion_data = sensor_data_new(SENSOR_DATA_TYPE_BOOL);
        if (!ad->motion_data)
                return false;
 
+       // Declare new sensor data for LED data
        ad->led_data = sensor_data_new(SENSOR_DATA_TYPE_STR);
        if (!ad->led_data)
                return false;
 
+       // Initialize LED sensor data
        sensor_data_set_string(g_ad->led_data, SENSOR_LED_INIT, strlen(SENSOR_LED_INIT));
 
-       #ifdef USE_ST_SDK
-               if (__things_init())
-                       return false;
-       #endif
+       if (__things_init())
+               return false;
 
        return true;
 }
 
 static void service_app_control(app_control_h app_control, void *user_data)
 {
-#ifdef USE_ST_SDK
        __things_start();
-#else
-       gathering_start(user_data);
-#endif
 }
 
 static void service_app_terminate(void *user_data)
 {
        app_data *ad = (app_data *)user_data;
 
+       // Delete ecore timer
        if (ad->getter_motion)
                ecore_timer_del(ad->getter_motion);
 
-#ifdef USE_ST_SDK
+       // Stop and deinitialize things
        __things_stop();
        __things_deinit();
-#endif
 
+       // Turn off LED light with __set_led_light()
        __set_led_light(ad, LED_OFF);
 
+       // Free sensor Motion & LED data
        sensor_data_free(ad->motion_data);
        sensor_data_free(ad->led_data);
 
-       resource_close_infrared_motion_sensor(SENSOR_MOTION_PIN_NUM);
-       resource_close_led(SENSOR_LED_PIN_NUM);
+       // Close Motion and LED resources
+       resource_close_infrared_motion_sensor(46);
+       resource_close_led(130);
 
+       // Free app data
        free(ad);
 
        FN_END;