oobe-language
oobe-country
oobe-terms
-oobe-easy-setup
oobe-wifi
oobe-setup
+++ /dev/null
-<?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.2046301080">
- <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.tizen.nativecore.config.sbi.gcc45.app.debug.2046301080" 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="oobe-easy-setup" 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.2046301080" name="Debug" parent="org.tizen.nativecore.config.sbi.gcc45.app.debug">
- <folderInfo id="org.tizen.nativecore.config.sbi.gcc45.app.debug.2046301080." name="/" resourcePath="">
- <toolChain id="org.tizen.nativecore.toolchain.sbi.gcc45.app.debug.52277763" 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.946206827" osList="linux,win32" superClass="org.tizen.nativeide.target.sbi.gnu.platform.base"/>
- <builder autoBuildTarget="all" buildPath="${workspace_loc:/oobe-easy-setup}/Debug" enableAutoBuild="true" id="org.tizen.nativecore.target.sbi.gnu.builder.1520604450" 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.758696720" name="Archiver" superClass="org.tizen.nativecore.tool.sbi.gnu.archiver"/>
- <tool command="clang++" id="org.tizen.nativecore.tool.sbi.gnu.cpp.compiler.802378285" name="C++ Compiler" superClass="org.tizen.nativecore.tool.sbi.gnu.cpp.compiler">
- <option id="gnu.cpp.compiler.option.optimization.level.1697068666" name="Optimization Level" superClass="gnu.cpp.compiler.option.optimization.level" useByScannerDiscovery="false" 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.2144548012" name="Debug level" superClass="sbi.gnu.cpp.compiler.option.debugging.level.core" useByScannerDiscovery="false" valueType="enumerated"/>
- <option defaultValue="false" id="sbi.gnu.cpp.compiler.option.misc.pic.core.533821945" name="-fPIC option" superClass="sbi.gnu.cpp.compiler.option.misc.pic.core" useByScannerDiscovery="false" valueType="boolean"/>
- <option id="sbi.gnu.cpp.compiler.option.294093630" name="Tizen-Target" superClass="sbi.gnu.cpp.compiler.option" useByScannerDiscovery="false" valueType="userObjs">
- <listOptionValue builtIn="false" value="iot-headed-5.0-device.core_llvm40.armel"/>
- </option>
- <option id="sbi.gnu.cpp.compiler.option.frameworks_inc.core.942175546" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.core" useByScannerDiscovery="false" valueType="includePath">
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appcore-agent""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appfw""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/asp/""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/attach-panel""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/badge""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/base""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/cairo""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/calendar-service2""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/cbhm""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/chromium-ewk""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ckm""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/contacts-svc""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/content""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/context-service""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/csr""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/dali""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/dali-toolkit""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/dbus-1.0""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/device""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/device-certificate-manager""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/dlog""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-buffer-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-con-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-evas-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-file-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-imf-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-imf-evas-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-input-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-input-evas-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-ipc-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ector-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/edje-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eet-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/efl-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/efl-extension""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/efreet-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eina-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eina-1/eina""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eio-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/elementary-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/embryo-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/emile-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eo-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eom""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ethumb-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ethumb-client-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/evas-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/feedback""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/fontconfig""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/freetype2""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/geofence""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/gio-unix-2.0""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/glib-2.0""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/harfbuzz""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/iotcon""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/iotjs""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/json-glib-1.0""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/location""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/maps""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/media""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/media-content""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/messaging""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/metadata-editor""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/minicontrol""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/minizip""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/network""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/notification""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/nsd/""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/phonenumber-utils""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/privacy-privilege-manager/""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/rpc-port""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/SDL2""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/sensor""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/shortcut""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/storage""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/system""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/tef""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/tzsh""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ui""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ui-viewmgr""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/vulkan""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/web""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/widget_service""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/widget_viewer_dali""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/widget_viewer_evas""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/wifi-direct""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/yaca""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/lib/dbus-1.0/include""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/lib/glib-2.0/include""/>
- </option>
- <option id="sbi.gnu.cpp.compiler.option.frameworks_cflags.core.1699656852" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.cpp.compiler.option.frameworks_cflags.core" useByScannerDiscovery="false" 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="${SBI_SYSROOT}""/>
- <listOptionValue builtIn="false" value="-mthumb"/>
- </option>
- <option id="gnu.cpp.compiler.option.include.paths.586992872" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
- <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
- <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/api-cpp/src}""/>
- <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/ses-cpp/src}""/>
- <listOptionValue builtIn="false" value="/home/k.wieclaw/workspace/chair-setup/oobe-easy-setup/inc/services/${SDK_ARCH}"/>
- </option>
- <option id="sbi.gnu.cpp.compiler.option.frameworks.core.1882442707" name="Tizen-Frameworks" superClass="sbi.gnu.cpp.compiler.option.frameworks.core" useByScannerDiscovery="false" valueType="userObjs">
- <listOptionValue builtIn="false" value="Native_API"/>
- </option>
- <option id="sbi.gnu.cpp.compiler.option.preprocessor.def.deprecation.499646319" name="Defined symbols (-D)" superClass="sbi.gnu.cpp.compiler.option.preprocessor.def.deprecation" useByScannerDiscovery="false" valueType="definedSymbols">
- <listOptionValue builtIn="false" value="TIZEN_DEPRECATION"/>
- <listOptionValue builtIn="false" value="DEPRECATION_WARNING"/>
- <listOptionValue builtIn="false" value="_DEBUG"/>
- </option>
- <option id="gnu.cpp.compiler.option.dialect.std.2027193221" name="Language standard" superClass="gnu.cpp.compiler.option.dialect.std" useByScannerDiscovery="true" value="gnu.cpp.compiler.dialect.default" valueType="enumerated"/>
- <option id="gnu.cpp.compiler.option.dialect.flags.151802037" name="Other dialect flags" superClass="gnu.cpp.compiler.option.dialect.flags" useByScannerDiscovery="true" value="-std=c++14" valueType="string"/>
- <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.402767253" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
- </tool>
- <tool command="clang" id="org.tizen.nativecore.tool.sbi.gnu.c.compiler.1141856070" 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.535673547" name="Optimization Level" superClass="gnu.c.compiler.option.optimization.level" useByScannerDiscovery="false" valueType="enumerated"/>
- <option defaultValue="gnu.c.debugging.level.max" id="sbi.gnu.c.compiler.option.debugging.level.core.1816402512" name="Debug level" superClass="sbi.gnu.c.compiler.option.debugging.level.core" useByScannerDiscovery="false" valueType="enumerated"/>
- <option defaultValue="false" id="sbi.gnu.c.compiler.option.misc.pic.core.1057841414" name="-fPIC option" superClass="sbi.gnu.c.compiler.option.misc.pic.core" useByScannerDiscovery="false" valueType="boolean"/>
- <option id="sbi.gnu.c.compiler.option.1785849284" name="Tizen-Target" superClass="sbi.gnu.c.compiler.option" useByScannerDiscovery="false" valueType="userObjs">
- <listOptionValue builtIn="false" value="iot-headed-5.0-device.core_llvm40.armel"/>
- </option>
- <option id="sbi.gnu.c.compiler.option.frameworks_inc.core.113087976" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.c.compiler.option.frameworks_inc.core" useByScannerDiscovery="false" valueType="includePath">
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appcore-agent""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appfw""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/asp/""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/attach-panel""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/badge""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/base""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/cairo""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/calendar-service2""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/cbhm""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/chromium-ewk""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ckm""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/contacts-svc""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/content""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/context-service""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/csr""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/dali""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/dali-toolkit""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/dbus-1.0""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/device""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/device-certificate-manager""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/dlog""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-buffer-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-con-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-evas-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-file-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-imf-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-imf-evas-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-input-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-input-evas-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-ipc-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ector-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/edje-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eet-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/efl-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/efl-extension""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/efreet-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eina-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eina-1/eina""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eio-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/elementary-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/embryo-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/emile-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eo-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eom""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ethumb-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ethumb-client-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/evas-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/feedback""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/fontconfig""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/freetype2""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/geofence""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/gio-unix-2.0""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/glib-2.0""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/harfbuzz""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/iotcon""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/iotjs""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/json-glib-1.0""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/location""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/maps""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/media""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/media-content""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/messaging""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/metadata-editor""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/minicontrol""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/minizip""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/network""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/notification""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/nsd/""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/phonenumber-utils""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/privacy-privilege-manager/""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/rpc-port""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/SDL2""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/sensor""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/shortcut""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/storage""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/system""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/tef""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/tzsh""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ui""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ui-viewmgr""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/vulkan""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/web""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/widget_service""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/widget_viewer_dali""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/widget_viewer_evas""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/wifi-direct""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/yaca""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/lib/dbus-1.0/include""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/lib/glib-2.0/include""/>
- </option>
- <option id="sbi.gnu.c.compiler.option.frameworks_cflags.core.760210771" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.c.compiler.option.frameworks_cflags.core" useByScannerDiscovery="false" 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="${SBI_SYSROOT}""/>
- <listOptionValue builtIn="false" value="-mthumb"/>
- </option>
- <option id="gnu.c.compiler.option.include.paths.1229709013" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
- <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
- </option>
- <option id="sbi.gnu.c.compiler.option.frameworks.core.1236930439" name="Tizen-Frameworks" superClass="sbi.gnu.c.compiler.option.frameworks.core" useByScannerDiscovery="false" valueType="userObjs">
- <listOptionValue builtIn="false" value="Native_API"/>
- </option>
- <option id="sbi.gnu.c.compiler.option.preprocessor.def.symbols.deprecation.1424018913" name="Defined symbols (-D)" superClass="sbi.gnu.c.compiler.option.preprocessor.def.symbols.deprecation" useByScannerDiscovery="false" valueType="definedSymbols">
- <listOptionValue builtIn="false" value="TIZEN_DEPRECATION"/>
- <listOptionValue builtIn="false" value="DEPRECATION_WARNING"/>
- <listOptionValue builtIn="false" value="_DEBUG"/>
- </option>
- <option id="gnu.c.compiler.option.dialect.std.1422428462" name="Language standard" superClass="gnu.c.compiler.option.dialect.std" value="gnu.c.compiler.dialect.default" valueType="enumerated"/>
- <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.1401012689" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
- </tool>
- <tool id="org.tizen.nativeide.tool.sbi.gnu.c.linker.base.189273298" 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.573995231" name="C++ Linker" superClass="org.tizen.nativecore.tool.sbi.gnu.cpp.linker">
- <option defaultValue="false" id="sbi.gnu.cpp.link.option.strip.1277943749" name="Omit all symbol information (-s)" superClass="sbi.gnu.cpp.link.option.strip" useByScannerDiscovery="false" valueType="boolean"/>
- <option defaultValue="false" id="sbi.gnu.cpp.linker.option.shared_flag.core.41135143" name="Linker.Shared" superClass="sbi.gnu.cpp.linker.option.shared_flag.core" useByScannerDiscovery="false" valueType="boolean"/>
- <option defaultValue="false" id="sbi.gnu.cpp.linker.option.noundefined.core.639800704" name="Report unresolved symbol references (-Wl,--no-undefined)" superClass="sbi.gnu.cpp.linker.option.noundefined.core" useByScannerDiscovery="false" valueType="boolean"/>
- <option id="sbi.gnu.cpp.linker.option.frameworks_lflags.core.651525536" name="Tizen-Frameworks-Other-Lflags" superClass="sbi.gnu.cpp.linker.option.frameworks_lflags.core" useByScannerDiscovery="false" 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="${SBI_SYSROOT}""/>
- <listOptionValue builtIn="false" value="-Xlinker --version-script="${PROJ_PATH}/.exportMap""/>
- <listOptionValue builtIn="false" value="-L"${SBI_SYSROOT}/usr/lib""/>
- <listOptionValue builtIn="false" value="$(RS_LIBRARIES)"/>
- </option>
- <option id="gnu.cpp.link.option.paths.700243507" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" useByScannerDiscovery="false" valueType="libPaths">
- <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/lib}""/>
- </option>
- <option id="gnu.cpp.link.option.libs.1823861238" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" useByScannerDiscovery="false" valueType="libs">
- <listOptionValue builtIn="false" value="st_thing_master_api"/>
- </option>
- <option id="gnu.cpp.link.option.other.408667859" name="Other options (-Xlinker [option])" superClass="gnu.cpp.link.option.other" useByScannerDiscovery="false" valueType="stringList">
- <listOptionValue builtIn="false" value="-rpath=$$ORIGIN/../lib/services/${SDK_ARCH}"/>
- <listOptionValue builtIn="false" value="-rpath=./services/${SDK_ARCH}"/>
- </option>
- <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.2091948199" 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.356679142" name="Assembler" superClass="org.tizen.nativeapp.tool.sbi.gnu.assembler.base">
- <inputType id="cdt.managedbuild.tool.gnu.assembler.input.2101956884" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
- </tool>
- <tool id="org.tizen.nativecore.tool.fnmapgen.898465126" name="C FN-Map Generator" superClass="org.tizen.nativecore.tool.fnmapgen"/>
- <tool id="org.tizen.nativecore.tool.fnmapgen.cpp.1041071141" name="C++ FN-Map Generator" superClass="org.tizen.nativecore.tool.fnmapgen.cpp"/>
- <tool id="org.tizen.nativecore.tool.ast.1037812068" name="C Static Analyzer" superClass="org.tizen.nativecore.tool.ast"/>
- <tool id="org.tizen.nativecore.tool.ast.cpp.315079439" name="C++ Static Analyzer" superClass="org.tizen.nativecore.tool.ast.cpp"/>
- <tool id="org.tizen.nativecore.tool.sbi.gnu.archiver.mergelib.1307162722" name="Archive Generator" superClass="org.tizen.nativecore.tool.sbi.gnu.archiver.mergelib"/>
- <tool id="org.tizen.nativecore.tool.sbi.po.compiler.1101406106" name="PO Resource Compiler" superClass="org.tizen.nativecore.tool.sbi.po.compiler"/>
- <tool id="org.tizen.nativecore.tool.sbi.edc.compiler.218186055" name="EDC Resource Compiler" superClass="org.tizen.nativecore.tool.sbi.edc.compiler"/>
- </toolChain>
- </folderInfo>
- <sourceEntries>
- <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="api-cpp/src"/>
- <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="ses-cpp/src"/>
- <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.238165481">
- <storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="org.tizen.nativecore.config.sbi.gcc45.app.release.238165481" 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="oobe-easy-setup" 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.238165481" name="Release" parent="org.tizen.nativecore.config.sbi.gcc45.app.release">
- <folderInfo id="org.tizen.nativecore.config.sbi.gcc45.app.release.238165481." name="/" resourcePath="">
- <toolChain id="org.tizen.nativecore.toolchain.sbi.gcc45.app.release.396029784" 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.1696289585" osList="linux,win32" superClass="org.tizen.nativeide.target.sbi.gnu.platform.base"/>
- <builder buildPath="${workspace_loc:/oobe-easy-setup}/Release" id="org.tizen.nativecore.target.sbi.gnu.builder.1958474822" 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.1339790339" name="Archiver" superClass="org.tizen.nativecore.tool.sbi.gnu.archiver"/>
- <tool command="clang++" id="org.tizen.nativecore.tool.sbi.gnu.cpp.compiler.1347042439" name="C++ Compiler" superClass="org.tizen.nativecore.tool.sbi.gnu.cpp.compiler">
- <option id="gnu.cpp.compiler.option.optimization.level.873315773" 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.176356456" 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.562497055" name="-fPIC option" superClass="sbi.gnu.cpp.compiler.option.misc.pic.core" valueType="boolean"/>
- <option id="sbi.gnu.cpp.compiler.option.1714250279" name="Tizen-Target" superClass="sbi.gnu.cpp.compiler.option" valueType="userObjs">
- <listOptionValue builtIn="false" value="iot-headed-5.0-device.core_llvm40.armel"/>
- </option>
- <option id="sbi.gnu.cpp.compiler.option.frameworks_inc.core.515728240" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.cpp.compiler.option.frameworks_inc.core" valueType="includePath">
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appcore-agent""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appfw""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/asp/""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/attach-panel""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/badge""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/base""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/cairo""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/calendar-service2""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/cbhm""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/chromium-ewk""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ckm""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/contacts-svc""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/content""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/context-service""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/csr""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/dali""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/dali-toolkit""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/dbus-1.0""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/device""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/device-certificate-manager""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/dlog""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-buffer-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-con-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-evas-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-file-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-imf-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-imf-evas-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-input-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-input-evas-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-ipc-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ector-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/edje-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eet-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/efl-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/efl-extension""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/efreet-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eina-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eina-1/eina""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eio-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/elementary-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/embryo-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/emile-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eo-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eom""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ethumb-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ethumb-client-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/evas-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/feedback""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/fontconfig""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/freetype2""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/geofence""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/gio-unix-2.0""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/glib-2.0""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/harfbuzz""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/iotcon""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/iotjs""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/json-glib-1.0""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/location""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/maps""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/media""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/media-content""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/messaging""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/metadata-editor""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/minicontrol""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/minizip""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/network""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/notification""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/nsd/""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/phonenumber-utils""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/privacy-privilege-manager/""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/rpc-port""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/SDL2""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/sensor""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/shortcut""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/storage""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/system""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/tef""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/tzsh""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ui""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ui-viewmgr""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/vulkan""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/web""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/widget_service""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/widget_viewer_dali""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/widget_viewer_evas""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/wifi-direct""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/yaca""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/lib/dbus-1.0/include""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/lib/glib-2.0/include""/>
- </option>
- <option id="sbi.gnu.cpp.compiler.option.frameworks_cflags.core.1327923693" 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="${SBI_SYSROOT}""/>
- <listOptionValue builtIn="false" value="-mthumb"/>
- </option>
- <option id="gnu.cpp.compiler.option.include.paths.773843936" name="Include paths (-I)" superClass="gnu.cpp.compiler.option.include.paths" useByScannerDiscovery="false" valueType="includePath">
- <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
- <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/ses-cpp/src}""/>
- <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/api-cpp/src}""/>
- <listOptionValue builtIn="false" value="/home/k.wieclaw/workspace/chair-setup/oobe-easy-setup/inc/services/${SDK_ARCH}"/>
- </option>
- <option id="sbi.gnu.cpp.compiler.option.frameworks.core.1752610314" name="Tizen-Frameworks" superClass="sbi.gnu.cpp.compiler.option.frameworks.core" valueType="userObjs">
- <listOptionValue builtIn="false" value="Native_API"/>
- </option>
- <option id="gnu.cpp.compiler.option.dialect.std.518005789" superClass="gnu.cpp.compiler.option.dialect.std" value="gnu.cpp.compiler.dialect.default" valueType="enumerated"/>
- <inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.840391898" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
- </tool>
- <tool command="clang" id="org.tizen.nativecore.tool.sbi.gnu.c.compiler.1718927725" 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.256299153" 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.544141194" 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.893322625" name="-fPIC option" superClass="sbi.gnu.c.compiler.option.misc.pic.core" valueType="boolean"/>
- <option id="sbi.gnu.c.compiler.option.1838303740" name="Tizen-Target" superClass="sbi.gnu.c.compiler.option" valueType="userObjs">
- <listOptionValue builtIn="false" value="iot-headed-5.0-device.core_llvm40.armel"/>
- </option>
- <option id="sbi.gnu.c.compiler.option.frameworks_inc.core.3875207" name="Tizen-Frameworks-Include-Path" superClass="sbi.gnu.c.compiler.option.frameworks_inc.core" valueType="includePath">
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/libxml2""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appcore-agent""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/appfw""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/asp/""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/attach-panel""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/badge""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/base""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/cairo""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/calendar-service2""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/cbhm""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/chromium-ewk""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ckm""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/contacts-svc""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/content""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/context-service""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/csr""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/dali""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/dali-toolkit""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/dbus-1.0""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/device""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/device-certificate-manager""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/dlog""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-buffer-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-con-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-evas-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-file-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-imf-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-imf-evas-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-input-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-input-evas-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ecore-ipc-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ector-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/edje-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eet-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/efl-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/efl-extension""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/efreet-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eina-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eina-1/eina""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eio-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/elementary-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/embryo-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/emile-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eo-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/eom""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ethumb-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ethumb-client-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/evas-1""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/feedback""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/fontconfig""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/freetype2""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/geofence""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/gio-unix-2.0""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/glib-2.0""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/harfbuzz""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/iotcon""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/iotjs""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/json-glib-1.0""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/location""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/maps""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/media""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/media-content""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/messaging""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/metadata-editor""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/minicontrol""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/minizip""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/network""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/notification""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/nsd/""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/phonenumber-utils""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/privacy-privilege-manager/""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/rpc-port""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/SDL2""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/sensor""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/shortcut""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/storage""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/system""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/tef""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/tzsh""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ui""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/ui-viewmgr""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/vulkan""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/web""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/widget_service""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/widget_viewer_dali""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/widget_viewer_evas""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/wifi-direct""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/include/yaca""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/lib/dbus-1.0/include""/>
- <listOptionValue builtIn="false" value=""${SBI_SYSROOT}/usr/lib/glib-2.0/include""/>
- </option>
- <option id="sbi.gnu.c.compiler.option.frameworks_cflags.core.1746609005" name="Tizen-Frameworks-Other-Cflags" superClass="sbi.gnu.c.compiler.option.frameworks_cflags.core" useByScannerDiscovery="false" 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="${SBI_SYSROOT}""/>
- <listOptionValue builtIn="false" value="-mthumb"/>
- </option>
- <option id="gnu.c.compiler.option.include.paths.2083141862" name="Include paths (-I)" superClass="gnu.c.compiler.option.include.paths" valueType="includePath">
- <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/inc}""/>
- <listOptionValue builtIn="false" value="/home/k.wieclaw/workspace/chair-setup/oobe-easy-setup/inc/services/${SDK_ARCH}"/>
- </option>
- <option id="sbi.gnu.c.compiler.option.frameworks.core.317466654" name="Tizen-Frameworks" superClass="sbi.gnu.c.compiler.option.frameworks.core" valueType="userObjs">
- <listOptionValue builtIn="false" value="Native_API"/>
- </option>
- <inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.832911699" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
- </tool>
- <tool id="org.tizen.nativeide.tool.sbi.gnu.c.linker.base.412413729" 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.1161091416" name="C++ Linker" superClass="org.tizen.nativecore.tool.sbi.gnu.cpp.linker">
- <option defaultValue="true" id="sbi.gnu.cpp.link.option.strip.720735844" 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.1978490334" 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.329007922" 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.765538515" name="Tizen-Frameworks-Other-Lflags" superClass="sbi.gnu.cpp.linker.option.frameworks_lflags.core" useByScannerDiscovery="false" 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="${SBI_SYSROOT}""/>
- <listOptionValue builtIn="false" value="-Xlinker --version-script="${PROJ_PATH}/.exportMap""/>
- <listOptionValue builtIn="false" value="-L"${SBI_SYSROOT}/usr/lib""/>
- <listOptionValue builtIn="false" value="$(RS_LIBRARIES)"/>
- </option>
- <option id="gnu.cpp.link.option.paths.1961114256" name="Library search path (-L)" superClass="gnu.cpp.link.option.paths" valueType="libPaths">
- <listOptionValue builtIn="false" value=""${workspace_loc:/${ProjName}/lib}""/>
- </option>
- <option id="gnu.cpp.link.option.libs.1963943712" name="Libraries (-l)" superClass="gnu.cpp.link.option.libs" useByScannerDiscovery="false" valueType="libs">
- <listOptionValue builtIn="false" value="st_thing_master_api"/>
- </option>
- <option id="gnu.cpp.link.option.other.2079174021" name="Other options (-Xlinker [option])" superClass="gnu.cpp.link.option.other" valueType="stringList">
- <listOptionValue builtIn="false" value="-rpath=$$ORIGIN/../lib/services/${SDK_ARCH}"/>
- <listOptionValue builtIn="false" value="-rpath=./services/${SDK_ARCH}"/>
- </option>
- <inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1431455794" 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.1697741595" name="Assembler" superClass="org.tizen.nativeapp.tool.sbi.gnu.assembler.base">
- <inputType id="cdt.managedbuild.tool.gnu.assembler.input.479213987" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
- </tool>
- <tool id="org.tizen.nativecore.tool.fnmapgen.1032569412" name="C FN-Map Generator" superClass="org.tizen.nativecore.tool.fnmapgen"/>
- <tool id="org.tizen.nativecore.tool.fnmapgen.cpp.316506884" name="C++ FN-Map Generator" superClass="org.tizen.nativecore.tool.fnmapgen.cpp"/>
- <tool id="org.tizen.nativecore.tool.ast.1052070204" name="C Static Analyzer" superClass="org.tizen.nativecore.tool.ast"/>
- <tool id="org.tizen.nativecore.tool.ast.cpp.1612138443" name="C++ Static Analyzer" superClass="org.tizen.nativecore.tool.ast.cpp"/>
- <tool id="org.tizen.nativecore.tool.sbi.gnu.archiver.mergelib.1800629631" name="Archive Generator" superClass="org.tizen.nativecore.tool.sbi.gnu.archiver.mergelib"/>
- <tool id="org.tizen.nativecore.tool.sbi.po.compiler.1288348067" name="PO Resource Compiler" superClass="org.tizen.nativecore.tool.sbi.po.compiler"/>
- <tool id="org.tizen.nativecore.tool.sbi.edc.compiler.1763555228" 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"/>
- <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="api-cpp/src"/>
- <entry flags="VALUE_WORKSPACE_PATH|RESOLVED" kind="sourcePath" name="ses-cpp/src"/>
- </sourceEntries>
- </configuration>
- </storageModule>
- <storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
- </cconfiguration>
- </storageModule>
- <storageModule moduleId="cdtBuildSystem" version="4.0.0">
- <project id="oobe-easy-setup.org.tizen.nativecore.target.sbi.gcc45.app.1909398531" 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.2046301080">
- <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
- </scannerConfigBuildInfo>
- <scannerConfigBuildInfo instanceId="org.tizen.nativecore.config.sbi.gcc45.app.release.238165481">
- <autodiscovery enabled="true" problemReportingEnabled="true" selectedProfileId=""/>
- </scannerConfigBuildInfo>
- </storageModule>
- <storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
- <storageModule moduleId="refreshScope" versionNumber="2">
- <configuration configurationName="Debug">
- <resource resourceType="PROJECT" workspacePath="/oobe-easy-setup"/>
- </configuration>
- <configuration configurationName="Release">
- <resource resourceType="PROJECT" workspacePath="/oobe-easy-setup"/>
- </configuration>
- </storageModule>
- <storageModule moduleId="org.eclipse.cdt.make.core.buildtargets"/>
- <storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
-</cproject>
+++ /dev/null
-{
- global: main;
- _IO_*;
- local: *;
-};
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>oobe-easy-setup</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.cdt.managedbuilder.core.genmakebuilder</name>
- <triggers>clean,full,incremental,</triggers>
- <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>0</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>0</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>
+++ /dev/null
-eclipse.preferences.version=1
-org.eclipse.cdt.codan.checkers.errnoreturn=Warning
-org.eclipse.cdt.codan.checkers.errnoreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"No return\\")",implicit\=>false}
-org.eclipse.cdt.codan.checkers.errreturnvalue=Error
-org.eclipse.cdt.codan.checkers.errreturnvalue.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused return value\\")"}
-org.eclipse.cdt.codan.checkers.nocommentinside=-Error
-org.eclipse.cdt.codan.checkers.nocommentinside.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Nesting comments\\")"}
-org.eclipse.cdt.codan.checkers.nolinecomment=-Error
-org.eclipse.cdt.codan.checkers.nolinecomment.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Line comments\\")"}
-org.eclipse.cdt.codan.checkers.noreturn=Error
-org.eclipse.cdt.codan.checkers.noreturn.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"No return value\\")",implicit\=>false}
-org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation=-Error
-org.eclipse.cdt.codan.internal.checkers.AbstractClassCreation.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Abstract class cannot be instantiated\\")"}
-org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem=-Error
-org.eclipse.cdt.codan.internal.checkers.AmbiguousProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Ambiguous problem\\")"}
-org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem=Warning
-org.eclipse.cdt.codan.internal.checkers.AssignmentInConditionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Assignment in condition\\")"}
-org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem=Error
-org.eclipse.cdt.codan.internal.checkers.AssignmentToItselfProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Assignment to itself\\")"}
-org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem=Warning
-org.eclipse.cdt.codan.internal.checkers.CaseBreakProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"No break at end of case\\")",no_break_comment\=>"no break",last_case_param\=>false,empty_case_param\=>false,enable_fallthrough_quickfix_param\=>false}
-org.eclipse.cdt.codan.internal.checkers.CatchByReference=Warning
-org.eclipse.cdt.codan.internal.checkers.CatchByReference.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Catching by reference is recommended\\")",unknown\=>false,exceptions\=>()}
-org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem=-Error
-org.eclipse.cdt.codan.internal.checkers.CircularReferenceProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Circular inheritance\\")"}
-org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization=Warning
-org.eclipse.cdt.codan.internal.checkers.ClassMembersInitialization.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Class members should be properly initialized\\")",skip\=>true}
-org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem=-Error
-org.eclipse.cdt.codan.internal.checkers.FieldResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Field cannot be resolved\\")"}
-org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem=-Error
-org.eclipse.cdt.codan.internal.checkers.FunctionResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Function cannot be resolved\\")"}
-org.eclipse.cdt.codan.internal.checkers.InvalidArguments=-Error
-org.eclipse.cdt.codan.internal.checkers.InvalidArguments.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid arguments\\")"}
-org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem=-Error
-org.eclipse.cdt.codan.internal.checkers.InvalidTemplateArgumentsProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid template argument\\")"}
-org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem=-Error
-org.eclipse.cdt.codan.internal.checkers.LabelStatementNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Label statement not found\\")"}
-org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem=-Error
-org.eclipse.cdt.codan.internal.checkers.MemberDeclarationNotFoundProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Member declaration not found\\")"}
-org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem=-Error
-org.eclipse.cdt.codan.internal.checkers.MethodResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Method cannot be resolved\\")"}
-org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker=-Info
-org.eclipse.cdt.codan.internal.checkers.NamingConventionFunctionChecker.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Name convention for function\\")",pattern\=>"^[a-z]",macro\=>true,exceptions\=>()}
-org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem=Warning
-org.eclipse.cdt.codan.internal.checkers.NonVirtualDestructorProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Class has a virtual method and non-virtual destructor\\")"}
-org.eclipse.cdt.codan.internal.checkers.OverloadProblem=-Error
-org.eclipse.cdt.codan.internal.checkers.OverloadProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid overload\\")"}
-org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem=-Error
-org.eclipse.cdt.codan.internal.checkers.RedeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid redeclaration\\")"}
-org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem=-Error
-org.eclipse.cdt.codan.internal.checkers.RedefinitionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Invalid redefinition\\")"}
-org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem=-Warning
-org.eclipse.cdt.codan.internal.checkers.ReturnStyleProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Return with parenthesis\\")"}
-org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem=-Warning
-org.eclipse.cdt.codan.internal.checkers.ScanfFormatStringSecurityProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Format String Vulnerability\\")"}
-org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem=Warning
-org.eclipse.cdt.codan.internal.checkers.StatementHasNoEffectProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Statement has no effect\\")",macro\=>true,exceptions\=>()}
-org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem=Warning
-org.eclipse.cdt.codan.internal.checkers.SuggestedParenthesisProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Suggested parenthesis around expression\\")",paramNot\=>false}
-org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem=Warning
-org.eclipse.cdt.codan.internal.checkers.SuspiciousSemicolonProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Suspicious semicolon\\")",else\=>false,afterelse\=>false}
-org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem=-Error
-org.eclipse.cdt.codan.internal.checkers.TypeResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Type cannot be resolved\\")"}
-org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem=Warning
-org.eclipse.cdt.codan.internal.checkers.UnusedFunctionDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused function declaration\\")",macro\=>true}
-org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem=Warning
-org.eclipse.cdt.codan.internal.checkers.UnusedStaticFunctionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused static function\\")",macro\=>true}
-org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem=Warning
-org.eclipse.cdt.codan.internal.checkers.UnusedVariableDeclarationProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Unused variable declaration in file scope\\")",macro\=>true,exceptions\=>("@(\#)","$Id")}
-org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem=-Error
-org.eclipse.cdt.codan.internal.checkers.VariableResolutionProblem.params={launchModes\=>{RUN_ON_FULL_BUILD\=>true,RUN_ON_INC_BUILD\=>true,RUN_ON_FILE_OPEN\=>false,RUN_ON_FILE_SAVE\=>false,RUN_AS_YOU_TYPE\=>true,RUN_ON_DEMAND\=>true},suppression_comment\=>"@suppress(\\"Symbol is not resolved\\")"}
+++ /dev/null
-eclipse.preferences.version=1
-environment/buildEnvironmentInclude/org.tizen.nativecore.config.sbi.gcc45.app.debug.2046301080/CPATH/delimiter=\:
-environment/buildEnvironmentInclude/org.tizen.nativecore.config.sbi.gcc45.app.debug.2046301080/CPATH/operation=remove
-environment/buildEnvironmentInclude/org.tizen.nativecore.config.sbi.gcc45.app.debug.2046301080/CPLUS_INCLUDE_PATH/delimiter=\:
-environment/buildEnvironmentInclude/org.tizen.nativecore.config.sbi.gcc45.app.debug.2046301080/CPLUS_INCLUDE_PATH/operation=remove
-environment/buildEnvironmentInclude/org.tizen.nativecore.config.sbi.gcc45.app.debug.2046301080/C_INCLUDE_PATH/delimiter=\:
-environment/buildEnvironmentInclude/org.tizen.nativecore.config.sbi.gcc45.app.debug.2046301080/C_INCLUDE_PATH/operation=remove
-environment/buildEnvironmentInclude/org.tizen.nativecore.config.sbi.gcc45.app.debug.2046301080/append=true
-environment/buildEnvironmentInclude/org.tizen.nativecore.config.sbi.gcc45.app.debug.2046301080/appendContributed=true
-environment/buildEnvironmentLibrary/org.tizen.nativecore.config.sbi.gcc45.app.debug.2046301080/LIBRARY_PATH/delimiter=\:
-environment/buildEnvironmentLibrary/org.tizen.nativecore.config.sbi.gcc45.app.debug.2046301080/LIBRARY_PATH/operation=remove
-environment/buildEnvironmentLibrary/org.tizen.nativecore.config.sbi.gcc45.app.debug.2046301080/append=true
-environment/buildEnvironmentLibrary/org.tizen.nativecore.config.sbi.gcc45.app.debug.2046301080/appendContributed=true
+++ /dev/null
-<?xml version="1.0"?>
-<tproject xmlns="http://www.tizen.org/tproject">
- <platforms>
- <platform>
- <name>iot-headed-5.0</name>
- </platform>
- </platforms>
- <package>
- <blacklist/>
- <resFallback autoGen="true"/>
- </package>
-</tproject>
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 TIZENAPIRESULT_H
-#define TIZENAPIRESULT_H
-
-#include "Error.hpp"
-#include "Result.hpp"
-
-namespace tizen {
-template <typename T>
-using ApiResult = Result<T, tizen::Error>;
-
-} /* tizen */
-
-#endif /* TIZENAPIRESULT_H */
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 APIUTILS_HPP
-#define APIUTILS_HPP
-
-#define IMPLEMENT_METHOD(retType, declaration, localParams, apiCall, retValue) \
-ApiResult<retType> declaration \
-{ \
- localParams; \
- int err = apiCall; \
- if (err != TIZEN_ERROR_NONE) { \
- return ApiResult<retType>::Error(err); \
- } else { \
- return ApiResult<retType>::Ok(retValue); \
- } \
-}
-
-#endif /* end of include guard: APIUTILS_HPP */
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 LOG_H
-#define LOG_H
-
-#include <dlog.h>
-#include <string>
-
-namespace tizen {
-
-template<typename T>
-class DLog
-{
- public:
- template<typename ...Args>
- static void Dbg(const char *format, Args... args)
- {
- dlog_print(DLOG_DEBUG, T::tag, format, std::forward<Args>(args)...);
- }
- static void Dbg(const char *format)
- {
- dlog_print(DLOG_DEBUG, T::tag, format, nullptr);
- }
- template<typename ...Args>
- static void Inf(const char *format, Args... args)
- {
- dlog_print(DLOG_INFO, T::tag, format, std::forward<Args>(args)...);
- }
- static void Inf(const char *format)
- {
- dlog_print(DLOG_INFO, T::tag, format, nullptr);
- }
- template<typename ...Args>
- static void Wrn(const char *format, Args... args)
- {
- dlog_print(DLOG_WARN, T::tag, format, std::forward<Args>(args)...);
- }
- static void Wrn(const char *format)
- {
- dlog_print(DLOG_WARN, T::tag, format, nullptr);
- }
- template<typename ...Args>
- static void Err(const char *format, Args... args)
- {
- dlog_print(DLOG_ERROR, T::tag, format, std::forward<Args>(args)...);
- }
- static void Err(const char *format)
- {
- dlog_print(DLOG_ERROR, T::tag, format, nullptr);
- }
- template<typename ...Args>
- static void Fat(const char *format, Args... args)
- {
- dlog_print(DLOG_FATAL, T::tag, format, std::forward<Args>(args)...);
- }
- static void Fat(const char *format)
- {
- dlog_print(DLOG_FATAL, T::tag, format, nullptr);
- }
-};
-
-} /* tizen */
-
-#endif
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 TIZENERROR_H
-#define TIZENERROR_H
-
-#include <tizen.h>
-
-namespace tizen {
-
-struct Error {
-public:
- Error() = default;
- Error(int error_code)
- : code_number(error_code)
- {
- }
-
- const char* message() const
- {
- return get_error_message(code_number);
- }
-
- int code() const
- {
- return code_number;
- }
-
-private:
- int code_number;
-};
-
-} /* tizen */
-
-#endif /* TIZENERROR_H */
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "Logger.hpp"
-
-constexpr char tizen::TizenppLoggerConfig::tag[];
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "DLog.hpp"
-
-namespace tizen {
-
-struct TizenppLoggerConfig
-{
- static constexpr char tag[] = "tizenpp";
-};
-
-using logger = DLog<TizenppLoggerConfig>;
-
-} /* tizen */
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 RESULT_H
-#define RESULT_H
-
-#include <utility>
-#include <stdexcept>
-
-template <typename T, typename E>
-class Result {
-public:
-
- explicit operator bool()
- {
- return !is_error;
- }
-
- const E& error() const
- {
- return err;
- }
-
- T& result()
- {
- return res;
- }
-
- T& unwrap() {
- if (is_error)
- throw std::runtime_error(error().message());
- return res;
- }
-
- static Result Ok(T val)
- {
- return Result(std::move(val));
- }
-
- static Result Error(E err)
- {
- return Result(std::move(err));
- }
-
-private:
- Result(T t)
- : res(std::move(t))
- {
- is_error = false;
- }
-
- Result(E e)
- : err(std::move(e))
- {
- is_error = true;
- }
-
- T res;
- E err;
- bool is_error;
-};
-
-template <typename E>
-class Result<void, E> {
-public:
- explicit operator bool()
- {
- return !is_error;
- }
-
- const E& error() const
- {
- return err;
- }
-
- void unwrap() {
- if (is_error)
- throw std::runtime_error(error().message());
- }
-
- static Result Ok()
- {
- return Result();
- }
-
- static Result Error(E err)
- {
- return Result(std::move(err));
- }
-
-private:
- Result()
- {
- is_error = false;
- }
-
- Result(E e)
- : err(std::move(e))
- {
- is_error = true;
- }
-
- E err;
- bool is_error;
-};
-#endif /* RESULT_H */
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "Strings.hpp"
-
-std::string tizen::wrapMallocString(char* mem)
-{
- std::string ret(mem);
- free(mem);
- return ret;
-}
-
-std::string tizen::wrapMallocString(char* mem, size_t len)
-{
- std::string ret(mem, len);
- free(mem);
- return ret;
-}
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 STRINGS_HPP
-#define STRINGS_HPP
-
-#include <string>
-#include <cstddef>
-
-namespace tizen {
-
-std::string wrapMallocString(char* mem);
-std::string wrapMallocString(char* mem, std::size_t len);
-
-} /* tizen */
-
-#endif /* end of include guard: STRINGS_HPP */
-
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "ThreadUtils.hpp"
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wconversion"
-#pragma GCC diagnostic ignored "-Wuseless-cast"
-#pragma GCC diagnostic ignored "-Wpedantic"
-#pragma GCC diagnostic ignored "-Wsign-conversion"
-#pragma GCC diagnostic ignored "-Wfloat-conversion"
-#pragma GCC diagnostic ignored "-Wdouble-promotion"
-#include <Ecore.h>
-#pragma GCC diagnostic pop
-#include <functional>
-#include <utility>
-
-using namespace tizen;
-
-void ThreadUtils::InvokeOnUIThreadSync(std::function<void()> func)
-{
- auto _func = new std::function<void()>(std::move(func));
- ecore_main_loop_thread_safe_call_sync(UIThreadCallbackSync,
- static_cast<void*>(_func));
-}
-
-void ThreadUtils::InvokeOnUIThread(std::function<void()> func)
-{
- auto _func = new std::function<void()>(std::move(func));
- ecore_main_loop_thread_safe_call_async(UIThreadCallback,
- static_cast<void*>(_func));
-}
-
-void* ThreadUtils::UIThreadCallbackSync(void* data)
-{
- auto _func = static_cast<std::function<void()>*>(data);
- (*_func)();
- delete _func;
- return NULL;
-}
-
-void ThreadUtils::UIThreadCallback(void* data)
-{
- auto _func = static_cast<std::function<void()>*>(data);
- (*_func)();
- delete _func;
-}
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 _THREAD_UTILS_H_
-#define _THREAD_UTILS_H_
-
-#include <functional>
-
-namespace tizen {
-
-class ThreadUtils {
-public:
- static void InvokeOnUIThreadSync(std::function<void()> func);
- static void InvokeOnUIThread(std::function<void()> func);
-
-private:
- static void* UIThreadCallbackSync(void* data);
- static void UIThreadCallback(void* data);
-};
-
-} //namespace tizen
-
-#endif
+++ /dev/null
-/*
- * Copyright AppControl::(c) 2019 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 AppControl::(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.
- */
-
-#include "tizen/application/AppControl.hpp"
-#include "tizen/application/AppException.hpp"
-#include "tizen/Strings.hpp"
-#include "tizen/Logger.hpp"
-#include <algorithm>
-
-namespace tizen {
-namespace application {
-
-//Operation types strings
-const std::string AppControl::OPERATION_STRING_NONE("");
-const std::string AppControl::OPERATION_STRING_MAIN(APP_CONTROL_OPERATION_MAIN);
-const std::string AppControl::OPERATION_STRING_DEFAULT(APP_CONTROL_OPERATION_DEFAULT);
-const std::string AppControl::OPERATION_STRING_EDIT(APP_CONTROL_OPERATION_EDIT);
-const std::string AppControl::OPERATION_STRING_VIEW(APP_CONTROL_OPERATION_VIEW);
-const std::string AppControl::OPERATION_STRING_PICK(APP_CONTROL_OPERATION_PICK);
-const std::string AppControl::OPERATION_STRING_CREATE_CONTENT(APP_CONTROL_OPERATION_CREATE_CONTENT);
-const std::string AppControl::OPERATION_STRING_CALL(APP_CONTROL_OPERATION_CALL);
-const std::string AppControl::OPERATION_STRING_SEND(APP_CONTROL_OPERATION_SEND);
-const std::string AppControl::OPERATION_STRING_SEND_TEXT(APP_CONTROL_OPERATION_SEND_TEXT);
-const std::string AppControl::OPERATION_STRING_SHARE(APP_CONTROL_OPERATION_SHARE);
-const std::string AppControl::OPERATION_STRING_MULTI_SHARE(APP_CONTROL_OPERATION_MULTI_SHARE);
-const std::string AppControl::OPERATION_STRING_SHARE_TEXT(APP_CONTROL_OPERATION_SHARE_TEXT);
-const std::string AppControl::OPERATION_STRING_DIAL(APP_CONTROL_OPERATION_DIAL);
-const std::string AppControl::OPERATION_STRING_SEARCH(APP_CONTROL_OPERATION_SEARCH);
-const std::string AppControl::OPERATION_STRING_DOWNLOAD(APP_CONTROL_OPERATION_DOWNLOAD);
-const std::string AppControl::OPERATION_STRING_PRINT(APP_CONTROL_OPERATION_PRINT);
-const std::string AppControl::OPERATION_STRING_COMPOSE(APP_CONTROL_OPERATION_COMPOSE);
-const std::string AppControl::OPERATION_STRING_LAUNCH_ON_EVENT(APP_CONTROL_OPERATION_LAUNCH_ON_EVENT);
-const std::string AppControl::OPERATION_STRING_ADD(APP_CONTROL_OPERATION_ADD);
-const std::string AppControl::OPERATION_STRING_IMAGE_CAPTURE(APP_CONTROL_OPERATION_IMAGE_CAPTURE);
-const std::string AppControl::OPERATION_STRING_VIDEO_CAPTURE(APP_CONTROL_OPERATION_VIDEO_CAPTURE);
-const std::string AppControl::OPERATION_STRING_SETTING_BT_ENABLE(APP_CONTROL_OPERATION_SETTING_BT_ENABLE);
-const std::string AppControl::OPERATION_STRING_SETTING_BT_VISIBILITY(APP_CONTROL_OPERATION_SETTING_BT_VISIBILITY);
-const std::string AppControl::OPERATION_STRING_SETTING_LOCATION(APP_CONTROL_OPERATION_SETTING_LOCATION);
-const std::string AppControl::OPERATION_STRING_SETTING_NFC(APP_CONTROL_OPERATION_SETTING_NFC);
-const std::string AppControl::OPERATION_STRING_SETTING(APP_CONTROL_OPERATION_SETTING);
-const std::string AppControl::OPERATION_STRING_SETTING_WIFI(APP_CONTROL_OPERATION_SETTING_WIFI);
-const std::string AppControl::OPERATION_STRING_SETTING_VPN(APP_CONTROL_OPERATION_SETTING_VPN);
-const std::string AppControl::OPERATION_STRING_GET_INPUT(APP_CONTROL_OPERATION_GET_INPUT);
-const std::string AppControl::OPERATION_STRING_MEDIA_CONTROLLER(APP_CONTROL_OPERATION_MEDIA_CONTROLLER);
-const std::string AppControl::OPERATION_STRING_PRIVACY_SETTING_GUIDE(APP_CONTROL_OPERATION_PRIVACY_SETTING_GUIDE);
-
-//Data types strings
-const std::string AppControl::DATA_STRING_NONE("");
-const std::string AppControl::DATA_STRING_FEATURE(APP_CONTROL_DATA_FEATURE);
-const std::string AppControl::DATA_STRING_PRIVILEGES(APP_CONTROL_DATA_PRIVILEGES);
-const std::string AppControl::DATA_STRING_SUBJECT(APP_CONTROL_DATA_SUBJECT);
-const std::string AppControl::DATA_STRING_TO(APP_CONTROL_DATA_TO);
-const std::string AppControl::DATA_STRING_CC(APP_CONTROL_DATA_CC);
-const std::string AppControl::DATA_STRING_BCC(APP_CONTROL_DATA_BCC);
-const std::string AppControl::DATA_STRING_TEXT(APP_CONTROL_DATA_TEXT);
-const std::string AppControl::DATA_STRING_TITLE(APP_CONTROL_DATA_TITLE);
-const std::string AppControl::DATA_STRING_SELECTED(APP_CONTROL_DATA_SELECTED);
-const std::string AppControl::DATA_STRING_PATH(APP_CONTROL_DATA_PATH);
-const std::string AppControl::DATA_STRING_SELECTION_MODE(APP_CONTROL_DATA_SELECTION_MODE);
-const std::string AppControl::DATA_STRING_CALENDAR_ALL_DAY(APP_CONTROL_DATA_CALENDAR_ALL_DAY);
-const std::string AppControl::DATA_STRING_CALENDAR_START_TIME(APP_CONTROL_DATA_CALENDAR_START_TIME);
-const std::string AppControl::DATA_STRING_CALENDAR_END_TIME(APP_CONTROL_DATA_CALENDAR_END_TIME);
-const std::string AppControl::DATA_STRING_EMAIL(APP_CONTROL_DATA_EMAIL);
-const std::string AppControl::DATA_STRING_PHONE(APP_CONTROL_DATA_PHONE);
-const std::string AppControl::DATA_STRING_URL(APP_CONTROL_DATA_URL);
-const std::string AppControl::DATA_STRING_ID(APP_CONTROL_DATA_ID);
-const std::string AppControl::DATA_STRING_TYPE(APP_CONTROL_DATA_TYPE);
-const std::string AppControl::DATA_STRING_TOTAL_COUNT(APP_CONTROL_DATA_TOTAL_COUNT);
-const std::string AppControl::DATA_STRING_TOTAL_SIZE(APP_CONTROL_DATA_TOTAL_SIZE);
-const std::string AppControl::DATA_STRING_NAME(APP_CONTROL_DATA_NAME);
-const std::string AppControl::DATA_STRING_LOCATION(APP_CONTROL_DATA_LOCATION);
-const std::string AppControl::DATA_STRING_INPUT_TYPE(APP_CONTROL_DATA_INPUT_TYPE);
-const std::string AppControl::DATA_STRING_INPUT_DEFAULT_TEXT(APP_CONTROL_DATA_INPUT_DEFAULT_TEXT);
-const std::string AppControl::DATA_STRING_INPUT_GUIDE_TEXT(APP_CONTROL_DATA_INPUT_GUIDE_TEXT);
-const std::string AppControl::DATA_STRING_INPUT_PREDICTION_HINT(APP_CONTROL_DATA_INPUT_PREDICTION_HINT);
-const std::string AppControl::DATA_STRING_INPUT_RETURNKEY_TYPE(APP_CONTROL_DATA_INPUT_RETURNKEY_TYPE);
-const std::string AppControl::DATA_STRING_INPUT_MAX_TEXT_LENGTH(APP_CONTROL_DATA_INPUT_MAX_TEXT_LENGTH);
-const std::string AppControl::DATA_STRING_INPUT_CURSOR_POSITION_SET(APP_CONTROL_DATA_INPUT_CURSOR_POSITION_SET);
-const std::string AppControl::DATA_STRING_INPUT_CURSOR_POSITION_GET(APP_CONTROL_DATA_INPUT_CURSOR_POSITION_GET);
-const std::string AppControl::DATA_STRING_INPUT_REPLY_TYPE(APP_CONTROL_DATA_INPUT_REPLY_TYPE);
-const std::string AppControl::DATA_STRING_WIDGET_INSTANCE_ID(APP_CONTROL_DATA_WIDGET_INSTANCE_ID);
-const std::string AppControl::DATA_STRING_WIDGET_CONTENT(APP_CONTROL_DATA_WIDGET_CONTENT);
-const std::string AppControl::DATA_STRING_WIDGET_APP_ID(APP_CONTROL_DATA_WIDGET_APP_ID);
-
-const std::map<OperationType, const std::string> AppControl::_opType2str{
- {OperationType::NONE, OPERATION_STRING_NONE},
- {OperationType::MAIN, OPERATION_STRING_MAIN},
- {OperationType::DEFAULT, OPERATION_STRING_DEFAULT},
- {OperationType::EDIT, OPERATION_STRING_EDIT},
- {OperationType::VIEW, OPERATION_STRING_VIEW},
- {OperationType::PICK, OPERATION_STRING_PICK},
- {OperationType::CREATE_CONTENT, OPERATION_STRING_CREATE_CONTENT},
- {OperationType::CALL, OPERATION_STRING_CALL},
- {OperationType::SEND, OPERATION_STRING_SEND},
- {OperationType::SEND_TEXT, OPERATION_STRING_SEND_TEXT},
- {OperationType::SHARE, OPERATION_STRING_SHARE},
- {OperationType::MULTI_SHARE, OPERATION_STRING_MULTI_SHARE},
- {OperationType::SHARE_TEXT, OPERATION_STRING_SHARE_TEXT},
- {OperationType::DIAL, OPERATION_STRING_DIAL},
- {OperationType::SEARCH, OPERATION_STRING_SEARCH},
- {OperationType::DOWNLOAD, OPERATION_STRING_DOWNLOAD},
- {OperationType::PRINT, OPERATION_STRING_PRINT},
- {OperationType::COMPOSE, OPERATION_STRING_COMPOSE},
- {OperationType::LAUNCH_ON_EVENT, OPERATION_STRING_LAUNCH_ON_EVENT},
- {OperationType::ADD, OPERATION_STRING_ADD},
- {OperationType::IMAGE_CAPTURE, OPERATION_STRING_IMAGE_CAPTURE},
- {OperationType::VIDEO_CAPTURE, OPERATION_STRING_VIDEO_CAPTURE},
- {OperationType::SETTING_BT_ENABLE, OPERATION_STRING_SETTING_BT_ENABLE},
- {OperationType::SETTING_BT_VISIBILITY, OPERATION_STRING_SETTING_BT_VISIBILITY},
- {OperationType::SETTING_LOCATION, OPERATION_STRING_SETTING_LOCATION},
- {OperationType::SETTING_NFC, OPERATION_STRING_SETTING_NFC},
- {OperationType::SETTING, OPERATION_STRING_SETTING},
- {OperationType::SETTING_WIFI, OPERATION_STRING_SETTING_WIFI},
- {OperationType::SETTING_VPN, OPERATION_STRING_SETTING_VPN},
- {OperationType::GET_INPUT, OPERATION_STRING_GET_INPUT},
- {OperationType::MEDIA_CONTROLLER, OPERATION_STRING_MEDIA_CONTROLLER},
- {OperationType::PRIVACY_SETTING_GUIDE, OPERATION_STRING_PRIVACY_SETTING_GUIDE}
-};
-
-const std::map<const std::string, OperationType> AppControl::_str2opType{
- {OPERATION_STRING_NONE, OperationType::NONE},
- {OPERATION_STRING_MAIN, OperationType::MAIN},
- {OPERATION_STRING_DEFAULT, OperationType::DEFAULT},
- {OPERATION_STRING_EDIT, OperationType::EDIT},
- {OPERATION_STRING_VIEW, OperationType::VIEW},
- {OPERATION_STRING_PICK, OperationType::PICK},
- {OPERATION_STRING_CREATE_CONTENT, OperationType::CREATE_CONTENT},
- {OPERATION_STRING_CALL, OperationType::CALL},
- {OPERATION_STRING_SEND, OperationType::SEND},
- {OPERATION_STRING_SEND_TEXT, OperationType::SEND_TEXT},
- {OPERATION_STRING_SHARE, OperationType::SHARE},
- {OPERATION_STRING_MULTI_SHARE, OperationType::MULTI_SHARE},
- {OPERATION_STRING_SHARE_TEXT, OperationType::SHARE_TEXT},
- {OPERATION_STRING_DIAL, OperationType::DIAL},
- {OPERATION_STRING_SEARCH, OperationType::SEARCH},
- {OPERATION_STRING_DOWNLOAD, OperationType::DOWNLOAD},
- {OPERATION_STRING_PRINT, OperationType::PRINT},
- {OPERATION_STRING_COMPOSE, OperationType::COMPOSE},
- {OPERATION_STRING_LAUNCH_ON_EVENT, OperationType::LAUNCH_ON_EVENT},
- {OPERATION_STRING_ADD, OperationType::ADD},
- {OPERATION_STRING_IMAGE_CAPTURE, OperationType::IMAGE_CAPTURE},
- {OPERATION_STRING_VIDEO_CAPTURE, OperationType::VIDEO_CAPTURE},
- {OPERATION_STRING_SETTING_BT_ENABLE, OperationType::SETTING_BT_ENABLE},
- {OPERATION_STRING_SETTING_BT_VISIBILITY, OperationType::SETTING_BT_VISIBILITY},
- {OPERATION_STRING_SETTING_LOCATION, OperationType::SETTING_LOCATION},
- {OPERATION_STRING_SETTING_NFC, OperationType::SETTING_NFC},
- {OPERATION_STRING_SETTING, OperationType::SETTING},
- {OPERATION_STRING_SETTING_WIFI, OperationType::SETTING_WIFI},
- {OPERATION_STRING_SETTING_VPN, OperationType::SETTING_VPN},
- {OPERATION_STRING_GET_INPUT, OperationType::GET_INPUT},
- {OPERATION_STRING_MEDIA_CONTROLLER, OperationType::MEDIA_CONTROLLER},
- {OPERATION_STRING_PRIVACY_SETTING_GUIDE, OperationType::PRIVACY_SETTING_GUIDE}
-};
-
-const std::map<DataType, const std::string> AppControl::_dataType2str{
- {DataType::NONE, DATA_STRING_NONE},
- {DataType::FEATURE, DATA_STRING_FEATURE},
- {DataType::PRIVILEGES, DATA_STRING_PRIVILEGES},
- {DataType::SUBJECT, DATA_STRING_SUBJECT},
- {DataType::TO, DATA_STRING_TO},
- {DataType::CC, DATA_STRING_CC},
- {DataType::BCC, DATA_STRING_BCC},
- {DataType::TEXT, DATA_STRING_TEXT},
- {DataType::TITLE, DATA_STRING_TITLE},
- {DataType::SELECTED, DATA_STRING_SELECTED},
- {DataType::PATH, DATA_STRING_PATH},
- {DataType::SELECTION_MODE, DATA_STRING_SELECTION_MODE},
- {DataType::CALENDAR_ALL_DAY, DATA_STRING_CALENDAR_ALL_DAY},
- {DataType::CALENDAR_START_TIME, DATA_STRING_CALENDAR_START_TIME},
- {DataType::CALENDAR_END_TIME, DATA_STRING_CALENDAR_END_TIME},
- {DataType::EMAIL, DATA_STRING_EMAIL},
- {DataType::PHONE, DATA_STRING_PHONE},
- {DataType::URL, DATA_STRING_URL},
- {DataType::ID, DATA_STRING_ID},
- {DataType::TYPE, DATA_STRING_TYPE},
- {DataType::TOTAL_COUNT, DATA_STRING_TOTAL_COUNT},
- {DataType::TOTAL_SIZE, DATA_STRING_TOTAL_SIZE},
- {DataType::NAME, DATA_STRING_NAME},
- {DataType::LOCATION, DATA_STRING_LOCATION},
- {DataType::INPUT_TYPE, DATA_STRING_INPUT_TYPE},
- {DataType::INPUT_DEFAULT_TEXT, DATA_STRING_INPUT_DEFAULT_TEXT},
- {DataType::INPUT_GUIDE_TEXT, DATA_STRING_INPUT_GUIDE_TEXT},
- {DataType::INPUT_PREDICTION_HINT, DATA_STRING_INPUT_PREDICTION_HINT},
- {DataType::INPUT_RETURNKEY_TYPE, DATA_STRING_INPUT_RETURNKEY_TYPE},
- {DataType::INPUT_MAX_TEXT_LENGTH, DATA_STRING_INPUT_MAX_TEXT_LENGTH},
- {DataType::INPUT_CURSOR_POSITION_SET, DATA_STRING_INPUT_CURSOR_POSITION_SET},
- {DataType::INPUT_CURSOR_POSITION_GET, DATA_STRING_INPUT_CURSOR_POSITION_GET},
- {DataType::INPUT_REPLY_TYPE, DATA_STRING_INPUT_REPLY_TYPE},
- {DataType::WIDGET_INSTANCE_ID, DATA_STRING_WIDGET_INSTANCE_ID},
- {DataType::WIDGET_CONTENT, DATA_STRING_WIDGET_CONTENT},
- {DataType::WIDGET_APP_ID, DATA_STRING_WIDGET_APP_ID}
-};
-
-const std::map<const std::string, DataType> AppControl::_str2dataType{
- {DATA_STRING_NONE, DataType::NONE},
- {DATA_STRING_FEATURE, DataType::FEATURE},
- {DATA_STRING_PRIVILEGES, DataType::PRIVILEGES},
- {DATA_STRING_SUBJECT, DataType::SUBJECT},
- {DATA_STRING_TO, DataType::TO},
- {DATA_STRING_CC, DataType::CC},
- {DATA_STRING_BCC, DataType::BCC},
- {DATA_STRING_TEXT, DataType::TEXT},
- {DATA_STRING_TITLE, DataType::TITLE},
- {DATA_STRING_SELECTED, DataType::SELECTED},
- {DATA_STRING_PATH, DataType::PATH},
- {DATA_STRING_SELECTION_MODE, DataType::SELECTION_MODE},
- {DATA_STRING_CALENDAR_ALL_DAY, DataType::CALENDAR_ALL_DAY},
- {DATA_STRING_CALENDAR_START_TIME, DataType::CALENDAR_START_TIME},
- {DATA_STRING_CALENDAR_END_TIME, DataType::CALENDAR_END_TIME},
- {DATA_STRING_EMAIL, DataType::EMAIL},
- {DATA_STRING_PHONE, DataType::PHONE},
- {DATA_STRING_URL, DataType::URL},
- {DATA_STRING_ID, DataType::ID},
- {DATA_STRING_TYPE, DataType::TYPE},
- {DATA_STRING_TOTAL_COUNT, DataType::TOTAL_COUNT},
- {DATA_STRING_TOTAL_SIZE, DataType::TOTAL_SIZE},
- {DATA_STRING_NAME, DataType::NAME},
- {DATA_STRING_LOCATION, DataType::LOCATION},
- {DATA_STRING_INPUT_TYPE, DataType::INPUT_TYPE},
- {DATA_STRING_INPUT_DEFAULT_TEXT, DataType::INPUT_DEFAULT_TEXT},
- {DATA_STRING_INPUT_GUIDE_TEXT, DataType::INPUT_GUIDE_TEXT},
- {DATA_STRING_INPUT_PREDICTION_HINT, DataType::INPUT_PREDICTION_HINT},
- {DATA_STRING_INPUT_RETURNKEY_TYPE, DataType::INPUT_RETURNKEY_TYPE},
- {DATA_STRING_INPUT_MAX_TEXT_LENGTH, DataType::INPUT_MAX_TEXT_LENGTH},
- {DATA_STRING_INPUT_CURSOR_POSITION_SET, DataType::INPUT_CURSOR_POSITION_SET},
- {DATA_STRING_INPUT_CURSOR_POSITION_GET, DataType::INPUT_CURSOR_POSITION_GET},
- {DATA_STRING_INPUT_REPLY_TYPE, DataType::INPUT_REPLY_TYPE},
- {DATA_STRING_WIDGET_INSTANCE_ID, DataType::WIDGET_INSTANCE_ID},
- {DATA_STRING_WIDGET_CONTENT, DataType::WIDGET_CONTENT},
- {DATA_STRING_WIDGET_APP_ID, DataType::WIDGET_APP_ID}
-};
-
-const std::string & AppControl::getOperationString(OperationType operation)
-{
- auto found = _opType2str.find(operation);
- return found != _opType2str.end()? found->second : OPERATION_STRING_NONE;
-}
-
-OperationType AppControl::getOperationType(const std::string &operation)
-{
- auto found = _str2opType.find(operation);
- return found != _str2opType.end()? found->second : OperationType::NONE;
-}
-
-const std::string & AppControl::getDataString(DataType type)
-{
- auto found = _dataType2str.find(type);
- return found != _dataType2str.end()? found->second : DATA_STRING_NONE;
-}
-
-DataType AppControl::getDataType(const std::string &operation)
-{
- auto found = _str2dataType.find(operation);
- return found != _str2dataType.end()? found->second : DataType::NONE;
-}
-
-AppControl::AppControl() : _destroyHandle(true), _callbacks(std::make_unique<_Callbacks>())
-{
- int err = app_control_create(&_handle);
- if(err)
- {
- logger::Err("Failed to create app_control handle: %d", err);
- throw AppException("Failed to create app control handle");
- }
-}
-
-AppControl::AppControl(const AppControl &appControl) : _destroyHandle(true), _callbacks(std::make_unique<_Callbacks>(*(appControl._callbacks)))
-{
- int err = app_control_clone(&_handle, appControl._handle);
- if(err)
- {
- logger::Err("Failed to clone app_control handle: %d", err);
- throw AppException("Failed to clone app control handle");
- }
-}
-
-AppControl &AppControl::operator=(const AppControl &appControl)
-{
- int err = app_control_clone(&_handle, appControl._handle);
- if(err)
- {
- logger::Err("Failed to clone app_control handle: %d", err);
- throw AppException("Failed to clone app control handle");
- }
- _destroyHandle = true;
- _callbacks = std::make_unique<_Callbacks>(*(appControl._callbacks));
- return *this;
-}
-
-AppControl::AppControl(AppControl &&appControl) : _handle(std::move(appControl._handle)),
- _destroyHandle(std::move(appControl._destroyHandle)), _callbacks(std::move(appControl._callbacks))
-{
- appControl._destroy();
-}
-
-AppControl &AppControl::operator=(AppControl &&appControl)
-{
- _destroy();
- _handle = std::move(appControl._handle);
- _destroyHandle = std::move(appControl._destroyHandle);
- _callbacks = std::move(appControl._callbacks);
- appControl._destroy();
- return *this;
-}
-
-AppControl::AppControl(app_control_h handle, bool destroyHandle) : _handle(handle), _destroyHandle(destroyHandle)
-{
- _callbacks = std::make_unique<_Callbacks>();
-}
-
-AppControl::~AppControl()
-{
- _destroy();
-}
-
-void AppControl::_destroy()
-{
- if(_handle && _destroyHandle)
- {
- int err = app_control_destroy(_handle);
- if(err)
- {
- logger::Err("Failed to destroy handle to app_control: $d", err);
- }
- }
-
- _handle = nullptr;
- _destroyHandle = false;
- _callbacks = nullptr;
-}
-
-ApiResult<void> AppControl::setOperation(OperationType operation)
-{
- return setOperationString(getOperationString(operation));
-}
-
-ApiResult<void> AppControl::setOperationString(const std::string &operation)
-{
- int err = app_control_set_operation(_handle, operation.c_str());
- if(err)
- {
- return ApiResult<void>::Error(err);
- }
- return ApiResult<void>::Ok();
-}
-
-ApiResult<OperationType> AppControl::getOperation() const
-{
- auto res = getOperationString();
- return res? ApiResult<OperationType>::Ok(AppControl::getOperationType(res.unwrap())) : ApiResult<OperationType>::Error(res.error());
-}
-
-ApiResult<std::string> AppControl::getOperationString() const
-{
- char *value;
- int err = app_control_get_operation(_handle, &value);
- if(err)
- {
- return ApiResult<std::string>::Error(err);
- }
- return ApiResult<std::string>::Ok(wrapMallocString(value));
-}
-
-ApiResult<void> AppControl::setUri(const std::string &uri)
-{
- int err = app_control_set_uri(_handle, uri.c_str());
- if(err)
- {
- return ApiResult<void>::Error(err);
- }
- return ApiResult<void>::Ok();
-}
-
-ApiResult<std::string> AppControl::getUri() const
-{
- char *value;
- int err = app_control_get_uri(_handle, &value);
- if(err)
- {
- return ApiResult<std::string>::Error(err);
- }
- return ApiResult<std::string>::Ok(wrapMallocString(value));
-}
-
-ApiResult<void> AppControl::setMime(const std::string &mime)
-{
- int err = app_control_set_mime(_handle, mime.c_str());
- if(err)
- {
- return ApiResult<void>::Error(err);
- }
- return ApiResult<void>::Ok();
-}
-
-ApiResult<std::string> AppControl::getMime() const
-{
- char *value;
- int err = app_control_get_mime(_handle, &value);
- if(err)
- {
- return ApiResult<std::string>::Error(err);
- }
- return ApiResult<std::string>::Ok(wrapMallocString(value));
-}
-
-ApiResult<void> AppControl::setCategory(const std::string &uri)
-{
- int err = app_control_set_category(_handle, uri.c_str());
- if(err)
- {
- return ApiResult<void>::Error(err);
- }
- return ApiResult<void>::Ok();
-}
-
-ApiResult<std::string> AppControl::getCategory() const
-{
- char *value;
- int err = app_control_get_category(_handle, &value);
- if(err)
- {
- return ApiResult<std::string>::Error(err);
- }
- return ApiResult<std::string>::Ok(wrapMallocString(value));
-}
-
-ApiResult<void> AppControl::setAppId(const std::string &appId)
-{
- int err = app_control_set_app_id(_handle, appId.c_str());
- if(err)
- {
- return ApiResult<void>::Error(err);
- }
- return ApiResult<void>::Ok();
-}
-
-ApiResult<std::string> AppControl::getAppId()
-{
- char *value;
- int err = app_control_get_app_id(_handle, &value);
- if(err)
- {
- return ApiResult<std::string>::Error(err);
- }
- return ApiResult<std::string>::Ok(wrapMallocString(value));
-}
-
-ApiResult<void> AppControl::addExtraData(DataType type, const std::string &value)
-{
- return addExtraData(getDataString(type), value);
-}
-
-ApiResult<void> AppControl::addExtraData(const std::string &key, const std::string &value)
-{
- int err = app_control_add_extra_data(_handle, key.c_str(), value.c_str());
- if(err)
- {
- return ApiResult<void>::Error(err);
- }
- return ApiResult<void>::Ok();
-}
-
-ApiResult<void> AppControl::addExtraDataArray(DataType type, const std::vector<std::string> &data)
-{
- return addExtraDataArray(getDataString(type), data);
-}
-
-ApiResult<void> AppControl::addExtraDataArray(const std::string &key, const std::vector<std::string> &data)
-{
- std::vector<const char *> array(data.size());
- for(const std::string &s : data)
- {
- array.push_back(s.c_str());
- }
- int err = app_control_add_extra_data_array(_handle, key.c_str(), array.data(), static_cast<int>(array.size()));
- if(err)
- {
- return ApiResult<void>::Error(err);
- }
- return ApiResult<void>::Ok();
-}
-
-ApiResult<void> AppControl::removeExtraData(DataType type)
-{
- return removeExtraData(getDataString(type));
-}
-
-ApiResult<void> AppControl::removeExtraData(const std::string &key)
-{
- int err = app_control_remove_extra_data(_handle, key.c_str());
- if(err)
- {
- return ApiResult<void>::Error(err);
- }
- return ApiResult<void>::Ok();
-}
-
-ApiResult<std::string> AppControl::getExtraData(DataType type)
-{
- return getExtraData(getDataString(type));
-}
-
-ApiResult<std::string> AppControl::getExtraData(const std::string &key)
-{
- char *value;
- int err = app_control_get_extra_data(_handle, key.c_str(), &value);
- if(err)
- {
- return ApiResult<std::string>::Error(err);
- }
- return ApiResult<std::string>::Ok(wrapMallocString(value));
-}
-
-ApiResult<std::vector<std::string>> AppControl::getExtraDataArray(DataType type)
-{
- return getExtraDataArray(getDataString(type));
-}
-
-ApiResult<std::vector<std::string>> AppControl::getExtraDataArray(const std::string &key)
-{
- int arSize;
- char **arValues;
- int err = app_control_get_extra_data_array(_handle, key.c_str(), &arValues, &arSize);
- if(err)
- {
- return ApiResult<std::vector<std::string>>::Error(err);
- }
- std::vector<std::string> res(arSize);
- for(int i = 0; i < arSize; ++i)
- {
- res.push_back(wrapMallocString(arValues[i]));
- }
- free(arValues);
- return ApiResult<std::vector<std::string>>::Ok(res);
-}
-
-ApiResult<bool> AppControl::isExtraDataArray(DataType type)
-{
- return isExtraDataArray(getDataString(type));
-}
-
-ApiResult<bool> AppControl::isExtraDataArray(const std::string &key)
-{
- bool value;
- int err = app_control_is_extra_data_array(_handle, key.c_str(), &value);
- if(err)
- {
- return ApiResult<bool>::Error(err);
- }
- return ApiResult<bool>::Ok(value);
-}
-
-ApiResult<void> AppControl::foreachExtraData(std::function<bool(AppControl &, const std::string &)> extraDataCb)
-{
- auto static_cb = [](app_control_h handle, const char *keyCstr, void *data)
- {
- _Callbacks *_callbacks = static_cast<_Callbacks*>(data);
- if(_callbacks->extraDataCb)
- {
- std::string key(keyCstr);
- AppControl appControl(handle);
- return _callbacks->extraDataCb(appControl, key);
- }
- return false;
- };
- int err = app_control_foreach_extra_data(_handle, static_cb, _callbacks.get());
- if(err)
- {
- return ApiResult<void>::Error(err);
- }
- _callbacks->extraDataCb = extraDataCb;
- return ApiResult<void>::Ok();
-}
-
-ApiResult<void> AppControl::foreachAppMatched(std::function<bool(AppControl &, const std::string &)> appMatchedCb)
-{
- auto static_cb = [](app_control_h handle, const char *appIdCstr, void *data)
- {
- _Callbacks *_callbacks = static_cast<_Callbacks*>(data);
- if(_callbacks->appMatchedCb)
- {
- std::string appId(appIdCstr);
- AppControl appControl(handle);
- return _callbacks->appMatchedCb(appControl, appId);
- }
- return false;
- };
- int err = app_control_foreach_app_matched(_handle, static_cb, _callbacks.get());
- if(err)
- {
- return ApiResult<void>::Error(err);
- }
- _callbacks->appMatchedCb = appMatchedCb;
- return ApiResult<void>::Ok();
-}
-
-ApiResult<void> AppControl::sendLaunchRequest(std::function<void(AppControl &, AppControl &, app_control_result_e)> replyCb)
-{
- auto static_cb = [](app_control_h requestHandle, app_control_h replyHandle, app_control_result_e result, void *data)
- {
- _Callbacks *_callbacks = static_cast<_Callbacks*>(data);
- if(_callbacks->syncLaunchReplyCb)
- {
- AppControl request(requestHandle);
- AppControl reply(replyHandle);
- _callbacks->syncLaunchReplyCb(request, reply, result);
- }
- };
- int err = app_control_send_launch_request(_handle, static_cb, _callbacks.get());
- if(err)
- {
- return ApiResult<void>::Error(err);
- }
- _callbacks->syncLaunchReplyCb = replyCb;
- return ApiResult<void>::Ok();
-}
-
-ApiResult<void> AppControl::sendTerminateRequest()
-{
- int err = app_control_send_terminate_request(_handle);
- if(err)
- {
- return ApiResult<void>::Error(err);
- }
- return ApiResult<void>::Ok();
-}
-
-ApiResult<void> AppControl::sendLaunchRequestAsync(std::function<void(AppControl &, app_control_error_e)> resultCb, std::function<void(AppControl &, AppControl &, app_control_result_e)> replyCb)
-{
- auto result_static_cb = [](app_control_h handle, app_control_error_e error, void *data)
- {
- _Callbacks *_callbacks = static_cast<_Callbacks*>(data);
- if(_callbacks->asyncLaunchResultCb)
- {
- AppControl appControl(handle);
- _callbacks->asyncLaunchResultCb(appControl, error);
- }
- };
-
- auto reply_static_cb = [](app_control_h requestHandle, app_control_h replyHandle, app_control_result_e result, void *data)
- {
- _Callbacks *_callbacks = static_cast<_Callbacks*>(data);
- if(_callbacks->asyncLaunchReplyCb)
- {
- AppControl request(requestHandle);
- AppControl reply(replyHandle);
- _callbacks->asyncLaunchReplyCb(request, reply, result);
- }
- };
-
- int err = app_control_send_launch_request_async(_handle, result_static_cb, reply_static_cb, _callbacks.get());
- if(err)
- {
- return ApiResult<void>::Error(err);
- }
- _callbacks->asyncLaunchReplyCb = replyCb;
- _callbacks->asyncLaunchResultCb = resultCb;
- return ApiResult<void>::Ok();
-}
-
-ApiResult<void> AppControl::replyToLaunchRequest(AppControl &reply, AppControl &request, app_control_result_e result)
-{
- logger::Dbg("Sending reply...");
- int err = app_control_reply_to_launch_request(reply._handle, request._handle, result);
- if(err)
- {
- logger::Err("Failed to send response - error code: $d", err);
- return ApiResult<void>::Error(err);
- }
- return ApiResult<void>::Ok();
-}
-
-ApiResult<std::string> AppControl::getCaller()
-{
- char *value;
- int err = app_control_get_caller(_handle, &value);
- if(err)
- {
- return ApiResult<std::string>::Error(err);
- }
- return ApiResult<std::string>::Ok(wrapMallocString(value));
-}
-
-ApiResult<bool> AppControl::isReplyRequested()
-{
- bool value;
- int err = app_control_is_reply_requested(_handle, &value);
- if(err)
- {
- return ApiResult<bool>::Error(err);
- }
- return ApiResult<bool>::Ok(value);
-}
-
-ApiResult<void> AppControl::setLaunchMode(app_control_launch_mode_e mode)
-{
- int err = app_control_set_launch_mode(_handle, mode);
- if(err)
- {
- return ApiResult<void>::Error(err);
- }
- return ApiResult<void>::Ok();
-}
-
-ApiResult<app_control_launch_mode_e> AppControl::getLaunchMode()
-{
- app_control_launch_mode_e value;
- int err = app_control_get_launch_mode(_handle, &value);
- if(err)
- {
- return ApiResult<app_control_launch_mode_e>::Error(err);
- }
- return ApiResult<app_control_launch_mode_e>::Ok(value);
-}
-
-ApiResult<void> AppControl::enableAppStartedResultEvent()
-{
- int err = app_control_enable_app_started_result_event(_handle);
- if(err)
- {
- return ApiResult<void>::Error(err);
- }
- return ApiResult<void>::Ok();
-}
-
-} // namespace application
-} // namespace tizen
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 APP_CONTROL_H
-#define APP_CONTROL_H
-
-#include "tizen/ApiResult.hpp"
-#include <app_control.h>
-#include <string>
-#include <vector>
-#include <functional>
-#include <memory>
-#include <map>
-
-namespace tizen {
-namespace application {
-
-enum class OperationType
-{
- NONE,
- MAIN,
- DEFAULT,
- EDIT,
- VIEW,
- PICK,
- CREATE_CONTENT,
- CALL,
- SEND,
- SEND_TEXT,
- SHARE,
- MULTI_SHARE,
- SHARE_TEXT,
- DIAL,
- SEARCH,
- DOWNLOAD,
- PRINT,
- COMPOSE,
- LAUNCH_ON_EVENT,
- ADD,
- IMAGE_CAPTURE,
- VIDEO_CAPTURE,
- SETTING_BT_ENABLE,
- SETTING_BT_VISIBILITY,
- SETTING_LOCATION,
- SETTING_NFC,
- SETTING,
- SETTING_WIFI,
- SETTING_VPN,
- GET_INPUT,
- MEDIA_CONTROLLER,
- PRIVACY_SETTING_GUIDE
-};
-
-enum class DataType
-{
- NONE,
- FEATURE,
- PRIVILEGES,
- SUBJECT,
- TO,
- CC,
- BCC,
- TEXT,
- TITLE,
- SELECTED,
- PATH,
- SELECTION_MODE,
- CALENDAR_ALL_DAY,
- CALENDAR_START_TIME,
- CALENDAR_END_TIME,
- EMAIL,
- PHONE,
- URL,
- ID,
- TYPE,
- TOTAL_COUNT,
- TOTAL_SIZE,
- NAME,
- LOCATION,
- INPUT_TYPE,
- INPUT_DEFAULT_TEXT,
- INPUT_GUIDE_TEXT,
- INPUT_PREDICTION_HINT,
- INPUT_RETURNKEY_TYPE,
- INPUT_MAX_TEXT_LENGTH,
- INPUT_CURSOR_POSITION_SET,
- INPUT_CURSOR_POSITION_GET,
- INPUT_REPLY_TYPE,
- WIDGET_INSTANCE_ID,
- WIDGET_CONTENT,
- WIDGET_APP_ID
-};
-
-class AppControl
-{
-public:
- AppControl();
- ~AppControl();
-
- AppControl(const AppControl &appControl);
- AppControl &operator=(const AppControl &appControl);
-
- AppControl(AppControl &&appControl);
- AppControl &operator=(AppControl &&appControl);
-
- ApiResult<void> setOperation(OperationType operation);
- ApiResult<void> setOperationString(const std::string &operation);
- ApiResult<OperationType> getOperation() const;
- ApiResult<std::string> getOperationString() const;
- static const std::string & getOperationString(OperationType operation);
- static OperationType getOperationType(const std::string &operation);
-
- ApiResult<void> setUri(const std::string &uri);
- ApiResult<std::string> getUri() const;
-
- ApiResult<void> setMime(const std::string &mime);
- ApiResult<std::string> getMime() const;
-
- ApiResult<void> setCategory(const std::string &uri);
- ApiResult<std::string> getCategory() const;
-
- ApiResult<void> setAppId(const std::string &appId);
- ApiResult<std::string> getAppId();
-
- ApiResult<void> addExtraData(DataType type, const std::string &value);
- ApiResult<void> addExtraData(const std::string &key, const std::string &value);
- ApiResult<void> addExtraDataArray(DataType type, const std::vector<std::string> &data);
- ApiResult<void> addExtraDataArray(const std::string &key, const std::vector<std::string> &data);
- ApiResult<void> removeExtraData(DataType type);
- ApiResult<void> removeExtraData(const std::string &key);
- ApiResult<std::string> getExtraData(DataType type);
- ApiResult<std::string> getExtraData(const std::string &key);
- ApiResult<std::vector<std::string>> getExtraDataArray(DataType type);
- ApiResult<std::vector<std::string>> getExtraDataArray(const std::string &key);
- ApiResult<bool> isExtraDataArray(DataType type);
- ApiResult<bool> isExtraDataArray(const std::string &key);
- ApiResult<void> foreachExtraData(std::function<bool(AppControl &, const std::string &)> extraDataCb);
-
- static const std::string & getDataString(DataType type);
- static DataType getDataType(const std::string &operation);
-
- ApiResult<void> foreachAppMatched(std::function<bool(AppControl &, const std::string &)> appMatchedCb);
-
- ApiResult<void> sendLaunchRequest(std::function<void(AppControl &, AppControl &, app_control_result_e)> replyCb);
- ApiResult<void> sendTerminateRequest();
- ApiResult<void> sendLaunchRequestAsync(std::function<void(AppControl &, app_control_error_e)> resultCb, std::function<void(AppControl &, AppControl &, app_control_result_e)> replyCb);
-
- static ApiResult<void> replyToLaunchRequest(AppControl &reply, AppControl &request, app_control_result_e result);
-
- ApiResult<std::string> getCaller();
-
- ApiResult<bool> isReplyRequested();
-
- ApiResult<void> setLaunchMode(app_control_launch_mode_e mode);
- ApiResult<app_control_launch_mode_e> getLaunchMode();
-
- ApiResult<void> enableAppStartedResultEvent();
-
-private:
- friend class ServiceApp;
- friend class UiApp;
- app_control_h _handle;
- bool _destroyHandle;
-
- struct _Callbacks
- {
- _Callbacks() = default;
- _Callbacks(const _Callbacks &) = default;
- _Callbacks &operator=(const _Callbacks &) = default;
- _Callbacks(_Callbacks &&) = default;
- _Callbacks & operator=(_Callbacks &&) = default;
-
- std::function<bool(AppControl &, const std::string &)> extraDataCb;
- std::function<bool(AppControl &, const std::string &)> appMatchedCb;
- std::function<void(AppControl &, AppControl &, app_control_result_e)> syncLaunchReplyCb;
- std::function<void(AppControl &, app_control_error_e)> asyncLaunchResultCb;
- std::function<void(AppControl &, AppControl &, app_control_result_e)> asyncLaunchReplyCb;
- };
-
- std::unique_ptr<_Callbacks> _callbacks;
-
- AppControl(app_control_h handle, bool destroyHandle = false);
- void _destroy();
-
- //Operation types strings
- static const std::string OPERATION_STRING_NONE;
- static const std::string OPERATION_STRING_MAIN;
- static const std::string OPERATION_STRING_DEFAULT;
- static const std::string OPERATION_STRING_EDIT;
- static const std::string OPERATION_STRING_VIEW;
- static const std::string OPERATION_STRING_PICK;
- static const std::string OPERATION_STRING_CREATE_CONTENT;
- static const std::string OPERATION_STRING_CALL;
- static const std::string OPERATION_STRING_SEND;
- static const std::string OPERATION_STRING_SEND_TEXT;
- static const std::string OPERATION_STRING_SHARE;
- static const std::string OPERATION_STRING_MULTI_SHARE;
- static const std::string OPERATION_STRING_SHARE_TEXT;
- static const std::string OPERATION_STRING_DIAL;
- static const std::string OPERATION_STRING_SEARCH;
- static const std::string OPERATION_STRING_DOWNLOAD;
- static const std::string OPERATION_STRING_PRINT;
- static const std::string OPERATION_STRING_COMPOSE;
- static const std::string OPERATION_STRING_LAUNCH_ON_EVENT;
- static const std::string OPERATION_STRING_ADD;
- static const std::string OPERATION_STRING_IMAGE_CAPTURE;
- static const std::string OPERATION_STRING_VIDEO_CAPTURE;
- static const std::string OPERATION_STRING_SETTING_BT_ENABLE;
- static const std::string OPERATION_STRING_SETTING_BT_VISIBILITY;
- static const std::string OPERATION_STRING_SETTING_LOCATION;
- static const std::string OPERATION_STRING_SETTING_NFC;
- static const std::string OPERATION_STRING_SETTING;
- static const std::string OPERATION_STRING_SETTING_WIFI;
- static const std::string OPERATION_STRING_SETTING_VPN;
- static const std::string OPERATION_STRING_GET_INPUT;
- static const std::string OPERATION_STRING_MEDIA_CONTROLLER;
- static const std::string OPERATION_STRING_PRIVACY_SETTING_GUIDE;
-
- //Data types strings
- static const std::string DATA_STRING_NONE;
- static const std::string DATA_STRING_FEATURE;
- static const std::string DATA_STRING_PRIVILEGES;
- static const std::string DATA_STRING_SUBJECT;
- static const std::string DATA_STRING_TO;
- static const std::string DATA_STRING_CC;
- static const std::string DATA_STRING_BCC;
- static const std::string DATA_STRING_TEXT;
- static const std::string DATA_STRING_TITLE;
- static const std::string DATA_STRING_SELECTED;
- static const std::string DATA_STRING_PATH;
- static const std::string DATA_STRING_SELECTION_MODE;
- static const std::string DATA_STRING_CALENDAR_ALL_DAY;
- static const std::string DATA_STRING_CALENDAR_START_TIME;
- static const std::string DATA_STRING_CALENDAR_END_TIME;
- static const std::string DATA_STRING_EMAIL;
- static const std::string DATA_STRING_PHONE;
- static const std::string DATA_STRING_URL;
- static const std::string DATA_STRING_ID;
- static const std::string DATA_STRING_TYPE;
- static const std::string DATA_STRING_TOTAL_COUNT;
- static const std::string DATA_STRING_TOTAL_SIZE;
- static const std::string DATA_STRING_NAME;
- static const std::string DATA_STRING_LOCATION;
- static const std::string DATA_STRING_INPUT_TYPE;
- static const std::string DATA_STRING_INPUT_DEFAULT_TEXT;
- static const std::string DATA_STRING_INPUT_GUIDE_TEXT;
- static const std::string DATA_STRING_INPUT_PREDICTION_HINT;
- static const std::string DATA_STRING_INPUT_RETURNKEY_TYPE;
- static const std::string DATA_STRING_INPUT_MAX_TEXT_LENGTH;
- static const std::string DATA_STRING_INPUT_CURSOR_POSITION_SET;
- static const std::string DATA_STRING_INPUT_CURSOR_POSITION_GET;
- static const std::string DATA_STRING_INPUT_REPLY_TYPE;
- static const std::string DATA_STRING_WIDGET_INSTANCE_ID;
- static const std::string DATA_STRING_WIDGET_CONTENT;
- static const std::string DATA_STRING_WIDGET_APP_ID;
-
- static const std::map<OperationType, const std::string> _opType2str;
- static const std::map<const std::string, OperationType> _str2opType;
- static const std::map<DataType, const std::string> _dataType2str;
- static const std::map<const std::string, DataType> _str2dataType;
-};
-
-} // namespace application
-} // namespace tizen
-
-#endif //APP_CONTROL_H
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "tizen/application/AppException.hpp"
-
-namespace tizen {
-namespace application {
-
-AppException::AppException(std::string message) : _message(message)
-{
-}
-
-AppException::~AppException()
-{
-}
-
-const char *AppException::what() const noexcept
-{
- return _message.c_str();
-}
-
-} // namespace application
-} // namespace tizen
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 APP_EXCEPTION_H
-#define APP_EXCEPTION_H
-
-#include <exception>
-#include <string>
-
-namespace tizen {
-namespace application {
- class AppException : public std::exception
- {
- public:
- AppException(std::string message = "");
- ~AppException();
-
- virtual const char *what() const noexcept override;
- private:
- std::string _message;
- };
-} // application
-} // tizen
-
-#endif //APP_EXCEPTION_H
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include <app.h>
-
-#include "tizen/application/Resource.hpp"
-
-using namespace tizen::application;
-
-std::string GetResourcePath(enum Directory dir, const char* relative)
-{
- char* prefix;
-
- switch (dir) {
- case Directory::DATA:
- prefix = app_get_data_path();
- break;
- case Directory::CACHE:
- prefix = app_get_cache_path();
- break;
- case Directory::RESOURCE:
- prefix = app_get_resource_path();
- break;
- case Directory::SHARED_DATA:
- prefix = app_get_shared_data_path();
- break;
- case Directory::SHARED_RESOURCE:
- prefix = app_get_shared_resource_path();
- break;
- case Directory::SHARED_TRUSTED:
- prefix = app_get_shared_trusted_path();
- break;
- case Directory::EXTERNAL_DATA:
- prefix = app_get_external_data_path();
- break;
- case Directory::EXTERNAL_CACHE:
- prefix = app_get_external_cache_path();
- break;
- default:
- return std::string();
- }
- if (!prefix)
- return std::string();
-
- std::string ret = prefix;
- // according to implementation prefix should be always '/' terminated.
- ret += relative;
- free(prefix);
-
- return ret;
-}
-
-
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 RESOURCE_HPP
-#define RESOURCE_HPP
-
-#include <string>
-
-namespace tizen {
-namespace application {
-
- /**
- * @brief Application sub-directories type.
- */
- enum class Directory {
- /** Data directory: ./data */
- DATA,
- /** Cache directory: ./cache */
- CACHE,
- /** Resource directory: ./res */
- RESOURCE,
- /** Data directory externally visible: ./shared/data */
- SHARED_DATA,
- /** Resource directory externally visible: ./shared/res */
- SHARED_RESOURCE,
- /** Resource directory externally visible for apps with same
- * signature: ./shared/trused */
- SHARED_TRUSTED,
- /** External data directory */
- EXTERNAL_DATA,
- /** External cache directory */
- EXTERNAL_CACHE
- };
-
- /**
- * @brief Returns absolute path to resource file located in applications directory.
- *
- * @param dir type of subdirectory
- * @param relative path of resource from starting from given sub dir.
- * eg. for DATA subdir and relative "database.db" => "/home/owner/apps/org.tizen.clock/data/database.db"
- * @return absolute path string.
- *
- * @note returns statically allocated string
- */
- std::string GetResourcePath(enum Directory dir, const char* relative);
-
-} /* application */
-} /* tizen */
-
-#endif /* end of include guard: RESOURCE_HPP */
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "tizen/application/ServiceApp.hpp"
-#include "tizen/Logger.hpp"
-
-using namespace tizen::application;
-
-bool ServiceApp::app_create(void* data)
-{
- ServiceApp* app = static_cast<ServiceApp*>(data);
- return app->OnCreate();
-}
-
-void ServiceApp::app_control(app_control_h app_control, void* data)
-{
- ServiceApp* app = static_cast<ServiceApp*>(data);
- AppControl appControlObject(app_control, false);
- app->OnService(appControlObject);
-}
-
-void ServiceApp::app_terminate(void* data)
-{
- ServiceApp* app = static_cast<ServiceApp*>(data);
- app->OnTerminate();
-}
-
-int ServiceApp::Run(int argc, char** argv)
-{
- int ret = 0;
-
- service_app_lifecycle_callback_s event_callback;
-
- event_callback.create = app_create;
- event_callback.terminate = app_terminate;
- event_callback.app_control = app_control;
-
- ret = service_app_main(argc, argv, &event_callback, this);
- if (ret != APP_ERROR_NONE)
- tizen::logger::Dbg("service_app_main() is failed. err = %d", ret);
-
- return ret;
-}
-
-void ServiceApp::Exit()
-{
- service_app_exit();
-}
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 SERVICEAPP_H
-#define SERVICEAPP_H
-
-#include "tizen/application/AppControl.hpp"
-#include <service_app.h>
-
-namespace tizen {
-namespace application {
-
-class ServiceApp
-{
-public:
- ServiceApp() = default;
- virtual ~ServiceApp() = default;
-
- /**
- * @brief Run Tizen application main loop
- */
- int Run(int argc, char** argv);
-
- /**
- * @brief Invoked when application recieved terminate request.
- */
- virtual void OnTerminate() {}
-
- /**
- * @brief Invoked when application recieved service request (recieve
- * app control request from other application)
- */
- virtual void OnService(AppControl &) { }
-
- /**
- * @brief Invoked when application recieved service request (recieve
- * app control request from other application)
- */
- virtual bool OnCreate() { return true; }
-
- /**
- * @brief Exits application process.
- */
- static void Exit();
-
-private:
- static bool app_create(void* data);
- static void app_control(app_control_h app_control, void* data);
- static void app_terminate(void* data);
-};
-
-} /* application */
-} /* tizen */
-
-#endif /* SERVICEAPP_H */
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "tizen/application/UiApp.hpp"
-#include "tizen/Logger.hpp"
-
-using namespace tizen::application;
-
-bool UiApp::app_create(void* data)
-{
- UiApp* app = static_cast<UiApp*>(data);
- return app->OnCreate();
-}
-
-void UiApp::app_control(app_control_h app_control, void* data)
-{
- UiApp* app = static_cast<UiApp*>(data);
- AppControl appControlObject(app_control, false);
- app->OnService(appControlObject);
-}
-
-void UiApp::app_pause(void* data)
-{
- UiApp* app = static_cast<UiApp*>(data);
- app->OnPause();
-}
-
-void UiApp::app_resume(void* data)
-{
- UiApp* app = static_cast<UiApp*>(data);
- app->OnResume();
-}
-
-void UiApp::app_terminate(void* data)
-{
- UiApp* app = static_cast<UiApp*>(data);
- app->OnTerminate();
-}
-
-void UiApp::ui_app_lang_changed(app_event_info_h event_info, void* data)
-{
- UiApp* app = static_cast<UiApp*>(data);
- app->OnLanguageChanged(event_info);
-}
-
-void UiApp::ui_app_orient_changed(app_event_info_h event_info, void* data)
-{
- UiApp* app = static_cast<UiApp*>(data);
- app->OnOrientChanged(event_info);
-}
-
-void UiApp::ui_app_region_changed(app_event_info_h event_info, void* data)
-{
- UiApp* app = static_cast<UiApp*>(data);
- app->OnRegionChanged(event_info);
-}
-
-void UiApp::ui_app_low_battery(app_event_info_h event_info, void* data)
-{
- UiApp* app = static_cast<UiApp*>(data);
- app->OnLowBattery(event_info);
-}
-
-void UiApp::ui_app_low_memory(app_event_info_h event_info, void* data)
-{
- UiApp* app = static_cast<UiApp*>(data);
- app->OnLowMemory(event_info);
-}
-
-int UiApp::Run(int argc, char** argv)
-{
- int ret = 0;
-
- ui_app_lifecycle_callback_s event_callback;
- app_event_handler_h handlers[5] = {NULL, };
-
- event_callback.create = app_create;
- event_callback.terminate = app_terminate;
- event_callback.pause = app_pause;
- event_callback.resume = app_resume;
- event_callback.app_control = app_control;
-
- ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, ui_app_low_battery, this);
- ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, ui_app_low_memory, this);
- ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, ui_app_orient_changed, this);
- ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, ui_app_lang_changed, this);
- ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, ui_app_region_changed, this);
-
- ret = ui_app_main(argc, argv, &event_callback, this);
- if (ret != APP_ERROR_NONE)
- logger::Dbg("ui_app_main() is failed. err = %d", ret);
-
- return ret;
-}
-
-void UiApp::Exit()
-{
- ui_app_exit();
-}
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 TIZENAPP_H
-#define TIZENAPP_H
-
-#include "tizen/application/AppControl.hpp"
-#include <app.h>
-#include <cstddef>
-#include <string>
-
-namespace tizen {
-namespace application {
-
-/**
- * @addtogroup tizen
- * @{
- */
-
-/**
- * @brief Tizen application main class. Starts application main loop and manages
- * lifecycle callbacks
- */
-class UiApp {
-public:
- UiApp() = default;
-
- virtual ~UiApp() = default;
-
- /**
- * @brief Run Tizen application main loop
- */
- int Run(int argc, char** argv);
-
- /**
- * @brief Exits application process.
- */
- static void Exit();
-
-protected:
- /**
- * @brief Invoked when application recieved service request (recieve
- * app control request from other application)
- */
- virtual bool OnCreate() { return true; }
-
- /**
- * @brief Invoked when application recieved terminate request.
- */
- virtual void OnTerminate() {}
- /**
- * @brief Invoked when application recieved resume request (going
- * foreground)
- */
- virtual void OnResume() {}
-
- /**
- * @brief Invoked when application recieved pause request (going
- * background)
- */
- virtual void OnPause() {}
-
- /**
- * @brief Invoked when application recieved service request (recieve
- * app control request from other application)
- */
- virtual void OnService(AppControl &) { }
-
- /**
- * @brief Invoked when system language has changed.
- */
- virtual void OnLanguageChanged(app_event_info_h event) { (void)event; }
-
- /**
- * @brief Invoked when system language has changed.
- */
- virtual void OnOrientChanged(app_event_info_h event) { (void)event; }
-
- /**
- * @brief Invoked when system language has changed.
- */
- virtual void OnRegionChanged(app_event_info_h event) { (void)event; }
-
- /**
- * @brief Invoked when system language has changed.
- */
- virtual void OnLowBattery(app_event_info_h event) { (void)event; }
-
- /**
- * @brief Invoked when system language has changed.
- */
- virtual void OnLowMemory(app_event_info_h event) { (void)event; }
-
-private:
- static bool app_create(void* data);
- static void app_control(app_control_h app_control, void* data);
- static void app_pause(void* data);
- static void app_resume(void* data);
- static void app_terminate(void* data);
- static void ui_app_lang_changed(app_event_info_h event_info, void* data);
- static void ui_app_orient_changed(app_event_info_h event_info, void* data);
- static void ui_app_region_changed(app_event_info_h event_info, void* data);
- static void ui_app_low_battery(app_event_info_h event_info, void* data);
- static void ui_app_low_memory(app_event_info_h event_info, void* data);
-};
-
-} /* application */
-} /* tizen */
-
-/**
- * @}
- */
-
-#endif /* end of include guard: TIZENAPP_H */
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "tizen/key_manager/KeyManager.hpp"
-#include "tizen/Logger.hpp"
-#include "tizen/Strings.hpp"
-#include <utility>
-
-namespace tizen {
-namespace key_manager {
-
-ApiResult<void> removeAlias(const std::string &alias)
-{
- logger::Dbg("alias [%s]", alias.c_str());
-
- int err = ckmc_remove_alias(alias.c_str());
- if (err != 0)
- {
- logger::Wrn("ckmc_remove_alias() failed [%d]", err);
- return ApiResult<void>::Error(err);
- };
-
- return ApiResult<void>::Ok();
-}
-
-ApiResult<std::string> getData(const std::string &alias)
-{
- logger::Dbg( "alias [%s]", alias.c_str());
-
- ckmc_raw_buffer_s *raw_buf = NULL;
-
- int err = ckmc_get_data(alias.c_str(), NULL, &raw_buf);
- if (err != 0)
- {
- if (err != CKMC_ERROR_DB_ALIAS_UNKNOWN)
- logger::Err("alias [%s].. ckmc_get_data() failed [%d]", alias.c_str(), err);
- else
- logger::Wrn("alias [%s].. is unknown [%d]", alias.c_str(), err);
- return ApiResult<std::string>::Error(err);
- }
- char *data = strndup(reinterpret_cast<const char *>(raw_buf->data), raw_buf->size);
- ckmc_buffer_free(raw_buf);
-
- return ApiResult<std::string>::Ok(wrapMallocString(data));
-}
-
-ApiResult<void> saveData(const std::string &alias, const std::string &data)
-{
- logger::Dbg("alias [%s]", alias.c_str());
-
- ckmc_raw_buffer_s save_data = {0,};
- save_data.data = reinterpret_cast<unsigned char *>(const_cast<char *>(data.c_str()));
- save_data.size = data.size();
-
- ckmc_policy_s save_policy = {0,};
- save_policy.password = NULL;
- save_policy.extractable = true;
-
- int err = ckmc_save_data(alias.c_str(), save_data, save_policy);
- if (err == CKMC_ERROR_DB_ALIAS_EXISTS)
- {
- logger::Dbg("alias [%s] will be replaced", alias.c_str());
-
- ckmc_remove_alias(alias.c_str());
- err = ckmc_save_data(alias.c_str(), save_data, save_policy);
- if (err != 0)
- {
- logger::Err("ckmc_save_data() failed [%d]", err);
- return ApiResult<void>::Error(err);
- }
- }
- else if (err != 0)
- {
- logger::Err("ckmc_save_data() failed [%d]", err);
- return ApiResult<void>::Error(err);
- }
-
- return ApiResult<void>::Ok();
-}
-
-ApiResult<std::vector<std::string>> getAliasList()
-{
- ckmc_alias_list_s *alias_list = NULL;
- ckmc_alias_list_s *plist;
-
- int err = ckmc_get_data_alias_list(&alias_list);
- if (err != 0)
- {
- logger::Err("ckmc_get_data_alias_list() failed [%d]", err);
- return ApiResult<std::vector<std::string>>::Error(err);
- }
-
- std::vector<std::string> res;
-
- plist = alias_list;
- while (plist != NULL)
- {
- res.push_back(std::string(plist->alias));
- plist = plist->next;
- }
-
- return ApiResult<std::vector<std::string>>::Ok(std::move(res));
-}
-
-ApiResult<bool> exists(const std::string &alias)
-{
- ckmc_raw_buffer_s *raw_buf = NULL;
-
- int err = ckmc_get_data(alias.c_str(), NULL, &raw_buf);
- if (err == 0)
- {
- ckmc_buffer_free(raw_buf);
- return ApiResult<bool>::Ok(true);
- }
- else if (err == CKMC_ERROR_DB_ALIAS_UNKNOWN)
- {
- return ApiResult<bool>::Ok(false);
- }
- else
- {
- return ApiResult<bool>::Error(err);
- }
-}
-
-ApiResult<void> setPermission(const std::string &alias, const std::string &accessor)
-{
- logger::Dbg("alias [%s], accessor [%s]", alias.c_str(), accessor.c_str());
-
- int err = ckmc_set_permission(alias.c_str(), accessor.c_str(), CKMC_PERMISSION_READ);
- if (err != 0) {
- logger::Err("ckmc_set_permission() failed [%d]", err);
- return ApiResult<void>::Error(err);
- }
-
- return ApiResult<void>::Ok();
-}
-
-ApiResult<void> removeAllAliases()
-{
- ckmc_alias_list_s *alias_list = NULL;
- ckmc_alias_list_s *plist;
-
- int err = ckmc_get_data_alias_list(&alias_list);
- if (err != 0)
- {
- logger::Err("ckmc_get_data_alias_list() failed [%d]", err);
- return ApiResult<void>::Error(err);
- }
-
- plist = alias_list;
- while (plist != NULL)
- {
- logger::Dbg("alias [%s] will be removed", plist->alias);
- ckmc_remove_alias(plist->alias);
- plist = plist->next;
- }
-
- ckmc_alias_list_all_free(alias_list);
-
- return ApiResult<void>::Ok();
-}
-
-} // namespace key_manager
-} // namespace tizen
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 KEY_MANAGER_H
-#define KEY_MANAGER_H
-
-#include "tizen/ApiResult.hpp"
-#include <ckmc/ckmc-manager.h>
-#include <string>
-#include <vector>
-
-namespace tizen {
-namespace key_manager {
- ApiResult<void> removeAlias(const std::string &alias);
- ApiResult<std::string> getData(const std::string &alias);
- ApiResult<void> saveData(const std::string &alias, const std::string &data);
- ApiResult<std::vector<std::string>> getAliasList();
- ApiResult<bool> exists(const std::string &alias);
- ApiResult<void> setPermission(const std::string &alias, const std::string &accessor);
- ApiResult<void> removeAllAliases();
-} // key_manager
-} // tizen
-
-#endif //KEY_MANAGER_H
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 MACROS_HPP
-#define MACROS_HPP
-
-#define UNUSED __attribute__((unused))
-
-#endif /* end of include guard: MACROS_HPP */
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "tizen/network/bluetooth/Adapter.hpp"
-#include "tizen/Strings.hpp"
-#include "tizen/network/bluetooth/DeviceInfo.hpp"
-#include "tizen/network/bluetooth/DiscoveryInfo.hpp"
-
-namespace tizen {
-namespace network {
-namespace bluetooth {
-
-std::weak_ptr<Adapter> Adapter::_instance;
-
- std::shared_ptr<Adapter> Adapter::instance()
- {
- if(_instance.expired())
- {
- std::shared_ptr<Adapter> adapter_ptr(new Adapter());
- _instance = adapter_ptr;
- return adapter_ptr;
- }
- else
- {
- return _instance.lock();
- }
- }
-
- ApiResult<bt_adapter_state_e> getState()
- {
- bt_adapter_state_e state;
- int res;
- res = bt_adapter_get_state(&state);
- if(res != BT_ERROR_NONE)
- {
- return ApiResult<bt_adapter_state_e>::Error(res);
- }
- return ApiResult<bt_adapter_state_e>::Ok(state);
- }
-
- static std::weak_ptr<Adapter> _instance;
-
- Adapter::Adapter()
- {
- _bluetoothManager = Manager::instance();
- }
-
- Adapter::~Adapter()
- {
- _bluetoothManager = nullptr;
- }
-
- ApiResult<bt_adapter_state_e> Adapter::getState()
- {
- bt_adapter_state_e state;
- int res;
- res = bt_adapter_get_state(&state);
- if(res != BT_ERROR_NONE)
- {
- return ApiResult<bt_adapter_state_e>::Error(res);
- }
- else
- {
- return ApiResult<bt_adapter_state_e>::Ok(state);
- }
- }
-
- ApiResult<std::string> Adapter::getAddress()
- {
- char *address;
- int res;
- res = bt_adapter_get_address(&address);
- if(res != BT_ERROR_NONE)
- {
- return ApiResult<std::string>::Error(res);
- }
- else
- {
- std::string address_string = wrapMallocString(address);
- return ApiResult<std::string>::Ok(address_string);
- }
- }
-
- ApiResult<std::string> Adapter::getName()
- {
- char *name;
- int res;
- res = bt_adapter_get_name(&name);
- if(res != BT_ERROR_NONE)
- {
- return ApiResult<std::string>::Error(res);
- }
- else
- {
- std::string name_string = wrapMallocString(name);
- return ApiResult<std::string>::Ok(name_string);
- }
- }
-
- ApiResult<void> Adapter::setName(const std::string & name)
- {
- int res;
- res = bt_adapter_set_name(name.c_str());
- if(res != BT_ERROR_NONE)
- {
- return ApiResult<void>::Error(res);
- }
- else
- {
- return ApiResult<void>::Ok();
- }
- }
-
- ApiResult<bt_adapter_visibility_mode_e> Adapter::getVisibilityMode()
- {
- bt_adapter_visibility_mode_e visibility_mode;
- int duration;
- int res;
- res = bt_adapter_get_visibility(&visibility_mode, &duration);
- if(res != BT_ERROR_NONE)
- {
- return ApiResult<bt_adapter_visibility_mode_e>::Error(res);
- }
- else
- {
- return ApiResult<bt_adapter_visibility_mode_e>::Ok(visibility_mode);
- }
- }
-
- ApiResult<int> Adapter::getVisibilityDuration()
- {
- bt_adapter_visibility_mode_e visibility_mode;
- int duration;
- int res;
- res = bt_adapter_get_visibility(&visibility_mode, &duration);
- if(res != BT_ERROR_NONE)
- {
- return ApiResult<int>::Error(res);
- }
- else
- {
- return ApiResult<int>::Ok(duration);
- }
- }
-
- ApiResult<void> Adapter::startDeviceDiscovery()
- {
- int res;
- res = bt_adapter_start_device_discovery();
- if(res != BT_ERROR_NONE)
- {
- return ApiResult<void>::Error(res);
- }
- else
- {
- return ApiResult<void>::Ok();
- }
- }
-
- ApiResult<void> Adapter::stopDeviceDiscovery()
- {
- int res;
- res = bt_adapter_stop_device_discovery();
- if(res != BT_ERROR_NONE)
- {
- return ApiResult<void>::Error(res);
- }
- else
- {
- return ApiResult<void>::Ok();
- }
- }
-
- ApiResult<bool> Adapter::isDiscovering()
- {
- bool isTrue;
- int res;
- res = bt_adapter_is_discovering(&isTrue);
- if(res != BT_ERROR_NONE)
- {
- return ApiResult<bool>::Error(res);
- }
- else
- {
- return ApiResult<bool>::Ok(isTrue);
- }
- }
-
- ApiResult<void> Adapter::foreachBondedDevice(std::function<bool(const DeviceInfo &)> foreach_cb)
- {
- int res;
- _bonded_device_cb = foreach_cb;
- auto static_cb = [](bt_device_info_s *device_info, void *user_data){
- Adapter *adapter = static_cast<Adapter*>(user_data);
- DeviceInfo deviceInfo(device_info);
- bool ret = adapter->_bonded_device_cb(deviceInfo);
- return ret;
- };
- res = bt_adapter_foreach_bonded_device(static_cb, this);
- _bonded_device_cb = nullptr;
- if(res != BT_ERROR_NONE)
- {
- return ApiResult<void>::Error(res);
- }
- else
- {
- return ApiResult<void>::Ok();
- }
-
- }
-
- ApiResult<const DeviceInfo> Adapter::getBondedDeviceInfo(const std::string & remote_address)
- {
- bt_device_info_s *device_info;
- int res;
- res = bt_adapter_get_bonded_device_info(remote_address.c_str(), &device_info);
- if(res != BT_ERROR_NONE)
- {
- return ApiResult<const DeviceInfo>::Error(res);
- }
- else
- {
- DeviceInfo deviceInfo(device_info);
- return ApiResult<const DeviceInfo>::Ok(deviceInfo);
- }
-
- }
-
- ApiResult<bool> Adapter::isServiceUsed(const std::string & service_uuid)
- {
- bool isTrue;
- int res;
- res = bt_adapter_is_service_used(service_uuid.c_str(), &isTrue);
- if(res != BT_ERROR_NONE)
- {
- return ApiResult<bool>::Error(res);
- }
- else
- {
- return ApiResult<bool>::Ok(isTrue);
- }
-
- }
-
- ApiResult<void> Adapter::setStateChangedCb(std::function<void(int, bt_adapter_state_e)> cb)
- {
- int res;
- auto old_cb = _state_changed_cb;
- _state_changed_cb = cb;
- auto static_cb = [](int result, bt_adapter_state_e adapter_state, void *user_data){
- Adapter *adapter = static_cast<Adapter*>(user_data);
- adapter->_state_changed_cb(result, adapter_state);
- };
- res = bt_adapter_set_state_changed_cb(static_cb, this);
- if(res != BT_ERROR_NONE)
- {
- _state_changed_cb = old_cb;
- return ApiResult<void>::Error(res);
- }
- else
- {
- return ApiResult<void>::Ok();
- }
- }
-
- ApiResult<void> Adapter::unsetStateChangeCb()
- {
- int res;
- res = bt_adapter_unset_state_changed_cb();
- if(res != BT_ERROR_NONE)
- {
- return ApiResult<void>::Error(res);
- }
- else
- {
- _state_changed_cb = nullptr;
- return ApiResult<void>::Error(res);
- }
- }
-
- ApiResult<void> Adapter::setNameChangedCb(std::function<void(const std::string &)> cb)
- {
- int res;
- auto old_cb = _name_changed_cb;
- _name_changed_cb = cb;
- auto static_cb = [](char *device_name, void *user_data){
- Adapter *adapter = static_cast<Adapter*>(user_data);
- std::string device_name_string(device_name);
- adapter->_name_changed_cb(device_name_string);
- };
- res = bt_adapter_set_name_changed_cb(static_cb, this);
- if(res != BT_ERROR_NONE)
- {
- _name_changed_cb = old_cb;
- return ApiResult<void>::Error(res);
- }
- else
- {
- return ApiResult<void>::Ok();
- }
- }
-
- ApiResult<void> Adapter::unsetNameChangedCb()
- {
- int res;
- res = bt_adapter_unset_name_changed_cb();
- if(res != BT_ERROR_NONE)
- {
- return ApiResult<void>::Error(res);
- }
- else
- {
- _name_changed_cb = nullptr;
- return ApiResult<void>::Error(res);
- }
- }
-
- ApiResult<void> Adapter::setVisibilityModeChangedCb(std::function<void(int, bt_adapter_visibility_mode_e)> cb)
- {
- int res;
- auto old_cb = _visibility_mode_changed_cb;
- _visibility_mode_changed_cb = cb;
- auto static_cb = [](int result, bt_adapter_visibility_mode_e visibility_mode, void *user_data){
- Adapter *adapter = static_cast<Adapter*>(user_data);
- adapter->_visibility_mode_changed_cb(result, visibility_mode);
- };
- res = bt_adapter_set_visibility_mode_changed_cb(static_cb, this);
- if(res != BT_ERROR_NONE)
- {
- _visibility_mode_changed_cb = old_cb;
- return ApiResult<void>::Error(res);
- }
- else
- {
- return ApiResult<void>::Ok();
- }
- }
-
- ApiResult<void> Adapter::unsetVisibilityModeChangedCb()
- {
- int res;
- res = bt_adapter_unset_visibility_mode_changed_cb();
- if(res != BT_ERROR_NONE)
- {
- return ApiResult<void>::Error(res);
- }
- else
- {
- _visibility_mode_changed_cb = nullptr;
- return ApiResult<void>::Error(res);
- }
-
- }
-
- ApiResult<void> Adapter::setVisibilityDurationChangedCb(std::function<void(int)> cb)
- {
- int res;
- auto old_cb = _visibility_duration_changed_cb;
- _visibility_duration_changed_cb = cb;
- auto static_cb = [](int duration, void *user_data){
- Adapter *adapter = static_cast<Adapter*>(user_data);
- adapter->_visibility_duration_changed_cb(duration);
- };
- res = bt_adapter_set_visibility_duration_changed_cb(static_cb, this);
- if(res != BT_ERROR_NONE)
- {
- _visibility_duration_changed_cb = old_cb;
- return ApiResult<void>::Error(res);
- }
- else
- {
- return ApiResult<void>::Ok();
- }
- }
-
- ApiResult<void> Adapter::unsetVisibilityDurationChangedCb()
- {
- int res;
- res = bt_adapter_unset_visibility_duration_changed_cb();
- if(res != BT_ERROR_NONE)
- {
- return ApiResult<void>::Error(res);
- }
- else
- {
- _visibility_duration_changed_cb = nullptr;
- return ApiResult<void>::Error(res);
- }
-
- }
-
- ApiResult<void> Adapter::setDeviceDisoveryStateChangedCb(std::function<void(int, bt_adapter_device_discovery_state_e, const DiscoveryInfo &)> cb)
- {
- int res;
- auto old_cb = _device_discovery_state_changed_cb;
- _device_discovery_state_changed_cb = cb;
- auto static_cb = [](int result, bt_adapter_device_discovery_state_e discovery_state, bt_adapter_device_discovery_info_s *discovery_info, void *user_data){
- Adapter *adapter = static_cast<Adapter*>(user_data);
- DiscoveryInfo discoveryInfo(discovery_info);
- adapter->_device_discovery_state_changed_cb(result, discovery_state, discoveryInfo);
- };
- res = bt_adapter_set_device_discovery_state_changed_cb(static_cb, this);
- if(res != BT_ERROR_NONE)
- {
- _device_discovery_state_changed_cb = old_cb;
- return ApiResult<void>::Error(res);
- }
- else
- {
- return ApiResult<void>::Ok();
- }
- }
-
- ApiResult<void> Adapter::unsetDeviceDisoveryStateChangedCb()
- {
- int res;
- res = bt_adapter_unset_device_discovery_state_changed_cb();
- if(res != BT_ERROR_NONE)
- {
- return ApiResult<void>::Error(res);
- }
- else
- {
- _device_discovery_state_changed_cb = nullptr;
- return ApiResult<void>::Error(res);
- }
-
- }
-} /* bluetooth */
-} /* network */
-} /* tizen */
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 ADAPTER_H
-#define ADAPTER_H
-
-#include <memory>
-#include <bluetooth.h>
-#include <functional>
-#include <utility>
-#include "tizen/ApiResult.hpp"
-#include "tizen/network/bluetooth/DeviceInfo.hpp"
-#include "tizen/network/bluetooth/Manager.hpp"
-#include "tizen/network/bluetooth/DiscoveryInfo.hpp"
-
-namespace tizen {
-namespace network {
-namespace bluetooth {
-
-class Adapter
-{
-public:
- /*@brief Returns shared pointer to existing instance of bluetooth adapter or creates new
- *@warning This function is not thread-safe!*/
- static std::shared_ptr<Adapter> instance();
-
- ApiResult<bt_adapter_state_e> getState();
- ApiResult<std::string> getAddress();
- ApiResult<std::string> getName();
- ApiResult<void> setName(const std::string & name);
- ApiResult<bt_adapter_visibility_mode_e> getVisibilityMode();
- ApiResult<int> getVisibilityDuration();
- ApiResult<void> startDeviceDiscovery();
- ApiResult<void> stopDeviceDiscovery();
- ApiResult<bool> isDiscovering();
- ApiResult<const DeviceInfo> getBondedDeviceInfo(const std::string & remote_address);
- ApiResult<bool> isServiceUsed(const std::string & service_uuid);
-
- /*@brief Runs foreach_cb(device_info) for all devices. It stops iterating if return value of foreach_cb is false*/
- ApiResult<void> foreachBondedDevice(std::function<bool(const DeviceInfo &)> foreach_cb);
-
- /*@brief Sets callback for state changing and runs cb(result_of_state_changing, state_to_be_changed) when it happens*/
- ApiResult<void> setStateChangedCb(std::function<void(int, bt_adapter_state_e)> cb);
- ApiResult<void> unsetStateChangeCb();
-
- /*@brief Sets callback for name changing and runs cb(name_of_bluetooth_device_to_be_changed) when it happens*/
- ApiResult<void> setNameChangedCb(std::function<void(const std::string &)> cb);
- ApiResult<void> unsetNameChangedCb();
-
- /*@brief Sets callback for visibility mode changing and runs cb(result_of_visibility_mode_changing, visibility_mode_to_be_changed)
- * when it happens*/
- ApiResult<void> setVisibilityModeChangedCb(std::function<void(int, bt_adapter_visibility_mode_e)> cb);
- ApiResult<void> unsetVisibilityModeChangedCb();
-
- /*@brief Sets callback for visibility duration changing and runs cb(duration_until_mode_is_changed_to_non_discoverable)
- * when it happens*/
- ApiResult<void> setVisibilityDurationChangedCb(std::function<void(int)> cb);
- ApiResult<void> unsetVisibilityDurationChangedCb();
-
- /* @brief Sets callback for discovery state changing and runs cb(result_of_device_discovery, state_to_be_changed, discovery_info)
- * @note if state_to_be_changed is BT_ADAPTER_DEVICE_DISCOVERY_STARTED or BT_ADAPTER_DEVICE_DISCOVERY_FINISHED,
- * discovery_info is not valid object*/
- ApiResult<void> setDeviceDisoveryStateChangedCb(std::function<void(int, bt_adapter_device_discovery_state_e, const DiscoveryInfo &)> cb);
- ApiResult<void> unsetDeviceDisoveryStateChangedCb();
-
- ~Adapter();
-
-private:
- static std::weak_ptr<Adapter> _instance;
-
- std::shared_ptr<Manager> _bluetoothManager;
-
- Adapter();
-
- Adapter(const Adapter&) = delete;
- Adapter(Adapter&&) = delete;
-
- Adapter& operator=(const Adapter&) = delete;
- Adapter& operator=(Adapter&&) = delete;
-
- std::function<void(int, bt_adapter_state_e)> _state_changed_cb;
- std::function<void(const std::string &)> _name_changed_cb;
- std::function<void(int, bt_adapter_visibility_mode_e)> _visibility_mode_changed_cb;
- std::function<void(int)> _visibility_duration_changed_cb;
- std::function<void(int, bt_adapter_device_discovery_state_e, const DiscoveryInfo &)> _device_discovery_state_changed_cb;
- std::function<bool(const DeviceInfo &)> _bonded_device_cb;
-};
-
-} /* bluetooth */
-} /* network */
-} /* tizen */
-#endif /* ADAPTER_H */
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "tizen/network/bluetooth/AdvertiserLE.hpp"
-#include "tizen/network/bluetooth/Exceptions.hpp"
-#include "tizen/macros.hpp"
-
-namespace tizen {
-namespace network {
-namespace bluetooth {
-
- AdvertiserLE::AdvertiserLE(std::shared_ptr<Manager> manager) : _manager(manager)
- {
- int res = bt_adapter_le_create_advertiser(&_advertiser);
- if(res != BT_ERROR_NONE)
- {
- throw BluetoothException(res, "Cannot initialize advertiser");
- }
- }
-
- AdvertiserLE::~AdvertiserLE()
- {
- _manager = nullptr;
- bt_adapter_le_destroy_advertiser(_advertiser);
- }
-
- ApiResult<void> AdvertiserLE::addServiceUuid(bt_adapter_le_packet_type_e packet_type, const std::string & uuid)
- {
- int res = bt_adapter_le_add_advertising_service_uuid(_advertiser, packet_type, uuid.c_str());
- if(res != BT_ERROR_NONE)
- {
- return ApiResult<void>::Error(res);
- }
- else
- {
- return ApiResult<void>::Ok();
- }
- }
-
- ApiResult<void> AdvertiserLE::addServiceSolicitationUuid(bt_adapter_le_packet_type_e packet_type, const std::string & uuid)
- {
- int res = bt_adapter_le_add_advertising_service_solicitation_uuid(_advertiser, packet_type, uuid.c_str());
- if(res != BT_ERROR_NONE)
- {
- return ApiResult<void>::Error(res);
- }
- else
- {
- return ApiResult<void>::Ok();
- }
- }
-
- ApiResult<void> AdvertiserLE::addServiceData(bt_adapter_le_packet_type_e packet_type, const std::string & uuid, std::vector<char> serviceData)
- {
- int res = bt_adapter_le_add_advertising_service_data(_advertiser, packet_type, uuid.c_str(), serviceData.data(), static_cast<int>(serviceData.size()));
- if(res != BT_ERROR_NONE)
- {
- return ApiResult<void>::Error(res);
- }
- else
- {
- return ApiResult<void>::Ok();
- }
- }
-
- ApiResult<void> AdvertiserLE::setAppearance(bt_adapter_le_packet_type_e packet_type, int appearance)
- {
- int res = bt_adapter_le_set_advertising_appearance(_advertiser, packet_type, appearance);
- if(res != BT_ERROR_NONE)
- {
- return ApiResult<void>::Error(res);
- }
- else
- {
- return ApiResult<void>::Ok();
- }
- }
-
- ApiResult<void> AdvertiserLE::addManufacturerData(bt_adapter_le_packet_type_e packet_type, int manufacturerId, std::vector<char> manufacturerData)
- {
- int res = bt_adapter_le_add_advertising_manufacturer_data(_advertiser, packet_type, manufacturerId, manufacturerData.data(), static_cast<int>(manufacturerData.size()));
- if(res != BT_ERROR_NONE)
- {
- return ApiResult<void>::Error(res);
- }
- else
- {
- return ApiResult<void>::Ok();
- }
- }
-
- ApiResult<void> AdvertiserLE::setDeviceName(bt_adapter_le_packet_type_e packet_type, bool includeName)
- {
- int res = bt_adapter_le_set_advertising_device_name(_advertiser, packet_type, includeName);
- if(res != BT_ERROR_NONE)
- {
- return ApiResult<void>::Error(res);
- }
- else
- {
- return ApiResult<void>::Ok();
- }
- }
-
- ApiResult<void> AdvertiserLE::setTxPowerLevel(bt_adapter_le_packet_type_e packet_type, bool includeTxPower)
- {
- int res = bt_adapter_le_set_advertising_tx_power_level(_advertiser, packet_type, includeTxPower);
- if(res != BT_ERROR_NONE)
- {
- return ApiResult<void>::Error(res);
- }
- else
- {
- return ApiResult<void>::Ok();
- }
- }
-
- ApiResult<void> AdvertiserLE::clearData(bt_adapter_le_packet_type_e packet_type)
- {
- int res = bt_adapter_le_clear_advertising_data(_advertiser, packet_type);
- if(res != BT_ERROR_NONE)
- {
- return ApiResult<void>::Error(res);
- }
- else
- {
- return ApiResult<void>::Ok();
- }
- }
-
- ApiResult<void> AdvertiserLE::stop()
- {
- int res = bt_adapter_le_stop_advertising(_advertiser);
- if(res != BT_ERROR_NONE)
- {
-
- return ApiResult<void>::Error(res);
- }
- else
- {
- return ApiResult<void>::Ok();
- }
- }
-
- ApiResult<void> AdvertiserLE::start(std::function<void(int, AdvertiserLE&, bt_adapter_le_advertising_state_e)> state_changed)
- {
- auto old_cb = _start_cb;
- _start_cb = state_changed;
- auto _static_cb = [](int result, bt_advertiser_h advertiser UNUSED, bt_adapter_le_advertising_state_e adv_state, void *user_data) -> void
- {
- AdvertiserLE *advertiserLE = static_cast<AdvertiserLE*>(user_data);
- advertiserLE->_start_cb(result, *advertiserLE, adv_state);
- };
-
- int res = bt_adapter_le_start_advertising_new(_advertiser, _static_cb, this);
- if(res != BT_ERROR_NONE)
- {
- _start_cb = old_cb;
- return ApiResult<void>::Error(res);
- }
- else
- {
- return ApiResult<void>::Ok();
- }
- }
-
- ApiResult<void> AdvertiserLE::setMode(bt_adapter_le_advertising_mode_e mode)
- {
- int res = bt_adapter_le_set_advertising_mode(_advertiser, mode);
- if(res != BT_ERROR_NONE)
- {
- return ApiResult<void>::Error(res);
- }
- else
- {
- return ApiResult<void>::Ok();
- }
- }
-}
-}
-}
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 ADVERTISER_LE_H
-#define ADVERTISER_LE_H
-
-#include "tizen/network/bluetooth/Manager.hpp"
-#include "tizen/ApiResult.hpp"
-#include <bluetooth.h>
-#include <vector>
-
-namespace tizen {
-namespace network {
-namespace bluetooth {
-
-class AdvertiserLE
-{
-public:
- AdvertiserLE(std::shared_ptr<Manager> manager);
- ~AdvertiserLE();
-
- AdvertiserLE() = delete;
- AdvertiserLE(const AdvertiserLE &) = delete;
- AdvertiserLE& operator=(const AdvertiserLE&) = delete;
-
- AdvertiserLE(const AdvertiserLE &&) = delete;
- AdvertiserLE& operator=(const AdvertiserLE&&) = delete;
-
- ApiResult<void> addServiceUuid(bt_adapter_le_packet_type_e packet_type, const std::string & uuid);
- ApiResult<void> addServiceSolicitationUuid(bt_adapter_le_packet_type_e packet_type, const std::string & uuid);
- ApiResult<void> addServiceData(bt_adapter_le_packet_type_e packet_type, const std::string & uuid, std::vector<char> serviceData);
- ApiResult<void> setAppearance(bt_adapter_le_packet_type_e packet_type, int appearance);
- ApiResult<void> addManufacturerData(bt_adapter_le_packet_type_e packet_type, int manufacturer_id, std::vector<char> manufacturerData);
- ApiResult<void> setDeviceName(bt_adapter_le_packet_type_e packet_type, bool includeName);
- ApiResult<void> setTxPowerLevel(bt_adapter_le_packet_type_e packet_type, bool includeTxPower);
- ApiResult<void> clearData(bt_adapter_le_packet_type_e packet_type);
- ApiResult<void> stop();
- ApiResult<void> setMode(bt_adapter_le_advertising_mode_e mode);
-
- /*@brief Start advertising and sets callback for state changing. Whenever its changed, state_changed_cb(result_of_requested_state_change,
- * advertiser, advertising_state_to_Be_changed) is called.*/
- ApiResult<void> start(std::function<void(int, AdvertiserLE&, bt_adapter_le_advertising_state_e)> state_changed_cb);
-
-private:
- std::shared_ptr<Manager> _manager;
- bt_advertiser_h _advertiser;
-
- std::function<void(int, AdvertiserLE&, bt_adapter_le_advertising_state_e)> _start_cb;
-};
-
-} /* bluetooth */
-} /* network */
-} /* tizen */
-
-#endif /* ADVERTISER_LE_H */
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "tizen/network/bluetooth/DeviceInfo.hpp"
-#include <cstring>
-
-namespace tizen {
-namespace network {
-namespace bluetooth {
-
- DeviceInfo::DeviceInfo(bt_device_info_s *device_info)
- {
- if(device_info != nullptr)
- {
- manufacturerData = std::vector<char>(device_info->manufacturer_data, device_info->manufacturer_data + device_info->manufacturer_data_len);
- remoteAddress = device_info->remote_address;
- remoteName = device_info->remote_name;
- btClass = device_info->bt_class;
- isBonded = device_info->is_bonded;
- isConnected = device_info->is_connected;
- isAuthorized = device_info->is_authorized;
- for(int i = 0; i < device_info->service_count; ++i)
- {
- serviceUuid.push_back(std::string(device_info->service_uuid[i]));
- }
- }
- }
-
- DeviceInfo::DeviceInfo()
- {
- isBonded = false;
- isConnected = false;
- isAuthorized = false;
- btClass.major_device_class = static_cast<bt_major_device_class_e>(0);
- btClass.major_service_class_mask = 0;
- btClass.minor_device_class = static_cast<bt_minor_device_class_e>(0);
- }
-
-} /* bluetooth */
-} /* network */
-} /* tizen */
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 BLUETOOTH_DEVICE_INFO_H
-#define BLUETOOTH_DEVICE_INFO_H
-
-#include <bluetooth.h>
-#include <string>
-#include <vector>
-
-namespace tizen {
-namespace network {
-namespace bluetooth {
-
-class DeviceInfo
-{
-public:
- DeviceInfo();
-
- DeviceInfo(bt_device_info_s *device_info);
-
- std::string remoteAddress;
- std::string remoteName;
- bt_class_s btClass;
- std::vector<std::string> serviceUuid;
- bool isBonded;
- bool isConnected;
- bool isAuthorized;
- std::vector<char> manufacturerData;
-};
-
-} /* bluetooth */
-} /* network */
-} /* tizen */
-
-#endif //BLUETOOTH_DEVICE_INFO_H
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "tizen/network/bluetooth/DiscoveryInfo.hpp"
-#include <cstring>
-
-namespace tizen {
-namespace network {
-namespace bluetooth {
-
- DiscoveryInfo::DiscoveryInfo(bt_adapter_device_discovery_info_s *device_discovery_info)
- {
- if(device_discovery_info != nullptr)
- {
- manufacturerData = std::vector<char>(device_discovery_info->manufacturer_data, device_discovery_info->manufacturer_data + device_discovery_info->manufacturer_data_len);
- remoteAddress = device_discovery_info->remote_address;
- remoteName = device_discovery_info->remote_name;
- btClass = device_discovery_info->bt_class;
- rssi = device_discovery_info->rssi;
- isBonded = device_discovery_info->is_bonded;
- appearance = device_discovery_info->appearance;
- for(int i = 0; i < device_discovery_info->service_count; ++i)
- {
- serviceUuid.push_back(std::string(device_discovery_info->service_uuid[i]));
- }
- }
- }
-
- DiscoveryInfo::DiscoveryInfo()
- {
- rssi = 0;
- isBonded = false;
- appearance = BT_APPEARANCE_TYPE_UNKNOWN;
- btClass.major_device_class = static_cast<bt_major_device_class_e>(0);
- btClass.major_service_class_mask = 0;
- btClass.minor_device_class = static_cast<bt_minor_device_class_e>(0);
- }
-
-} /* bluetooth */
-} /* network */
-} /* tizen */
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 DISCOVERYINFO_H
-#define DISCOVERYINFO_H
-
-#include <string>
-#include <bluetooth.h>
-#include <vector>
-
-namespace tizen {
-namespace network {
-namespace bluetooth {
-
-class DiscoveryInfo {
-public:
- DiscoveryInfo();
-
- DiscoveryInfo(bt_adapter_device_discovery_info_s *device_discovery_info);
-
- std::string remoteAddress;
- std::string remoteName;
- bt_class_s btClass;
- int rssi;
- bool isBonded;
- bt_appearance_type_e appearance;
- std::vector<char> manufacturerData;
- std::vector<std::string> serviceUuid;
-};
-
-} /* bluetooth */
-} /* network */
-} /* tizen */
-
-#endif //DISCOVERY_INFO_H
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "tizen/network/bluetooth/Exceptions.hpp"
-#include <string>
-
-namespace tizen {
-namespace network {
-namespace bluetooth {
- BluetoothException::BluetoothException(Error error, std::string message) : _error(error), _message(message)
- {
- }
-
- const char *BluetoothException::what() const noexcept
- {
- return (_message + ":" + _error.message()).c_str();
- }
-
- Error BluetoothException::getError() const
- {
- return _error;
- }
-} /* bluetooth */
-} /* network */
-} /* tizen */
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 BLUETOOTH_EXCEPTIONS_H
-#define BLUETOOTH_EXCEPTIONS_H
-
-#include <exception>
-#include <string>
-
-#include "tizen/Error.hpp"
-
-namespace tizen {
-namespace network {
-namespace bluetooth {
- class BluetoothException : public std::exception
- {
- public:
- BluetoothException(Error error, std::string message = "");
- ~BluetoothException() = default;
-
- virtual const char *what() const noexcept override;
- Error getError() const;
- private:
- Error _error;
- std::string _message;
- };
-}
-}
-}
-
-#endif //BLUETOOTH_EXCEPTIONS_H
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "Manager.hpp"
-
-#include "tizen/network/bluetooth/Exceptions.hpp"
-#include "tizen/Strings.hpp"
-#include "tizen/Logger.hpp"
-#include <bluetooth.h>
-
-namespace tizen {
-namespace network {
-namespace bluetooth {
-
-std::weak_ptr<Manager> Manager::_instance;
-
- std::shared_ptr<Manager> Manager::instance()
- {
- if(_instance.expired())
- {
- std::shared_ptr<Manager> shared_p(new Manager());
- _instance = shared_p;
- return shared_p;
- }
- else
- {
- return _instance.lock();
- }
- }
-
- Manager::Manager()
- {
- int res = bt_initialize();
- if(res != BT_ERROR_NONE)
- {
- throw BluetoothException(res, "Bluetooth manager constructor error");
- }
- }
-
- Manager::~Manager()
- {
- int res = bt_deinitialize();
- if(res != BT_ERROR_NONE)
- {
- Error error(res);
- logger::Err("Cannot deinitialize bluetooth: ", error.message());
- }
- }
-
- ApiResult<std::string> Manager::GetUuidName(const std::string & uuid)
- {
- char *name;
- int res = bt_get_uuid_name(uuid.c_str(), &name);
-
- if(res != BT_ERROR_NONE)
- {
- return ApiResult<std::string>::Error(res);
- }
-
- std::string string_name = wrapMallocString(name);
- return ApiResult<std::string>::Ok(string_name);
- }
-}
-}
-}
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 MANAGER_H
-#define MANAGER_H
-
-#include "tizen/ApiResult.hpp"
-#include <memory>
-#include <string>
-#include <functional>
-
-namespace tizen {
-namespace network {
-namespace bluetooth {
-
-class Manager
-{
-public:
- /*@brief Returns shared pointer to existing instance of Manager or creates new one.
- @warning This function is not thread-safe!*/
- static std::shared_ptr<Manager> instance();
-
- /*@brief Returns name of UUID (Universally Unique Identifier) for bluetooth manager*/
- ApiResult<std::string> GetUuidName(const std::string & uuid);
-
- ~Manager();
-
-private:
- static std::weak_ptr<Manager> _instance;
-
- Manager();
-
- Manager(const Manager&) = delete;
- Manager(Manager&&) = delete;
-
- Manager& operator=(const Manager&) = delete;
- Manager& operator=(Manager&&) = delete;
-
-
-};
-
-} /* bluetooth */
-} /* network */
-} /* tizen */
-
-#endif /* MANAGER_H */
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "tizen/network/softap/Client.hpp"
-#include "tizen/network/softap/Exception.hpp"
-#include "tizen/ApiUtils.hpp"
-#include "tizen/Strings.hpp"
-
-using namespace tizen;
-using namespace tizen::network::softap;
-
-Client::Client()
-{
-}
-
-Client::Client(softap_client_h hdl, bool owner) :
- handle(hdl, softap_client_deleter{owner})
-{
-}
-
-Client::Client(const Client& c)
-{
- softap_client_h cloned;
- int err = softap_client_clone(&cloned, c.handle.get());
- if (err != TIZEN_ERROR_NONE)
- throw SoftAPException(err);
-
- handle = std::unique_ptr<void, softap_client_deleter>(cloned, true);
-}
-
-Client& Client::operator=(const Client& c)
-{
- softap_client_h cloned;
- int err = softap_client_clone(&cloned, c.handle.get());
- if (err != TIZEN_ERROR_NONE)
- throw SoftAPException(err);
-
- handle = std::unique_ptr<void, softap_client_deleter>(cloned, true);
- return *this;
-}
-
-Client::Client(Client&& c)
-{
- handle.swap(c.handle);
-}
-
-Client& Client::operator=(Client&& c)
-{
- handle.swap(c.handle);
- return *this;
-}
-
-IMPLEMENT_METHOD(std::string, Client::name(), char *ret, softap_client_get_name(handle.get(), &ret), wrapMallocString(ret))
-IMPLEMENT_METHOD(std::string, Client::ipAddress(softap_address_family_e af), char *ret, softap_client_get_ip_address(handle.get(), af, &ret), wrapMallocString(ret))
-IMPLEMENT_METHOD(std::string, Client::macAddress(), char *ret, softap_client_get_mac_address(handle.get(), &ret), wrapMallocString(ret))
-IMPLEMENT_METHOD(std::chrono::system_clock::time_point, Client::time(), time_t ret, softap_client_get_time(handle.get(), &ret), std::chrono::system_clock::from_time_t(ret))
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 TIZEN_NETWORK_SOFTAP_CLIENT_H
-#define TIZEN_NETWORK_SOFTAP_CLIENT_H
-
-#include <softap.h>
-#include <memory>
-#include <chrono>
-
-#include "tizen/network/softap/Manager.hpp"
-
-namespace tizen {
-namespace network {
-namespace softap {
-
-class Manager;
-
-class Client
-{
-public:
- Client();
- Client(const Client&);
- Client& operator=(const Client&);
- Client(Client&&);
- Client& operator=(Client&&);
- ~Client() = default;
-
- ApiResult<std::string> name();
- ApiResult<std::string> ipAddress(softap_address_family_e);
- ApiResult<std::string> macAddress();
- ApiResult<std::chrono::system_clock::time_point> time();
-
-private:
- Client(softap_client_h, bool owner);
-
- struct softap_client_deleter {
- softap_client_deleter(bool o) : owns(o) {}
- softap_client_deleter() : softap_client_deleter(false) {}
- bool owns;
- void operator()(softap_client_h client) {
- if (owns && client)
- softap_client_destroy(client);
- }
- };
-
- std::unique_ptr<void, softap_client_deleter> handle;
- friend Manager;
-};
-
-} /* softap */
-} /* network */
-} /* tizen */
-
-#endif /* TIZEN_NETWORK_SOFTAP_CLIENT_H */
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 TIZEN_NETWORK_SOFTAP_EXCEPTION_H
-#define TIZEN_NETWORK_SOFTAP_EXCEPTION_H
-
-#include <stdexcept>
-#include <tizen.h>
-
-namespace tizen {
-namespace network {
-namespace softap {
-
-class SoftAPException : std::runtime_error
-{
-public:
- SoftAPException(int err) : std::runtime_error(get_error_message(err)) {}
- virtual ~SoftAPException() = default;
-};
-
-} /* wifi */
-} /* network */
-} /* softap */
-
-#endif /* TIZEN_NETWORK_SOFTAP_EXCEPTION_H */
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "tizen/network/softap/Manager.hpp"
-#include "tizen/network/softap/Exception.hpp"
-#include "tizen/ApiUtils.hpp"
-#include "tizen/Strings.hpp"
-
-using namespace tizen;
-using namespace tizen::network::softap;
-
-Manager::Manager()
-{
- int err = softap_create(&handle);
- if (err != TIZEN_ERROR_NONE) {
- throw SoftAPException(err);
- }
-}
-
-Manager::~Manager()
-{
- softap_destroy(handle);
-}
-
-IMPLEMENT_METHOD(void, Manager::enable(), , softap_enable(handle), )
-IMPLEMENT_METHOD(void, Manager::disable(), , softap_disable(handle), )
-IMPLEMENT_METHOD(bool, Manager::isEnabled(), bool ret , softap_is_enabled(handle, &ret), ret)
-IMPLEMENT_METHOD(std::string, Manager::macAddress(), char *ret , softap_get_mac_address(handle, &ret), wrapMallocString(ret))
-IMPLEMENT_METHOD(std::string, Manager::networkInterfaceName(), char *ret , softap_get_network_interface_name(handle, &ret), wrapMallocString(ret))
-IMPLEMENT_METHOD(void, Manager::setIpAddress(softap_address_family_e address_family, const std::string& ip_address), , softap_set_ip_address(handle, address_family, ip_address.c_str()), )
-IMPLEMENT_METHOD(std::string, Manager::ipAddress(softap_address_family_e address_family), char *ret , softap_get_ip_address(handle, address_family, &ret), wrapMallocString(ret))
-IMPLEMENT_METHOD(std::string, Manager::gatewayAddress(softap_address_family_e address_family), char *ret , softap_get_gateway_address(handle, address_family, &ret), wrapMallocString(ret))
-IMPLEMENT_METHOD(std::string, Manager::subnetMask(softap_address_family_e address_family), char *ret , softap_get_subnet_mask(handle, address_family, &ret), wrapMallocString(ret))
-IMPLEMENT_METHOD(void, Manager::setSecurityType(softap_security_type_e st), , softap_set_security_type(handle, st), )
-IMPLEMENT_METHOD(softap_security_type_e, Manager::securityType(), softap_security_type_e ret, softap_get_security_type(handle, &ret), ret)
-IMPLEMENT_METHOD(void, Manager::setSsid(const std::string& ssid), , softap_set_ssid(handle, ssid.c_str()), )
-IMPLEMENT_METHOD(std::string, Manager::ssid(), char *ret, softap_get_ssid(handle, &ret), wrapMallocString(ret))
-IMPLEMENT_METHOD(void, Manager::setSsidVisibility(bool v), , softap_set_ssid_visibility(handle, v), )
-IMPLEMENT_METHOD(bool, Manager::ssidVisibility(), bool ret, softap_get_ssid_visibility(handle, &ret), ret)
-IMPLEMENT_METHOD(void, Manager::setPassphrase(const std::string &pass), , softap_set_passphrase(handle, pass.c_str()), )
-IMPLEMENT_METHOD(std::string, Manager::passphrase(), char *ret, softap_get_passphrase(handle, &ret), wrapMallocString(ret))
-IMPLEMENT_METHOD(void, Manager::pushWpsButton(), , softap_push_wps_button(handle), )
-IMPLEMENT_METHOD(void, Manager::setWpsPin(const std::string& v), , softap_set_wps_pin(handle, v.c_str()), )
-IMPLEMENT_METHOD(void, Manager::setVendorElemenet(const std::string& v), , softap_set_vendor_element(handle, v.c_str()), )
-IMPLEMENT_METHOD(std::string, Manager::vendorElemenet(), char *ret, softap_get_vendor_element(handle, &ret), wrapMallocString(ret))
-IMPLEMENT_METHOD(void, Manager::setChannel(int v), , softap_set_channel(handle, v), )
-IMPLEMENT_METHOD(int, Manager::channel(), int ret, softap_get_channel(handle, &ret), ret)
-IMPLEMENT_METHOD(void, Manager::enableDHCP(), , softap_enable_dhcp(handle), )
-IMPLEMENT_METHOD(void, Manager::disableDHCP(), , softap_disable_dhcp(handle), )
-IMPLEMENT_METHOD(bool, Manager::isDHCPEnabled(), bool ret, softap_is_dhcp_enabled(handle, &ret), ret)
-IMPLEMENT_METHOD(void, Manager::enableDHCPWithRange(const std::string& start, const std::string& end), , softap_enable_dhcp_with_range(handle, const_cast<char*>(start.c_str()), const_cast<char*>(end.c_str())), )
-IMPLEMENT_METHOD(void, Manager::setMode(softap_wireless_mode_e m), , softap_set_mode(handle, m), )
-IMPLEMENT_METHOD(softap_wireless_mode_e, Manager::mode(), softap_wireless_mode_e ret, softap_get_mode(handle, &ret), ret)
-IMPLEMENT_METHOD(void, Manager::reloadSettings(SettingsReloadedCallback cb), settings_reloaded_cb = cb, softap_reload_settings(handle, [](softap_error_e err, void *user_data) {
- Manager *mgr = static_cast<Manager*>(user_data);
- if (mgr->settings_reloaded_cb) mgr->settings_reloaded_cb(err);
- }, this), )
-
-ApiResult<std::vector<Client>> Manager::connectedClients()
-{
- std::vector<Client> ret;
- int err = softap_foreach_connected_clients(handle, [](softap_client_h c, void *user_data) -> bool {
- std::vector<Client> *ret = static_cast<std::vector<Client>*>(user_data);
- Client client(c, false);
- ret->push_back(client);
- return true;
- }, &ret);
- if (err != TIZEN_ERROR_NONE) {
- return ApiResult<std::vector<Client>>::Error(err);
- } else {
- return ApiResult<std::vector<Client>>::Ok(ret);
- }
-}
-
-IMPLEMENT_METHOD(void, Manager::setEnabledCallback(EnabledCallback cb),
- static const auto ccb = [](softap_error_e result, bool is_requested, void *user_data) {
- Manager *mgr = static_cast<Manager*>(user_data);
- if (mgr->enabled_cb) mgr->enabled_cb(result, is_requested);
- };
- enabled_cb = cb;,
- cb ? softap_set_enabled_cb(handle, ccb, this) : softap_unset_enabled_cb(handle), )
-
-IMPLEMENT_METHOD(void, Manager::setDisabledCallback(DisabledCallback cb),
- static const auto ccb = [](softap_error_e result, softap_disabled_cause_e cause, void *user_data) {
- Manager *mgr = static_cast<Manager*>(user_data);
- if (mgr->disabled_cb) mgr->disabled_cb(result, cause);
- };
- disabled_cb = cb;,
- cb ? softap_set_disabled_cb(handle, ccb, this) : softap_unset_disabled_cb(handle);, )
-
-IMPLEMENT_METHOD(void, Manager::setClientConnectionStateChangedCallback(ClientConnectionStateChangedCallback cb),
- static const auto ccb = [](softap_client_h client, bool opened, void *user_data) {
- Manager *mgr = static_cast<Manager*>(user_data);
- Client c(client, false);
- if (mgr->client_state_changed_cb) mgr->client_state_changed_cb(c, opened);
- };
- client_state_changed_cb = cb;,
- cb ? softap_set_client_connection_state_changed_cb(handle, ccb, this) : softap_unset_client_connection_state_changed_cb(handle);,)
-
-IMPLEMENT_METHOD(void, Manager::setSecurityTypeChangedCallback(SecurityTypeChangedCallback cb),
- static const auto ccb = [](softap_security_type_e changed_type, void *user_data) {
- Manager *mgr = static_cast<Manager*>(user_data);
- if (mgr->security_type_changed_cb) mgr->security_type_changed_cb(changed_type);
- };
- security_type_changed_cb = cb;,
- cb ? softap_set_security_type_changed_cb(handle, ccb, this) : softap_unset_security_type_changed_cb(handle);,)
-
-IMPLEMENT_METHOD(void, Manager::setSsidVisibilityChangedCallback(SsidVisibilityChangedCallback cb),
- static const auto ccb = [](bool changed_visible, void *user_data) {
- Manager *mgr = static_cast<Manager*>(user_data);
- if (mgr->visibility_changed_cb) mgr->visibility_changed_cb(changed_visible);
- };
- visibility_changed_cb = cb;,
- cb ? softap_set_ssid_visibility_changed_cb(handle, ccb, this) : softap_unset_ssid_visibility_changed_cb(handle);, )
-
-IMPLEMENT_METHOD(void, Manager::setPassphraseChangedCallback(PassphraseChangedCallback cb),
- static const auto ccb = [](void *user_data) {
- Manager *mgr = static_cast<Manager*>(user_data);
- if (mgr->passphrase_changed_cb) mgr->passphrase_changed_cb();
- };
- passphrase_changed_cb = cb;,
- cb ? softap_set_passphrase_changed_cb(handle, ccb, this) : softap_unset_passphrase_changed_cb(handle);, )
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 TIZEN_NETWORK_SOFTAP_MANANGER
-#define TIZEN_NETWORK_SOFTAP_MANANGER
-
-#include <softap.h>
-#include <string>
-#include <vector>
-#include <functional>
-
-#include "tizen/ApiResult.hpp"
-#include "tizen/network/softap/Client.hpp"
-
-namespace tizen {
-namespace network {
-namespace softap {
-
-class Client;
-
-class Manager
-{
-public:
- Manager();
- Manager(const Manager&) = delete;
- Manager& operator=(const Manager&) = delete;
- Manager(Manager&&) = delete;
- Manager& operator=(Manager&&) = delete;
-
- virtual ~Manager();
-
- ApiResult<void> enable();
- ApiResult<void> disable();
- ApiResult<bool> isEnabled();
- ApiResult<std::string> macAddress();
- ApiResult<std::string> networkInterfaceName();
-
- ApiResult<std::vector<Client>> connectedClients();
-
- using EnabledCallback = std::function<void(softap_error_e result, bool is_requested)>;
- using DisabledCallback = std::function<void(softap_error_e result, softap_disabled_cause_e cause)>;
- using ClientConnectionStateChangedCallback = std::function<void(Client &c, bool opened)>;
- using SecurityTypeChangedCallback = std::function<void(softap_security_type_e changed_type)>;
- using SsidVisibilityChangedCallback = std::function<void(bool changed_visible)>;
- using PassphraseChangedCallback = std::function<void()>;
- using SettingsReloadedCallback = std::function<void(softap_error_e result)>;
-
- ApiResult<void> setIpAddress(softap_address_family_e address_family, const std::string& ip_address);
- ApiResult<std::string> ipAddress(softap_address_family_e address_family);
- ApiResult<std::string> gatewayAddress(softap_address_family_e address_family);
- ApiResult<std::string> subnetMask(softap_address_family_e address_family);
-
- ApiResult<void> setEnabledCallback(EnabledCallback);
- ApiResult<void> setDisabledCallback(DisabledCallback);
- ApiResult<void> setClientConnectionStateChangedCallback(ClientConnectionStateChangedCallback);
- ApiResult<void> setSecurityTypeChangedCallback(SecurityTypeChangedCallback);
- ApiResult<void> setSsidVisibilityChangedCallback(SsidVisibilityChangedCallback);
- ApiResult<void> setPassphraseChangedCallback(PassphraseChangedCallback);
-
- ApiResult<void> setSecurityType(softap_security_type_e);
- ApiResult<softap_security_type_e> securityType();
- ApiResult<void> setSsid(const std::string& ssid);
- ApiResult<std::string> ssid();
- ApiResult<void> setSsidVisibility(bool);
- ApiResult<bool> ssidVisibility();
- ApiResult<void> setPassphrase(const std::string &pass);
- ApiResult<std::string> passphrase();
-
- ApiResult<void> pushWpsButton();
- ApiResult<void> setWpsPin(const std::string&);
- ApiResult<void> setVendorElemenet(const std::string&);
- ApiResult<std::string> vendorElemenet();
- ApiResult<void> setChannel(int);
- ApiResult<int> channel();
- ApiResult<void> enableDHCP();
- ApiResult<void> disableDHCP();
- ApiResult<bool> isDHCPEnabled();
- ApiResult<void> enableDHCPWithRange(const std::string& start, const std::string& end);
- ApiResult<void> setMode(softap_wireless_mode_e);
- ApiResult<softap_wireless_mode_e> mode();
- ApiResult<void> reloadSettings(SettingsReloadedCallback);
-private:
- softap_h handle;
- EnabledCallback enabled_cb;
- DisabledCallback disabled_cb;
- ClientConnectionStateChangedCallback client_state_changed_cb;
- SecurityTypeChangedCallback security_type_changed_cb;
- SsidVisibilityChangedCallback visibility_changed_cb;
- PassphraseChangedCallback passphrase_changed_cb;
- SettingsReloadedCallback settings_reloaded_cb;
-};
-
-} /* softap */
-} /* network */
-} /* tizen */
-
-#endif /* TIZEN_NETWORK_SOFTAP_MANANGER */
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "tizen/network/wifi/Ap.hpp"
-#include "tizen/ApiUtils.hpp"
-
-using namespace tizen;
-using namespace tizen::network::wifi;
-
-Ap::Ap() : handle(nullptr) {}
-
-Ap::~Ap() {
- if (handle)
- wifi_manager_ap_destroy(handle);
-}
-
-Ap::Ap(const Ap &ap) {
- wifi_manager_ap_h cloned;
-
- int err = wifi_manager_ap_clone(&cloned, ap.handle);
- if (err != TIZEN_ERROR_NONE) {
- throw WifiException(err);
- }
-
- if (handle)
- wifi_manager_ap_destroy(handle);
-
- handle = cloned;
-}
-
-Ap &Ap::operator=(const Ap &ap) {
- wifi_manager_ap_h cloned;
-
- int err = wifi_manager_ap_clone(&cloned, ap.handle);
- if (err != TIZEN_ERROR_NONE) {
- throw WifiException(err);
- }
-
- if (handle)
- wifi_manager_ap_destroy(handle);
-
- handle = cloned;
- return *this;
-}
-
-Ap::Ap(Ap &&ap) {
- std::swap(handle, ap.handle);
-}
-
-Ap &Ap::operator=(Ap &&ap) {
- std::swap(handle, ap.handle);
-
- return *this;
-}
-
-Ap::Ap(wifi_manager_ap_h ap)
- : handle(ap) {}
-
-IMPLEMENT_METHOD(std::string, Ap::essid(), char *tmp,
- wifi_manager_ap_get_essid(handle, &tmp), wrapMallocString(tmp))
-IMPLEMENT_METHOD(std::string, Ap::rawSsid(), char *ssid; int len;
- , wifi_manager_ap_get_raw_ssid(handle, &ssid, &len),
- wrapMallocString(ssid, static_cast<size_t>(len)))
-IMPLEMENT_METHOD(std::string, Ap::bssid(), char *tmp,
- wifi_manager_ap_get_bssid(handle, &tmp), wrapMallocString(tmp))
-IMPLEMENT_METHOD(int, Ap::rssi(), int val,
- wifi_manager_ap_get_rssi(handle, &val), val)
-IMPLEMENT_METHOD(wifi_manager_rssi_level_e, Ap::rssiLevel(),
- wifi_manager_rssi_level_e val,
- wifi_manager_ap_get_rssi_level(handle, &val), val)
-IMPLEMENT_METHOD(int, Ap::frequency(), int val,
- wifi_manager_ap_get_frequency(handle, &val), val)
-IMPLEMENT_METHOD(int, Ap::maxSpeed(), int val,
- wifi_manager_ap_get_max_speed(handle, &val), val)
-IMPLEMENT_METHOD(bool, Ap::isFavourite(), bool val,
- wifi_manager_ap_is_favorite(handle, &val), val)
-IMPLEMENT_METHOD(bool, Ap::isPasspoint(), bool val,
- wifi_manager_ap_is_passpoint(handle, &val), val)
-IMPLEMENT_METHOD(wifi_manager_connection_state_e, Ap::connectionState(),
- wifi_manager_connection_state_e val,
- wifi_manager_ap_get_connection_state(handle, &val), val)
-
-IMPLEMENT_METHOD(std::vector<std::string>, Ap::ipv6Addresses(),
- std::vector<std::string> ret;
- , wifi_manager_ap_foreach_ipv6_address(
- handle,
- [](char *ipv6address, void *user_data) -> bool {
- std::vector<std::string> *ret =
- static_cast<std::vector<std::string> *>(user_data);
- ret->push_back(ipv6address);
- return true;
- },
- &ret),
- ret)
-
-IMPLEMENT_METHOD(wifi_manager_disconnect_reason_e, Ap::disconnectReason(),
- wifi_manager_disconnect_reason_e val,
- wifi_manager_ap_get_disconnect_reason(handle, &val), val)
-IMPLEMENT_METHOD(wifi_manager_error_e, Ap::getErrorState(),
- wifi_manager_error_e val,
- wifi_manager_ap_get_error_state(handle, &val), val)
-IMPLEMENT_METHOD(wifi_manager_assoc_status_code_e, Ap::assocStatusCode(),
- wifi_manager_assoc_status_code_e val,
- wifi_manager_ap_get_assoc_status_code(handle, &val), val)
-
-IMPLEMENT_METHOD(
- std::vector<std::vector<unsigned char>>, Ap::vises(),
- std::vector<std::vector<unsigned char>> ret,
- wifi_manager_ap_foreach_vsie(
- handle,
- [](unsigned char *vsie, int length, void *user_data) -> bool {
- std::vector<std::vector<unsigned char>> *ret =
- static_cast<std::vector<std::vector<unsigned char>> *>(user_data);
- std::vector<unsigned char> elem(vsie, vsie + length);
- ret->push_back(elem);
- return true;
- },
- &ret),
- ret)
-
-IMPLEMENT_METHOD(std::string, Ap::countryCode(), char *val,
- wifi_manager_ap_get_countrycode(handle, &val), val)
-
-IMPLEMENT_METHOD(std::vector<BssidInfo>, Ap::foundBssids(),
- std::vector<BssidInfo> ret,
- wifi_manager_foreach_found_bssid(
- handle,
- [](const char *bssid, int rssi, int freq,
- void *user_data) -> bool {
- std::vector<BssidInfo> *ret =
- static_cast<std::vector<BssidInfo> *>(user_data);
- BssidInfo info = {bssid, rssi, freq};
- ret->push_back(info);
- return true;
- },
- &ret),
- ret)
-
-// Security
-IMPLEMENT_METHOD(wifi_manager_security_type_e, Ap::securityType(),
- wifi_manager_security_type_e val,
- wifi_manager_ap_get_security_type(handle, &val), val)
-IMPLEMENT_METHOD(void, Ap::setSecurityType(wifi_manager_security_type_e val), ,
- wifi_manager_ap_set_security_type(handle, val), )
-IMPLEMENT_METHOD(wifi_manager_encryption_type_e, Ap::encryptionType(),
- wifi_manager_encryption_type_e val,
- wifi_manager_ap_get_encryption_type(handle, &val), val)
-IMPLEMENT_METHOD(void, Ap::setSecurityType(wifi_manager_encryption_type_e val),
- , wifi_manager_ap_set_encryption_type(handle, val), )
-IMPLEMENT_METHOD(bool, Ap::isPassphraseRequired(), bool val,
- wifi_manager_ap_is_passphrase_required(handle, &val), val)
-IMPLEMENT_METHOD(void, Ap::setPassphrase(const std::string &val), ,
- wifi_manager_ap_set_passphrase(handle, val.c_str()), )
-IMPLEMENT_METHOD(bool, Ap::isWpsSupported(), bool val,
- wifi_manager_ap_is_wps_supported(handle, &val), val)
-
-// Security - Eap
-IMPLEMENT_METHOD(void, Ap::setEapPassphrase(const std::string &username,
- const std::string &passphrase),
- , wifi_manager_ap_set_eap_passphrase(handle, username.c_str(),
- passphrase.c_str()), )
-IMPLEMENT_METHOD(EapPassphraseInfo, Ap::eapPassphrase(), EapPassphraseInfo ret;
- char *val; bool is_set;
- , wifi_manager_ap_get_eap_passphrase(handle, &val, &is_set),
- (EapPassphraseInfo{wrapMallocString(val), is_set}))
-IMPLEMENT_METHOD(void, Ap::setEapCACertFile(const std::string &filepath), ,
- wifi_manager_ap_set_eap_ca_cert_file(handle,
- filepath.c_str()), )
-IMPLEMENT_METHOD(std::string, Ap::eapCACertFile(), char *val,
- wifi_manager_ap_get_eap_ca_cert_file(handle, &val),
- wrapMallocString(val))
-IMPLEMENT_METHOD(void, Ap::setEapClientCertFile(const std::string &filepath), ,
- wifi_manager_ap_set_eap_client_cert_file(handle,
- filepath.c_str()), )
-IMPLEMENT_METHOD(std::string, Ap::eapClientCertFile(), char *val,
- wifi_manager_ap_get_eap_client_cert_file(handle, &val),
- wrapMallocString(val))
-IMPLEMENT_METHOD(std::string, Ap::eapPrivateKeyFile(), char *val,
- wifi_manager_ap_get_eap_private_key_file(handle, &val),
- wrapMallocString(val))
-IMPLEMENT_METHOD(void, Ap::setEapPrivateKeyInfo(const std::string &file,
- const std::string &password),
- ,
- wifi_manager_ap_set_eap_private_key_info(handle, file.c_str(),
- password.c_str()), )
-IMPLEMENT_METHOD(wifi_manager_eap_type_e, Ap::eapType(),
- wifi_manager_eap_type_e val,
- wifi_manager_ap_get_eap_type(handle, &val), val)
-IMPLEMENT_METHOD(void, Ap::setEapType(wifi_manager_eap_type_e type), ,
- wifi_manager_ap_set_eap_type(handle, type), )
-IMPLEMENT_METHOD(wifi_manager_eap_auth_type_e, Ap::eapAuthType(),
- wifi_manager_eap_auth_type_e val,
- wifi_manager_ap_get_eap_auth_type(handle, &val), val)
-IMPLEMENT_METHOD(void, Ap::setEapAuthType(wifi_manager_eap_auth_type_e type), ,
- wifi_manager_ap_set_eap_auth_type(handle, type), )
-IMPLEMENT_METHOD(wifi_manager_ip_config_type_e, Ap::config(wifi_manager_address_family_e af),
- wifi_manager_ip_config_type_e val,
- wifi_manager_ap_get_ip_config_type(handle, af, &val),
- val)
-IMPLEMENT_METHOD(void, Ap::setConfig(wifi_manager_address_family_e af, wifi_manager_ip_config_type_e type), ,
- wifi_manager_ap_set_ip_config_type(handle, af, type), )
-
-IMPLEMENT_METHOD(std::string, Ap::address(wifi_manager_address_family_e af), char *ret,
- wifi_manager_ap_get_ip_address(handle, af, &ret), wrapMallocString(ret))
-IMPLEMENT_METHOD(void, Ap::setAddress(wifi_manager_address_family_e af, const std::string& addr), ,
- wifi_manager_ap_set_ip_address(handle, af, addr.c_str()), )
-
-IMPLEMENT_METHOD(std::string, Ap::subnetMask(wifi_manager_address_family_e af), char *ret,
- wifi_manager_ap_get_subnet_mask(handle, af, &ret), wrapMallocString(ret))
-IMPLEMENT_METHOD(void, Ap::setSubnetMask(wifi_manager_address_family_e af, const std::string& addr), ,
- wifi_manager_ap_set_subnet_mask(handle, af, addr.c_str()), )
-
-IMPLEMENT_METHOD(std::string, Ap::gatewayAddress(wifi_manager_address_family_e af), char *ret,
- wifi_manager_ap_get_gateway_address(handle, af, &ret), wrapMallocString(ret))
-IMPLEMENT_METHOD(void, Ap::setGatewayAddress(wifi_manager_address_family_e af, const std::string& addr), ,
- wifi_manager_ap_set_gateway_address(handle, af, addr.c_str()), )
-
-IMPLEMENT_METHOD(std::string, Ap::dhcpServerAddress(wifi_manager_address_family_e af), char *ret,
- wifi_manager_ap_get_dhcp_server_address(handle, af, &ret), wrapMallocString(ret))
-
-IMPLEMENT_METHOD(std::chrono::seconds, Ap::dhcpServerLeaseDuration(wifi_manager_address_family_e af), int ret,
- wifi_manager_ap_get_dhcp_lease_duration(handle, af, &ret), std::chrono::seconds(ret))
-
-IMPLEMENT_METHOD(std::string, Ap::proxyAddress(wifi_manager_address_family_e af), char *ret,
- wifi_manager_ap_get_proxy_address(handle, af, &ret), wrapMallocString(ret))
-IMPLEMENT_METHOD(void, Ap::setProxyAddress(wifi_manager_address_family_e af, const std::string& addr), ,
- wifi_manager_ap_set_proxy_address(handle, af, addr.c_str()), )
-
-IMPLEMENT_METHOD(wifi_manager_proxy_type_e, Ap::proxyType(), wifi_manager_proxy_type_e ret,
- wifi_manager_ap_get_proxy_type(handle, &ret), ret)
-IMPLEMENT_METHOD(void, Ap::setProxyType(wifi_manager_proxy_type_e type), ,
- wifi_manager_ap_set_proxy_type(handle, type),)
-
-IMPLEMENT_METHOD(std::string, Ap::dnsAddress(int order, wifi_manager_address_family_e af), char *ret,
- wifi_manager_ap_get_dns_address(handle, order, af, &ret), wrapMallocString(ret))
-IMPLEMENT_METHOD(void, Ap::setDnsAddress(int order, wifi_manager_address_family_e af, const std::string& addr), ,
- wifi_manager_ap_set_dns_address(handle, order, af, addr.c_str()), )
-
-IMPLEMENT_METHOD(wifi_manager_dns_config_type_e, Ap::dnsConfigType(wifi_manager_address_family_e af), wifi_manager_dns_config_type_e ret,
- wifi_manager_ap_get_dns_config_type(handle, af, &ret), ret)
-IMPLEMENT_METHOD(void, Ap::setDnsConfigType(wifi_manager_address_family_e af, wifi_manager_dns_config_type_e type), ,
- wifi_manager_ap_set_dns_config_type(handle, af, type),)
-
-IMPLEMENT_METHOD(int, Ap::prefixLength(wifi_manager_address_family_e af), int ret,
- wifi_manager_ap_get_prefix_length(handle, af, &ret), ret)
-IMPLEMENT_METHOD(void, Ap::setPrefixLength(wifi_manager_address_family_e af, int len), ,
- wifi_manager_ap_set_prefix_length(handle, af, len),)
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 AP_H
-#define AP_H
-
-#include <chrono>
-#include <memory>
-#include <string>
-#include <vector>
-#include <wifi-manager.h>
-
-#include "tizen/ApiResult.hpp"
-#include "tizen/ApiUtils.hpp"
-#include "tizen/Strings.hpp"
-#include "tizen/network/wifi/Exception.hpp"
-
-namespace tizen {
-namespace network {
-namespace wifi {
-
-class Manager;
-
-struct EapPassphraseInfo {
- std::string username;
- bool is_password_set;
-};
-
-struct BssidInfo {
- std::string bssid;
- int rssi;
- int frequency;
-};
-
-class Ap {
-public:
- Ap();
- Ap(const Ap &ap);
- Ap &operator=(const Ap &ap);
- Ap(Ap &&ap);
- Ap &operator=(Ap &&ap);
- ~Ap();
-
- ApiResult<std::string> essid();
- ApiResult<std::string> rawSsid();
- ApiResult<std::string> bssid();
- ApiResult<int> rssi();
- ApiResult<wifi_manager_rssi_level_e> rssiLevel();
- ApiResult<int> frequency();
- ApiResult<int> maxSpeed();
- ApiResult<bool> isFavourite();
- ApiResult<bool> isPasspoint();
- ApiResult<wifi_manager_connection_state_e> connectionState();
- ApiResult<wifi_manager_ip_config_type_e> config(wifi_manager_address_family_e);
- ApiResult<void> setConfig(wifi_manager_address_family_e, wifi_manager_ip_config_type_e);
- ApiResult<std::string> address(wifi_manager_address_family_e);
- ApiResult<void> setAddress(wifi_manager_address_family_e, const std::string&);
- ApiResult<std::string> subnetMask(wifi_manager_address_family_e);
- ApiResult<void> setSubnetMask(wifi_manager_address_family_e, const std::string&);
-
- ApiResult<std::string> gatewayAddress(wifi_manager_address_family_e);
- ApiResult<void> setGatewayAddress(wifi_manager_address_family_e, const std::string&);
-
- ApiResult<std::string> dhcpServerAddress(wifi_manager_address_family_e);
- ApiResult<std::chrono::seconds> dhcpServerLeaseDuration(wifi_manager_address_family_e);
-
- ApiResult<std::string> proxyAddress(wifi_manager_address_family_e);
- ApiResult<void> setProxyAddress(wifi_manager_address_family_e, const std::string&);
-
- ApiResult<wifi_manager_proxy_type_e> proxyType();
- ApiResult<void> setProxyType(wifi_manager_proxy_type_e);
-
- ApiResult<std::string> dnsAddress(int order, wifi_manager_address_family_e);
- ApiResult<void> setDnsAddress(int order, wifi_manager_address_family_e, const std::string&);
-
- ApiResult<wifi_manager_dns_config_type_e> dnsConfigType(wifi_manager_address_family_e);
- ApiResult<void> setDnsConfigType(wifi_manager_address_family_e, wifi_manager_dns_config_type_e);
-
- ApiResult<int> prefixLength(wifi_manager_address_family_e);
- ApiResult<void> setPrefixLength(wifi_manager_address_family_e, int);
-
- ApiResult<std::vector<std::string>> ipv6Addresses();
- ApiResult<wifi_manager_disconnect_reason_e> disconnectReason();
- ApiResult<wifi_manager_error_e> getErrorState();
- ApiResult<wifi_manager_assoc_status_code_e> assocStatusCode();
- ApiResult<std::vector<std::vector<unsigned char>>> vises();
- ApiResult<std::string> countryCode();
-
- ApiResult<std::vector<BssidInfo>> foundBssids();
-
- // Security
- ApiResult<wifi_manager_security_type_e> securityType();
- ApiResult<void> setSecurityType(wifi_manager_security_type_e val);
- ApiResult<wifi_manager_encryption_type_e> encryptionType();
- ApiResult<void> setSecurityType(wifi_manager_encryption_type_e val);
- ApiResult<bool> isPassphraseRequired();
- ApiResult<void> setPassphrase(const std::string &val);
- ApiResult<bool> isWpsSupported();
- // Security - Eap
- ApiResult<void> setEapPassphrase(const std::string &username,
- const std::string &passphrase);
-
- ApiResult<EapPassphraseInfo> eapPassphrase();
- ApiResult<void> setEapCACertFile(const std::string &filepath);
-
- ApiResult<std::string> eapCACertFile();
- ApiResult<void> setEapClientCertFile(const std::string &filepath);
- ApiResult<std::string> eapClientCertFile();
- ApiResult<std::string> eapPrivateKeyFile();
- ApiResult<void> setEapPrivateKeyInfo(const std::string &file,
- const std::string &password);
- ApiResult<wifi_manager_eap_type_e> eapType();
- ApiResult<void> setEapType(wifi_manager_eap_type_e type);
- ApiResult<wifi_manager_eap_auth_type_e> eapAuthType();
- ApiResult<void> setEapAuthType(wifi_manager_eap_auth_type_e type);
-
-private:
- Ap(wifi_manager_ap_h ap);
-
- wifi_manager_ap_h handle = nullptr;
-
- friend tizen::network::wifi::Manager;
-};
-
-} /* wifi */
-} /* network */
-} /* tizen */
-
-#endif /* AP_H */
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 TIZEN_NETWORK_WIFI_EXCEPTION_H
-#define TIZEN_NETWORK_WIFI_EXCEPTION_H
-
-#include <stdexcept>
-#include <tizen.h>
-
-namespace tizen {
-namespace network {
-namespace wifi {
-
-class WifiException : public std::runtime_error {
-public:
- WifiException(int err) : std::runtime_error(get_error_message(err)) {}
- virtual ~WifiException() = default;
-
-private:
-};
-
-} /* wifi */
-} /* network */
-} /* tizen */
-
-#endif /* TIZEN_NETWORK_WIFI_EXCEPTION_H */
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "Manager.hpp"
-#include "tizen/ApiUtils.hpp"
-
-#include <tizen/network/wifi/Exception.hpp>
-
-using namespace tizen;
-using namespace tizen::network::wifi;
-
-Manager::Manager() {
- wifi_manager_h hdl;
-
- int err = wifi_manager_initialize(&hdl);
- if (err != TIZEN_ERROR_NONE) {
- throw WifiException(err);
- }
- handle = hdl;
-}
-
-Manager::~Manager() { wifi_manager_deinitialize(handle); }
-
-void Manager::connected_static_callback(wifi_manager_error_e err,
- void *user_data) {
- Manager *manager = static_cast<Manager *>(user_data);
- if (manager->connected_cb)
- manager->connected_cb(err);
-}
-
-void Manager::disconnected_static_callback(wifi_manager_error_e err,
- void *user_data) {
- Manager *manager = static_cast<Manager *>(user_data);
- if (manager->disconnected_cb)
- manager->disconnected_cb(err);
-}
-
-void Manager::activated_static_callback(wifi_manager_error_e err,
- void *user_data) {
- Manager *manager = static_cast<Manager *>(user_data);
- if (manager->activate_cb)
- manager->activate_cb(err);
-}
-
-void Manager::deactivated_static_callback(wifi_manager_error_e err,
- void *user_data) {
- Manager *manager = static_cast<Manager *>(user_data);
- if (manager->deactivate_cb)
- manager->deactivate_cb(err);
-}
-
-void Manager::forget_ap_static_callback(wifi_manager_error_e err,
- void *user_data) {
- Manager *manager = static_cast<Manager *>(user_data);
- if (manager->forget_ap_cb)
- manager->forget_ap_cb(err);
-}
-
-void Manager::scan_static_callback(wifi_manager_error_e err, void *user_data) {
- Manager *manager = static_cast<Manager *>(user_data);
- if (manager->scan_finished_cb)
- manager->scan_finished_cb(err);
-}
-
-void Manager::scan_specific_static_callback(wifi_manager_error_e err,
- void *user_data) {
- Manager *manager = static_cast<Manager *>(user_data);
- if (manager->scan_specific_finished_cb)
- manager->scan_specific_finished_cb(err);
-}
-
-void Manager::multi_scan_static_callback(wifi_manager_error_e err,
- void *user_data) {
- Manager *manager = static_cast<Manager *>(user_data);
- if (manager->multi_scan_finished_cb)
- manager->multi_scan_finished_cb(err);
-}
-
-void Manager::bssid_scan_static_callback(wifi_manager_error_e err,
- void *user_data) {
- Manager *manager = static_cast<Manager *>(user_data);
- if (manager->bssid_scan_finished_cb)
- manager->bssid_scan_finished_cb(err);
-}
-
-bool Manager::ap_iterator(wifi_manager_ap_h ap, void *user_data) {
- auto *aps = static_cast<std::vector<Ap> *>(user_data);
- wifi_manager_ap_h cloned;
- int err = wifi_manager_ap_clone(&cloned, ap);
- if (err == TIZEN_ERROR_NONE) {
- aps->push_back(Ap{cloned});
- }
- return true;
-}
-
-void Manager::device_state_changed_static_callback(
- wifi_manager_device_state_e state, void *user_data) {
- Manager *manager = static_cast<Manager *>(user_data);
- if (manager->device_state_changed_cb)
- manager->device_state_changed_cb(state);
-}
-
-void Manager::background_scan_finished_static_callback(wifi_manager_error_e err,
- void *user_data) {
- Manager *manager = static_cast<Manager *>(user_data);
- if (manager->background_scan_finished_cb)
- manager->background_scan_finished_cb(err);
-}
-
-void Manager::scan_state_changed_static_callback(
- wifi_manager_scan_state_e state, void *user_data) {
- Manager *manager = static_cast<Manager *>(user_data);
- if (manager->scan_state_changed_cb)
- manager->scan_state_changed_cb(state);
-}
-
-void Manager::connection_state_changed_static_callback(
- wifi_manager_connection_state_e state, wifi_manager_ap_h ap,
- void *user_data) {
- Manager *manager = static_cast<Manager *>(user_data);
- Ap access_point(ap);
- if (manager->connection_state_changed_cb)
- manager->connection_state_changed_cb(state, access_point);
-}
-
-void Manager::rssi_level_changed_static_callback(
- wifi_manager_rssi_level_e level, void *user_data) {
- Manager *manager = static_cast<Manager *>(user_data);
- if (manager->rssi_level_changed_cb)
- manager->rssi_level_changed_cb(level);
-}
-
-void Manager::module_state_changed_static_callback(
- wifi_manager_module_state_e state, void *user_data) {
- Manager *manager = static_cast<Manager *>(user_data);
- if (manager->module_state_changed_cb)
- manager->module_state_changed_cb(state);
-}
-
-void Manager::setActivatedCallback(ActivateCallback callback) {
- activate_cb = callback;
-}
-
-void Manager::setDeactivatedCallback(DeactivateCallback callback) {
- deactivate_cb = callback;
-}
-
-void Manager::setScanFinishedCallback(ScanFinishedCallback callback) {
- scan_finished_cb = callback;
-}
-
-void Manager::setScanSpecificFinishedCallback(ScanFinishedCallback callback) {
- scan_specific_finished_cb = callback;
-}
-
-void Manager::setMultiScanFinishedCallback(ScanFinishedCallback callback) {
- multi_scan_finished_cb = callback;
-}
-
-void Manager::setConnectedCallback(ConnectedCallback callback) {
- connected_cb = callback;
-}
-
-void Manager::setDisconnectedCallback(DisconnectedCallback callback) {
- disconnected_cb = callback;
-}
-
-void Manager::setForgetApCallback(ForgetApCallback callback) {
- forget_ap_cb = callback;
-}
-
-void Manager::setBssidScanFinishedCallback(ScanFinishedCallback callback) {
- bssid_scan_finished_cb = callback;
-}
-
-Ap Manager::create_ap(const std::string &essid) {
- wifi_manager_ap_h aphandle;
- int err = wifi_manager_ap_create(handle, essid.c_str(), &aphandle);
- if (err != TIZEN_ERROR_NONE) {
- throw WifiException(err);
- }
-
- return Ap{aphandle};
-}
-
-Ap Manager::create_hidden_ap(const std::string &essid) {
- wifi_manager_ap_h aphandle;
- int err = wifi_manager_ap_hidden_create(handle, essid.c_str(), &aphandle);
- if (err != TIZEN_ERROR_NONE) {
- throw WifiException(err);
- }
- return Ap{aphandle};
-}
-
-IMPLEMENT_METHOD(void, Manager::activate(), ,
- wifi_manager_activate(handle, activated_static_callback,
- this), )
-IMPLEMENT_METHOD(void, Manager::activateWithPickerTested(), ,
- wifi_manager_activate_with_wifi_picker_tested(
- handle, activated_static_callback, this), )
-IMPLEMENT_METHOD(void, Manager::deactivate(), ,
- wifi_manager_deactivate(handle, deactivated_static_callback,
- this), )
-IMPLEMENT_METHOD(bool, Manager::activated(), bool activated,
- wifi_manager_is_activated(handle, &activated), activated)
-IMPLEMENT_METHOD(std::string, Manager::macAddress(), char *str,
- wifi_manager_get_mac_address(handle, &str),
- wrapMallocString(str))
-IMPLEMENT_METHOD(std::string, Manager::networkInterfaceName(), char *str,
- wifi_manager_get_network_interface_name(handle, &str),
- wrapMallocString(str))
-IMPLEMENT_METHOD(void, Manager::scan(), ,
- wifi_manager_scan(handle, scan_static_callback, this), )
-IMPLEMENT_METHOD(wifi_manager_scan_state_e, Manager::scanState(),
- wifi_manager_scan_state_e ret,
- wifi_manager_get_scan_state(handle, &ret), ret)
-IMPLEMENT_METHOD(void, Manager::scanSpecificAp(const std::string &essid), ,
- wifi_manager_scan_specific_ap(handle, essid.c_str(),
- scan_specific_static_callback,
- this), )
-IMPLEMENT_METHOD(SpecificScan, Manager::specificScanCreate(),
- wifi_manager_specific_scan_h sscan,
- wifi_manager_specific_scan_create(handle, &sscan),
- (SpecificScan{handle, sscan}))
-IMPLEMENT_METHOD(void, Manager::multiScan(SpecificScan &sscan), ,
- wifi_manager_specific_ap_start_multi_scan(
- handle, sscan.handle, multi_scan_static_callback, this), )
-IMPLEMENT_METHOD(void, Manager::bssidScan(), ,
- wifi_manager_bssid_scan(handle, bssid_scan_static_callback,
- this), )
-IMPLEMENT_METHOD(void,
- Manager::connectHiddenAp(const std::string &essid,
- wifi_manager_security_type_e sec_type,
- const std::string &pass),
- , wifi_manager_connect_hidden_ap(handle, essid.c_str(),
- sec_type, pass.c_str(),
- connected_static_callback,
- this), )
-IMPLEMENT_METHOD(Ap, Manager::connectedAp(), wifi_manager_ap_h ap,
- wifi_manager_get_connected_ap(handle, &ap), Ap{ap})
-IMPLEMENT_METHOD(std::vector<Ap>, Manager::foundAps(), std::vector<Ap> aps,
- wifi_manager_foreach_found_ap(handle, ap_iterator, &aps), aps)
-IMPLEMENT_METHOD(
- std::vector<Ap>, Manager::specificFoundAps(), std::vector<Ap> aps,
- wifi_manager_foreach_found_specific_ap(handle, ap_iterator, &aps), aps)
-IMPLEMENT_METHOD(std::vector<Ap>, Manager::foundBssidAps(), std::vector<Ap> aps,
- wifi_manager_foreach_found_bssid_ap(handle, ap_iterator, &aps),
- aps)
-IMPLEMENT_METHOD(void, Manager::connect(Ap &ap), ,
- wifi_manager_connect(handle, ap.handle,
- connected_static_callback, this), )
-IMPLEMENT_METHOD(void, Manager::disconnect(Ap &ap), ,
- wifi_manager_disconnect(handle, ap.handle,
- disconnected_static_callback, this), )
-IMPLEMENT_METHOD(void, Manager::connectByWpsPbc(Ap &ap), ,
- wifi_manager_connect_by_wps_pbc(handle, ap.handle,
- connected_static_callback,
- this), )
-IMPLEMENT_METHOD(void, Manager::connectByWpsPin(Ap &ap, const std::string &pin),
- ,
- wifi_manager_connect_by_wps_pin(handle, ap.handle, pin.c_str(),
- connected_static_callback,
- this), )
-IMPLEMENT_METHOD(void, Manager::connectByWpsPbcWithoutSsid(), ,
- wifi_manager_connect_by_wps_pbc_without_ssid(
- handle, connected_static_callback, this), )
-IMPLEMENT_METHOD(void,
- Manager::connectByWpsPinWithoutSsid(const std::string &pin), ,
- wifi_manager_connect_by_wps_pin_without_ssid(
- handle, pin.c_str(), connected_static_callback, this), )
-IMPLEMENT_METHOD(void, Manager::cancelWps(), ,
- wifi_manager_cancel_wps(handle), )
-IMPLEMENT_METHOD(std::string, Manager::wpsGeneratedPin(), char *ret,
- wifi_manager_get_wps_generated_pin(handle, &ret),
- wrapMallocString(ret))
-IMPLEMENT_METHOD(void, Manager::forgetAp(Ap &ap), ,
- wifi_manager_forget_ap(handle, ap.handle), )
-IMPLEMENT_METHOD(void, Manager::forgetApAsync(Ap &ap), ,
- wifi_manager_forget_ap_async(handle, ap.handle,
- forget_ap_static_callback,
- this), )
-IMPLEMENT_METHOD(void, Manager::addVsie(wifi_manager_vsie_frames_e id,
- const std::string &payload),
- , wifi_manager_add_vsie(handle, id, payload.c_str()), )
-IMPLEMENT_METHOD(std::string, Manager::getVsie(wifi_manager_vsie_frames_e id),
- char *ret, wifi_manager_get_vsie(handle, id, &ret),
- wrapMallocString(ret))
-IMPLEMENT_METHOD(void, Manager::removeVsie(wifi_manager_vsie_frames_e id,
- const std::string &payload),
- , wifi_manager_remove_vsie(handle, id, payload.c_str()), )
-
-// monitor
-IMPLEMENT_METHOD(wifi_manager_connection_state_e, Manager::connectionState(),
- wifi_manager_connection_state_e ret,
- wifi_manager_get_connection_state(handle, &ret), ret)
-
-#define IMPLEMENT_CALLBACK_SETTER(prototype, setter, unsetter, field) \
- ApiResult<void> prototype { \
- int err; \
- if (callback) { \
- err = setter; \
- } else { \
- err = unsetter; \
- } \
- if (err != TIZEN_ERROR_NONE) { \
- field = callback; \
- return ApiResult<void>::Ok(); \
- } else { \
- return ApiResult<void>::Error(err); \
- } \
- }
-
-IMPLEMENT_CALLBACK_SETTER(
- Manager::setDeviceStateChangedCallback(DeviceStateChangedCallback callback),
- wifi_manager_set_device_state_changed_cb(
- handle, device_state_changed_static_callback, this),
- wifi_manager_unset_device_state_changed_cb(handle), device_state_changed_cb)
-
-IMPLEMENT_CALLBACK_SETTER(
- Manager::setBackgroundScanFinishedCallback(ScanFinishedCallback callback),
- wifi_manager_set_background_scan_cb(
- handle, background_scan_finished_static_callback, this),
- wifi_manager_unset_background_scan_cb(handle), background_scan_finished_cb)
-
-IMPLEMENT_CALLBACK_SETTER(
- Manager::setScanStateChangedCallback(ScanStateChangedCallback callback),
- wifi_manager_set_scan_state_changed_cb(handle,
- scan_state_changed_static_callback,
- this),
- wifi_manager_unset_scan_state_changed_cb(handle), scan_state_changed_cb)
-
-IMPLEMENT_CALLBACK_SETTER(
- Manager::setConnectionStateChangedCallback(
- ConnectionStateChangedCallback callback),
- wifi_manager_set_connection_state_changed_cb(
- handle, connection_state_changed_static_callback, this),
- wifi_manager_unset_connection_state_changed_cb(handle),
- connection_state_changed_cb)
-
-IMPLEMENT_CALLBACK_SETTER(
- Manager::setRssiLevelChangedCallback(RssiLevelChangedCallback callback),
- wifi_manager_set_rssi_level_changed_cb(handle,
- rssi_level_changed_static_callback,
- this),
- wifi_manager_unset_rssi_level_changed_cb(handle), rssi_level_changed_cb)
-
-IMPLEMENT_CALLBACK_SETTER(
- Manager::setModuleStateChangedCallback(ModuleStateChangedCallback callback),
- wifi_manager_set_module_state_changed_cb(
- handle, module_state_changed_static_callback, this),
- wifi_manager_unset_module_state_changed_cb(handle), module_state_changed_cb)
-
-IMPLEMENT_METHOD(wifi_manager_module_state_e, Manager::moduleState(),
- wifi_manager_module_state_e ret,
- wifi_manager_get_module_state(handle, &ret), ret)
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 TIZEN_NETWORK_WIFI_MANAGER_H
-#define TIZEN_NETWORK_WIFI_MANAGER_H
-
-#include <memory>
-#include <vector>
-
-#include <wifi-manager.h>
-
-#include "tizen/ApiResult.hpp"
-#include "tizen/network/wifi/Ap.hpp"
-#include "tizen/network/wifi/Exception.hpp"
-#include "tizen/network/wifi/SpecificScan.hpp"
-
-namespace tizen {
-namespace network {
-namespace wifi {
-
-class Ap;
-class SpecificScan;
-
-class Manager {
-public:
- Manager();
- ~Manager();
- Manager(const Manager &) = delete;
- Manager &operator=(const Manager &) = delete;
- Manager(Manager &&) = delete;
- Manager &operator=(Manager &&) = delete;
-
- using ActivateCallback = std::function<void(wifi_manager_error_e)>;
- using DeactivateCallback = std::function<void(wifi_manager_error_e)>;
- using ScanFinishedCallback = std::function<void(wifi_manager_error_e)>;
- using ConnectedCallback = std::function<void(wifi_manager_error_e)>;
- using DisconnectedCallback = std::function<void(wifi_manager_error_e)>;
- using ForgetApCallback = std::function<void(wifi_manager_error_e)>;
-
- // management
-
- ApiResult<void> activate();
- ApiResult<void> activateWithPickerTested();
- ApiResult<void> deactivate();
- ApiResult<bool> activated();
-
- ApiResult<std::string> macAddress();
- ApiResult<std::string> networkInterfaceName();
-
- // TODO write what callbacks will be triggered after each call
- ApiResult<void> scan();
- ApiResult<wifi_manager_scan_state_e> scanState();
- ApiResult<void> scanSpecificAp(const std::string &essid);
- ApiResult<SpecificScan> specificScanCreate();
- ApiResult<void> multiScan(SpecificScan &scan);
- ApiResult<void> bssidScan();
-
- ApiResult<void> connectHiddenAp(const std::string &essid,
- wifi_manager_security_type_e sec_type,
- const std::string &pass);
- ApiResult<Ap> connectedAp();
-
- ApiResult<std::vector<Ap>> foundAps();
- ApiResult<std::vector<Ap>> specificFoundAps();
- ApiResult<std::vector<Ap>> foundBssidAps();
-
- ApiResult<void> connect(Ap &ap);
- ApiResult<void> disconnect(Ap &ap);
- ApiResult<void> connectByWpsPbc(Ap &ap);
- ApiResult<void> connectByWpsPin(Ap &ap, const std::string &pin);
- ApiResult<void> connectByWpsPbcWithoutSsid();
- ApiResult<void> connectByWpsPinWithoutSsid(const std::string &pin);
- ApiResult<void> cancelWps();
- ApiResult<std::string> wpsGeneratedPin();
- ApiResult<void> forgetAp(Ap &ap);
- ApiResult<void> forgetApAsync(Ap &ap);
- ApiResult<void> addVsie(wifi_manager_vsie_frames_e id,
- const std::string &payload);
- ApiResult<std::string> getVsie(wifi_manager_vsie_frames_e id);
- ApiResult<void> removeVsie(wifi_manager_vsie_frames_e id,
- const std::string &payload);
-
- void setActivatedCallback(ActivateCallback callback);
- void setDeactivatedCallback(DeactivateCallback callback);
- void setScanFinishedCallback(ScanFinishedCallback callback);
- void setScanSpecificFinishedCallback(ScanFinishedCallback callback);
- void setMultiScanFinishedCallback(ScanFinishedCallback callback);
- void setConnectedCallback(ConnectedCallback callback);
- void setDisconnectedCallback(DisconnectedCallback callback);
- void setForgetApCallback(ForgetApCallback callback);
- void setBssidScanFinishedCallback(ScanFinishedCallback callback);
-
- Ap create_ap(const std::string &essid);
- Ap create_hidden_ap(const std::string &essid);
-
- // monitor
-
- using DeviceStateChangedCallback =
- std::function<void(wifi_manager_device_state_e)>;
- using ScanStateChangedCallback =
- std::function<void(wifi_manager_scan_state_e)>;
- using ConnectionStateChangedCallback =
- std::function<void(wifi_manager_connection_state_e, const Ap &)>;
- using RssiLevelChangedCallback =
- std::function<void(wifi_manager_rssi_level_e)>;
- using ModuleStateChangedCallback =
- std::function<void(wifi_manager_module_state_e)>;
-
- ApiResult<wifi_manager_connection_state_e> connectionState();
- ApiResult<void>
- setDeviceStateChangedCallback(DeviceStateChangedCallback callback);
- ApiResult<void>
- setBackgroundScanFinishedCallback(ScanFinishedCallback callback);
- ApiResult<void>
- setScanStateChangedCallback(ScanStateChangedCallback callback);
- ApiResult<void>
- setConnectionStateChangedCallback(ConnectionStateChangedCallback callback);
- ApiResult<void>
- setRssiLevelChangedCallback(RssiLevelChangedCallback callback);
- ApiResult<void>
- setModuleStateChangedCallback(ModuleStateChangedCallback callback);
- ApiResult<wifi_manager_module_state_e> moduleState();
-
-private:
- ActivateCallback activate_cb;
- DeactivateCallback deactivate_cb;
-
- ScanFinishedCallback scan_finished_cb;
- ScanFinishedCallback scan_specific_finished_cb;
- ScanFinishedCallback multi_scan_finished_cb;
- ScanFinishedCallback bssid_scan_finished_cb;
-
- ConnectedCallback connected_cb;
- DisconnectedCallback disconnected_cb;
- ForgetApCallback forget_ap_cb;
-
- DeviceStateChangedCallback device_state_changed_cb;
- ScanFinishedCallback background_scan_finished_cb;
- ScanStateChangedCallback scan_state_changed_cb;
- ConnectionStateChangedCallback connection_state_changed_cb;
- RssiLevelChangedCallback rssi_level_changed_cb;
- ModuleStateChangedCallback module_state_changed_cb;
-
- static void activated_static_callback(wifi_manager_error_e err,
- void *user_data);
- static void deactivated_static_callback(wifi_manager_error_e err,
- void *user_data);
- static void connected_static_callback(wifi_manager_error_e err,
- void *user_data);
- static void disconnected_static_callback(wifi_manager_error_e err,
- void *user_data);
- static void forget_ap_static_callback(wifi_manager_error_e err,
- void *user_data);
- static void scan_static_callback(wifi_manager_error_e err, void *user_data);
- static void scan_specific_static_callback(wifi_manager_error_e err,
- void *user_data);
- static void multi_scan_static_callback(wifi_manager_error_e err,
- void *user_data);
- static void bssid_scan_static_callback(wifi_manager_error_e err,
- void *user_data);
- static bool ap_iterator(wifi_manager_ap_h ap, void *user_data);
-
- static void
- device_state_changed_static_callback(wifi_manager_device_state_e state,
- void *user_data);
- static void background_scan_finished_static_callback(wifi_manager_error_e err,
- void *user_data);
- static void
- scan_state_changed_static_callback(wifi_manager_scan_state_e state,
- void *user_data);
- static void connection_state_changed_static_callback(
- wifi_manager_connection_state_e state, wifi_manager_ap_h ap,
- void *user_data);
- static void
- rssi_level_changed_static_callback(wifi_manager_rssi_level_e level,
- void *user_data);
- static void
- module_state_changed_static_callback(wifi_manager_module_state_e state,
- void *user_data);
-
- wifi_manager_h handle = nullptr;
-};
-
-} /* wifi */
-} /* network */
-} /* tizen */
-
-#endif /* TIZEN_NETWORK_WIFI_MANAGER_H */
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "tizen/network/wifi/SpecificScan.hpp"
-#include "tizen/ApiUtils.hpp"
-
-using namespace tizen::network::wifi;
-using namespace tizen;
-
-SpecificScan::SpecificScan(wifi_manager_h m, wifi_manager_specific_scan_h h)
- : handle(h), manager(m) {}
-
-SpecificScan::~SpecificScan() {
- wifi_manager_specific_scan_destroy(manager, handle);
-}
-
-SpecificScan::SpecificScan(SpecificScan &&ss) {
- std::swap(handle, ss.handle);
- std::swap(manager, ss.manager);
-}
-
-SpecificScan &SpecificScan::operator=(SpecificScan &&ss) {
- std::swap(handle, ss.handle);
- std::swap(manager, ss.manager);
- return *this;
-}
-
-IMPLEMENT_METHOD(void, SpecificScan::setSsid(const std::string &ssid), ,
- wifi_manager_specific_scan_set_ssid(handle, ssid.c_str()), )
-IMPLEMENT_METHOD(void, SpecificScan::setFreq(int freq), ,
- wifi_manager_specific_scan_set_freq(handle, freq), )
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 TIZEN_NETWORK_WIFI_SPECIFICSCAN_H
-#define TIZEN_NETWORK_WIFI_SPECIFICSCAN_H
-
-#include <tizen/ApiResult.hpp>
-#include <tizen/network/wifi/Manager.hpp>
-#include <wifi-manager.h>
-
-namespace tizen {
-namespace network {
-namespace wifi {
-
-class SpecificScan {
-public:
- SpecificScan() = default;
- ~SpecificScan();
- SpecificScan(const SpecificScan &) = delete;
- SpecificScan &operator=(const SpecificScan &) = delete;
- SpecificScan(SpecificScan &&);
- SpecificScan &operator=(SpecificScan &&);
-
- ApiResult<void> setSsid(const std::string &str);
- ApiResult<void> setFreq(int freq);
-
-private:
- SpecificScan(wifi_manager_h, wifi_manager_specific_scan_h);
-
- wifi_manager_specific_scan_h handle;
- wifi_manager_h manager;
- friend Manager;
-};
-
-} /* wifi */
-} /* network */
-} /* tizen */
-
-#endif /* TIZEN_NETWORK_WIFI_SPECIFICSCAN_H */
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "tizen/peripheral/gpio/GpioException.hpp"
-
-namespace tizen {
-namespace peripheral {
-namespace gpio {
-
- GpioException::GpioException(Error error, std::string message) : _error(error), _message(message)
- {
- }
-
- GpioException::~GpioException()
- {
-
- }
-
- const char *GpioException::what() const noexcept
- {
- return (_message + ":" + _error.message()).c_str();
- }
-
- Error GpioException::error() const
- {
- return _error;
- }
-} // gpio
-} // peripheral
-} // tizen
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 GPIO_EXCEPTION_H
-#define GPIO_EXCEPTION_H
-
-#include "tizen/Error.hpp"
-#include <exception>
-#include <string>
-
-namespace tizen {
-namespace peripheral {
-namespace gpio {
-
- class GpioException : public std::exception
- {
- public:
- GpioException(Error error, std::string message = "");
- ~GpioException();
-
- virtual const char *what() const noexcept override;
- Error error() const;
- private:
- Error _error;
- std::string _message;
- };
-} // gpio
-} // peripheral
-} // tizen
-
-
-#endif //GPIO_EXCEPTION_H
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "tizen/peripheral/gpio/Pin.hpp"
-#include "tizen/peripheral/gpio/GpioException.hpp"
-#include "tizen/Logger.hpp"
-
-namespace tizen {
-namespace peripheral {
-namespace gpio {
-
-Pin::Pin(unsigned int pinNumber, peripheral_gpio_direction_e direction) : _pinNnumber(pinNumber)
-{
- int err = peripheral_gpio_open(static_cast<int>(pinNumber), &_handle);
- if(err != PERIPHERAL_ERROR_NONE)
- {
- logger::Err("Failed to open pin %u (%d)", pinNumber, err);
- throw GpioException(err, "Failed to open pin " + std::to_string(pinNumber));
- }
- err = peripheral_gpio_set_direction(_handle, direction);
- if(err != PERIPHERAL_ERROR_NONE)
- {
- logger::Err("Failed to set direction %d for pin %u (%d)", direction, pinNumber, err);
- throw GpioException(err, "Failed to set direction " + std::to_string(direction) + " for pin " + std::to_string(pinNumber));
- }
-}
-
-Pin::~Pin()
-{
- if(_handle == nullptr)
- return;
-
- int err = peripheral_gpio_close(_handle);
- if(err != PERIPHERAL_ERROR_NONE)
- {
- logger::Err("Failed to close pin %u (%d)", _pinNnumber, err);
- }
-}
-
-Pin::Pin(Pin &&pin)
-{
- this->_pinNnumber = std::move(pin._pinNnumber);
- this->_interruptedCb = std::move(pin._interruptedCb);
- this->_handle = std::move(pin._handle);
- pin._handle = nullptr;
-}
-
-Pin& Pin::operator=(Pin &&pin)
-{
- this->_pinNnumber = std::move(pin._pinNnumber);
- this->_interruptedCb = std::move(pin._interruptedCb);
- this->_handle = std::move(pin._handle);
- pin._handle = nullptr;
- return *this;
-}
-
-ApiResult<void> Pin::setDirection(peripheral_gpio_direction_e direction)
-{
- int err = peripheral_gpio_set_direction(_handle, direction);
- if(err != PERIPHERAL_ERROR_NONE)
- {
- return ApiResult<void>::Error(err);
- }
- return ApiResult<void>::Ok();
-}
-
-ApiResult<unsigned int> Pin::read()
-{
- unsigned int value;
- int err = peripheral_gpio_read(_handle, &value);
- if(err != PERIPHERAL_ERROR_NONE)
- {
- return ApiResult<unsigned int>::Error(err);
- }
- return ApiResult<unsigned int>::Ok(value);
-}
-
-ApiResult<void> Pin::write(unsigned int value)
-{
- int err = peripheral_gpio_write(_handle, value);
- if(err != PERIPHERAL_ERROR_NONE)
- {
- return ApiResult<void>::Error(err);
- }
- return ApiResult<void>::Ok();
-}
-
-ApiResult<void> Pin::setEdgeMode(peripheral_gpio_edge_e edge)
-{
- int err = peripheral_gpio_set_edge_mode(_handle, edge);
- if(err != PERIPHERAL_ERROR_NONE)
- {
- return ApiResult<void>::Error(err);
- }
- return ApiResult<void>::Ok();
-}
-
-ApiResult<void> Pin::setInterruptedCb(std::function<void(peripheral_error_e)> interruptedCb)
-{
- auto static_cb = [](peripheral_gpio_h, peripheral_error_e error, void *user_data)
- {
- Pin *self = static_cast<Pin*>(user_data);
- if(self->_interruptedCb)
- self->_interruptedCb(error);
- };
- int err = peripheral_gpio_set_interrupted_cb(_handle, static_cb, this);
- if(err != PERIPHERAL_ERROR_NONE)
- {
- return ApiResult<void>::Error(err);
- }
- _interruptedCb = interruptedCb;
- return ApiResult<void>::Ok();
-}
-
-unsigned int Pin::getPinNumber()
-{
- return _pinNnumber;
-}
-
-} // gpio
-} // peripheral
-} // tizen
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 PIN_H
-#define PIN_H
-
-#include "tizen/ApiResult.hpp"
-#include <peripheral_io.h>
-#include <functional>
-
-namespace tizen {
-namespace peripheral {
-namespace gpio {
-
-class Pin
-{
-public:
- Pin(unsigned int pinNumber, peripheral_gpio_direction_e direction);
- ~Pin();
-
- Pin(const Pin&) = delete;
- Pin& operator=(const Pin&) = delete;
-
- Pin(Pin &&pin);
- Pin& operator=(Pin &&pin);
-
- ApiResult<void> setDirection(peripheral_gpio_direction_e direction);
- ApiResult<unsigned int> read();
- ApiResult<void> write(unsigned int value);
- ApiResult<void> setEdgeMode(peripheral_gpio_edge_e edge);
- ApiResult<void> setInterruptedCb(std::function<void(peripheral_error_e)> interruptedCb);
- unsigned int getPinNumber();
-private:
- peripheral_gpio_h _handle;
- std::function<void(peripheral_error_e)> _interruptedCb;
- unsigned int _pinNnumber;
-};
-
-} // gpio
-} // peripheral
-} // tizen
-
-#endif // PIN_H
\ No newline at end of file
+++ /dev/null
- /*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "tizen/peripheral/spi/Spi.hpp"
-#include "tizen/peripheral/spi/SpiException.hpp"
-#include "tizen/Logger.hpp"
-
-namespace tizen {
-namespace peripheral {
-namespace spi {
-
-Spi::Spi(int bus, int chip_select) : _bus(bus), _chip(chip_select)
-{
- int err = peripheral_spi_open(bus, chip_select, &_handle);
- if(err != PERIPHERAL_ERROR_NONE)
- {
- logger::Err("Failed to open SPI on bus %d and chip %d (%d)", bus, chip_select, err);
- throw SpiException(err, "Failed to open SPI");
- }
-}
-
-Spi::~Spi()
-{
- int err = peripheral_spi_close(_handle);
- if(err != PERIPHERAL_ERROR_NONE)
- {
- logger::Err("Failed to close SPI on bus %d and chip %d (%d)", _bus, _chip, err);
- }
-}
-
-Spi::Spi(Spi &&spi)
-{
- _handle = spi._handle;
- _bus = spi._bus;
- _chip = spi._chip;
-}
-
-Spi &Spi::operator=(Spi &&spi)
-{
- _handle = spi._handle;
- _bus = spi._bus;
- _chip = spi._chip;
- return *this;
-}
-
-ApiResult<void> Spi::read(char* buffer, size_t length)
-{
- int err = peripheral_spi_read(_handle, reinterpret_cast<uint8_t *>(buffer), length);
- if(err != PERIPHERAL_ERROR_NONE)
- {
- return ApiResult<void>::Error(err);
- }
- return ApiResult<void>::Ok();
-}
-
-ApiResult<void> Spi::write(const char* buffer, size_t length)
-{
- int err = peripheral_spi_write(_handle, reinterpret_cast<uint8_t *>(const_cast<char *>(buffer)), length);
- if(err != PERIPHERAL_ERROR_NONE)
- {
- return ApiResult<void>::Error(err);
- }
- return ApiResult<void>::Ok();
-}
-
-ApiResult<void> Spi::transfer(const char *transmitBuffer, char *receiveBuffer, size_t length)
-{
- int err = peripheral_spi_transfer(_handle, reinterpret_cast<uint8_t *>(const_cast<char *>(transmitBuffer)), reinterpret_cast<uint8_t *>(receiveBuffer), length);
- if(err != PERIPHERAL_ERROR_NONE)
- {
- return ApiResult<void>::Error(err);
- }
- return ApiResult<void>::Ok();
-}
-
-ApiResult<void> Spi::setBitsPerWord(uint8_t bitsPerWord)
-{
- int err = peripheral_spi_set_bits_per_word(_handle, bitsPerWord);
- if(err != PERIPHERAL_ERROR_NONE)
- {
- return ApiResult<void>::Error(err);
- }
- return ApiResult<void>::Ok();
-}
-
-ApiResult<void> Spi::setFrequency(uint32_t frequency)
-{
- int err = peripheral_spi_set_frequency(_handle, frequency);
- if(err != PERIPHERAL_ERROR_NONE)
- {
- return ApiResult<void>::Error(err);
- }
- return ApiResult<void>::Ok();
-}
-
-ApiResult<void> Spi::setMode(peripheral_spi_mode_e mode)
-{
- int err = peripheral_spi_set_mode(_handle, mode);
- if(err != PERIPHERAL_ERROR_NONE)
- {
- return ApiResult<void>::Error(err);
- }
- return ApiResult<void>::Ok();
-}
-
-ApiResult<void> Spi::setBitOrder(peripheral_spi_bit_order_e bitOrder)
-{
- int err = peripheral_spi_set_bit_order(_handle, bitOrder);
- if(err != PERIPHERAL_ERROR_NONE)
- {
- return ApiResult<void>::Error(err);
- }
- return ApiResult<void>::Ok();
-}
-
-int Spi::getBus() const
-{
- return _bus;
-}
-
-int Spi::getSelectedChip() const
-{
- return _chip;
-}
-
-} // spi
-} // peripheral
-} // tizen
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 SPI_H
-#define SPI_H
-
-#include "tizen/ApiResult.hpp"
-#include <peripheral_io.h>
-
-namespace tizen {
-namespace peripheral {
-namespace spi {
-
-class Spi
-{
-public:
- Spi(int bus, int chip_select);
- virtual ~Spi();
-
- Spi(const Spi &) = delete;
- Spi &operator=(const Spi &) = delete;
-
- Spi(Spi &&spi);
- Spi &operator=(Spi &&spi);
-
- ApiResult<void> read(char* buffer, size_t length);
- ApiResult<void> write(const char* buffer, size_t length);
- ApiResult<void> transfer(const char *transmitBuffer, char *receiveBuffer, size_t length);
- ApiResult<void> setBitsPerWord(uint8_t bitsPerWord);
- ApiResult<void> setFrequency(uint32_t frequency);
- ApiResult<void> setMode(peripheral_spi_mode_e mode);
- ApiResult<void> setBitOrder(peripheral_spi_bit_order_e bitOrder);
- int getBus() const;
- int getSelectedChip() const;
-private:
- peripheral_spi_h _handle;
- int _bus;
- int _chip;
-};
-
-} // spi
-} // peripheral
-} // tizen
-
-#endif //SPI_H
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "tizen/peripheral/spi/SpiException.hpp"
-
-namespace tizen {
-namespace peripheral {
-namespace spi {
-
- SpiException::SpiException(Error error, std::string message) : _error(error), _message(message)
- {
-
- }
-
- SpiException::~SpiException()
- {
-
- }
-
- const char *SpiException::what() const noexcept
- {
- return (_message + ":" + _error.message()).c_str();
- }
-
- Error SpiException::error() const
- {
- return _error;
- }
-} // spi
-} // peripheral
-} // tizen
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 SPI_EXCEPTION_H
-#define SPI_EXCEPTION_H
-
-#include "tizen/Error.hpp"
-#include <exception>
-#include <string>
-
-namespace tizen {
-namespace peripheral {
-namespace spi {
-
- class SpiException : public std::exception
- {
- public:
- SpiException(Error error, std::string message = "");
- ~SpiException();
-
- virtual const char *what() const noexcept override;
- Error error() const;
- private:
- Error _error;
- std::string _message;
- };
-} // spi
-} // peripheral
-} // tizen
-
-
-#endif //SPI_EXCEPTION_H
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "tizen/timer/Timer.hpp"
-#include "tizen/timer/TimerException.hpp"
-#include "tizen/Logger.hpp"
-
-namespace tizen {
-namespace timer {
-
-Timer::Timer(double interval, std::function<bool()> cb) : _cb(cb)
-{
- auto static_cb = [](void *data)
- {
- Timer *self = static_cast<Timer*>(data);
- bool res = false;
- if(self->_cb)
- res = self->_cb();
- if(res == false)
- {
- self->_isActive = false;
- return ECORE_CALLBACK_CANCEL;
- }
- else
- {
- return ECORE_CALLBACK_RENEW;
- }
-
- };
- _timer = ecore_timer_add(interval, static_cb, this);
- if(_timer == nullptr)
- {
- logger::Err("Failed to create timer");
- throw TimerException("ecore_timer_add failed");
- }
- _isActive = true;
-}
-
-Timer::~Timer()
-{
- if(_timer != nullptr && _isActive)
- {
- if(!ecore_timer_del(_timer))
- {
- logger::Err("ecore_timer_del failed");
- }
- }
-}
-
-Timer::Timer(Timer &&timer)
-{
- this->_cb = std::move(timer._cb);
- this->_isActive = std::move(timer._isActive);
- this->_timer = std::move(timer._timer);
- timer._timer = nullptr;
-}
-
-Timer& Timer::operator=(Timer &&timer)
-{
- this->_cb = std::move(timer._cb);
- this->_isActive = std::move(timer._isActive);
- this->_timer = std::move(timer._timer);
- timer._timer = nullptr;
- return *this;
-}
-
-void Timer::cancel()
-{
- if(_isActive)
- {
- if(ecore_timer_del(_timer))
- {
- logger::Err("ecore_timer_del failed");
- };
- _isActive = false;
- }
-}
-
-} // timer
-} // tizen
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 TIMER_H
-#define TIMER_H
-
-#include <Ecore.h>
-#include <functional>
-#include <vector>
-#include <memory>
-
-namespace tizen {
-namespace timer {
-
-class Timer
-{
-public:
- Timer(double interval, std::function<bool()> cb);
- ~Timer();
-
- Timer(const Timer&) = delete;
- Timer& operator=(const Timer&) = delete;
-
- Timer(Timer &&timer);
- Timer& operator=(Timer &&timer);
-
- void cancel();
-private:
- std::function<bool()> _cb;
- bool _isActive;
- Ecore_Timer *_timer;
-};
-
-} // timer
-} // tizen
-
-#endif //TIMER_H
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "tizen/timer/TimerException.hpp"
-
-namespace tizen {
-namespace timer {
-
- TimerException::TimerException( std::string message) : _message(message)
- {
- }
-
- TimerException::~TimerException()
- {
-
- }
-
- const char *TimerException::what() const noexcept
- {
- return _message.c_str();
- }
-} // timer
-} // tizen
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 TIMER_EXCEPTION_H
-#define TIMER_EXCEPTION_H
-
-#include <exception>
-#include <string>
-
-namespace tizen {
-namespace timer {
- class TimerException : public std::exception
- {
- public:
- TimerException(std::string message = "");
- ~TimerException();
-
- virtual const char *what() const noexcept override;
- private:
- std::string _message;
- };
-} // timer
-} // tizen
-
-
-#endif //TIMER_EXCEPTION_H
\ No newline at end of file
+++ /dev/null
-
-# Add pre/post build process
-PREBUILD_DESC =
-PREBUILD_COMMAND =
-POSTBUILD_DESC =
-POSTBUILD_COMMAND =
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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 UTILITY_H
-#define UTILITY_H
-
-#include "tizen/application/AppControl.hpp"
-#include <Elementary.h>
-#include <app.h>
-#include <string>
-#include <memory>
-
-class AppUtils
-{
-public:
- static std::string getResource(std::string path);
- static Evas_Object *getConformant();
- static Evas_Object *getWindow();
- static tizen::application::AppControl &getAppControl();
- static void saveConformant(Evas_Object *conformant);
- static void saveWindow(Evas_Object *window);
- static void saveAppControl(tizen::application::AppControl &appControl);
- static void setTranslatableText(Evas_Object *object, const std::string &key);
- static void setTranslatableText(Evas_Object *object, const std::string &part, const std::string &key);
- static std::string getTranslatedText(const std::string &key);
-private:
- static Evas_Object *_conformant;
- static Evas_Object *_window;
- static std::unique_ptr<tizen::application::AppControl> _appControl;
-};
-
-#endif //UTILITY_H
\ No newline at end of file
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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 EASY_SETUP_HELPER_H
-#define EASY_SETUP_HELPER_H
-
-#include "smartthings.h"
-#include "EasySetupEvent.hpp"
-#include "common/Observable.hpp"
-#include "ses/smartthings/thing/ApInfo.hpp"
-#include "ses/smartthings/thing/Master.hpp"
-#include <memory>
-#include <functional>
-#include <string>
-
-
-class EasySetup : public Observable<EasySetupEvent>
-{
-public:
- EasySetup();
- ~EasySetup();
- EasySetup(const EasySetup &) = delete;
- EasySetup& operator=(const EasySetup &) = delete;
- EasySetup(EasySetup &&) = default;
- EasySetup& operator=(EasySetup &&) = default;
-
- void startST();
- void resetST();
- void stopST();
-private:
- std::unique_ptr<ses::smartthings::thing::Master> _st_master;
- static const std::string MY_PROV_VENDOR_INFO;
- static const std::string DEVICE_NAME;
- static const std::string CERT_FILE;
- static const std::string KEY_FILE;
- void _startSTEasySetup(std::function<void(smartthings_status_e)> status_cb, std::function<void(const std::string &)> pin_cb);
- void _easySetupConnectionStateCallback(smartthings_status_e status);
- void _easySetupPinCallback(const std::string &pin);
-};
-
-#endif //EASY_SETUP_HELPER_H
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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 EASY_SETUP_EVENT_H
-#define EASY_SETUP_EVENT_H
-
-#include <functional>
-#include "ses/smartthings/thing/ApInfo.hpp"
-#include "smartthings.h"
-
-enum EasySetupEventType
-{
- NOT_READY = SMARTTHINGS_STATUS_NOT_READY,
- INIT = SMARTTHINGS_STATUS_INIT,
- ES_STARTED = SMARTTHINGS_STATUS_ES_STARTED,
- ES_DONE = SMARTTHINGS_STATUS_ES_DONE,
- ES_FAILED_OWNERSHIP_TRANSFER = SMARTTHINGS_STATUS_ES_FAILED_ON_OWNERSHIP_TRANSFER,
- CONNECTING_TO_AP = SMARTTHINGS_STATUS_CONNECTING_TO_AP,
- CONNECTED_TO_AP = SMARTTHINGS_STATUS_CONNECTED_TO_AP,
- CONNECTING_TO_AP_FAILED = SMARTTHINGS_STATUS_CONNECTING_TO_AP_FAILED,
- REGISTERING_TO_CLOUD = SMARTTHINGS_STATUS_REGISTERING_TO_CLOUD,
- REGISTERED_TO_CLOUD = SMARTTHINGS_STATUS_REGISTERED_TO_CLOUD,
- REGISTERING_FAILED_ON_SIGN_IN = SMARTTHINGS_STATUS_REGISTERING_FAILED_ON_SIGN_IN,
- REGISTERING_FAILED_ON_PUB_RES = SMARTTHINGS_STATUS_REGISTERING_FAILED_ON_PUB_RES,
- PIN_AQUIRED,
- WIFI_PROVISIONING,
- MEDIUM_REQUEST,
- CLOUD_TIMEOUT,
- SET_DEVICE_PROPERTY_ERROR,
- SET_RESET_CONFIRM_CB_ERROR,
- SET_RESET_RESULT_CB_ERROR,
- SET_PIN_CB_ERROR,
- SET_USER_CONFIRM_CB_ERROR,
- SET_WIFI_AP_PROVISIONING_CB_ERROR,
- SET_STATUS_CB_ERROR,
- SET_CERTIFICATE_ERROR,
- START_ERROR,
- START_ES_ERROR
-};
-
-struct EasySetupEvent
-{
-public:
- EasySetupEvent(EasySetupEventType type) : type(type)
- {
-
- }
- EasySetupEventType type;
-};
-
-struct EasySetupEventPinAquired : EasySetupEvent
-{
-public:
- EasySetupEventPinAquired(const std::string &pin) : EasySetupEvent(EasySetupEventType::PIN_AQUIRED), pin(pin)
- {
- }
- std::string pin;
-};
-
-struct EasySetupEventWifiProvisioning : EasySetupEvent
-{
-public:
- EasySetupEventWifiProvisioning(ses::smartthings::thing::ApInfo &apInfo) : EasySetupEvent(EasySetupEventType::WIFI_PROVISIONING), apInfo(apInfo)
- {
-
- }
- std::reference_wrapper<ses::smartthings::thing::ApInfo> apInfo;
-};
-
-#endif //EASY_SETUP_EVENT_H
\ No newline at end of file
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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 EASY_SETUP_EVENT_ADAPTER_H
-#define EASY_SETUP_EVENT_ADAPTER_H
-
-#include "StateManager.hpp"
-#include "common/Observer.hpp"
-#include "EasySetupEvent.hpp"
-#include "tizen/timer/Timer.hpp"
-#include <functional>
-
-class StateManager;
-
-class EasySetupEventAdapter : public Observer<EasySetupEvent>
-{
-public:
- EasySetupEventAdapter(std::shared_ptr<StateManager> stateManager);
- ~EasySetupEventAdapter() = default;
- EasySetupEventAdapter(const EasySetupEventAdapter&) = delete;
- EasySetupEventAdapter& operator=(const EasySetupEventAdapter&) = delete;
- EasySetupEventAdapter(EasySetupEventAdapter &&) = default;
- EasySetupEventAdapter& operator=(EasySetupEventAdapter &&) = default;
- virtual void update(const EasySetupEvent &event) override;
-private:
- std::shared_ptr<StateManager> _stateManager;
- std::unique_ptr<tizen::timer::Timer> _timerConnected, _timerInit;
- static const double _timeoutInterval;
-};
-
-#endif //EASY_SETUP_EVENT_ADAPTER_H
\ No newline at end of file
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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 ERROR_TYPE_H
-#define ERROR_TYPE_H
-
-enum class ErrorType {
- RESETABLE,
- UNRECOVERABLE
-};
-
-#endif //ERROR_TYPE_H
\ No newline at end of file
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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 OOBE_EASY_SETUP_APP_H
-#define OOBE_EASY_SETUP_APP_H
-
-#include "tizen/application/UiApp.hpp"
-#include "ViewManager.hpp"
-#include "EasySetup.hpp"
-#include "StateManager.hpp"
-#include <memory>
-
-class OobeEasySetupApp : public tizen::application::UiApp
-{
-public:
- OobeEasySetupApp() = default;
-
- OobeEasySetupApp(const OobeEasySetupApp &) = delete;
- OobeEasySetupApp& operator=(const OobeEasySetupApp &) = delete;
-
- OobeEasySetupApp(OobeEasySetupApp &&) = delete;
- OobeEasySetupApp& operator=(OobeEasySetupApp &&) = delete;
-
- virtual ~OobeEasySetupApp();
-protected:
- virtual bool OnCreate() override;
- virtual void OnService(tizen::application::AppControl & app) override;
- virtual void OnLanguageChanged(app_event_info_h event) override;
-
-private:
- void _createSkeleton();
- static void _win_delete_request_cb(void *data, Evas_Object *obj, void *event_info);
-
- Evas_Object *_win;
- Evas_Object *_conform;
- std::shared_ptr<StateManager> _stateManager;
-
- std::shared_ptr<ViewManager> _viewManager;
- std::shared_ptr<EasySetup> _easySetup;
-
- std::shared_ptr<Observer<EasySetupEvent>> _easySetupEventAdapter;
- std::shared_ptr<Observer<ViewEvent>> _viewEventAdapter;
-
- static const std::string DEMANDED_CALLER;
- static const std::string DEMANDED_CALLER_KEY;
- static const std::string DEMANDED_CALLER_VALUE;
-};
-
-#endif //OOBE_EASY_SETUP_APP_H
\ No newline at end of file
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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 OOBE_EASY_SETUP_H
-#define OOBE_EASY_SETUP_H
-
-#include <app.h>
-#include <Elementary.h>
-#include <system_settings.h>
-#include <efl_extension.h>
-#include <dlog.h>
-
-#ifdef LOG_TAG
-#undef LOG_TAG
-#endif
-#define LOG_TAG "oobe-easy-setup"
-
-#if !defined(PACKAGE)
-#define PACKAGE "org.tizen.oobe-easy-setup"
-#endif
-
-#endif // OOBE_EASY_SETUP_H
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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 STATE_MANAGER_H
-#define STATE_MANAGER_H
-
-//#define TEST_UI_STATE_MANAGER
-
-#include "ViewManager.hpp"
-#include "connectivity/TizenHomeAP.hpp"
-#include "connectivity/TizenSoftAP.hpp"
-#include "EasySetup.hpp"
-#include <string>
-
-class StateManager
-{
-public:
- StateManager(std::shared_ptr<ViewManager> viewManager, std::shared_ptr<TizenHomeAP> homeAp,
- std::shared_ptr<TizenSoftAP> medium, std::shared_ptr<EasySetup> easySetup);
- ~StateManager() = default;
- StateManager(const StateManager&) = delete;
- StateManager& operator=(const StateManager&) = delete;
- StateManager(StateManager &&) = default;
- StateManager& operator=(StateManager &&) = default;
- void startPreparation();
- void startAdvertisement();
- void processAdvertisement();
- void setupPin(std::string pin);
- void confirmPin();
- void logOnSamsungAccount();
- void finishSetup();
- void skipRequest();
- void cancelSkipRequest();
- void closeApp();
- void connectToNetwork(std::string ssid, std::string password);
- void enableMedium();
- void disableMedium();
- void reset();
- void error();
- void timeout();
- void saveWifiConnection();
- void unrecoverableError();
-private:
- std::shared_ptr<ViewManager> _viewManager;
- std::shared_ptr<TizenHomeAP> _homeAp;
- std::shared_ptr<TizenSoftAP> _medium;
- std::shared_ptr<EasySetup> _easySetup;
-
- bool _easySetupFinished;
- bool _connectedToAp;
- bool _loggedToSA;
-
- static const std::string REPLY_KEY;
- static const std::string LOGGED_TO_SA_KEY;
- static const std::string EASY_SETUP_FINISHED_KEY;
- static const std::string WIFI_CONNECTED_KEY;
-};
-
-#endif //STATE_MANAGER_H
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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 TEST_UI_VIEW_EVENT_ADAPTER_H
-#define TEST_UI_VIEW_EVENT_ADAPTER_H
-
-#include "StateManager.hpp"
-#include "ViewManager.hpp"
-#include "common/Observer.hpp"
-#include <functional>
-
-class TestUIViewEventAdapter : public Observer<ViewEvent>
-{
-public:
- TestUIViewEventAdapter(std::shared_ptr<StateManager> _stateManager);
- virtual ~TestUIViewEventAdapter() = default;
- TestUIViewEventAdapter(const TestUIViewEventAdapter &) = delete;
- TestUIViewEventAdapter& operator=(const TestUIViewEventAdapter &) = delete;
- TestUIViewEventAdapter(TestUIViewEventAdapter &&) = default;
- TestUIViewEventAdapter& operator=(TestUIViewEventAdapter &&) = default;
- virtual void update(const ViewEvent &event) override;
-private:
- std::shared_ptr<StateManager> _stateManager;
-};
-
-#endif //TEST_UI_VIEW_EVENT_ADAPTER_H
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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 VIEW_BASE_H
-#define VIEW_BASE_H
-
-#include "OobeEasySetupMain.hpp"
-
-#include "ViewDefines.hpp"
-#include "ViewTypes.hpp"
-#include "common/Observable.hpp"
-#include <string>
-
-class View : public Observable<std::string>
-{
-public:
- View() = default;
- ~View() = default;
- View(const View &) = delete;
- View& operator=(const View &) = delete;
- View(View &&) = default;
- View& operator=(View &&) = default;
- virtual void show() = 0;
- virtual void hide() = 0;
-};
-
-#endif //VIEW_BASE_H
-
-
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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 VIEW_DEFINES_H
-#define VIEW_DEFINES_H
-
-#include "../res/edje/common_definitions.h"
-
-#endif //VIEW_DEFINES_H
\ No newline at end of file
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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 EASY_SETUP_VIEW_EVENT_ADAPTER_H
-#define EASY_SETUP_VIEW_EVENT_ADAPTER_H
-
-#include "StateManager.hpp"
-#include "ViewManager.hpp"
-#include "common/Observer.hpp"
-#include <functional>
-
-class ViewEventAdapter : public Observer<ViewEvent>
-{
-public:
- ViewEventAdapter(std::shared_ptr<StateManager> _stateManager);
- virtual ~ViewEventAdapter() = default;
- ViewEventAdapter(const ViewEventAdapter &) = delete;
- ViewEventAdapter& operator=(const ViewEventAdapter &) = delete;
- ViewEventAdapter(ViewEventAdapter &&) = default;
- ViewEventAdapter& operator=(ViewEventAdapter &&) = default;
- virtual void update(const ViewEvent &event) override;
-private:
- std::shared_ptr<StateManager> _stateManager;
-};
-
-#endif //EASY_SETUP_VIEW_EVENT_ADAPTER_H
\ No newline at end of file
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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 VIEW_EVENT_OBSERVER_H
-#define VIEW_EVENT_OBSERVER_H
-
-#include "View.hpp"
-#include <functional>
-
-class ViewManager;
-
-class ViewEventObserver : public Observer<std::string>
-{
-public:
- ViewEventObserver(ViewManager &viewManager);
- virtual void update(const std::string &info) override;
-private:
- std::reference_wrapper<ViewManager> _viewManager;
-};
-
-#endif //VIEW_EVENT_OBSERVER_H
\ No newline at end of file
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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 VIEW_MANAGER_H
-#define VIEW_MANAGER_H
-
-#include "View.hpp"
-#include "ViewEventObserver.hpp"
-#include "ErrorType.hpp"
-#include "common/Observer.hpp"
-#include <memory>
-
-struct ViewData
-{
- ViewData() : pin("12345678"), isLogged(false) {};
- std::string pin;
- bool isLogged;
- ErrorType errorType;
-};
-
-struct ViewEvent
-{
- view_e source;
- std::string info;
-};
-
-class ViewManager : public Observable<ViewEvent>
-{
-public:
- ViewManager();
- ~ViewManager();
- ViewManager(const ViewManager &) = delete;
- ViewManager& operator=(const ViewManager &) = delete;
- ViewManager(ViewManager &&) = default;
- ViewManager& operator=(ViewManager &&) = default;
- void setView(view_e view);
- void showPopup(popup_e popup);
- void hidePopup();
- ViewData viewData;
- void processInfo(std::string info);
-private:
- view_e _currentEnum;
- popup_e _currentPopupEnum;
- std::shared_ptr<View> _current;
- std::shared_ptr<View> _currentPopup;
- std::shared_ptr<ViewEventObserver> _viewEventObserver;
- std::shared_ptr<ViewEventObserver> _popupEventObserver;
-};
-
-
-#endif //VIEW_MANAGER_H
\ No newline at end of file
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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 VIEW_TYPES_H
-#define VIEW_TYPES_H
-
-enum view_e
-{
- VIEW_START = 0,
- VIEW_ADVERTISEMENT,
- VIEW_CONNECTED_TO_SOFTAP,
- VIEW_PIN,
- VIEW_AUTO_CONFIGURTION,
- VIEW_ERROR
-};
-
-enum popup_e
-{
- POPUP_NONE = -1,
- POPUP_SKIP
-};
-
-#endif //VIEW_TYPES_H
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 HOME_AP_CONNECTION
-#define HOME_AP_CONNECTION
-
-#include <string>
-#include "common/Observable.hpp"
-
-enum ConnectionState
-{
- CONNECTED,
- DISCONNECTED,
- ERROR
-};
-
-class HomeAP : public Observable<ConnectionState>
-{
-public:
- HomeAP() = default;
- virtual ~HomeAP() = default;
-
- virtual bool connect(const std::string &ssid, const std::string& passwd) = 0;
- virtual void disconnect() = 0;
- virtual bool activated() = 0;
-private:
-
-};
-
-#endif /* HOME_AP_CONNECTION */
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 SASIGNER_H
-#define SASIGNER_H
-
-#include "common/Observable.hpp"
-#include "common/SigningEvent.hpp"
-#include <memory>
-
-class SASigner : public Observable<SigningEvent>
-{
-public:
-
- virtual void checkUserProfileReady() = 0;
- virtual bool signIn() = 0;
-
- virtual std::string userName() const = 0;
- virtual std::string nickName() const = 0;
-};
-
-#endif //SASIGNER_H
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 ABSTRACT_SOFTAP_H
-#define ABSTRACT_SOFTAP_H
-
-#include "common/Observable.hpp"
-
-enum class SoftAPState
-{
- ENABLED,
- DISABLED,
- ERROR,
-};
-
-class SoftAP : public Observable<SoftAPState>
-{
-public:
- SoftAP() = default;
- virtual ~SoftAP() = default;
-
- virtual void enable() = 0;
- virtual void disable() = 0;
-private:
-};
-
-#endif /* ABSTRACT_SOFTAP_H */
+++ /dev/null
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Flora License, Version 1.1 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://floralicense.org/license/
- *
- * 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 OBSERVABLE_H
-#define OBSERVABLE_H
-
-#include <memory>
-#include <vector>
-
-#include "Observer.hpp"
-
-template <typename T>
-class Observable {
-public:
- Observable() = default;
- virtual ~Observable() = default;
-
- void attach(std::weak_ptr<Observer<T>> observer)
- {
- observers.push_back(observer);
- }
-
- void detach(std::weak_ptr<Observer<T>> observer)
- {
- for (auto it = observers.begin(); it != observers.end(); ++it) {
- auto ptr = it->lock();
- if (ptr == observer.lock()) {
- observers.erase(it);
- return;
- }
- }
- }
-
- void notify(const T &item)
- {
- auto observers_copy = observers;
- for (auto& obs : observers_copy) {
- auto ptr = obs.lock();
- if (ptr)
- ptr->update(item);
- }
- }
-
-private:
- std::vector<std::weak_ptr<Observer<T>>> observers;
-};
-
-#endif /* OBSERVABLE_H */
+++ /dev/null
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Flora License, Version 1.1 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://floralicense.org/license/
- *
- * 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 OBSERVER_H
-#define OBSERVER_H
-
-template <typename T>
-class Observer {
-public:
- Observer() = default;
- virtual ~Observer() = default;
- virtual void update(const T &item) = 0;
-};
-
-#endif /* OBSERVER_H */
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "abstractions/HomeAP.hpp"
-#include <tizen/network/wifi/Manager.hpp>
-#include <tizen/network/softap/Manager.hpp>
-
-#ifndef TIZENHOMEAP_H
-#define TIZENHOMEAP_H
-
-class TizenHomeAP : public HomeAP
-{
-public:
- TizenHomeAP();
- bool connect(const std::string &ssid, const std::string& passwd) override;
- void disconnect() override;
- bool activated() override;
-private:
- bool connectNow(const std::string &ssid, const std::string& passwd);
- tizen::network::wifi::Manager wifi_mgr;
- tizen::network::softap::Manager softap_mgr;
-};
-
-#endif /* TIZENHOMEAP_H */
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 TIZENSOFTAP_H
-#define TIZENSOFTAP_H
-
-#include <string>
-#include <tizen/network/softap/Manager.hpp>
-#include <tizen/network/wifi/Manager.hpp>
-
-#include "abstractions/SoftAP.hpp"
-
-class TizenSoftAP : public SoftAP
-{
-public:
- TizenSoftAP();
- void enable() override;
- void disable() override;
-private:
- void enableNow();
- tizen::network::softap::Manager softap_mgr;
- tizen::network::wifi::Manager wifi_mgr;
-};
-
-#endif /* TIZENSOFTAP_H */
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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.
-*/
-
-#include "OobeEasySetupMain.hpp"
-#include "dlog.h"
-
-#define LOG_DBG(format, ...) dlog_print(DLOG_DEBUG, LOG_TAG, format, ## __VA_ARGS__)
-#define LOG_WRN(format, ...) dlog_print(DLOG_WARN, LOG_TAG, format, ## __VA_ARGS__)
-#define LOG_INF(format, ...) dlog_print(DLOG_INFO, LOG_TAG, format, ## __VA_ARGS__)
-#define LOG_ERR(format, ...) dlog_print(DLOG_ERROR, LOG_TAG, format, ## __VA_ARGS__)
-#define LOG_FAT(format, ...) dlog_print(DLOG_FATAL, LOG_TAG, format, ## __VA_ARGS__)
\ No newline at end of file
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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 POPUP_SKIP_H
-#define POPUP_SKIP_H
-
-#include "View.hpp"
-#include <string>
-
-class PopupSkip : public View
-{
-public:
- PopupSkip() = default;
- ~PopupSkip() = default;
- PopupSkip(const PopupSkip &) = delete;
- PopupSkip& operator=(const PopupSkip &) = delete;
- PopupSkip(PopupSkip &&) = default;
- PopupSkip& operator=(PopupSkip &&) = default;
- virtual void show() override;
- virtual void hide() override;
-private:
- Evas_Object *popup;
-
- static const std::string POPUP_SKIP_EDJE_FILE;
- static const std::string POPUP_SKIP_TEXT_KEY;
- static const std::string POPUP_SKIP_NO;
- static const std::string POPUP_SKIP_YES;
-};
-
-#endif //POPUP_SKIP_H
\ No newline at end of file
+++ /dev/null
-/*****************************************************************
- *
- * Copyright (c) 2018 Samsung Electronics Co., Ltd. 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 __SAMSUNG_EXPERIENCE_SERVICE_SMARTTHINGS_H__
-#define __SAMSUNG_EXPERIENCE_SERVICE_SMARTTHINGS_H__
-
-#include <stdlib.h>
-#include <stdbool.h>
-#include <tizen.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/**
- * @addtogroup CAPI_SMARTTHINGS_THING_MASTER_MODULE
- * @{
- */
-
-/**
- * @brief Definition for the max length of SSID for access point.
- * @since_ses 1
- */
-#define SMARTTHINGS_SSID_LEN_MAX 32
-
-/**
- * @brief Definition for the max length of cloud information.
- * @since_ses 1
- */
-#define SMARTTHINGS_CLOUD_INFO_LEN_MAX 128
-
-/**
- * @brief Enumeration for the SmartThings error.
- * @since_ses 1
- */
-typedef enum {
- SMARTTHINGS_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful */
- SMARTTHINGS_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
- SMARTTHINGS_ERROR_OUT_OF_MEMORY = TIZEN_ERROR_OUT_OF_MEMORY, /**< Out of memory */
- SMARTTHINGS_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
- SMARTTHINGS_ERROR_NO_DATA = TIZEN_ERROR_NO_DATA, /**< No data */
- SMARTTHINGS_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported */
- SMARTTHINGS_ERROR_OPERATION_FAILED = TIZEN_ERROR_UNKNOWN - 1, /**< Operation failed */
- SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE = TIZEN_ERROR_UNKNOWN -2 /**< Service unavailable */
-} smartthings_error_e;
-
-/**
- * @brief Enumeration for SmartThings status.
- * @since_ses 1
- */
-typedef enum {
- SMARTTHINGS_STATUS_NOT_READY = -1, /**< Service agent is not ready */
- SMARTTHINGS_STATUS_INIT = 0, /**< Initial state of SmartThings Thing */
- SMARTTHINGS_STATUS_ES_STARTED, /**< Easy-setup is started */
- SMARTTHINGS_STATUS_ES_DONE, /**< Easy-setup is done */
- SMARTTHINGS_STATUS_ES_FAILED_ON_OWNERSHIP_TRANSFER, /**< Easy-setup failed due to Ownership-Transfer failure */
- SMARTTHINGS_STATUS_CONNECTING_TO_AP, /**< Connecting to target Wi-Fi access point */
- SMARTTHINGS_STATUS_CONNECTED_TO_AP, /**< Connected to target Wi-Fi access point */
- SMARTTHINGS_STATUS_CONNECTING_TO_AP_FAILED, /**< Failed to connect to target Wi-Fi access point */
- SMARTTHINGS_STATUS_REGISTERING_TO_CLOUD, /**< Trying to sign up, sign in and publish resources to cloud */
- SMARTTHINGS_STATUS_REGISTERED_TO_CLOUD, /**< Publish resources to cloud is complete. Now the thing is ready to be controlled via cloud */
- SMARTTHINGS_STATUS_REGISTERING_FAILED_ON_SIGN_IN, /**< Failed to sign in to cloud */
- SMARTTHINGS_STATUS_REGISTERING_FAILED_ON_PUB_RES /**< Failed to publish resources to cloud */
-} smartthings_status_e;
-
-/**
- * @brief Enumeration for RPC connection status.
- * @since_ses 1
- */
-typedef enum {
- SMARTTHINGS_CONNECTION_STATUS_CONNECTED = 0, /**< Connection is connected */
- SMARTTHINGS_CONNECTION_STATUS_DISCONNECTED, /**< Connection is disconnected */
- SMARTTHINGS_CONNECTION_STATUS_REJECTED, /**< Connection is rejected */
-} smartthings_connection_status_e;
-
-/**
- * @brief The Wi-Fi mode.
- * @since_ses 1
- */
-typedef enum {
- SMARTTHINGS_WIFI_MODE_11A = (1 << 0), /**< Wi-Fi 11A */
- SMARTTHINGS_WIFI_MODE_11B = (1 << 1), /**< Wi-Fi 11B */
- SMARTTHINGS_WIFI_MODE_11G = (1 << 2), /**< Wi-Fi 11G */
- SMARTTHINGS_WIFI_MODE_11N = (1 << 3), /**< Wi-Fi 11N */
- SMARTTHINGS_WIFI_MODE_11AC = (1 << 4) /**< Wi-Fi 11AC */
-} smartthings_wifi_mode_e;
-
-/**
- * @brief The Wi-Fi frequency band.
- * @since_ses 1
- */
-typedef enum {
- SMARTTHINGS_WIFI_FREQ_24G = (1 << 0), /**< Wi-Fi 2.4GHz */
- SMARTTHINGS_WIFI_FREQ_5G = (1 << 1), /**< Wi-Fi 5GHz */
-} smartthings_wifi_freq_e;
-
-/**
- * @brief The Wi-Fi authentication type of access point.
- * @since_ses 1
- */
-typedef enum {
- SMARTTHINGS_WIFI_AUTHTYPE_NONE = 0, /**< No authentication */
- SMARTTHINGS_WIFI_AUTHTYPE_WEP, /**< WEP */
- SMARTTHINGS_WIFI_AUTHTYPE_WPA_PSK, /**< WPA-PSK */
- SMARTTHINGS_WIFI_AUTHTYPE_WPA2_PSK /**< WPA2-PSK */
-} smartthings_wifi_authtype_e;
-
-/**
- * @brief The Wi-Fi encryption type of access point.
- * @since_ses 1
- */
-typedef enum {
- SMARTTHINGS_WIFI_ENCTYPE_NONE = 0, /**< No encryption */
- SMARTTHINGS_WIFI_ENCTYPE_WEP_64, /**< WEP 64 */
- SMARTTHINGS_WIFI_ENCTYPE_WEP_128, /**< WEP 128 */
- SMARTTHINGS_WIFI_ENCTYPE_TKIP, /**< TKIP */
- SMARTTHINGS_WIFI_ENCTYPE_AES, /**< AES */
- SMARTTHINGS_WIFI_ENCTYPE_TKIP_AES /**< TKIP/AES */
-} smartthings_wifi_enctype_e;
-
-/**
- * @brief The SmartThings handle.
- * @since_ses 1
- */
-typedef struct smartthings_s *smartthings_h;
-
-/**
- * @brief The access point information handle.
- * @since_ses 1
- */
-typedef struct smartthings_ap_info_s *smartthings_ap_info_h;
-
-/**
- * @brief The device provisioning information handle.
- * @since_ses 1
- */
-typedef struct smartthings_device_prov_info_s *smartthings_device_prov_info_h;
-
-/**
- * @brief The cloud information handle for cloud sign-up.
- * @since_ses 1
- */
-typedef struct smartthings_cloud_info_s *smartthings_cloud_info_h;
-
-/**
- * @brief The access point list handle.
- * @since_ses 1
- */
-typedef struct smartthings_ap_list_s *smartthings_ap_list_h;
-
-/**
- * @brief Callback for status of connection to SmartThings Thing agent.
- * @since_ses 1
- *
- * @remarks The @a handle should not be released.
- * @remarks The @a handle is the same object for which the callback was set/added.
- * @remarks The @a handle will be released when smartthings_deinitialize() is called.
- * @remarks When callback is called, user can see connection status as #smartthings_connection_status_e enumeration value.
- *
- * @param[in] result The result of connection operation
- * @param[in] handle The SmartThings handle
- * @param[in] status The status of connection
- * @param[in] user_data The user data passed from the callback registration function
- *
- * @see smartthings_initialize()
- */
-typedef void (*smartthings_connection_status_cb)(smartthings_h handle, smartthings_connection_status_e status, void *user_data);
-
-/**
- * @brief Callback for SmartThings Thing status.
- * @since_ses 1
- *
- * @remarks The @a handle should not be released.
- * @remarks The @a handle is the same object for which the callback was set/added.
- * @remarks The @a handle will be released when smartthings_deinitialize() is called.
- * @remarks When callback is called, user can see SmartThings status as #smartthings_status_e enumeration value.
- *
- * @param[in] handle The SmartThings handle
- * @param[in] status The status of SmartThings
- * @param[in] user_data The user data passed from the callback registration function
- *
- * @see smartthings_set_status_changed_cb()
- * @see smartthings_unset_status_changed_cb()
- */
-typedef void (*smartthings_status_changed_cb)(smartthings_h handle, smartthings_status_e status, void *user_data);
-
-/**
- * @brief Callback for getting user's input regarding mutual verification.
- * @since_ses 1
- *
- * @remarks The @a handle should not be released.
- * @remarks The @a handle is the same object for which the callback was set/added.
- * @remarks The @a handle will be released when smartthings_deinitialize() is called.
- * @remarks When callback is called, user can send a confirmation for mutual verification as true or false.
- *
- * @param[in] handle The SmartThings handle
- * @param[in] user_data The user data passed from the callback registration function
- *
- * @see smartthings_set_user_confirm_cb()
- * @see smartthings_unset_user_confirm_cb()
- */
-typedef void (*smartthings_user_confirm_cb)(smartthings_h handle, void *user_data);
-
-/**
- * @brief Callback for getting user's opinion regarding device reset.
- * @since_ses 1
- *
- * @remarks The @a handle should not be released.
- * @remarks The @a handle is the same object for which the callback was set/added.
- * @remarks The @a handle will be released when smartthings_deinitialize() is called.
- * @remarks When callback is called, user can sends a confirmation for reset as true or false.
- *
- * @param[in] handle The SmartThings handle
- * @param[in] user_data The user data passed from the callback registration function
- *
- * @see smartthings_set_reset_confirm_cb()
- * @see smartthings_unset_reset_confirm_cb()
- */
-typedef void (*smartthings_reset_confirm_cb)(smartthings_h handle, void *user_data);
-
-/**
- * @brief Callback for result of reset operation.
- * @since_ses 1
- *
- * @remarks The @a handle should not be released.
- * @remarks The @a handle is the same object for which the callback was set/added.
- * @remarks The @a handle will be released when smartthings_deinitialize() is called.
- * @remarks When callback is called, user can check reset operation succeeds or fails.
- *
- * @param[in] handle The SmartThings handle
- * @param[in] result The result of reset
- * @param[in] user_data The user data passed from the callback registration function
- *
- * @see smartthings_set_reset_result_cb()
- * @see smartthings_unset_reset_result_cb()
- */
-typedef void (*smartthings_reset_result_cb)(smartthings_h handle, bool result, void *user_data);
-
-/**
- * @brief Callback for carrying the randomly generated PIN information.
- * @since_ses 1
- *
- * @remarks The @a handle should not be released.
- * @remarks The @a handle is the same object for which the callback was set/added.
- * @remarks The @a handle will be released when smartthings_deinitialize() is called.
- * @remarks The @a pin can be used only in the callback. To use outside, make a copy.
- * @remarks When callback is called, user can see PIN value and length.
- *
- * @param[in] handle The SmartThings handle
- * @param[in] pin The PIN data in string format
- * @param[in] size The PIN length of @a pin
- * @param[in] user_data The user data passed from the callback registration function
- *
- * @see smartthings_set_pin_cb()
- * @see smartthings_unset_pin_cb()
- */
-typedef void (*smartthings_pin_generated_cb)(smartthings_h handle, const char* pin, size_t size, void *user_data);
-
-/**
- * @brief Callback for informing the application to close the PIN display.
- * @since_ses 1
- *
- * @remarks The @a handle should not be released.
- * @remarks The @a handle is the same object for which the callback was set/added.
- * @remarks The @a handle will be released when smartthings_deinitialize() is called.
- * @remarks When callback is called, user can know PIN based ownership transfer is finished.
- *
- * @param[in] handle The SmartThings handle
- * @param[in] user_data The user data passed from the callback registration function
- *
- * @see smartthings_set_pin_cb()
- * @see smartthings_unset_pin_cb()
- */
-typedef void (*smartthings_pin_display_close_cb)(smartthings_h handle, void *user_data);
-
-/**
- * @brief Callback for informing Wi-Fi AP information to connect.
- * @since_ses 1
- *
- * @remarks The @a handle should not be released.
- * @remarks The @a handle is the same object for which the callback was set/added.
- * @remarks The @a handle will be released when smartthings_deinitialize() is called.
- * @remarks The @a ap_info_h should not be released.
- * @remarks The @a ap_info_h will be released when smartthings_unset_wifi_ap_provisioning_cb() is called.
- * @remarks When callback is called, user can get Wi-Fi provisioning information.
- *
- * @param[in] handle The SmartThings handle
- * @param[in] ap_info_h The AP information handle
- * @param[in] user_data The user data passed from the callback registration function
- *
- * @see smartthings_set_wifi_ap_provisioning_cb()
- * @see smartthings_unset_wifi_ap_provisioning_cb()
- */
-typedef void (*smartthings_wifi_ap_provisioning_cb)(smartthings_h handle, smartthings_ap_info_h ap_info_h, void *user_data);
-
-/**
- * @brief Callback for informing device provisioning information.
- * @since_ses 1
- *
- * @remarks The @a handle should not be released.
- * @remarks The @a handle is the same object for which the callback was set/added.
- * @remarks The @a handle will be released when smartthings_deinitialize() is called.
- * @remarks The @a dev_prov_h should not be released.
- * @remarks The @a dev_prov_h will be released when smartthings_unset_device_provisioning_cb() is called.
- * @remarks When callback is called, user can get device provisioning information.
- *
- * @param[in] handle The SmartThings handle
- * @param[in] dev_prov_h The device provisioning information handle
- * @param[in] user_data The user data passed from the callback registration function
- *
- * @see smartthings_set_device_provisioning_cb()
- * @see smartthings_unset_device_provisioning_cb()
- */
-typedef void (*smartthings_device_provisioning_cb)(smartthings_h handle, smartthings_device_prov_info_h dev_prov_h, void *user_data);
-
-/**
- * @brief Callback for informing the scan AP list request.
- * @since_ses 1
- *
- * @remarks The @a handle should not be released.
- * @remarks The @a handle is the same object for which the callback was set/added.
- * @remarks The @a handle will be released when smartthings_deinitialize() is called.
- * @remarks When callback is called, user scans access points, sets AP list and sends it to agent.
- *
- * @param[in] handle The SmartThings handle
- * @param[in] req_id The request ID
- * @param[in] user_data The user data passed from the callback registration function
- *
- * @see smartthings_set_scan_ap_cb()
- * @see smartthings_unset_scan_ap_cb()
- */
-typedef void (*smartthings_scan_ap_cb)(smartthings_h handle, int req_id, void *user_data);
-
-/**
- * @brief Callback for informing the stop soft AP request.
- * @since_ses 1
- *
- * @remarks The @a handle should not be released.
- * @remarks The @a handle is the same object for which the callback was set/added.
- * @remarks The @a handle will be released when smartthings_deinitialize() is called.
- * @remarks When callback is called, user stops soft AP.
- *
- * @param[in] handle The SmartThings handle
- * @param[in] user_data The user data passed from the callback registration function
- *
- * @see smartthings_set_stop_soft_ap_cb()
- * @see smartthings_unset_stop_soft_ap_cb()
- */
-typedef void (*smartthings_stop_soft_ap_cb)(smartthings_h handle, void *user_data);
-
-/**
- * @brief Creates a handle and connects to agent.
- * @since_ses 1
- * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
- * %http://tizen.org/privilege/appmanager.launch \n
- * %http://tizen.org/privilege/datasharing
- *
- * @remarks The @a handle must be released using smartthings_deinitialize().
- * @remarks Ths function returns #SMARTTHINGS_ERROR_PERMISSION_DENIED\n
- * if the application has no app-defined privilege for 'http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master'.
- *
- * @param[out] handle The SmartThings handle to be newly created on success
- * @param[in] connection_status_cb The RPC connection status callback to register
- * @param[in] user_data The user data to be passed to the callback function
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #SMARTTHINGS_ERROR_NOT_SUPPORTED Not supported
- * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
- *
- * @see smartthings_deinitialize()
- */
-int smartthings_initialize(smartthings_h *handle,
- smartthings_connection_status_cb connection_status_cb,
- void *user_data);
-
-/**
- * @brief Deinitializes a handle and disconnects from the agent.
- * @since_ses 1
- *
- * @param[in] handle The SmartThings handle
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- *
- * @see smartthings_initialize()
- */
-int smartthings_deinitialize(smartthings_h handle);
-
-/**
- * @brief Starts SmartThings Thing operation.
- * @since_ses 1
- * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
- * %http://tizen.org/privilege/appmanager.launch \n
- * %http://tizen.org/privilege/datasharing
- *
- * @param[in] handle The SmartThings handle
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
- *
- * @see smartthings_stop()
- */
-int smartthings_start(smartthings_h handle);
-
-/**
- * @brief Stops SmartThings Thing operation.
- * @since_ses 1
- * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
- * %http://tizen.org/privilege/appmanager.launch \n
- * %http://tizen.org/privilege/datasharing
- *
- * @param[in] handle The SmartThings handle
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
- *
- * @see smartthings_start()
- */
-int smartthings_stop(smartthings_h handle);
-
-/**
- * @brief Sets thing status changed callback.
- * @since_ses 1
- * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
- * %http://tizen.org/privilege/appmanager.launch \n
- * %http://tizen.org/privilege/datasharing
- *
- * @remarks Only one callback function can be set with this function.
- * @remarks If multiple callbacks are set, the last one is registered only.
- * @remarks Callback is called when SmartThings status is changed.
- * @remarks When callback is called, user can get SmartThings status as #smartthings_status_e enumeration value.
- *
- * @param[in] handle The SmartThings handle
- * @param[in] status_cb The status changed callback to register
- * @param[in] user_data The user data to be passed to the callback function
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
- *
- * @see smartthings_unset_status_changed_cb()
- */
-int smartthings_set_status_changed_cb(smartthings_h handle,
- smartthings_status_changed_cb status_cb,
- void *user_data);
-
-/**
- * @brief Unsets thing status changed callback.
- * @since_ses 1
- * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
- * %http://tizen.org/privilege/appmanager.launch \n
- * %http://tizen.org/privilege/datasharing
- *
- * @param[in] handle The SmartThings handle
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
- *
- * @see smartthings_set_status_changed_cb()
- */
-int smartthings_unset_status_changed_cb(smartthings_h handle);
-
-/**
- * @brief Sets test certificate files.
- * @since_ses 1
- * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
- * %http://tizen.org/privilege/appmanager.launch \n
- * %http://tizen.org/privilege/datasharing
- *
- * @remarks These files should be placed in 'res' directory of application.
- * @remarks This function is needed only for using test certificate.
- * @remarks This function can be used before smartthings_start()
- *
- * @param[in] handle The SmartThings handle
- * @param[in] certificate The certificate file
- * @param[in] private_key The private key file
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
- */
-int smartthings_set_certificate_file(smartthings_h handle, const char *certificate, const char *private_key);
-
-/**
- * @brief Sets device property for Easy-setup.
- * @since_ses 1
- *
- * @remarks This function can be used before smartthings_start()
- *
- * @param[in] handle The SmartThings handle
- * @param[in] dev_name The device name
- * @param[in] wifi_mode The supported Wi-Fi mode (bit masked value for #smartthings_wifi_mode_e)
- * @param[in] wifi_freq The supported Wi-Fi frequency (bit masked value for #smartthings_wifi_freq_e)
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- */
-int smartthings_set_device_property(smartthings_h handle, const char* dev_name, int wifi_mode, int wifi_freq);
-
-/**
- * @brief Gets a device ID.
- * @since_ses 1
- * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
- * %http://tizen.org/privilege/appmanager.launch \n
- * %http://tizen.org/privilege/datasharing
- *
- * @remarks The @a device_id should be released using free().
- *
- * @param[in] handle The SmartThings handle
- * @param[out] device_id The device ID
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
- */
-int smartthings_get_device_id(smartthings_h handle, char **device_id);
-
-/**
- * @brief Gets a Easy-setup status.
- * @since_ses 1
- * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
- * %http://tizen.org/privilege/appmanager.launch \n
- * %http://tizen.org/privilege/datasharing
- *
- * @param[in] handle The SmartThings handle
- * @param[out] is_completed The status of Easy-setup whether it is completed or not
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
- */
-int smartthings_get_easysetup_status(smartthings_h handle, bool *is_completed);
-
-/**
- * @brief Starts Easy-setup mode.
- *
- * @details This function requests for turning on soft AP to SmartThings Thing agent.
- * @since_ses 1
- * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
- * %http://tizen.org/privilege/appmanager.launch \n
- * %http://tizen.org/privilege/datasharing \n
- * %http://tizen.org/privilege/softap
- *
- * @param[in] handle The SmartThings handle
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
- *
- * @see smartthings_stop_easysetup()
- */
-int smartthings_start_easysetup(smartthings_h handle);
-
-/**
- * @brief Stops Easy-setup mode.
- *
- * @details This function requests for turning off soft AP to SmartThings Thing agent.
- * @since_ses 1
- * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
- * %http://tizen.org/privilege/appmanager.launch \n
- * %http://tizen.org/privilege/datasharing \n
- * %http://tizen.org/privilege/softap
- *
- * @param[in] handle The SmartThings handle
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
- *
- * @see smartthings_start_easysetup()
- */
-int smartthings_stop_easysetup(smartthings_h handle);
-
-/**
- * @brief Sets callback for getting user confirmation for mutual verification based just work ownership transfer.
- * @since_ses 1
- * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
- * %http://tizen.org/privilege/appmanager.launch \n
- * %http://tizen.org/privilege/datasharing
- *
- * @remarks Only one callback function can be set with this function.
- * @remarks If multiple callbacks are set, the last one is registered only.
- * @remarks Callback is called when it needs user's confirm for mutual verification based just work ownership transfer.
- * @remarks When callback is called, user can send a confirmation for mutual verification based just work ownership transfer as true or false.
- *
- * @param[in] handle The SmartThings handle
- * @param[in] confirm_cb The user confirm callback to register
- * @param[in] user_data The user data to be passed to the callback function
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
- *
- * @see smartthings_unset_user_confirm_cb()
- */
-int smartthings_set_user_confirm_cb(smartthings_h handle,
- smartthings_user_confirm_cb confirm_cb,
- void *user_data);
-
-/**
- * @brief Unsets user confirmation callback.
- * @since_ses 1
- * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
- * %http://tizen.org/privilege/appmanager.launch \n
- * %http://tizen.org/privilege/datasharing
- *
- * @param[in] handle The SmartThings handle
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
- *
- * @see smartthings_set_user_confirm_cb()
- */
-int smartthings_unset_user_confirm_cb(smartthings_h handle);
-
-/**
- * @brief Sets reset confirmation callback.
- * @since_ses 1
- * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
- * %http://tizen.org/privilege/appmanager.launch \n
- * %http://tizen.org/privilege/datasharing
- *
- * @remarks Only one callback function can be set with this function.
- * @remarks If multiple callbacks are set, the last one is registered only.
- * @remarks Callback is called when it needs user's confirm for reset.
- * @remarks When callback is called, user can send a confirmation for reset as true or false.
- *
- * @param[in] handle The SmartThings handle
- * @param[in] confirm_cb The reset confirm callback to register
- * @param[in] user_data The user data to be passed to the callback function
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
- *
- * @see smartthings_unset_reset_confirm_cb()
- */
-int smartthings_set_reset_confirm_cb(smartthings_h handle,
- smartthings_reset_confirm_cb confirm_cb,
- void *user_data);
-
-/**
- * @brief Unsets reset confirmation callback.
- * @since_ses 1
- * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
- * %http://tizen.org/privilege/appmanager.launch \n
- * %http://tizen.org/privilege/datasharing
- *
- * @param[in] handle The SmartThings handle
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
- *
- * @see smartthings_set_reset_confirm_cb()
- */
-int smartthings_unset_reset_confirm_cb(smartthings_h handle);
-
-/**
- * @brief Sets reset result callback.
- * @since_ses 1
- * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
- * %http://tizen.org/privilege/appmanager.launch \n
- * %http://tizen.org/privilege/datasharing
- *
- * @remarks Only one callback function can be set with this function.
- * @remarks If multiple callbacks are set, the last one is registered only.
- * @remarks Callback is called when reset operation returns its result.
- * @remarks When callback is called, user can check reset operation succeeds or fails.
- *
- * @param[in] handle The SmartThings handle
- * @param[in] reset_result_cb The reset result callback to register
- * @param[in] user_data The user data to be passed to the callback function
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
- *
- * @see smartthings_unset_reset_result_cb()
- */
-int smartthings_set_reset_result_cb(smartthings_h handle,
- smartthings_reset_result_cb reset_result_cb,
- void *user_data);
-
-/**
- * @brief Unsets reset result callback.
- * @since_ses 1
- * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
- * %http://tizen.org/privilege/appmanager.launch \n
- * %http://tizen.org/privilege/datasharing
- *
- * @param[in] handle The SmartThings handle
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
- *
- * @see smartthings_set_reset_result_cb()
- */
-int smartthings_unset_reset_result_cb(smartthings_h handle);
-
-
-/**
- * @brief Sets callback for getting randomly generated PIN for the PIN-based ownership transfer request.
- * @since_ses 1
- * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
- * %http://tizen.org/privilege/appmanager.launch \n
- * %http://tizen.org/privilege/datasharing
- *
- * @remarks Only one callback function can be set with this function.
- * @remarks If multiple callbacks are set, the last one is registered only.
- * @remarks @a generated_cb callback is called when PIN is generated.
- * @remarks @a close_cb callback is called when PIN based ownership transfer is finished.
- * @remarks When @a generated_cb callback is called, user can see PIN value and length.
- * @remarks When @a close_cb callback is called, user can know PIN based ownership transfer is finished.
- *
- * @param[in] handle The SmartThings handle
- * @param[in] generated_cb The PIN generation callback to register
- * @param[in] close_cb The PIN display close callback to register
- * @param[in] user_data The user data to be passed to the callback function
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
- *
- * @see smartthings_unset_pin_cb()
- */
-int smartthings_set_pin_cb(smartthings_h handle,
- smartthings_pin_generated_cb generated_cb,
- smartthings_pin_display_close_cb close_cb,
- void *user_data);
-
-/**
- * @brief Unsets PIN callback.
- * @since_ses 1
- * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
- * %http://tizen.org/privilege/appmanager.launch \n
- * %http://tizen.org/privilege/datasharing
- *
- * @param[in] handle The SmartThings handle
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
- *
- * @see smartthings_set_pin_cb()
- */
-int smartthings_unset_pin_cb(smartthings_h handle);
-
-/**
- * @brief Sets callback for getting Wi-Fi AP information during Easy-setup.
- * @since_ses 1
- * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
- * %http://tizen.org/privilege/appmanager.launch \n
- * %http://tizen.org/privilege/datasharing
- *
- * @remarks Only one callback function can be set with this function.
- * @remarks If multiple callbacks are set, the last one is registered only.
- * @remarks Callback is called when Wi-Fi provisioning event occurs.
- * @remarks When callback is called, user can get Wi-Fi provisioning information.
- *
- * @param[in] handle The SmartThings handle
- * @param[in] wifi_ap_cb The Wi-Fi AP callback to register
- * @param[in] user_data The user data to be passed to the callback function
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
- *
- * @see smartthings_unset_wifi_ap_provisioning_cb()
- */
-int smartthings_set_wifi_ap_provisioning_cb(smartthings_h handle,
- smartthings_wifi_ap_provisioning_cb wifi_ap_cb,
- void *user_data);
-
-/**
- * @brief Unsets callback for getting Wi-Fi AP information during Easy-setup.
- * @since_ses 1
- * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
- * %http://tizen.org/privilege/appmanager.launch \n
- * %http://tizen.org/privilege/datasharing
- *
- * @param[in] handle The SmartThings handle
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
- *
- * @see smartthings_set_wifi_ap_provisioning_cb()
- */
-int smartthings_unset_wifi_ap_provisioning_cb(smartthings_h handle);
-
-/**
- * @brief Sets callback for getting device provisioning information.
- * @since_ses 1
- * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
- * %http://tizen.org/privilege/appmanager.launch \n
- * %http://tizen.org/privilege/datasharing
- *
- * @remarks Only one callback function can be set with this function.
- * @remarks If multiple callbacks are set, the last one is registered only.
- * @remarks Callback is called when device provisioning event occurs.
- * @remarks When callback is called, user can get device provisioning information.
- *
- * @param[in] handle The SmartThings handle
- * @param[in] dev_prov_cb The device provisioning callback to register
- * @param[in] user_data The user data to be passed to the callback function
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
- *
- * @see smartthings_unset_device_provisioning_cb()
- */
-int smartthings_set_device_provisioning_cb(smartthings_h handle,
- smartthings_device_provisioning_cb dev_prov_cb,
- void *user_data);
-
-/**
- * @brief Unsets callback for getting device provisioning information.
- * @since_ses 1
- * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
- * %http://tizen.org/privilege/appmanager.launch \n
- * %http://tizen.org/privilege/datasharing
- *
- * @param[in] handle The SmartThings handle
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
- *
- * @see smartthings_set_device_provisioning_cb()
- */
-int smartthings_unset_device_provisioning_cb(smartthings_h handle);
-
-/**
- * @brief Sets callback for informing the scan AP list request.
- * @since_ses 1
- * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
- * %http://tizen.org/privilege/appmanager.launch \n
- * %http://tizen.org/privilege/datasharing
- *
- * @remarks Only one callback function can be set with this function.
- * @remarks If multiple callbacks are set, the last one is registered only.
- * @remarks Callback is called when GET request for access point list.
- * @remarks When callback is called, user scans access points, sets AP list and sends it to agent.
- *
- * @param[in] handle The SmartThings handle
- * @param[in] scan_ap_cb The callback to register
- * @param[in] user_data The user data to be passed to the callback function
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
- *
- * @see smartthings_unset_scan_ap_cb()
- * @see smartthings_send_ap_list()
- */
-int smartthings_set_scan_ap_cb(smartthings_h handle,
- smartthings_scan_ap_cb scan_ap_cb,
- void *user_data);
-
-/**
- * @brief Unsets callback for informing the scan AP list request.
- * @since_ses 1
- * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
- * %http://tizen.org/privilege/appmanager.launch \n
- * %http://tizen.org/privilege/datasharing
- *
- * @param[in] handle The SmartThings handle
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
- *
- * @see smartthings_set_scan_ap_cb()
- */
-int smartthings_unset_scan_ap_cb(smartthings_h handle);
-
-/**
- * @brief Sets callback for informing the stop soft AP request.
- * @since_ses 1
- * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
- * %http://tizen.org/privilege/appmanager.launch \n
- * %http://tizen.org/privilege/datasharing
- *
- * @remarks Only one callback function can be set with this function.
- * @remarks If multiple callbacks are set, the last one is registered only.
- * @remarks Callback is called when POST request for stopping soft AP.
- * @remarks When callback is called, user stops soft AP.
- *
- * @param[in] handle The SmartThings handle
- * @param[in] stop_soft_ap_cb The callback to register
- * @param[in] user_data The user data to be passed to the callback function
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
- *
- * @see smartthings_unset_stop_soft_ap_cb()
- */
-int smartthings_set_stop_soft_ap_cb(smartthings_h handle,
- smartthings_stop_soft_ap_cb stop_soft_ap_cb,
- void *user_data);
-
-/**
- * @brief Unsets callback for informing the stop soft AP request.
- * @since_ses 1
- * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
- * %http://tizen.org/privilege/appmanager.launch \n
- * %http://tizen.org/privilege/datasharing
- *
- * @param[in] handle The SmartThings handle
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
- *
- * @see smartthings_set_stop_soft_ap_cb()
- */
-int smartthings_unset_stop_soft_ap_cb(smartthings_h handle);
-
-/**
- * @brief Sends a user confirmation for MUTUAL VERIFICATION BASED JUST WORK Ownership transfer.
- * @since_ses 1
- * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
- * %http://tizen.org/privilege/appmanager.launch \n
- * %http://tizen.org/privilege/datasharing \n
- * %http://tizen.org/privilege/internet
- *
- * @param[in] handle The SmartThings handle
- * @param[in] confirm The user confirmation for OTM(ownership transfer method)
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
- *
- * @see smartthings_set_user_confirm_cb()
- * @see smartthings_unset_user_confirm_cb()
- */
-int smartthings_send_user_confirm(smartthings_h handle, bool confirm);
-
-
-/**
- * @brief Sends a reset confirmation.
- * @since_ses 1
- * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
- * %http://tizen.org/privilege/appmanager.launch \n
- * %http://tizen.org/privilege/datasharing \n
- * %http://tizen.org/privilege/internet
- *
- * @param[in] handle The SmartThings handle
- * @param[in] confirm The reset confirmation
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
- *
- * @see smartthings_set_reset_confirm_cb()
- * @see smartthings_unset_reset_confirm_cb()
- */
-int smartthings_send_reset_confirm(smartthings_h handle, bool confirm);
-
-/**
- * @brief Sends a reset command for resetting the device's Cloud signup and Easy-setup.
- * @since_ses 1
- * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
- * %http://tizen.org/privilege/appmanager.launch \n
- * %http://tizen.org/privilege/datasharing \n
- * %http://tizen.org/privilege/internet
- *
- * @param[in] handle The SmartThings handle
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
- *
- * @see smartthings_set_reset_result_cb()
- * @see smartthings_unset_reset_result_cb()
- */
-int smartthings_reset(smartthings_h handle);
-
-/**
- * @brief Gets SSID of access point.
- * @since_ses 1
- *
- * @remarks The @a ssid should be released using free().
- *
- * @param[in] ap_info_h The SmartThings AP information handle
- * @param[out] ssid The SSID name
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- *
- * @see smartthings_set_wifi_ap_provisioning_cb()
- * @see smartthings_unset_wifi_ap_provisioning_cb()
- */
-int smartthings_apinfo_get_ssid(smartthings_ap_info_h ap_info_h, char **ssid);
-
-/**
- * @brief Gets password of access point.
- * @since_ses 1
- *
- * @remarks The @a pwd should be released using free().
- *
- * @param[in] ap_info_h The SmartThings AP information handle
- * @param[out] pwd The password
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- *
- * @see smartthings_set_wifi_ap_provisioning_cb()
- * @see smartthings_unset_wifi_ap_provisioning_cb()
- */
-int smartthings_apinfo_get_password(smartthings_ap_info_h ap_info_h, char **pwd);
-
-/**
- * @brief Gets authentification type of access point.
- * @since_ses 1
- *
- * @param[in] ap_info_h The SmartThings AP information handle
- * @param[out] authtype The authentification type
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- *
- * @see smartthings_set_wifi_ap_provisioning_cb()
- * @see smartthings_unset_wifi_ap_provisioning_cb()
- */
-int smartthings_apinfo_get_authtype(smartthings_ap_info_h ap_info_h, smartthings_wifi_authtype_e *authtype);
-
-/**
- * @brief Gets encryption type of access point.
- * @since_ses 1
- *
- * @param[in] ap_info_h The SmartThings AP information handle
- * @param[out] enctype The encryption type
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- *
- * @see smartthings_set_wifi_ap_provisioning_cb()
- * @see smartthings_unset_wifi_ap_provisioning_cb()
- */
-int smartthings_apinfo_get_enctype(smartthings_ap_info_h ap_info_h, smartthings_wifi_enctype_e *enctype);
-
-/**
- * @brief Gets channel information of access point.
- * @since_ses 1
- *
- * @param[in] ap_info_h The SmartThings AP information handle
- * @param[out] channel The frequency channel
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- *
- * @see smartthings_set_wifi_ap_provisioning_cb()
- * @see smartthings_unset_wifi_ap_provisioning_cb()
- */
-int smartthings_apinfo_get_channel(smartthings_ap_info_h ap_info_h, int *channel);
-
-/**
- * @brief Gets language of device provisioing information.
- * @since_ses 1
- *
- * @remarks The @a language should be released using free().
- *
- * @param[in] dev_prov_h The SmartThings device provisioning information handle
- * @param[out] language The IETF language tag using ISO 639X
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- *
- * @see smartthings_set_device_provisioning_cb()
- * @see smartthings_unset_device_provisioning_cb()
- */
-int smartthings_devinfo_get_language(smartthings_device_prov_info_h dev_prov_h, char **language);
-
-/**
- * @brief Gets country of device provisioing information.
- * @since_ses 1
- *
- * @remarks The @a country should be released using free().
- *
- * @param[in] dev_prov_h The SmartThings device provisioning information handle
- * @param[out] country The ISO Country Code (ISO 3166-1 Alpha-2)
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- *
- * @see smartthings_set_device_provisioning_cb()
- * @see smartthings_unset_device_provisioning_cb()
- */
-int smartthings_devinfo_get_country(smartthings_device_prov_info_h dev_prov_h, char **country);
-
-/**
- * @brief Gets datetime of device provisioing information.
- * @since_ses 1
- *
- * @remarks The @a datetime should be released using free().
- *
- * @param[in] dev_prov_h The SmartThings device provisioning information handle
- * @param[out] datetime The date and time
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- *
- * @see smartthings_set_device_provisioning_cb()
- * @see smartthings_unset_device_provisioning_cb()
- */
-int smartthings_devinfo_get_datetime(smartthings_device_prov_info_h dev_prov_h, char **datetime);
-
-/**
- * @brief Creates a SmartThings AP list handle.
- * @since_ses 1
- *
- * @remarks The @a ap_list_h must be released using smartthings_aplist_destroy().
- *
- * @param[out] ap_list_h The SmartThings AP list handle to be newly created on success
- * @param[in] count The count of AP
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_OUT_OF_MEMORY Out of memory
- *
- * @see smartthings_aplist_destroy()
- */
-int smartthings_aplist_create(smartthings_ap_list_h *ap_list_h, unsigned int count);
-
-/**
- * @brief Destroys a SmartThings AP list handle.
- * @since_ses 1
- *
- * @param[in] ap_list_h The SmartThings AP list handle
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- *
- * @see smartthings_aplist_create()
- */
-int smartthings_aplist_destroy(smartthings_ap_list_h ap_list_h);
-
-/**
- * @brief Sets SSID at the specific index of AP list handle.
- * @since_ses 1
- *
- * @param[in] ap_list_h The SmartThings AP list handle
- * @param[in] idx The index
- * @param[in] ssid The SSID of AP
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- *
- * @see smartthings_aplist_create()
- * @see smartthings_aplist_destroy()
- */
-int smartthings_aplist_set_ssid(smartthings_ap_list_h ap_list_h, int idx, const char *ssid);
-
-/**
- * @brief Sets BSSID at the specific index of AP list handle.
- * @since_ses 1
- *
- * @param[in] ap_list_h The SmartThings AP list handle
- * @param[in] idx The index
- * @param[in] bssid The BSSID of AP
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- *
- * @see smartthings_aplist_create()
- * @see smartthings_aplist_destroy()
- */
-int smartthings_aplist_set_bssid(smartthings_ap_list_h ap_list_h, int idx, const char *bssid);
-
-/**
- * @brief Sets authentification type at the specific index of AP list handle.
- * @since_ses 1
- *
- * @param[in] ap_list_h The SmartThings AP list handle
- * @param[in] idx The index
- * @param[in] authtype The authentification type of AP
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- *
- * @see smartthings_aplist_create()
- * @see smartthings_aplist_destroy()
- */
-int smartthings_aplist_set_authtype(smartthings_ap_list_h ap_list_h, int idx, smartthings_wifi_authtype_e authtype);
-
-/**
- * @brief Sets encryption type at the specific index of AP list handle.
- * @since_ses 1
- *
- * @param[in] ap_list_h The SmartThings AP list handle
- * @param[in] idx The index
- * @param[in] enctype The encryption type of AP
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- *
- * @see smartthings_aplist_create()
- * @see smartthings_aplist_destroy()
- */
-int smartthings_aplist_set_enctype(smartthings_ap_list_h ap_list_h, int idx, smartthings_wifi_enctype_e enctype);
-
-/**
- * @brief Sets frequency channel at the specific index of AP list handle.
- * @since_ses 1
- *
- * @param[in] ap_list_h The SmartThings AP list handle
- * @param[in] idx The index
- * @param[in] channel The frequency channel of AP
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- *
- * @see smartthings_aplist_create()
- * @see smartthings_aplist_destroy()
- */
-int smartthings_aplist_set_channel(smartthings_ap_list_h ap_list_h, int idx, int channel);
-
-/**
- * @brief Sets signal level at the specific index of AP list handle.
- * @since_ses 1
- *
- * @param[in] ap_list_h The SmartThings AP list handle
- * @param[in] idx The index
- * @param[in] signal_level The signal level of AP
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- *
- * @see smartthings_aplist_create()
- * @see smartthings_aplist_destroy()
- */
-int smartthings_aplist_set_signal_level(smartthings_ap_list_h ap_list_h, int idx, int signal_level);
-
-/**
- * @brief Sets max speed rate at the specific index of AP list handle.
- * @since_ses 1
- *
- * @param[in] ap_list_h The SmartThings AP list handle
- * @param[in] idx The index
- * @param[in] max_rate The max speed rate of AP
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- *
- * @see smartthings_aplist_create()
- * @see smartthings_aplist_destroy()
- */
-int smartthings_aplist_set_max_rate(smartthings_ap_list_h ap_list_h, int idx, int max_rate);
-
-/**
- * @brief Sends the scanned AP list.
- * @since_ses 1
- * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
- * %http://tizen.org/privilege/appmanager.launch \n
- * %http://tizen.org/privilege/datasharing \n
- * %http://tizen.org/privilege/internet
- *
- * @param[in] handle The SmartThings handle
- * @param[in] ap_list_h The SmartThings AP list handle
- * @param[in] req_id The request ID
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_OUT_OF_MEMORY Out of memory
- * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
- *
- * @see smartthings_aplist_create()
- * @see smartthings_aplist_destroy()
- * @see smartthings_set_scan_ap_cb()
- */
-int smartthings_send_ap_list(smartthings_h handle, smartthings_ap_list_h ap_list_h, int req_id);
-
-/**
- * @brief Creates a SmartThings cloud information handle.
- * @since_ses 1
- *
- * @remarks The @a cloud_info_h must be released using smartthings_cloudinfo_destroy().
- *
- * @param[out] cloud_info_h The SmartThings cloud information handle to be newly created on success
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_OUT_OF_MEMORY Out of memory
- *
- * @see smartthings_cloudinfo_destroy()
- */
-int smartthings_cloudinfo_create(smartthings_cloud_info_h *cloud_info_h);
-
-/**
- * @brief Destroys a SmartThings cloud information handle.
- * @since_ses 1
- *
- * @param[in] cloud_info_h The SmartThings cloud information handle
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- *
- * @see smartthings_cloudinfo_create()
- */
-int smartthings_cloudinfo_destroy(smartthings_cloud_info_h cloud_info_h);
-
-/**
- * @brief Sets region of cloud information.
- * @since_ses 1
- *
- * @remarks The @a region can be set to one of "global" or "china".
- * @remarks If it doesn't use this function, the @a region will be set to "global" internally.
- *
- * @param[in] cloud_info_h The SmartThings cloud information handle
- * @param[in] region The region name
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- */
-int smartthings_cloudinfo_set_region(smartthings_cloud_info_h cloud_info_h, const char *region);
-
-/**
- * @brief Sets authentification provider of cloud information.
- * @since_ses 1
- *
- * @param[in] cloud_info_h The SmartThings cloud information handle
- * @param[in] auth_provider The authentification provider
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- */
-int smartthings_cloudinfo_set_auth_provider(smartthings_cloud_info_h cloud_info_h, const char *auth_provider);
-
-/**
- * @brief Sets access token of cloud information.
- * @since_ses 1
- *
- * @param[in] cloud_info_h The SmartThings cloud information handle
- * @param[in] access_token The access token
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- */
-int smartthings_cloudinfo_set_access_token(smartthings_cloud_info_h cloud_info_h, const char *access_token);
-
-/**
- * @brief Sets refresh token of cloud information.
- * @since_ses 1
- *
- * @param[in] cloud_info_h The SmartThings cloud information handle
- * @param[in] refresh_token The refresh token
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- */
-int smartthings_cloudinfo_set_refresh_token(smartthings_cloud_info_h cloud_info_h, const char *refresh_token);
-
-/**
- * @brief Sets user ID of cloud information.
- * @since_ses 1
- *
- * @param[in] cloud_info_h The SmartThings cloud information handle
- * @param[in] user_id The user ID
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- */
-int smartthings_cloudinfo_set_user_id(smartthings_cloud_info_h cloud_info_h, const char *user_id);
-
-/**
- * @brief Sets client ID of cloud information.
- * @since_ses 1
- *
- * @param[in] cloud_info_h The SmartThings cloud information handle
- * @param[in] client_id The client ID
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- */
-int smartthings_cloudinfo_set_client_id(smartthings_cloud_info_h cloud_info_h, const char *client_id);
-
-/**
- * @brief Requests to sign up to cloud.
- * @since_ses 1
- * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
- * %http://tizen.org/privilege/appmanager.launch \n
- * %http://tizen.org/privilege/datasharing \n
- * %http://tizen.org/privilege/internet
- *
- * @param[in] handle The SmartThings handle
- * @param[in] cloud_info_h The handle for cloud signup
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
- */
-int smartthings_sign_up_cloud(smartthings_h handle, smartthings_cloud_info_h cloud_info_h);
-
-/**
- * @brief Sets preconfigured PIN.
- * @since_ses 1
- * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
- * %http://tizen.org/privilege/appmanager.launch \n
- * %http://tizen.org/privilege/datasharing
- *
- * @param[in] handle The SmartThings handle
- * @param[in] pin The PIN code to preconfigure
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
- */
-int smartthings_set_preconfigured_pin(smartthings_h handle, const char* pin);
-
-/**
- * @brief Sets MOT(multiple ownership transfer) status.
- * @since_ses 1
- * @privilege %http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master \n
- * %http://tizen.org/privilege/appmanager.launch \n
- * %http://tizen.org/privilege/datasharing
- *
- * @param[in] handle The SmartThings handle
- * @param[in] enable The MOT(multiple ownership transfer) status
- *
- * @return @c 0 on success,
- * otherwise a negative error value
- * @retval #SMARTTHINGS_ERROR_NONE Successful
- * @retval #SMARTTHINGS_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #SMARTTHINGS_ERROR_PERMISSION_DENIED Permission denied
- * @retval #SMARTTHINGS_ERROR_OPERATION_FAILED Operation failed
- * @retval #SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE Service unavailable
- */
-int smartthings_set_mot_status(smartthings_h handle, bool enable);
-
-/**
- * @}
- */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* __SAMSUNG_EXPERIENCE_SERVICE_SMARTTHINGS_H__ */
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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 VIEW_ADVERTISEMENT_H
-#define VIEW_ADVERTISEMENT_H
-
-#include "View.hpp"
-#include <string>
-
-class ViewAdvertisement : public View
-{
-public:
- ViewAdvertisement() = default;
- ~ViewAdvertisement() = default;
- ViewAdvertisement(const ViewAdvertisement &) = delete;
- ViewAdvertisement& operator=(const ViewAdvertisement &) = delete;
- ViewAdvertisement(ViewAdvertisement &&) = default;
- ViewAdvertisement& operator=(ViewAdvertisement &&) = default;
- virtual void show() override;
- virtual void hide() override;
-private:
- static const std::string VIEW_ADVERTISEMENT_EDJE_FILE;
-
- static const std::string VIEW_ADVERTISEMENT_TEXT_KEY;
- static const std::string VIEW_ADVERTISEMENT_SKIP_TEXT_KEY;
-};
-
-#endif //VIEW_ADVERTISEMENT_H
\ No newline at end of file
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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 VIEW_AUTO_CONFIGURATION_H
-#define VIEW_AUTO_CONFIGURATION_H
-
-#include "View.hpp"
-#include <string>
-
-class ViewAutoConfiguration : public View
-{
-public:
- ViewAutoConfiguration() = default;
- ~ViewAutoConfiguration() = default;
- ViewAutoConfiguration(const ViewAutoConfiguration &) = delete;
- ViewAutoConfiguration& operator=(const ViewAutoConfiguration &) = delete;
- ViewAutoConfiguration(ViewAutoConfiguration &&) = default;
- ViewAutoConfiguration& operator=(ViewAutoConfiguration &&) = default;
- virtual void show() override;
- virtual void hide() override;
-private:
- static const std::string VIEW_AUTO_CONFIGURATION_EDJE_FILE;
-
- static const std::string VIEW_AUTO_CONFIGURATION_TEXT_KEY;
- static const std::string VIEW_AUTO_CONFIGURATION_SKIP_TEXT_KEY;
-};
-
-#endif //VIEW_AUTO_CONFIGURATION_H
\ No newline at end of file
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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 VIEW_CONNECTED_TO_SOFTAP_H
-#define VIEW_CONNECTED_TO_SOFTAP_H
-
-#include "View.hpp"
-#include <string>
-
-class ViewConnectedToSoftAP : public View
-{
-public:
- ViewConnectedToSoftAP() = default;
- ~ViewConnectedToSoftAP() = default;
- ViewConnectedToSoftAP(const ViewConnectedToSoftAP &) = delete;
- ViewConnectedToSoftAP& operator=(const ViewConnectedToSoftAP &) = delete;
- ViewConnectedToSoftAP(ViewConnectedToSoftAP &&) = default;
- ViewConnectedToSoftAP& operator=(ViewConnectedToSoftAP &&) = default;
- virtual void show() override;
- virtual void hide() override;
-private:
- static const std::string VIEW_CONNECTED_TO_SOFTAP_EDJE_FILE;
-
- static const std::string VIEW_CONNECTED_TO_SOFTAP_TEXT_KEY;
- static const std::string VIEW_CONNECTED_TO_SOFTPA_SKIP_TEXT_KEY;
-};
-
-#endif //VIEW_CONNECTED_TO_SOFTAP_H
\ No newline at end of file
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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 VIEW_ERROR_H
-#define VIEW_ERROR_H
-
-#include "View.hpp"
-#include "ErrorType.hpp"
-#include <string>
-
-class ViewError : public View
-{
-public:
- ViewError(ErrorType errorType = ErrorType::RESETABLE);
- ~ViewError() = default;
- ViewError(const ViewError &) = delete;
- ViewError& operator=(const ViewError &) = delete;
- ViewError(ViewError &&) = default;
- ViewError& operator=(ViewError &&) = default;
-
- virtual void show() override;
- virtual void hide() override;
-private:
- ErrorType _errorType;
-
- static const std::string VIEW_ERROR_EDJE_FILE;
-
- static const std::string VIEW_ERROR_SKIP_TEXT_KEY;
- static const std::string VIEW_ERROR_RESETABLE_MAIN_TEXT_KEY;
- static const std::string VIEW_ERROR_UNRECOVERABLE_MAIN_TEXT_KEY;
- static const std::string VIEW_ERROR_RESETABLE_TEXT_KEY;
- static const std::string VIEW_ERROR_UNRECOVERABLE_TEXT_KEY;
-};
-
-#endif //VIEW_SUCCESS_H
\ No newline at end of file
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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 VIEW_PIN_H
-#define VIEW_PIN_H
-
-#include "View.hpp"
-#include <string>
-
-class ViewPin : public View
-{
-public:
- ViewPin(const std::string &pin = "");
- ~ViewPin() = default;
- ViewPin(const ViewPin &) = delete;
- ViewPin& operator=(const ViewPin &) = delete;
- ViewPin(ViewPin &&) = default;
- ViewPin& operator=(ViewPin &&) = default;
- virtual void show() override;
- virtual void hide() override;
-private:
- std::string _pin;
- static const std::string VIEW_PIN_EDJE_FILE;
- void _setPinOnView();
- void _setPinOnView(const std::string & pin);
- Evas_Object *_layout;
-
- static const std::string VIEW_PIN_TEXT_KEY;
- static const std::string VIEW_PIN_SKIP_TEXT_KEY;
-};
-
-#endif //VIEW_PIN_H
\ No newline at end of file
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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 VIEW_START_H
-#define VIEW_START_H
-
-#include "View.hpp"
-#include <string>
-
-class ViewStart : public View
-{
-public:
- ViewStart() = default;
- ~ViewStart() = default;
- ViewStart(const ViewStart &) = delete;
- ViewStart& operator=(const ViewStart &) = delete;
- ViewStart(ViewStart &&) = default;
- ViewStart& operator=(ViewStart &&) = default;
- virtual void show() override;
- virtual void hide() override;
-private:
- static const std::string VIEW_START_EDJE_FILE;
-
- static const std::string VIEW_START_SKIP_TEXT_KEY;
- static const std::string VIEW_START_START_TEXT_KEY;
- static const std::string VIEW_START_TEXT_KEY;
-};
-
-#endif //VIEW_START_H
\ No newline at end of file
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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 VIEW_SUCCESS_H
-#define VIEW_SUCCESS_H
-
-#include "View.hpp"
-#include <string>
-
-class ViewSuccess : public View
-{
-public:
- ViewSuccess(bool fullDone = false);
- ~ViewSuccess() = default;
- ViewSuccess(const ViewSuccess &) = delete;
- ViewSuccess& operator=(const ViewSuccess &) = delete;
- ViewSuccess(ViewSuccess &&) = default;
- ViewSuccess& operator=(ViewSuccess &&) = default;
-
- virtual void show() override;
- virtual void hide() override;
-private:
- bool _fullDone;
- static const std::string VIEW_SUCCESS_EDJE_FILE;
-
- static const std::string VIEW_SUCCESS_DONE_TEXT_KEY;
- static const std::string VIEW_SUCCESS_MAIN_LOGGED_TEXT_KEY;
- static const std::string VIEW_SUCCESS_MAIN_NOT_LOGGED_TEXT_KEY;
-};
-
-#endif //VIEW_SUCCESS_H
\ No newline at end of file
+++ /dev/null
-
-# Project Name
-APPNAME = oobe-easy-setup
-
-# Project Type
-type = app
-
-# Project Profile
-profile = iot-headed-5.0
-
-# C/CPP Sources
-USER_SRCS = api-cpp/src/tizen/network/wifi/SpecificScan.cpp api-cpp/src/tizen/network/softap/Manager.cpp api-cpp/src/tizen/network/bluetooth/AdvertiserLE.cpp api-cpp/src/tizen/network/bluetooth/DeviceInfo.cpp ses-cpp/src/ses/smartthings/thing/SmartThingsThingExceptions.cpp api-cpp/src/tizen/network/softap/Client.cpp api-cpp/src/tizen/application/ServiceApp.cpp src/views/ViewPin.cpp api-cpp/src/tizen/application/UiApp.cpp src/views/ViewError.cpp api-cpp/src/tizen/ThreadUtils.cpp ses-cpp/src/ses/smartthings/thing/Master.cpp src/ViewManager.cpp src/views/ViewAutoConfiguration.cpp src/OobeEasySetupApp.cpp api-cpp/src/tizen/Logger.cpp src/views/ViewAdertisement.cpp api-cpp/src/tizen/application/Resource.cpp src/ViewEventAdapter.cpp api-cpp/src/tizen/network/wifi/Ap.cpp api-cpp/src/tizen/network/bluetooth/DiscoveryInfo.cpp api-cpp/src/tizen/peripheral/gpio/Pin.cpp api-cpp/src/tizen/network/bluetooth/Manager.cpp api-cpp/src/tizen/peripheral/spi/SpiException.cpp ses-cpp/src/ses/smartthings/thing/ApList.cpp ses-cpp/src/ses/smartthings/thing/CloudInfo.cpp src/TestUIViewEventAdapter.cpp src/views/ViewConnectedToSoftAP.cpp src/EasySetupEventAdapter.cpp ses-cpp/src/ses/smartthings/thing/ApInfo.cpp src/AppUtils.cpp api-cpp/src/tizen/application/AppException.cpp api-cpp/src/tizen/network/bluetooth/Adapter.cpp src/connectivity/TizenHomeAP.cpp src/StateManager.cpp api-cpp/src/tizen/network/wifi/Manager.cpp api-cpp/src/tizen/network/bluetooth/Exceptions.cpp api-cpp/src/tizen/network/wifi/Exception.cpp api-cpp/src/tizen/peripheral/gpio/GpioException.cpp api-cpp/src/tizen/timer/TimerException.cpp src/ViewEventObserver.cpp ses-cpp/src/ses/smartthings/thing/DeviceProvInfo.cpp api-cpp/src/tizen/application/AppControl.cpp api-cpp/src/tizen/key_manager/KeyManager.cpp src/views/ViewStart.cpp src/connectivity/TizenSoftAP.cpp api-cpp/src/tizen/Strings.cpp api-cpp/src/tizen/peripheral/spi/Spi.cpp src/OobeEasySetupMain.cpp src/EasySetup.cpp src/popups/PopupSkip.cpp api-cpp/src/tizen/timer/Timer.cpp
-
-# EDC Sources
-USER_EDCS =
-
-# PO Sources
-USER_POS = res/po/en_US.po res/po/pl_PL.po
-
-# User Defines
-USER_DEFS =
-USER_CPP_DEFS = TIZEN_DEPRECATION DEPRECATION_WARNING
-
-# User Undefines
-USER_UNDEFS =
-USER_CPP_UNDEFS =
-
-# User Libraries
-USER_LIBS = st_thing_master_api
-
-# User Objects
-USER_OBJS =
-
-# User Includes
-## C Compiler
-USER_C_INC_DIRS =
-USER_INC_FILES =
-## C++ Compiler
-USER_CPP_INC_DIRS = inc api-cpp/src ses-cpp/src inc/services/arm
-USER_CPP_INC_FILES =
-USER_CPP_OPTS = -std=c++14
-
-USER_INC_DIRS = $(USER_C_INC_DIRS) $(USER_CPP_INC_DIRS)
-
-# User Library Path
-USER_LIB_DIRS = lib
-
-# EDC Resource Path
-USER_EDCS_IMAGE_DIRS = ${OUTPUT_DIR} edje/images
-USER_EDCS_SOUND_DIRS = ${OUTPUT_DIR} edje/sounds
-USER_EDCS_FONT_DIRS = ${OUTPUT_DIR} edje/fonts
-
-# EDC Flags
-USER_EXT_EDC_KEYS = EDC0
-
-USER_EXT_EDC0_EDCS = res/edje/connected_to_softap.edc res/edje/pin.edc res/edje/advertisement.edc res/edje/error.edc res/edje/oobe_button.edc res/edje/start.edc res/edje/auto_configuration.edc
-USER_EXT_EDC0_EDCS_IMAGE_DIRS = ${OUTPUT_DIR} edje/images
-USER_EXT_EDC0_EDCS_SOUND_DIRS = ${OUTPUT_DIR} edje/sounds
-USER_EXT_EDC0_EDCS_FONT_DIRS = ${OUTPUT_DIR} edje/fonts
-
-# Resource Filter
-USER_RES_INCLUDE =
-USER_RES_EXCLUDE =
-
+++ /dev/null
-#include "common_definitions.h"
-
-#define ANIMATION_DURATION 3.0
-
-collections {
- base_scale: 1.8;
- images {
- image: RECT_IMAGE COMP;
- image: BG_IMAGE COMP;
- image: TRIANGLE_IMAGE COMP;
- image: PHONE_IMAGE_LEFT COMP;
- image: APP_STORES_IMAGE COMP;
- image: SMARTTHINGS_LOGO_IMAGE COMP;
- }
-
- fonts {
- font: SAMSUNG_ONE_400_PATH SAMSUNG_ONE_400;
- }
-
- styles {
- MAIN_STYLE("main_style")
- }
-
- group { GRP_MAIN;
- parts {
- PART_BG
- PART_PHONE_LEFT
- PART_SMARTTHINGS
- PART_BUBBLE(ADVERTISEMENT_TEXT, ADVERTISEMENT_BUBBLE_RECT, ADVERTISEMENT_BUBBLE_TRIANGLE)
- PART_BUBBLE_TEXT(ADVERTISEMENT_TEXT, ADVERTISEMENT_BUBBLE_RECT, "main_style", 596, 400, 550)
-
- PART_BUTTON_SKIP(ADVERTISEMENT_SKIP_PLACEHOLDER)
- }
-
- programs {
- program {
- name: "load";
- signal: "load";
- source: "";
- sequence {
- action: STATE_SET "upper";
- target: "phone";
-
- action: STATE_SET "default";
- target: "phone";
- transition: LINEAR ANIMATION_DURATION;
- }
- }
- }
- }
-}
+++ /dev/null
-#include "common_definitions.h"
-
-collections {
- base_scale: 1.8;
- images {
- image: RECT_IMAGE COMP;
- image: BG_IMAGE COMP;
- image: TRIANGLE_IMAGE COMP;
- image: PHONE_IMAGE_RIGHT COMP;
- image: APP_STORES_IMAGE COMP;
- image: SMARTTHINGS_LOGO_IMAGE COMP;
- }
-
- fonts {
- font: SAMSUNG_ONE_400_PATH SAMSUNG_ONE_400;
- }
-
- styles {
- style {
- name: "main_style";
- base: "font="SAMSUNG_ONE_400" font_size=35 color=#F3F9EF wrap=mixed align=left valign=center linegap=0";
- tag: "b" "+ font_weight=Bold";
- }
- }
-
- group { GRP_MAIN;
- parts {
- PART_BG
- PART_PHONE_RIGHT
- PART_SMARTTHINGS
- PART_BUBBLE(AUTO_CONFIGURATION_TEXT, AUTO_CONFIGURATION_BUBBLE_RECT, AUTO_CONFIGURATION_BUBBLE_TRIANGLE)
- PART_BUBBLE_TEXT(AUTO_CONFIGURATION_TEXT, AUTO_CONFIGURATION_BUBBLE_RECT, "main_style", 596, 400, 550)
-
- PART_BUTTON_SKIP(AUTO_CONFIGURATION_SKIP_PLACEHOLDER)
- }
- }
-}
+++ /dev/null
-#define START_START_PLACEHOLDER "btn.start.placeholder"
-#define START_SKIP_PLACEHOLDER "btn.skip.placeholder"
-#define START_TEXT "bubble_text"
-#define START_BUBBLE_RECT "bubble_rect"
-#define START_BUBBLE_TRIANGLE "bubble_triangle"
-#define ADVERTISEMENT_SKIP_PLACEHOLDER "btn.skip.placeholder"
-#define ADVERTISEMENT_TEXT "bubble_text"
-#define ADVERTISEMENT_BUBBLE_RECT "bubble_rect"
-#define ADVERTISEMENT_BUBBLE_TRIANGLE "bubble_traingle"
-#define CONNECTED_TO_SOFTAP_SKIP_PLACEHOLDER "btn.skip.placeholder"
-#define CONNECTED_TO_SOFTAP_TEXT "bubble_text"
-#define CONNECTED_TO_SOFTAP_TEXT_IND "text_anim_ind"
-#define CONNECTED_TO_SOFTAP_TEXT0 "text_anim0"
-#define CONNECTED_TO_SOFTAP_TEXT1 "text_anim1"
-#define CONNECTED_TO_SOFTAP_TEXT2 "text_anim2"
-#define CONNECTED_TO_SOFTAP_TEXT3 "text_anim3"
-#define CONNECTED_TO_SOFTAP_BUBBLE_RECT "bubble_rect"
-#define CONNECTED_TO_SOFTAP_BUBBLE_TRIANGLE "bubble_triangle"
-#define PIN_SKIP_PLACEHOLDER "btn.skip.placeholder"
-#define PIN_PIN_TEXT1 "text.pin.1"
-#define PIN_PIN_TEXT2 "text.pin.2"
-#define PIN_PIN_TEXT3 "text.pin.3"
-#define PIN_PIN_TEXT4 "text.pin.4"
-#define PIN_PIN_TEXT5 "text.pin.5"
-#define PIN_PIN_TEXT6 "text.pin.6"
-#define PIN_PIN_TEXT7 "text.pin.7"
-#define PIN_PIN_TEXT8 "text.pin.8"
-#define PIN_TEXT "bubble_text"
-#define PIN_BUBBLE_RECT "bubble_rect"
-#define PIN_BUBBLE_TRIANGLE "bubble_triangle"
-#define AUTO_CONFIGURATION_SKIP_PLACEHOLDER "btn.skip.placeholder"
-#define AUTO_CONFIGURATION_TEXT "bubble_text"
-#define AUTO_CONFIGURATION_BUBBLE_RECT "bubble_rect"
-#define AUTO_CONFIGURATION_BUBBLE_TRIANGLE "bubble_triangle"
-#define ERROR_MAIN_BUTTON_PLACEHOLDER "btn.main.placeholder"
-#define ERROR_EXTRA_BUTTON_PLACEHOLDER "btn.extra.placeholder"
-#define ERROR_TEXT "text"
-#define SKIP_POPUP_YES_PLACEHOLDER "btn.yes.placeholder"
-#define SKIP_POPUP_NO_PLACEHOLDER "btn.no.placeholder"
-
-#define SAMSUNG_ONE_300_PATH "SamsungOneUI-300_v1.0.ttf"
-#define SAMSUNG_ONE_300 "samsung-one-300"
-#define SAMSUNG_ONE_400_PATH "SamsungOneUI-400_v3.0.ttf"
-#define SAMSUNG_ONE_400 "samsung-one-400"
-#define SAMSUNG_ONE_400C_PATH "SamsungOneUI-400C_v1.0.ttf"
-#define SAMSUNG_ONE_400C "samsung-one-400c"
-#define SAMSUNG_ONE_600_PATH "SamsungOneUI-600_v3.0.ttf"
-#define SAMSUNG_ONE_600 "samsung-one-600"
-#define SAMSUNG_ONE_800_PATH "SamsungOneUI-800_v1.0.ttf"
-#define SAMSUNG_ONE_800 "samsung-one-800"
-
-#define BG_IMAGE "bg.png"
-#define PHONE_IMAGE_LEFT "es/phone_image_left.png"
-#define PHONE_IMAGE_RIGHT "es/phone_image_right.png"
-#define SMARTTHINGS_LOGO_IMAGE "es/smartthings_logo.png"
-#define TRIANGLE_IMAGE "es/bubble_triangle.png"
-#define RECT_IMAGE "es/rect100x100.png"
-#define CIRCLE_IMAGE "es/puls_circle.png"
-#define ICON_IMAGE "es/icon_phone.png"
-
-#define GRP_MAIN "main"
-
-#define COLOR_DARK_GREY 19 64 54 255
-#define COLOR_GREEN 16 27 2 255
-#define COLOR_QUASI_WHITE 243 249 239 255
-#define COLOR_WHITE 255 255 255 255
-
-#define MAX_TEXTBLOCK_HEIGHT 500
-#define CALC_Y_TEXTBLOCK_START(Y_CENTER) (Y_CENTER - MAX_TEXTBLOCK_HEIGHT/2)
-#define CALC_Y_TEXTBLOCK_END(Y_CENTER) (Y_CENTER + MAX_TEXTBLOCK_HEIGHT/2)
-
-#define TEXT_COLOR COLOR_QUASI_WHITE
-#define TEXT_SIZE 35
-
-#define BUBBLE_COLOR COLOR_DARK_GREY
-
-#define MAIN_STYLE(NAME) \
- style { \
- name: NAME; \
- base: "font=samsung-one-400 font_size=35 color=#F3F9EF wrap=mixed align=left valign=0 linegap=0";\
- tag: "b" "+ font_weight=Bold"; \
- }
-
-#define PART_BG \
- image { "bg"; \
- description { "default"; \
- rel1.relative: 0/1280 0/720; \
- rel2.relative: (1280-254)/1280 720/720; \
- image.normal: BG_IMAGE; \
- image.middle: DEFAULT; \
- } \
- }
-
-#define PART_PHONE_LEFT \
- image { "phone"; \
- description { "default"; \
- rel1.relative: 84/1280 130/720; \
- rel2.relative: (84+468)/1280 (130+479)/720; \
- image.normal: PHONE_IMAGE_LEFT; \
- image.middle: DEFAULT; \
- } \
- description { "upper" \
- inherit: "default"; \
- rel1.relative: 84/1280 87/720; \
- rel2.relative: (84+468)/1280 (87+479)/720; \
- } \
- } \
-
-
-#define PART_PHONE_RIGHT \
- image { "phone"; \
- description { "default"; \
- rel1.relative: 84/1280 130/720; \
- rel2.relative: (84+468)/1280 (130+479)/720; \
- image.normal: PHONE_IMAGE_RIGHT; \
- image.middle: DEFAULT; \
- } \
- description { "upper" \
- inherit: "default"; \
- rel1.relative: 84/1280 87/720; \
- rel2.relative: (84+468)/1280 (87+479)/720; \
- } \
- }
-
-#define PART_SMARTTHINGS \
- image { "smartthings_logo"; \
- description { "default"; \
- rel.to: "phone"; \
- rel1.relative: 206/468 66/479; \
- rel2.relative: (206+140)/468 (66+309)/479; \
- image.normal: SMARTTHINGS_LOGO_IMAGE; \
- image.middle: DEFAULT; \
- } \
- }
-
-#define PART_BUBBLE_TEXT(TEXT_PART, BUBBLE_RECT_PART, STYLE, X, Y_CENTER, WIDTH)\
- textblock { TEXT_PART; \
- mouse_events: 0; \
- multiline: 1; \
- description { "default"; \
- rel1.relative: X/1280 CALC_Y_TEXTBLOCK_START(Y_CENTER)/720; \
- rel2.relative: (X+WIDTH)/1280 CALC_Y_TEXTBLOCK_END(Y_CENTER)/720; \
- align: 0.0 0.5; \
- color: TEXT_COLOR; \
- text { \
- text: "?"; \
- elipsis: -1; \
- align: 0.0 0.5; \
- max: 1 1; \
- style: STYLE; \
- } \
- } \
- }
-
-#define PART_BUBBLE(TEXT_PART, BUBBLE_RECT_PART, BUBBLE_TRIANGLE_PART)\
- image { BUBBLE_RECT_PART; \
- description { "default"; \
- rel.to: TEXT_PART; \
- rel1.offset: -20 -10; \
- rel2.offset: 20 10; \
- image.normal: RECT_IMAGE; \
- image.middle: DEFAULT; \
- image.border: 3 3 3 3; \
- color: BUBBLE_COLOR; \
- } \
- } \
- image { BUBBLE_TRIANGLE_PART; \
- description { "default"; \
- rel.to: BUBBLE_RECT_PART; \
- rel1.offset: -26 0; \
- min: 27 27; \
- max: 27 27; \
- align: 0 0.5; \
- image.normal: TRIANGLE_IMAGE; \
- image.middle: DEFAULT; \
- color: BUBBLE_COLOR; \
- } \
- }
-
-#define PART_BUTTON_SKIP(NAME) \
- swallow { NAME; \
- mouse_events: 1; \
- description { "default"; \
- rel1.relative: 1072/1280 38/720; \
- rel2.relative: (1280-35)/1280 (720-622)/720; \
- } \
- }
+++ /dev/null
-#include "common_definitions.h"
-
-#define TEXT_TEXT0 "Connecting "
-#define TEXT_TEXT1 "Connecting. "
-#define TEXT_TEXT2 "Connecting.. "
-#define TEXT_TEXT3 "Connecting..."
-
-#define TEXT_ANIMATION_TIME 1.0
-#define TEXT_ANIMATION_FRAME_TIME (TEXT_ANIMATION_TIME/4)
-
-#define PULSAR_ANIMATION_TIME 1.0
-#define PULSAR_ANIMATION_FRAME_TIME (PULSAR_ANIMATION_TIME/2)
-
-#define TEXT_BUF_SIZE 1024
-
-collections {
- base_scale: 1.8;
- images {
- image: RECT_IMAGE COMP;
- image: BG_IMAGE COMP;
- image: TRIANGLE_IMAGE COMP;
- image: PHONE_IMAGE_LEFT COMP;
- image: APP_STORES_IMAGE COMP;
- image: SMARTTHINGS_LOGO_IMAGE COMP;
- image: CIRCLE_IMAGE COMP;
- image: ICON_IMAGE COMP;
- }
-
- fonts {
- font: SAMSUNG_ONE_400_PATH SAMSUNG_ONE_400;
- }
-
- styles {
- MAIN_STYLE("main_style")
- }
-
- group { GRP_MAIN;
- parts {
- PART_BG
- PART_PHONE_LEFT
-
- image { "pulsar";
- description { "default";
- rel.to: "icon";
- image.normal: CIRCLE_IMAGE;
- image.middle: DEFAULT;
- }
- description { "clutched";
- inherit: "default";
- rel1.offset: -19 -19;
- rel2.offset: 19 19;
- }
- }
-
- image { "icon";
- description { "default";
- rel1.relative: 337/1280 253/720;
- rel2.relative: (337+50)/1280 (253+50)/720;
- image.normal: ICON_IMAGE;
- image.middle: DEFAULT;
- }
- }
-
- PART_BUBBLE(CONNECTED_TO_SOFTAP_TEXT, CONNECTED_TO_SOFTAP_BUBBLE_RECT, CONNECTED_TO_SOFTAP_BUBBLE_TRIANGLE)
- PART_BUBBLE_TEXT(CONNECTED_TO_SOFTAP_TEXT, CONNECTED_TO_SOFTAP_BUBBLE_RECT, "main_style", 596, 400, 550)
-
- PART_BUTTON_SKIP(CONNECTED_TO_SOFTAP_SKIP_PLACEHOLDER)
- }
-
- programs {
- program {
- name: "load";
- signal: "load";
- source: "";
- sequence {
- action: SIGNAL_EMIT "text_anim" "";
- action: SIGNAL_EMIT "pulsar_anim" "";
- }
- }
-
- /*program { "text_animator";
- signal: "text_anim";
- source: "";
-
- sequence {
- action: TEXT_SET ;
- target: CONNECTED_TO_SOFTAP_TEXT;
- transition: LINEAR TEXT_ANIMATION_FRAME_TIME;
-
- action: TEXT_SET "text1";
- target: CONNECTED_TO_SOFTAP_TEXT;
- transition: LINEAR TEXT_ANIMATION_FRAME_TIME;
-
- action: TEXT_SET "text2";
- target: CONNECTED_TO_SOFTAP_TEXT;
- transition: LINEAR TEXT_ANIMATION_FRAME_TIME;
-
- action: TEXT_SET "text3";
- target: CONNECTED_TO_SOFTAP_TEXT;
- transition: LINEAR TEXT_ANIMATION_FRAME_TIME;
-
- action: SIGNAL_EMIT "text_anim" "";
- }
- }*/
-
- program { "pulsar_animator";
- signal: "pulsar_anim";
- source: "";
-
- sequence {
- action: STATE_SET "default";
- target: "pulsar";
- transition: LINEAR PULSAR_ANIMATION_FRAME_TIME;
-
- action: STATE_SET "clutched";
- target: "pulsar";
- transition: LINEAR PULSAR_ANIMATION_FRAME_TIME;
-
- action: SIGNAL_EMIT "pulsar_anim" "";
- }
- }
- }
- }
-}
+++ /dev/null
-#include "common_definitions.h"
-
-#define GEARS_IMAGE "es/gears.png"
-
-collections {
- base_scale: 1.8;
-
- images {
- image: BG_IMAGE COMP;
- image: GEARS_IMAGE COMP;
- }
-
- styles {
- style {
- name: "error_style";
- base: "font=samsung-one-400 font_size=36 color=#102502 wrap=mixed align=center valign=0 linegap=0";
- tag: "b" "+ font_weight=Bold";
- }
- }
-
- group { GRP_MAIN;
- parts {
- PART_BG
-
- image { "gears";
- description {
- rel1.relative: 280/1280 76/720;
- rel2.relative: (280+325)/1280 (76+295)/720;
- image.normal: GEARS_IMAGE;
- }
- }
-
- textblock { ERROR_TEXT;
- multiline: 1;
- description { "default";
- rel1.relative: 154/1280 400/720;
- rel2.relative: (154+610)/1280 (400+100)/720;
- align: 0.5 0.5;
- text {
- text: "?";
- style: "error_style";
- elipsis: -1;
- align: 0.5 0.5;
- }
- }
- }
-
- swallow { ERROR_MAIN_BUTTON_PLACEHOLDER;
- mouse_events: 1;
- description { "default";
- rel1.relative: 169/1280 552/720;
- rel2.relative: (1280-538)/1280 (720-108)/720;
- }
- }
-
- PART_BUTTON_SKIP(ERROR_EXTRA_BUTTON_PLACEHOLDER)
- }
- }
-}
\ No newline at end of file
+++ /dev/null
-#include "../../../edje-common/oobe_button_definition.edc"
+++ /dev/null
-#include "common_definitions.h"
-
-#define PIN_SIZE 25
-
-#define PIN_COLOR COLOR_DARK_GREY
-
-#define PIN_DIGIT_WIDTH 15
-#define PIN_DIGIT_HEIGHT 30
-
-#define PIN_DIGIT_X 285
-#define PIN_DIGIT_Y 282
-#define PIN_DIGIT_SPACE 18
-
-#define PART_PIN(NAME, X, Y) \
- text { NAME; \
- description { "default"; \
- rel1.relative: X/1280 Y/720; \
- rel2.relative: (X+PIN_DIGIT_WIDTH)/1280 (Y+PIN_DIGIT_HEIGHT)/720; \
- color: PIN_COLOR; \
- align: 0.5 0.5; \
- text {\
- text: "?";\
- font: SAMSUNG_ONE_400;\
- size: PIN_SIZE;\
- align: 0.5 0.5;\
- ellipsis: -1;\
- }\
- }\
- }\
- rect {\
- description { "default";\
- rel.to: NAME;\
- rel1.relative: 0 1;\
- rel2.relative: 1 1;\
- min: PIN_DIGIT_WIDTH 2;\
- max: PIN_DIGIT_WIDTH 2;\
- color: 0 0 0 64;\
- }\
- }
-
-
-collections {
- base_scale: 1.8;
- images {
- image: RECT_IMAGE COMP;
- image: BG_IMAGE COMP;
- image: TRIANGLE_IMAGE COMP;
- image: PHONE_IMAGE_LEFT COMP;
- image: APP_STORES_IMAGE COMP;
- image: SMARTTHINGS_LOGO_IMAGE COMP;
- }
-
- fonts {
- font: SAMSUNG_ONE_400_PATH SAMSUNG_ONE_400;
- }
-
- styles {
- MAIN_STYLE("main_style")
- }
-
- group { GRP_MAIN;
- parts {
- PART_BG
- PART_PHONE_LEFT
- PART_BUBBLE(PIN_TEXT, PIN_BUBBLE_RECT, PIN_BUBBLE_TRIANGLE)
- PART_BUBBLE_TEXT(PIN_TEXT, PIN_BUBBLE_RECT, "main_style", 596, 400, 550)
-
- PART_BUTTON_SKIP(PIN_SKIP_PLACEHOLDER)
-
- PART_PIN(PIN_PIN_TEXT1, PIN_DIGIT_X, PIN_DIGIT_Y)
- PART_PIN(PIN_PIN_TEXT2, (PIN_DIGIT_X + PIN_DIGIT_SPACE), PIN_DIGIT_Y)
- PART_PIN(PIN_PIN_TEXT3, (PIN_DIGIT_X + 2*PIN_DIGIT_SPACE), PIN_DIGIT_Y)
- PART_PIN(PIN_PIN_TEXT4, (PIN_DIGIT_X + 3*PIN_DIGIT_SPACE), PIN_DIGIT_Y)
- PART_PIN(PIN_PIN_TEXT5, (PIN_DIGIT_X + 4*PIN_DIGIT_SPACE), PIN_DIGIT_Y)
- PART_PIN(PIN_PIN_TEXT6, (PIN_DIGIT_X + 5*PIN_DIGIT_SPACE), PIN_DIGIT_Y)
- PART_PIN(PIN_PIN_TEXT7, (PIN_DIGIT_X + 6*PIN_DIGIT_SPACE), PIN_DIGIT_Y)
- PART_PIN(PIN_PIN_TEXT8, (PIN_DIGIT_X + 7*PIN_DIGIT_SPACE), PIN_DIGIT_Y)
- }
- }
-}
+++ /dev/null
-#include "common_definitions.h"
-
-collections {
- base_scale: 1.8;
- images {
- image: RECT_IMAGE COMP;
- image: BG_IMAGE COMP;
- image: TRIANGLE_IMAGE COMP;
- image: PHONE_IMAGE_LEFT COMP;
- image: APP_STORES_IMAGE COMP;
- image: SMARTTHINGS_LOGO_IMAGE COMP;
- }
-
- fonts {
- font: SAMSUNG_ONE_400_PATH SAMSUNG_ONE_400;
- }
-
- styles {
- MAIN_STYLE("main_style")
- }
-
- group { GRP_MAIN;
- parts {
- PART_BG
- PART_PHONE_LEFT
- PART_SMARTTHINGS
- PART_BUBBLE(START_TEXT, START_BUBBLE_RECT, START_BUBBLE_TRIANGLE)
- PART_BUBBLE_TEXT(START_TEXT, START_BUBBLE_RECT, "main_style", 596, 400, 550)
-
- swallow { START_START_PLACEHOLDER;
- mouse_events: 1;
- description { "default";
- min: 500 60;
- max: 500 60;
- align: 0 1;
- rel1.offset: 100 0;
- rel2.offset: 0 -48;
- }
- }
-
- PART_BUTTON_SKIP(START_SKIP_PLACEHOLDER)
- }
-
- programs {
- program {
- name: "load";
- signal: "load";
- source: "";
- action: STATE_SET "upper";
- target: "phone";
- }
- }
- }
-}
+++ /dev/null
-# This PO file is automatically generated by PO File Editor of Tizen Studio
-# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES CAN BE OVERWRITTEN
-
-msgid "ERROR_CONTENT_UNRECOVERABLE"
-msgstr "Error occured during EasySetup."
-
-msgid "ACTION_APPENDIX"
-msgstr "..."
-
-msgid "SKIP_CONTENT"
-msgstr "<font_size=24 color=#102502 font=SamsungOne align=center valign=center>Are You sure You want to leave EasySetup?</font>"
-
-msgid "ERROR_CONTENT_RESETABLE"
-msgstr "Something went wrong - do You want to restart EasySetup?"
-
-msgid "AUTO_CONFIGURATION_CONTENT"
-msgstr "Follow instructions on Your mobile."
-
-msgid "PIN_CONTENT"
-msgstr "Enter following PIN on Your mobile app."
-
-msgid "CONNECTED_TO_SOFTAP_CONTENT"
-msgstr "Connecting..."
-
-msgid "ADVERTISEMENT_CONTENT"
-msgstr "Find Your device on ST app."
-
-msgid "START_CONTENT"
-msgstr "Download the <b>SmartThings app</b> on Your mobile and press start (or skip to manual setup). "
-
-msgid "LOGIN_TO_SAMSUNG_ACCOUNT"
-msgstr "Login to Samsung Account"
-
-msgid "CONNECTING"
-msgstr "Connecting"
-
-msgid "DONE"
-msgstr "DONE"
-
-msgid "START"
-msgstr "START"
-
-msgid "RETRY"
-msgstr "RETRY"
-
-msgid "SKIP"
-msgstr "SKIP"
-
-msgid "NO"
-msgstr "NO"
-
-msgid "YES"
-msgstr "YES"
-
-msgid "OK"
-msgstr "OK"
-
+++ /dev/null
-# This PO file is automatically generated by PO File Editor of Tizen Studio
-# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES CAN BE OVERWRITTEN
-
-msgid "ERROR_CONTENT_UNRECOVERABLE"
-msgstr "Wystąpił bład podczas działania EasySetupu."
-
-msgid "ACTION_APPENDIX"
-msgstr "..."
-
-msgid "SKIP_CONTENT"
-msgstr "<font_size=24 color=#102502 font=SamsungOne align=center valign=center>Jesteś pewien, że chcesz opuścić EasySetup?</font>"
-
-msgid "ERROR_CONTENT_RESETABLE"
-msgstr "Coś poszło nie tak - czy chcesz zrestartować EasySetup?"
-
-msgid "AUTO_CONFIGURATION_CONTENT"
-msgstr "Postępuj zgodnie z instrukcjami na urządzeniu mobilnym."
-
-msgid "PIN_CONTENT"
-msgstr "Wprowadź PIN na Twoim urządzeniu mobilnym."
-
-msgid "CONNECTED_TO_SOFTAP_CONTENT"
-msgstr "Łączenie..."
-
-msgid "ADVERTISEMENT_CONTENT"
-msgstr "Znajdź swoje urządzenie w aplikacji ST."
-
-msgid "START_CONTENT"
-msgstr "Pobierz <b>aplikację SmartThings</b> na Twoje urządzenie mobilne i naciśnij start (lub pomiń, by skonfigurować ręcznie)."
-
-msgid "LOGIN_TO_SAMSUNG_ACCOUNT"
-msgstr "Zaloguj do konta Samsung"
-
-msgid "DONE"
-msgstr "ZAKOŃCZ"
-
-msgid "START"
-msgstr "START"
-
-msgid "RETRY"
-msgstr "PONÓW"
-
-msgid "SKIP"
-msgstr "POMIŃ"
-
-msgid "NO"
-msgstr "NIE"
-
-msgid "YES"
-msgstr "TAK"
-
-msgid "OK"
-msgstr "OK"
-
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "ses/smartthings/thing/ApInfo.hpp"
-#include "tizen/Strings.hpp"
-#include "tizen/Logger.hpp"
-#include "tizen/Error.hpp"
-
-namespace ses {
-namespace smartthings {
-namespace thing {
-
- ApInfo::ApInfo(smartthings_ap_info_h handle) : _handle(handle)
- {
- }
-
- tizen::ApiResult<std::string> ApInfo::getSsid()
- {
- char *ssid;
- int res = smartthings_apinfo_get_ssid(_handle, &ssid);
- if(res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<std::string>::Error(res);
- }
- return tizen::ApiResult<std::string>::Ok(tizen::wrapMallocString(ssid));
- }
-
- tizen::ApiResult<std::string> ApInfo::getPassword()
- {
- char *ssid;
- int res = smartthings_apinfo_get_ssid(_handle, &ssid);
- if(res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<std::string>::Error(res);
- }
- return tizen::ApiResult<std::string>::Ok(tizen::wrapMallocString(ssid));
- }
-
- tizen::ApiResult<smartthings_wifi_authtype_e> ApInfo::getAuthtype()
- {
- smartthings_wifi_authtype_e authtype;
- int res = smartthings_apinfo_get_authtype(_handle, &authtype);
- if(res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<smartthings_wifi_authtype_e>::Error(res);
- }
- return tizen::ApiResult<smartthings_wifi_authtype_e>::Ok(authtype);
- }
-
- tizen::ApiResult<smartthings_wifi_enctype_e> ApInfo::getEnctype()
- {
- smartthings_wifi_enctype_e enctype;
- int res = smartthings_apinfo_get_enctype(_handle, &enctype);
- if(res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<smartthings_wifi_enctype_e>::Error(res);
- }
- return tizen::ApiResult<smartthings_wifi_enctype_e>::Ok(enctype);
- }
-
- tizen::ApiResult<int> ApInfo::getChannel()
- {
- int channel;
- int res = smartthings_apinfo_get_channel(_handle, &channel);
- if(res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<int>::Error(res);
- }
- return tizen::ApiResult<int>::Ok(channel);
- }
-
-} // thing
-} // smartthings
-} // ses
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 SMARTTHINGS_AP_INFO_H
-#define SMARTTHINGS_AP_INFO_H
-
-#include "tizen/ApiResult.hpp"
-#include "smartthings.h"
-#include <string>
-
-namespace ses {
-namespace smartthings {
-namespace thing {
-
-class ApInfo
-{
-friend class Master;
-public:
- ApInfo() = delete;
- ApInfo(const ApInfo&) = delete;
- ApInfo& operator=(const ApInfo&) = delete;
-
- ApInfo(const ApInfo&&) = delete;
- ApInfo& operator=(const ApInfo&&) = delete;
-
- tizen::ApiResult<std::string> getSsid();
- tizen::ApiResult<std::string> getPassword();
- tizen::ApiResult<smartthings_wifi_authtype_e> getAuthtype();
- tizen::ApiResult<smartthings_wifi_enctype_e> getEnctype();
- tizen::ApiResult<int> getChannel();
-private:
- ApInfo(smartthings_ap_info_h handle);
- smartthings_ap_info_h _handle;
-};
-
-} // thing
-} // smartthings
-} // ses
-
-#endif //SMARTTHINGS_AP_INFO_H
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "ses/smartthings/thing/ApList.hpp"
-#include "ses/smartthings/thing/SmartThingsThingExceptions.hpp"
-#include "tizen/Logger.hpp"
-#include "tizen/Error.hpp"
-
-namespace ses {
-namespace smartthings {
-namespace thing {
-
-ApList::ApList(unsigned int count)
-{
- int res = smartthings_aplist_create(&_handle, count);
- if(res != SMARTTHINGS_ERROR_NONE)
- {
- throw SmartThingsThingException(res);
- }
-}
-
-ApList::~ApList()
-{
- int res = smartthings_aplist_destroy(_handle);
- if(res != SMARTTHINGS_ERROR_NONE)
- {
- tizen::logger::Err("Failed to destroy aplist: %s", tizen::Error(res).message());
- }
-}
-
-tizen::ApiResult<void> ApList::setSsid(int idx, const std::string & ssid)
-{
- int res = smartthings_aplist_set_ssid(_handle, idx, ssid.c_str());
- if(res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> ApList::setBssid(int idx, const std::string & bssid)
-{
- int res = smartthings_aplist_set_bssid(_handle, idx, bssid.c_str());
- if(res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> ApList::setAuthType(int idx, smartthings_wifi_authtype_e authtype)
-{
- int res = smartthings_aplist_set_authtype(_handle, idx, authtype);
- if(res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> ApList::setEncType(int idx, smartthings_wifi_enctype_e enctype)
-{
- int res = smartthings_aplist_set_enctype(_handle, idx, enctype);
- if(res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> ApList::setChannel(int idx, int channel)
-{
- int res = smartthings_aplist_set_channel(_handle, idx, channel);
- if(res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> ApList::setMaxRate(int idx, int maxRate)
-{
- int res = smartthings_aplist_set_signal_level(_handle, idx, maxRate);
- if(res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-
-} // thing
-} // smartthings
-} // ses
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 SMARTTHINGS_AP_LIST_H
-#define SMARTTHINGS_AP_LIST_H
-
-#include "tizen/ApiResult.hpp"
-#include "smartthings.h"
-#include <string>
-
-namespace ses {
-namespace smartthings {
-namespace thing {
-
-class ApList
-{
-friend class Master;
-public:
- ApList(unsigned int count);
- ~ApList();
-
- ApList() = delete;
- ApList(const ApList&) = delete;
- ApList& operator=(const ApList&) = delete;
-
- ApList(const ApList&&) = delete;
- ApList& operator=(const ApList&&) = delete;
-
- tizen::ApiResult<void> setSsid(int idx, const std::string & ssid);
- tizen::ApiResult<void> setBssid(int idx, const std::string & bssid);
- tizen::ApiResult<void> setAuthType(int idx, smartthings_wifi_authtype_e authtype);
- tizen::ApiResult<void> setEncType(int idx, smartthings_wifi_enctype_e enctype);
- tizen::ApiResult<void> setChannel(int idx, int channel);
- tizen::ApiResult<void> setSignalLevel(int idx, int signalLevel);
- tizen::ApiResult<void> setMaxRate(int idx, int maxRate);
-private:
- smartthings_ap_list_h _handle;
-};
-
-} // thing
-} // smartthings
-} // ses
-
-#endif //SMARTTHING_AP_LIST_H
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "ses/smartthings/thing/CloudInfo.hpp"
-#include "ses/smartthings/thing/SmartThingsThingExceptions.hpp"
-#include "tizen/Logger.hpp"
-#include "tizen/Error.hpp"
-
-namespace ses {
-namespace smartthings {
-namespace thing {
-
-CloudInfo::CloudInfo()
-{
- int res = smartthings_cloudinfo_create(&_handle);
- if(res != SMARTTHINGS_ERROR_NONE)
- {
- throw SmartThingsThingException(res);
- }
-}
-
-CloudInfo::~CloudInfo()
-{
- smartthings_cloudinfo_destroy(_handle);
-}
-
-tizen::ApiResult<void> CloudInfo::setRegion(const std::string & region)
-{
- int res = smartthings_cloudinfo_set_region(_handle, region.c_str());
- if(res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> CloudInfo::setAuthProvider(const std::string & authProvider)
-{
- int res = smartthings_cloudinfo_set_region(_handle, authProvider.c_str());
- if(res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> CloudInfo::setAccessToken(const std::string & accessToken)
-{
- int res = smartthings_cloudinfo_set_region(_handle, accessToken.c_str());
- if(res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> CloudInfo::setRefreshToken(const std::string & refreshToken)
-{
- int res = smartthings_cloudinfo_set_refresh_token(_handle, refreshToken.c_str());
- if(res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> CloudInfo::setUserId(const std::string & userId)
-{
- int res = smartthings_cloudinfo_set_user_id(_handle, userId.c_str());
- if(res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> CloudInfo::setClientId(const std::string & clientId)
-{
- int res = smartthings_cloudinfo_set_client_id(_handle, clientId.c_str());
- if(res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-
-} // thing
-} // smartthings
-} // ses
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 SMARTTHING_CLOUD_INFO_H
-#define SMARTTHING_CLOUD_INFO_H
-
-#include "tizen/ApiResult.hpp"
-#include "smartthings.h"
-#include <string>
-
-namespace ses {
-namespace smartthings {
-namespace thing {
-
-class CloudInfo
-{
-friend class Master;
-public:
- CloudInfo();
- ~CloudInfo();
-
- CloudInfo(const CloudInfo&) = delete;
- CloudInfo& operator=(const CloudInfo&) = delete;
-
- CloudInfo(const CloudInfo&&) = delete;
- CloudInfo& operator=(const CloudInfo&&) = delete;
-
- tizen::ApiResult<void> setRegion(const std::string & region);
- tizen::ApiResult<void> setAuthProvider(const std::string & authProvider);
- tizen::ApiResult<void> setAccessToken(const std::string & accessToken);
- tizen::ApiResult<void> setRefreshToken(const std::string & refreshToken);
- tizen::ApiResult<void> setUserId(const std::string & userId);
- tizen::ApiResult<void> setClientId(const std::string & clientId);
-private:
- smartthings_cloud_info_h _handle;
-};
-
-} // thing
-} // smartthings
-} // ses
-
-#endif // SMARTTHING_CLOUD_INFO_H
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "ses/smartthings/thing/DeviceProvInfo.hpp"
-#include "tizen/Strings.hpp"
-#include "ses/smartthings/thing/SmartThingsThingExceptions.hpp"
-#include "tizen/Logger.hpp"
-#include "tizen/Error.hpp"
-
-namespace ses {
-namespace smartthings {
-namespace thing {
-
-DeviceProvInfo::DeviceProvInfo(smartthings_device_prov_info_h handle) : _handle(handle)
-{
-
-}
-
-tizen::ApiResult<std::string> DeviceProvInfo::getLanguage()
-{
- char *lang;
- int res = smartthings_devinfo_get_language(_handle, &lang);
- if(res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<std::string>::Error(res);
- }
- return tizen::ApiResult<std::string>::Ok(tizen::wrapMallocString(lang));
-}
-
-tizen::ApiResult<std::string> DeviceProvInfo::getCountry()
-{
- char *country;
- int res = smartthings_devinfo_get_country(_handle, &country);
- if(res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<std::string>::Error(res);
- }
- return tizen::ApiResult<std::string>::Ok(tizen::wrapMallocString(country));
-}
-
-tizen::ApiResult<std::string> DeviceProvInfo::getDatetime()
-{
- char *datetime;
- int res = smartthings_devinfo_get_datetime(_handle, &datetime);
- if(res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<std::string>::Error(res);
- }
- return tizen::ApiResult<std::string>::Ok(tizen::wrapMallocString(datetime));
-}
-
-} // thing
-} // smartthings
-} // ses
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 SMARTTHING_DEVICE_PROVISING_INFO_H
-#define SMARTTHING_DEVICE_PROVISING_INFO_H
-
-#include "tizen/ApiResult.hpp"
-#include "smartthings.h"
-#include <string>
-
-namespace ses {
-namespace smartthings {
-namespace thing {
-
-class DeviceProvInfo
-{
-friend class Master;
-public:
- DeviceProvInfo() = delete;
- DeviceProvInfo(const DeviceProvInfo&) = delete;
- DeviceProvInfo& operator=(const DeviceProvInfo&) = delete;
-
- DeviceProvInfo(const DeviceProvInfo&&) = delete;
- DeviceProvInfo& operator=(const DeviceProvInfo&&) = delete;
-
- tizen::ApiResult<std::string> getLanguage();
- tizen::ApiResult<std::string> getCountry();
- tizen::ApiResult<std::string> getDatetime();
-private:
- DeviceProvInfo(smartthings_device_prov_info_h handle);
- smartthings_device_prov_info_h _handle;
-};
-
-} // thing
-} // smartthings
-} // ses
-
-#endif // SMARTTHING_DEVICE_PROVISING_INFO_H
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "ses/smartthings/thing/Master.hpp"
-#include "ses/smartthings/thing/SmartThingsThingExceptions.hpp"
-#include "tizen/Strings.hpp"
-#include "tizen/Logger.hpp"
-#include "tizen/Error.hpp"
-#include <string>
-
-namespace ses
-{
-namespace smartthings
-{
-namespace thing
-{
-
-Master::Master(std::function<void(smartthings_connection_status_e)> connectionStatusCb)
-{
- _connectionStatusCb = connectionStatusCb;
- auto static_cb = [](smartthings_h, smartthings_connection_status_e connection_status, void *data) {
- Master *master = static_cast<Master *>(data);
- if (master->_connectionStatusCb)
- master->_connectionStatusCb(connection_status);
- };
- int res = smartthings_initialize(&_handle, static_cb, this);
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- tizen::logger::Err("Failed to initialize smartthings (%d)", res);
- throw SmartThingsThingException(res);
- }
-}
-
-Master::~Master()
-{
- int res = smartthings_deinitialize(_handle);
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- tizen::logger::Err("Failed to deinitialize smartthings handle: %s", tizen::Error(res).message());
- }
-}
-
-tizen::ApiResult<void> Master::start()
-{
- int res = smartthings_start(_handle);
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> Master::stop()
-{
- int res = smartthings_stop(_handle);
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> Master::setStatusChangedCb(std::function<void(smartthings_status_e)> statusCb)
-{
- auto oldCb = _statusCb;
- _statusCb = statusCb;
- auto static_cb = [](smartthings_h, smartthings_status_e status, void *data) {
- Master *master = static_cast<Master *>(data);
- if (master->_statusCb)
- master->_statusCb(status);
- };
- int res = smartthings_set_status_changed_cb(_handle, static_cb, this);
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- _statusCb = oldCb;
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> Master::unsetStatusChangedCb()
-{
- int res = smartthings_unset_status_changed_cb(_handle);
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- _statusCb = nullptr;
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> Master::setCertificateFile(const std::string &certificate, const std::string &privateKey)
-{
- int res = smartthings_set_certificate_file(_handle, certificate.c_str(), privateKey.c_str());
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> Master::setDeviceProperty(const std::string &devName, int wifiMode, int wifiFreq)
-{
- int res = smartthings_set_device_property(_handle, devName.c_str(), wifiMode, wifiFreq);
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<std::string> Master::getDeviceId()
-{
- char *device_id;
- int res = smartthings_get_device_id(_handle, &device_id);
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<std::string>::Error(res);
- }
- return tizen::ApiResult<std::string>::Ok(tizen::wrapMallocString(device_id));
-}
-
-tizen::ApiResult<bool> Master::getEasysetupStatus()
-{
- bool easy_setup_status;
- int res = smartthings_get_easysetup_status(_handle, &easy_setup_status);
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<bool>::Error(res);
- }
- return tizen::ApiResult<bool>::Ok(easy_setup_status);
-}
-
-tizen::ApiResult<void> Master::startEasysetup()
-{
- int res = smartthings_start_easysetup(_handle);
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> Master::stopEasysetup()
-{
- int res = smartthings_stop_easysetup(_handle);
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> Master::setUserConfirmCb(std::function<void()> confirmCb)
-{
- auto oldCb = _confirmCb;
- _confirmCb = confirmCb;
- auto static_cb = [](smartthings_h, void *data) {
- Master *master = static_cast<Master *>(data);
- if (master->_confirmCb)
- master->_confirmCb();
- };
- int res = smartthings_set_user_confirm_cb(_handle, static_cb, this);
- tizen::logger::Dbg("set user in progress");
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- switch (res)
- {
- case SMARTTHINGS_ERROR_NONE:
- tizen::logger::Dbg("set user Successful");
- break;
- case SMARTTHINGS_ERROR_NOT_SUPPORTED:
- tizen::logger::Dbg("set user Not supported");
- break;
- case SMARTTHINGS_ERROR_INVALID_PARAMETER:
- tizen::logger::Dbg("set user Invalid parameter");
- break;
- case SMARTTHINGS_ERROR_PERMISSION_DENIED:
- tizen::logger::Dbg("set user Permission denied");
- break;
- case SMARTTHINGS_ERROR_OPERATION_FAILED:
- tizen::logger::Dbg("set user Operation failed");
- break;
- case SMARTTHINGS_ERROR_SERVICE_UNAVAILABLE:
- tizen::logger::Dbg("set user Service Unavailable");
- break;
- default:
- tizen::logger::Dbg("set user unkown error");
- }
- _confirmCb = oldCb;
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> Master::unsetUserConfirmCb()
-{
- int res = smartthings_unset_user_confirm_cb(_handle);
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- _confirmCb = nullptr;
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> Master::setResetConfirmCb(std::function<void()> resetConfirmCb)
-{
- auto oldCb = _resetConfirmCb;
- _resetConfirmCb = resetConfirmCb;
- auto static_cb = [](smartthings_h, void *data) {
- Master *master = static_cast<Master *>(data);
- if (master->_resetConfirmCb)
- master->_resetConfirmCb();
- };
- int res = smartthings_set_reset_confirm_cb(_handle, static_cb, this);
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- _resetConfirmCb = oldCb;
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> Master::unsetResetConfirmCb()
-{
- int res = smartthings_unset_reset_confirm_cb(_handle);
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- _resetConfirmCb = nullptr;
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> Master::setResetResultCb(std::function<void(bool)> resetResultCb)
-{
- auto oldCb = _resetResultCb;
- _resetResultCb = resetResultCb;
- auto static_cb = [](smartthings_h, bool result, void *data) {
- Master *master = static_cast<Master *>(data);
- if (master->_resetResultCb)
- master->_resetResultCb(result);
- };
- int res = smartthings_set_reset_result_cb(_handle, static_cb, this);
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- _resetResultCb = oldCb;
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> Master::unsetResetResultCb()
-{
- int res = smartthings_unset_reset_result_cb(_handle);
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- _resetResultCb = nullptr;
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> Master::setPinCb(std::function<void(const std::string &)> generatedCb, std::function<void()> closeCb)
-{
- auto oldgeneratedCb = _pinGeneratedCb;
- auto oldCloseCb = _pinCloseCb;
- _pinGeneratedCb = generatedCb;
- _pinCloseCb = closeCb;
-
- auto static_generated_cb = [](smartthings_h, const char *pin, size_t size, void *data) {
- Master *master = static_cast<Master *>(data);
- if (master->_pinGeneratedCb)
- master->_pinGeneratedCb(std::string(pin, size));
- };
-
- auto static_close_cb = [](smartthings_h, void *data) {
- Master *master = static_cast<Master *>(data);
- if (master->_pinCloseCb)
- master->_pinCloseCb();
- };
- int res = smartthings_set_pin_cb(_handle, static_generated_cb, static_close_cb, this);
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- _pinGeneratedCb = oldgeneratedCb;
- _pinCloseCb = oldCloseCb;
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> Master::unsetPinCb()
-{
- int res = smartthings_unset_pin_cb(_handle);
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- _pinGeneratedCb = nullptr;
- _pinCloseCb = nullptr;
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> Master::setWifiApProvisioningCb(std::function<void(ApInfo &)> wifiApCb)
-{
- auto oldCb = _wifiApCb;
- _wifiApCb = wifiApCb;
- auto static_cb = [](smartthings_h, smartthings_ap_info_h apInfo, void *data) {
- Master *master = static_cast<Master *>(data);
- if (master->_wifiApCb)
- {
- ApInfo info(apInfo);
- master->_wifiApCb(info);
- }
- };
- int res = smartthings_set_wifi_ap_provisioning_cb(_handle, static_cb, this);
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> Master::unsetWifiApProvisioningCb()
-{
- int res = smartthings_unset_wifi_ap_provisioning_cb(_handle);
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- _wifiApCb = nullptr;
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> Master::setDeviceProvisioningCb(std::function<void(DeviceProvInfo &)> devProvCb)
-{
- auto oldCb = _devProvCb;
- _devProvCb = devProvCb;
- auto static_cb = [](smartthings_h, smartthings_device_prov_info_h deviceProvInfo, void *data) {
- Master *master = static_cast<Master *>(data);
- if (master->_devProvCb)
- {
- DeviceProvInfo info(deviceProvInfo);
- master->_devProvCb(info);
- }
- };
- int res = smartthings_set_device_provisioning_cb(_handle, static_cb, this);
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> Master::unsetDeviceProvisioningCb()
-{
- int res = smartthings_unset_device_provisioning_cb(_handle);
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- _devProvCb = nullptr;
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> Master::setScanApCb(std::function<void(int)> scanApCb)
-{
- auto oldCb = _scanApCb;
- _scanApCb = scanApCb;
- auto static_cb = [](smartthings_h, int reqId, void *data) {
- Master *master = static_cast<Master *>(data);
- if (master->_scanApCb)
- master->_scanApCb(reqId);
- };
- int res = smartthings_set_scan_ap_cb(_handle, static_cb, this);
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- _scanApCb = oldCb;
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> Master::unsetScanApCb()
-{
- int res = smartthings_unset_scan_ap_cb(_handle);
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- _scanApCb = nullptr;
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> Master::setStopSoftApCb(std::function<void()> stopSoftApCb)
-{
- auto oldCb = _stopSoftApCb;
- _stopSoftApCb = stopSoftApCb;
- auto static_cb = [](smartthings_h, void *data) {
- Master *master = static_cast<Master *>(data);
- if (master->_stopSoftApCb)
- master->_stopSoftApCb();
- };
- int res = smartthings_set_stop_soft_ap_cb(_handle, static_cb, this);
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- _stopSoftApCb = oldCb;
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> Master::unsetStopSoftApCb()
-{
- int res = smartthings_unset_stop_soft_ap_cb(_handle);
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- _stopSoftApCb = nullptr;
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> Master::sendUserConfirm(bool confirm)
-{
- int res = smartthings_send_user_confirm(_handle, confirm);
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-tizen::ApiResult<void> Master::sendResetConfirm(bool confirm)
-{
- int res = smartthings_send_reset_confirm(_handle, confirm);
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> Master::reset()
-{
- int res = smartthings_reset(_handle);
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> Master::sendApList(ApList &apList, int reqId)
-{
- int res = smartthings_send_ap_list(_handle, apList._handle, reqId);
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> Master::signUpCloud(CloudInfo &cloudInfo)
-{
- int res = smartthings_sign_up_cloud(_handle, cloudInfo._handle);
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> Master::setPreconfiguredPin(const std::string &pin)
-{
- int res = smartthings_set_preconfigured_pin(_handle, pin.c_str());
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-
-tizen::ApiResult<void> Master::setMotStatus(bool enable)
-{
- int res = smartthings_set_mot_status(_handle, enable);
- if (res != SMARTTHINGS_ERROR_NONE)
- {
- return tizen::ApiResult<void>::Error(res);
- }
- return tizen::ApiResult<void>::Ok();
-}
-
-} // namespace thing
-} // namespace smartthings
-} // namespace ses
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 SMARTTHINGS_MASTER_H
-#define SMARTTHINGS_MASTER_H
-
-#include "tizen/ApiResult.hpp"
-#include "ses/smartthings/thing/ApInfo.hpp"
-#include "ses/smartthings/thing/DeviceProvInfo.hpp"
-#include "ses/smartthings/thing/ApList.hpp"
-#include "ses/smartthings/thing/CloudInfo.hpp"
-#include "smartthings.h"
-#include <functional>
-#include <string>
-#include <vector>
-
-namespace ses {
-namespace smartthings {
-namespace thing {
-
-class Master
-{
-public:
- Master(std::function<void(smartthings_connection_status_e)> connectionStatusCb);
- ~Master();
-
- Master() = delete;
- Master(const Master &) = delete;
- Master& operator=(const Master&) = delete;
-
- Master(const Master &&) = delete;
- Master& operator=(const Master&&) = delete;
-
- tizen::ApiResult<void> start();
- tizen::ApiResult<void> stop();
- tizen::ApiResult<void> setStatusChangedCb(std::function<void(smartthings_status_e)> statusCb);
- tizen::ApiResult<void> unsetStatusChangedCb();
- tizen::ApiResult<void> setCertificateFile(const std::string &certificate, const std::string &privateKey);
- tizen::ApiResult<void> setDeviceProperty(const std::string &devName, int wifiMode, int wifiFreq);
- tizen::ApiResult<std::string> getDeviceId();
- tizen::ApiResult<bool> getEasysetupStatus();
- tizen::ApiResult<void> startEasysetup();
- tizen::ApiResult<void> stopEasysetup();
- tizen::ApiResult<void> setUserConfirmCb(std::function<void()> confirmCb);
- tizen::ApiResult<void> unsetUserConfirmCb();
- tizen::ApiResult<void> setResetConfirmCb(std::function<void()> resetConfirmCb);
- tizen::ApiResult<void> unsetResetConfirmCb();
- /*@brief Sets reset result callback. It is called with boolean result of reset*/
- tizen::ApiResult<void> setResetResultCb(std::function<void(bool)> resetResultCb);
- tizen::ApiResult<void> unsetResetResultCb();
- tizen::ApiResult<void> setPinCb(std::function<void(const std::string &)> generatedCb, std::function<void()> closeCb);
- tizen::ApiResult<void> unsetPinCb();
- tizen::ApiResult<void> setWifiApProvisioningCb(std::function<void(ApInfo&)> wifiApCb);
- tizen::ApiResult<void> unsetWifiApProvisioningCb();
- tizen::ApiResult<void> setDeviceProvisioningCb(std::function<void(DeviceProvInfo&)> devProvCb);
- tizen::ApiResult<void> unsetDeviceProvisioningCb();
- /*@brief Sets scan AP list callback. It is called with integer, requestId.*/
- tizen::ApiResult<void> setScanApCb(std::function<void(int)> scanApCb);
- tizen::ApiResult<void> unsetScanApCb();
- tizen::ApiResult<void> setStopSoftApCb(std::function<void()> stopSoftApCb);
- tizen::ApiResult<void> unsetStopSoftApCb();
- tizen::ApiResult<void> sendUserConfirm(bool confirm);
- tizen::ApiResult<void> sendResetConfirm(bool confirm);
- tizen::ApiResult<void> reset();
- tizen::ApiResult<void> sendApList(ApList & apList, int reqId);
- tizen::ApiResult<void> signUpCloud(CloudInfo & cloudInfo);
- tizen::ApiResult<void> setPreconfiguredPin(const std::string & pin);
- tizen::ApiResult<void> setMotStatus(bool enable);
-
-private:
- smartthings_h _handle;
-
- std::function<void(smartthings_connection_status_e)> _connectionStatusCb;
- std::function<void(smartthings_status_e)> _statusCb;
- std::function<void()> _confirmCb;
- std::function<void()> _resetConfirmCb;
- std::function<void(bool)> _resetResultCb;
- std::function<void(const std::string &)> _pinGeneratedCb;
- std::function<void()> _pinCloseCb;
- std::function<void(ApInfo&)> _wifiApCb;
- std::function<void(DeviceProvInfo&)> _devProvCb;
- std::function<void(int)> _scanApCb;
- std::function<void()> _stopSoftApCb;
-};
-
-} // SmartThingsThing
-} // Samsung
-} // tizen
-
-#endif // SMARTTHINGS_MASTER_H
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "ses/smartthings/thing/SmartThingsThingExceptions.hpp"
-
-namespace ses {
-namespace smartthings {
-namespace thing {
-
-SmartThingsThingException::SmartThingsThingException(tizen::Error error, const std::string & message) : _error(error),
- _message(message + ":" + _error.message() + "(" + std::to_string(error.code()) + ")")
-{
-
-}
-
-const char *SmartThingsThingException::what() const noexcept
-{
- return _message.c_str();
-}
-
-const tizen::Error SmartThingsThingException::getError() const
-{
- return _error;
-}
-
-} // thing
-} // smartthings
-} // ses
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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 SMARTTHINGS_THING_EXCEPTION_H
-#define SMARTTHINGS_THING_EXCEPTION_H
-
-#include "tizen/Error.hpp"
-#include <exception>
-#include <string>
-
-namespace ses {
-namespace smartthings {
-namespace thing {
-
-class SmartThingsThingException : public std::exception
-{
-public:
- SmartThingsThingException(tizen::Error error, const std::string & message = "");
- const char *what() const noexcept override;
- const tizen::Error getError() const;
-private:
- tizen::Error _error;
- std::string _message;
-};
-
-} // thing
-} // smartthings
-} // ses
-
-#endif //SMARTTHINGS_THING_EXCEPTION_H
\ No newline at end of file
+++ /dev/null
-{
- "devices": [
- {
- "deviceType": "oic.d.light",
- "deviceName": "ChairRPi3",
- "mnid": "fIAB",
- "vid": "sdc2018"
- }
- ],
- "configuration": {
- "otmDescription" : "ownershipTransferMethod : b0001(Random PIN-based), b0010(UserConfirm-based), b0100(Preconfigured PIN)",
- "easySetup": {
- "mode": 1,
- "setupId": "202"
- },
- "otm": 1,
- "crtType": 1
- }
-}
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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.
-*/
-
-#include "AppUtils.hpp"
-
-Evas_Object *AppUtils::_conformant = nullptr;
-Evas_Object *AppUtils::_window = nullptr;
-std::unique_ptr<tizen::application::AppControl> AppUtils::_appControl(nullptr);
-
-std::string AppUtils::getResource(std::string path)
-{
- return app_get_resource_path() + path;
-}
-
-Evas_Object *AppUtils::getConformant()
-{
- return _conformant;
-}
-
-Evas_Object *AppUtils::getWindow()
-{
- return _window;
-}
-
-tizen::application::AppControl &AppUtils::getAppControl()
-{
- return *_appControl;
-}
-
-void AppUtils::saveConformant(Evas_Object *conformant)
-{
- _conformant = conformant;
-}
-
-void AppUtils::saveWindow(Evas_Object *window)
-{
- _window = window;
-}
-
-void AppUtils::saveAppControl(tizen::application::AppControl &appControl)
-{
- _appControl = std::make_unique<tizen::application::AppControl>(appControl);
-}
-
-void AppUtils::setTranslatableText(Evas_Object *object, const std::string &key)
-{
- elm_object_translatable_text_set(object, key.c_str());
-}
-
-void AppUtils::setTranslatableText(Evas_Object *object, const std::string &part, const std::string &key)
-{
- elm_object_translatable_part_text_set(object, part.c_str(), key.c_str());
-}
-
-std::string AppUtils::getTranslatedText(const std::string &key)
-{
- return gettext(key.c_str());
-}
\ No newline at end of file
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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.
-*/
-
-#include "EasySetup.hpp"
-#include "logger.h"
-#include <memory>
-#include <utility>
-
-using namespace ses::smartthings::thing;
-
-const std::string EasySetup::MY_PROV_VENDOR_INFO("{\"x.com.samsung.targetDevType\":6,\"x.com.samsung.targetDevIcon\":1}");
-const std::string EasySetup::DEVICE_NAME("motion-light-app");
-const std::string EasySetup::CERT_FILE("test_cert_03.pem");
-const std::string EasySetup::KEY_FILE("priv_03.pem");
-
-EasySetup::EasySetup()
-{
-}
-
-EasySetup::~EasySetup()
-{
-}
-
-void EasySetup::startST()
-{
- _startSTEasySetup(
- [this](smartthings_status_e status){ this->_easySetupConnectionStateCallback(status); },
- [this](const std::string &pin){ this->_easySetupPinCallback(pin); }
- );
-}
-
-void EasySetup::resetST()
-{
- LOG_DBG("Resetting Easy Setup...");
- if(!_st_master)
- {
- LOG_DBG("Cannot reset easy setup - easy setup has not started yet");
- startST();
- return;
- }
-
- _st_master->stopEasysetup();
- _st_master->reset();
- _st_master->startEasysetup();
-}
-
-void EasySetup::stopST()
-{
- if(_st_master == nullptr)
- {
- LOG_WRN("Cannot stop EasySetup - not started");
- return;
- }
- LOG_DBG("Stopping Easy Setup...");
- _st_master->stopEasysetup();
- _st_master->stop();
- _st_master = nullptr;
- LOG_DBG("Successfully stopped Easy Setup...");
-}
-
-void EasySetup::_startSTEasySetup(std::function<void(smartthings_status_e)> status_cb, std::function<void(const std::string &)> pin_cb)
-{
- if (_st_master)
- {
- LOG_ERR("Cannot start Easy Setup - already started");
- return;
- }
-
- LOG_DBG("Startings Easy setup...");
- _st_master = std::make_unique<Master>([status_cb, pin_cb, this](smartthings_connection_status_e status) {
- if (status == SMARTTHINGS_CONNECTION_STATUS_CONNECTED)
- {
- int wifi_mode = SMARTTHINGS_WIFI_MODE_11B | SMARTTHINGS_WIFI_MODE_11G | SMARTTHINGS_WIFI_MODE_11N;
- int wifi_freq = SMARTTHINGS_WIFI_FREQ_24G | SMARTTHINGS_WIFI_FREQ_5G;
-
- auto res = _st_master->setDeviceProperty(DEVICE_NAME.c_str(), wifi_mode, wifi_freq);
- if(!res)
- {
- LOG_ERR("Failed to set device property: %s (%d)", res.error().message(), res.error().code());
- notify(EasySetupEvent{SET_DEVICE_PROPERTY_ERROR});
- return;
- }
-
- res = _st_master->setResetConfirmCb([this]() {
- LOG_DBG("resetConfirmCb");
- LOG_DBG("Auto accept reset request w/o confirm...");
- auto res = _st_master->sendResetConfirm(true);
- if(!res)
- {
- LOG_ERR("Failed to send reset confirm: %s (%d)", res.error().message(), res.error().code());
- }
- });
- if(!res)
- {
- LOG_ERR("Failed to set reset confirm callback: %s (%d)", res.error().message(), res.error().code());
- notify(EasySetupEvent{SET_RESET_CONFIRM_CB_ERROR});
- return;
- }
-
- res = _st_master->setResetResultCb([](bool v) {
- LOG_DBG("resetResultCb: %d", v);
- });
- if(!res)
- {
- LOG_ERR("Failed to set reset result callback: %s (%d)", res.error().message(), res.error().code());
- notify(EasySetupEvent{SET_RESET_RESULT_CB_ERROR});
- return;
- }
-
- res = _st_master->setPinCb(pin_cb, []{
- LOG_DBG("Close pin callback");
- });
- if(!res)
- {
- LOG_ERR("Failed to set pin callback: %s (%d)", res.error().message(), res.error().code());
- notify(EasySetupEvent{SET_PIN_CB_ERROR});
- return;
- }
-
- res = _st_master->setUserConfirmCb([]() {
- LOG_DBG("User confim callback");
- });
- if(!res)
- {
- LOG_ERR("Failed to set user confirm callback: %s (%d)", res.error().message(), res.error().code());
- notify(EasySetupEvent{SET_USER_CONFIRM_CB_ERROR});
- return;
- }
-
- res = _st_master->setWifiApProvisioningCb([this](ApInfo &ap) {
- LOG_DBG("WifiApProvisioningCb");
- this->notify(EasySetupEventWifiProvisioning(ap));
- });
- if(!res)
- {
- LOG_ERR("Failed to set wifi ap provisioning callback: %s (%d)", res.error().message(), res.error().code());
- notify(EasySetupEvent{SET_WIFI_AP_PROVISIONING_CB_ERROR});
- return;
- }
-
- res = _st_master->setStatusChangedCb(status_cb);
- if(!res)
- {
- LOG_ERR("Failed to set status changed callback: %s (%d)", res.error().message(), res.error().code());
- notify(EasySetupEvent{SET_STATUS_CB_ERROR});
- return;
- }
-
- res = _st_master->setCertificateFile(CERT_FILE.c_str(), KEY_FILE.c_str());
- if(!res)
- {
- LOG_ERR("Failed to set certificate (cert: %s, key: %s): %s (%d)",
- CERT_FILE.c_str(), KEY_FILE.c_str(), res.error().message(), res.error().code());
- notify(EasySetupEvent{SET_CERTIFICATE_ERROR});
- return;
- }
-
- LOG_DBG("Successfully set certificates from files: %s and %s", CERT_FILE.c_str(), KEY_FILE.c_str());
-
- res = _st_master->start();
- if (!res)
- {
- LOG_ERR("_st_master->start failed: %s (%d)", res.error().message(), res.error().code());
- notify(EasySetupEvent{START_ERROR});
- return;
- }
-
- auto started = _st_master->getEasysetupStatus();
- if (started && started.result())
- {
- LOG_DBG("Easy setup finished");
- }
- else
- {
- notify(EasySetupEvent{MEDIUM_REQUEST});
- }
-
- res = _st_master->startEasysetup();
- if(!res)
- {
- LOG_ERR("_st_master->startEasysetup failed: %s (%d)", res.error().message(), res.error().code());
- notify(EasySetupEvent{START_ES_ERROR});
- return;
- }
- else
- {
- LOG_INF("Easy setup successfully started");
- }
- }
- else
- {
- LOG_ERR("Smartthings status: %d", status);
- }
- });
-}
-
-void EasySetup::_easySetupConnectionStateCallback(smartthings_status_e status)
-{
- switch (status)
- {
- case SMARTTHINGS_STATUS_NOT_READY:
- LOG_ERR("status: [%d] [%s]", status, "SMARTTHINGS_STATUS_NOT_READY");
- notify(EasySetupEvent{NOT_READY});
- break;
- case SMARTTHINGS_STATUS_INIT:
- LOG_DBG("status: [%d] [%s]", status, "SMARTTHINGS_STATUS_INIT");
- notify(EasySetupEvent{INIT});
- break;
- case SMARTTHINGS_STATUS_ES_STARTED:
- LOG_DBG("status: [%d] [%s]", status, "SMARTTHINGS_STATUS_ES_STARTED");
- notify(EasySetupEvent{ES_STARTED});
- break;
- case SMARTTHINGS_STATUS_ES_DONE:
- LOG_DBG("status: [%d] [%s]", status, "SMARTTHINGS_STATUS_ES_DONE");
- notify(EasySetupEvent{ES_DONE});
- break;
- case SMARTTHINGS_STATUS_ES_FAILED_ON_OWNERSHIP_TRANSFER:
- LOG_DBG("status: [%d] [%s]", status, "SMARTTHINGS_STATUS_ES_FAILED_ON_OWNERSHIP_TRANSFER");
- notify(EasySetupEvent{ES_FAILED_OWNERSHIP_TRANSFER});
- break;
- case SMARTTHINGS_STATUS_CONNECTING_TO_AP:
- LOG_DBG("status: [%d] [%s]", status, "SMARTTHINGS_STATUS_CONNECTING_TO_AP");
- notify(EasySetupEvent{CONNECTING_TO_AP});
- break;
- case SMARTTHINGS_STATUS_CONNECTED_TO_AP:
- LOG_DBG("status: [%d] [%s]", status, "SMARTTHINGS_STATUS_CONNECTED_TO_AP");
- notify(EasySetupEvent{CONNECTED_TO_AP});
- break;
- case SMARTTHINGS_STATUS_CONNECTING_TO_AP_FAILED:
- LOG_DBG("status: [%d] [%s]", status, "SMARTTHINGS_STATUS_CONNECTING_TO_AP_FAILED");
- notify(EasySetupEvent{CONNECTING_TO_AP_FAILED});
- break;
- case SMARTTHINGS_STATUS_REGISTERING_TO_CLOUD:
- LOG_DBG("status: [%d] [%s]", status, "SMARTTHINGS_STATUS_REGISTERING_TO_CLOUD");
- notify(EasySetupEvent{REGISTERING_TO_CLOUD});
- break;
- case SMARTTHINGS_STATUS_REGISTERED_TO_CLOUD:
- LOG_DBG("[VERDICT] status: [%d] [%s]", status, "SMARTTHINGS_STATUS_REGISTERED_TO_CLOUD");
- notify(EasySetupEvent{REGISTERED_TO_CLOUD});
- break;
- case SMARTTHINGS_STATUS_REGISTERING_FAILED_ON_SIGN_IN:
- LOG_DBG("status: [%d] [%s]", status, "SMARTTHINGS_STATUS_REGISTERING_FAILED_ON_SIGN_IN");
- notify(EasySetupEvent{REGISTERING_FAILED_ON_SIGN_IN});
- break;
- case SMARTTHINGS_STATUS_REGISTERING_FAILED_ON_PUB_RES:
- LOG_DBG("status: [%d] [%s]", status, "SMARTTHINGS_STATUS_REGISTERING_FAILED_ON_PUB_RES");
- notify(EasySetupEvent{REGISTERING_FAILED_ON_PUB_RES});
- break;
- default:
- LOG_ERR("status: [%d][%s]", status, "Unknown Status");
- break;
- }
-};
-
-void EasySetup::_easySetupPinCallback(const std::string &pin)
-{
- notify(EasySetupEventPinAquired(pin));
-}
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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.
-*/
-
-#include "EasySetupEventAdapter.hpp"
-#include "StateManager.hpp"
-#include "logger.h"
-
-const double EasySetupEventAdapter::_timeoutInterval = 90.0;
-
-EasySetupEventAdapter::EasySetupEventAdapter(std::shared_ptr<StateManager> stateManager) : _stateManager(stateManager)
-{
-
-}
-
-void EasySetupEventAdapter::update(const EasySetupEvent &event)
-{
- LOG_DBG("EasySetupEventAdapter is processing event of type %d", event.type);
- switch(event.type)
- {
- case NOT_READY:
- case INIT:
- break;
- case ES_STARTED:
- _stateManager->processAdvertisement();
- break;
- case ES_DONE:
- _stateManager->confirmPin();
- break;
- case CONNECTING_TO_AP:
- _timerConnected = nullptr;
- break;
- case CONNECTED_TO_AP:
- _stateManager->saveWifiConnection();
- if(_timerConnected == nullptr)
- {
- _timerConnected = std::make_unique<tizen::timer::Timer>(EasySetupEventAdapter::_timeoutInterval,
- [this]()
- {
- _stateManager->timeout();
- return false;
- });
- }
- break;
- case REGISTERED_TO_CLOUD:
- _timerConnected = nullptr;
- _stateManager->finishSetup();
- break;
- case PIN_AQUIRED:
- {
- const EasySetupEventPinAquired &pinEvent = static_cast<const EasySetupEventPinAquired &>(event);
- _stateManager->setupPin(pinEvent.pin);
- break;
- }
- case WIFI_PROVISIONING:
- {
- /*_stateManager->disableMedium();
- const EasySetupEventWifiProvisioning &wifiProvEvent = static_cast<const EasySetupEventWifiProvisioning &>(event);
- _stateManager->connectToNetwork(
- wifiProvEvent.apInfo.get().getSsid().result(),
- wifiProvEvent.apInfo.get().getPassword().result());*/
- break;
- }
- case MEDIUM_REQUEST:
- //_stateManager->enableMedium();
- break;
- case ES_FAILED_OWNERSHIP_TRANSFER:
- _timerConnected = nullptr;
- _stateManager->error();
- break;
- case CONNECTING_TO_AP_FAILED:
- _timerConnected = nullptr;
- _stateManager->error();
- break;
- case REGISTERING_FAILED_ON_PUB_RES:
- _timerConnected = nullptr;
- _stateManager->error();
- break;
- case REGISTERING_FAILED_ON_SIGN_IN:
- _timerInit = nullptr;
- //_stateManager->error();
- break;
- case SET_DEVICE_PROPERTY_ERROR:
- _stateManager->unrecoverableError();
- break;
- case SET_PIN_CB_ERROR:
- _stateManager->unrecoverableError();
- break;
- case SET_CERTIFICATE_ERROR:
- _stateManager->unrecoverableError();
- break;
- default:
- break;
- }
-}
\ No newline at end of file
+++ /dev/null
-#include "OobeEasySetupApp.hpp"
-#include "AppUtils.hpp"
-#ifdef TEST_UI_STATE_MANAGER
-#include "TestUIViewEventAdapter.hpp"
-#else
-#include "ViewEventAdapter.hpp"
-#endif
-#include "EasySetupEventAdapter.hpp"
-
-using namespace tizen::application;
-
-const std::string OobeEasySetupApp::DEMANDED_CALLER("org.tizen.oobe");
-const std::string OobeEasySetupApp::DEMANDED_CALLER_KEY("caller");
-const std::string OobeEasySetupApp::DEMANDED_CALLER_VALUE("oobe-setup");
-
-OobeEasySetupApp::~OobeEasySetupApp()
-{
- _viewManager->detach(_viewEventAdapter);
- _easySetup->detach(_easySetupEventAdapter);
-}
-
-void OobeEasySetupApp::_win_delete_request_cb(void *data, Evas_Object *obj, void *event_info)
-{
- OobeEasySetupApp::Exit();
-}
-
-void OobeEasySetupApp::_createSkeleton()
-{
- /* Window */
- /* Create and initialize elm_win.
- elm_win is mandatory to manipulate window. */
-
- std::string styles_edj_path = AppUtils::getResource("edje/oobe_button.edj");
- dlog_print(DLOG_DEBUG, LOG_TAG, "Path for edj with styles: %s", styles_edj_path.c_str());
- elm_theme_extension_add(NULL, styles_edj_path.c_str());
-
- _win = elm_win_util_standard_add(PACKAGE, PACKAGE);
- elm_win_conformant_set(_win, EINA_TRUE);
- elm_win_indicator_mode_set(_win, ELM_WIN_INDICATOR_HIDE);
- elm_win_autodel_set(_win, EINA_TRUE);
- elm_win_layer_set(_win, 6);
-
- evas_object_smart_callback_add(_win, "delete,request", _win_delete_request_cb, NULL);
-
- if (elm_win_wm_rotation_supported_get(_win)) {
- int rots[4] = { 0, 90, 180, 270 };
- elm_win_wm_rotation_available_rotations_set(_win, (const int *)(&rots), 4);
- }
-
- AppUtils::saveWindow(_win);
-
-
- /* Conformant */
- /* Create and initialize elm_conformant.
- elm_conformant is mandatory for base gui to have proper size
- when indicator or virtual keypad is visible. */
- _conform = elm_conformant_add(_win);
- evas_object_size_hint_weight_set(_conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_win_resize_object_add(_win, _conform);
- evas_object_show(_conform);
- AppUtils::saveConformant(_conform);
-
- /* Show window after base gui is set up */
- evas_object_show(_win);
-}
-
-bool OobeEasySetupApp::OnCreate()
-{
- dlog_print(DLOG_DEBUG, LOG_TAG, "***\nAppCreate\nBuildTime: %s %s\n***", __DATE__, __TIME__);
-
- return true;
-}
-
-void OobeEasySetupApp::OnService(AppControl &app)
-{
- AppUtils::saveAppControl(app);
- auto callerRes = app.getCaller();
- if(!callerRes || callerRes.result() != OobeEasySetupApp::DEMANDED_CALLER)
- {
- dlog_print(DLOG_DEBUG, LOG_TAG, "Caller ID is %s (expected %s) - getting caller from extra data",
- callerRes? callerRes.result().c_str() : "unknown", OobeEasySetupApp::DEMANDED_CALLER.c_str());
- auto dataRes = app.getExtraData(OobeEasySetupApp::DEMANDED_CALLER_KEY);
- if(!dataRes || dataRes.result() != OobeEasySetupApp::DEMANDED_CALLER_VALUE)
- {
- dlog_print(DLOG_DEBUG, LOG_TAG, "Caller data is %s (expected %s) - terminating app",
- dataRes? dataRes.result().c_str() : "unknown", OobeEasySetupApp::DEMANDED_CALLER_VALUE.c_str());
- OobeEasySetupApp::Exit();
- }
- }
-
-
- _createSkeleton();
- _viewManager = std::make_shared<ViewManager>();
- _easySetup = std::make_shared<EasySetup>();
- _stateManager = std::make_shared<StateManager>(
- _viewManager,
- nullptr /*std::make_shared<TizenHomeAP>()*/,
- nullptr /*std::make_shared<TizenSoftAP>()*/,
- _easySetup);
-#ifdef TEST_UI_STATE_MANAGER
- _viewEventAdapter = std::make_shared<TestUIViewEventAdapter>(_stateManager);
-#else
- _viewEventAdapter = std::make_shared<ViewEventAdapter>(_stateManager);
-#endif
- _easySetupEventAdapter = std::make_shared<EasySetupEventAdapter>(_stateManager);
-
- _viewManager->attach(_viewEventAdapter);
- _easySetup->attach(_easySetupEventAdapter);
-
-
- _stateManager->startPreparation();
-}
-
-void OobeEasySetupApp::OnLanguageChanged(app_event_info_h event_info)
-{
- int ret;
- char *language;
-
- ret = app_event_get_language(event_info, &language);
- if (ret != APP_ERROR_NONE)
- {
- dlog_print(DLOG_ERROR, LOG_TAG, "app_event_get_language() failed. Err = %d.", ret);
- return;
- }
-
- if (language != NULL)
- {
- elm_language_set(language);
- free(language);
- }
-}
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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.
-*/
-
-#include "OobeEasySetupMain.hpp"
-#include "OobeEasySetupApp.hpp"
-
-int main(int argc, char *argv[])
-{
- OobeEasySetupApp app;
- try
- {
- int ret = app.Run(argc, argv);
- if (ret != APP_ERROR_NONE)
- {
- dlog_print(DLOG_ERROR, LOG_TAG, "App run failed. err = %d", ret);
- }
- return ret;
- }
- catch(const std::exception &e)
- {
- dlog_print(DLOG_FATAL, LOG_TAG, "App threw uncaught exception: %s", e.what());
- return 1;
- }
- catch(...)
- {
- dlog_print(DLOG_FATAL, LOG_TAG, "App threw uncaught object");
- return 1;
- }
-}
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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.
-*/
-
-#include "StateManager.hpp"
-#include "logger.h"
-#include "OobeEasySetupApp.hpp"
-#include "AppUtils.hpp"
-#include <utility>
-
-const std::string StateManager::REPLY_KEY("reply");
-const std::string StateManager::LOGGED_TO_SA_KEY("loggedToSA");
-const std::string StateManager::EASY_SETUP_FINISHED_KEY("completed");
-const std::string StateManager::WIFI_CONNECTED_KEY("connectedToAp");
-
-StateManager::StateManager(std::shared_ptr<ViewManager> viewManager, std::shared_ptr<TizenHomeAP> homeAp,
- std::shared_ptr<TizenSoftAP> medium, std::shared_ptr<EasySetup> easySetup)
- : _viewManager(viewManager), _homeAp(homeAp), _medium(medium), _easySetup(easySetup),
- _easySetupFinished(false), _connectedToAp(false), _loggedToSA(false)
-{
-
-}
-
-void StateManager::startPreparation()
-{
- LOG_DBG("State Manager: start preparation");
- _viewManager->setView(VIEW_START);
-}
-
-void StateManager::startAdvertisement()
-{
- LOG_DBG("State Manager: start advertisement");
- _viewManager->setView(VIEW_ADVERTISEMENT);
- _easySetup->startST();
-}
-
-void StateManager::processAdvertisement()
-{
- LOG_DBG("State Manager: processing advertisement");
- _viewManager->setView(VIEW_CONNECTED_TO_SOFTAP);
-}
-
-void StateManager::setupPin(std::string pin)
-{
- LOG_DBG("State Manager: setuping pin (%s)", pin.c_str());
- _viewManager->viewData.pin = pin;
- _viewManager->setView(VIEW_PIN);
-}
-
-void StateManager::confirmPin()
-{
- LOG_DBG("State Manager: confirming pin");
- _viewManager->setView(VIEW_AUTO_CONFIGURTION);
-}
-
-void StateManager::logOnSamsungAccount()
-{
- LOG_DBG("State Manager: tried to log on, but this method is unimplemented");
- //UNIMPLEMENTED
-}
-
-void StateManager::finishSetup()
-{
- LOG_DBG("State Manager: finishing setup");
- _easySetupFinished = true;
- closeApp();
-}
-
-void StateManager::skipRequest()
-{
- LOG_DBG("State Manager: serving skip request");
- _viewManager->showPopup(POPUP_SKIP);
-}
-
-void StateManager::cancelSkipRequest()
-{
- LOG_DBG("State Manager: cancelling skip request");
- _viewManager->hidePopup();
-}
-
-void StateManager::closeApp()
-{
- LOG_DBG("State Manager: closing app request");
- _easySetup->stopST();
- LOG_DBG("Preparing reply...");
- tizen::application::AppControl &appControl = AppUtils::getAppControl();
- tizen::application::AppControl reply;
- reply.addExtraData(REPLY_KEY.c_str(), _easySetupFinished? "done" : _connectedToAp? "connected" : "failed");
- reply.addExtraData(WIFI_CONNECTED_KEY.c_str(), _connectedToAp? "true" : "false");
- reply.addExtraData(EASY_SETUP_FINISHED_KEY.c_str(), _easySetupFinished? "true" : "false");
- reply.addExtraData(LOGGED_TO_SA_KEY.c_str(), _loggedToSA? "true" : "false");
- LOG_DBG("Replying to caller...");
- tizen::application::AppControl::replyToLaunchRequest(reply, appControl, APP_CONTROL_RESULT_SUCCEEDED);
- LOG_DBG("Closing app...");
- OobeEasySetupApp::Exit();
-}
-
-void StateManager::connectToNetwork(std::string ssid, std::string password)
-{
- LOG_DBG("State Manager: connecting to network (ssid: %s, password: %s)", ssid.c_str(), password.c_str());
-}
-
-void StateManager::enableMedium()
-{
- LOG_DBG("State Manager: enabling medium");
-}
-
-void StateManager::disableMedium()
-{
- LOG_DBG("State Manager: disabling medium");
-}
-
-void StateManager::reset()
-{
- LOG_DBG("State Manager: resetting");
-#ifndef TEST_UI_STATE_MANAGER
- _easySetupFinished = false;
-#endif
- _viewManager->setView(VIEW_ADVERTISEMENT);
- _easySetup->resetST();
-}
-
-void StateManager::error()
-{
- LOG_DBG("State Manager: serving error");
- _viewManager->viewData.errorType = ErrorType::RESETABLE;
- _viewManager->setView(VIEW_ERROR);
-}
-
-void StateManager::timeout()
-{
- LOG_DBG("State Manager: serving timeout");
- _viewManager->setView(VIEW_ERROR);
-}
-
-void StateManager::saveWifiConnection()
-{
- _connectedToAp = true;
-}
-
-void StateManager::unrecoverableError()
-{
- LOG_DBG("State Manager: serving unrecoverable error");
- _viewManager->viewData.errorType = ErrorType::UNRECOVERABLE;
- _viewManager->setView(VIEW_ERROR);
-}
\ No newline at end of file
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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.
-*/
-
-#include "TestUIViewEventAdapter.hpp"
-#include "StateManager.hpp"
-
-TestUIViewEventAdapter::TestUIViewEventAdapter(std::shared_ptr<StateManager> stateManager) : _stateManager(stateManager)
-{
-
-}
-
-void TestUIViewEventAdapter::update(const ViewEvent &event)
-{
- switch(event.source)
- {
- case VIEW_START:
- if(event.info == "next")
- {
- _stateManager->startAdvertisement();
- }
- else if(event.info == "skip")
- {
- _stateManager->skipRequest();
- }
- else if(event.info == "popup_no")
- {
- _stateManager->cancelSkipRequest();
- }
- if(event.info == "popup_yes")
- {
- _stateManager->closeApp();
- }
- break;
- case VIEW_ADVERTISEMENT:
- if(event.info == "skip")
- {
- _stateManager->processAdvertisement();
- }
- else if(event.info == "popup_yes")
- {
- _stateManager->closeApp();
- }
- else if(event.info == "popup_no")
- {
- _stateManager->cancelSkipRequest();
- }
- break;
- case VIEW_CONNECTED_TO_SOFTAP:
- if(event.info == "skip")
- {
- _stateManager->setupPin("12345678");
- }
- else if(event.info == "popup_yes")
- {
- _stateManager->closeApp();
- }
- else if(event.info == "popup_no")
- {
- _stateManager->cancelSkipRequest();
- }
- break;
- case VIEW_PIN:
- if(event.info == "skip")
- {
- _stateManager->confirmPin();
- }
- else if(event.info == "popup_yes")
- {
- _stateManager->closeApp();
- }
- else if(event.info == "popup_no")
- {
- _stateManager->cancelSkipRequest();
- }
- break;
- case VIEW_AUTO_CONFIGURTION:
- if(event.info == "skip")
- {
- _stateManager->finishSetup();
- }
- else if(event.info == "popup_yes")
- {
- _stateManager->closeApp();
- }
- else if(event.info == "popup_no")
- {
- _stateManager->cancelSkipRequest();
- }
- break;
- case VIEW_ERROR:
- if(event.info == "skip")
- {
- _stateManager->skipRequest();
- }
- else if(event.info == "retry")
- {
- _stateManager->reset();
- }
- else if(event.info == "popup_yes")
- {
- _stateManager->closeApp();
- }
- else if(event.info == "popup_no")
- {
- _stateManager->cancelSkipRequest();
- }
- break;
- default:
- break;
- }
-}
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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.
-*/
-
-#include "ViewEventAdapter.hpp"
-#include "StateManager.hpp"
-
-ViewEventAdapter::ViewEventAdapter(std::shared_ptr<StateManager> stateManager) : _stateManager(stateManager)
-{
-
-}
-
-void ViewEventAdapter::update(const ViewEvent &event)
-{
- switch(event.source)
- {
- case VIEW_START:
- if(event.info == "next")
- {
- _stateManager->startAdvertisement();
- }
- else if(event.info == "skip")
- {
- _stateManager->skipRequest();
- }
- else if(event.info == "popup_no")
- {
- _stateManager->cancelSkipRequest();
- }
- if(event.info == "popup_yes")
- {
- _stateManager->closeApp();
- }
- break;
- case VIEW_ADVERTISEMENT:
- if(event.info == "skip")
- {
- _stateManager->skipRequest();
- }
- else if(event.info == "popup_yes")
- {
- _stateManager->closeApp();
- }
- else if(event.info == "popup_no")
- {
- _stateManager->cancelSkipRequest();
- }
- break;
- case VIEW_CONNECTED_TO_SOFTAP:
- if(event.info == "skip")
- {
- _stateManager->skipRequest();
- }
- else if(event.info == "popup_yes")
- {
- _stateManager->closeApp();
- }
- else if(event.info == "popup_no")
- {
- _stateManager->cancelSkipRequest();
- }
- break;
- case VIEW_PIN:
- if(event.info == "skip")
- {
- _stateManager->skipRequest();
- }
- else if(event.info == "popup_yes")
- {
- _stateManager->closeApp();
- }
- else if(event.info == "popup_no")
- {
- _stateManager->cancelSkipRequest();
- }
- break;
- case VIEW_AUTO_CONFIGURTION:
- if(event.info == "skip")
- {
- _stateManager->skipRequest();
- }
- else if(event.info == "popup_yes")
- {
- _stateManager->closeApp();
- }
- else if(event.info == "popup_no")
- {
- _stateManager->cancelSkipRequest();
- }
- break;
- case VIEW_ERROR:
- if(event.info == "skip")
- {
- _stateManager->skipRequest();
- }
- else if(event.info == "retry")
- {
- _stateManager->reset();
- }
- else if(event.info == "popup_yes")
- {
- _stateManager->closeApp();
- }
- else if(event.info == "popup_no")
- {
- _stateManager->cancelSkipRequest();
- }
- else if(event.info == "force_skip")
- {
- _stateManager->closeApp();
- }
- break;
- default:
- break;
- }
-}
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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.
-*/
-
-#include "ViewEventObserver.hpp"
-#include "ViewManager.hpp"
-
-ViewEventObserver::ViewEventObserver(ViewManager &viewManager) : _viewManager(viewManager)
-{
-
-}
-
-void ViewEventObserver::update(const std::string &info)
-{
- _viewManager.get().processInfo(info);
-}
\ No newline at end of file
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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.
-*/
-
-#include "ViewManager.hpp"
-#include "views/ViewAdvertisement.hpp"
-#include "views/ViewAutoConfiguration.hpp"
-#include "views/ViewConnectedToSoftAP.hpp"
-#include "views/ViewPin.hpp"
-#include "views/ViewStart.hpp"
-#include "views/ViewSuccess.hpp"
-#include "views/ViewError.hpp"
-#include "popups/PopupSkip.hpp"
-#include "logger.h"
-
-ViewManager::ViewManager()
-{
- _viewEventObserver = std::make_shared<ViewEventObserver>(*this);
- _popupEventObserver = std::make_shared<ViewEventObserver>(*this);
-}
-
-ViewManager::~ViewManager()
-{
- if(_current)
- {
- _current->detach(_viewEventObserver);
- }
-
- if(_currentPopup)
- {
- _currentPopup->detach(_popupEventObserver);
- }
-}
-
-void ViewManager::setView(view_e view)
-{
- hidePopup();
- if(_current)
- {
- LOG_DBG("Hiding current view");
- _current->detach(_viewEventObserver);
- _current->hide();
- }
- switch(view)
- {
- case VIEW_ADVERTISEMENT:
- _current = std::make_unique<ViewAdvertisement>();
- break;
- case VIEW_AUTO_CONFIGURTION:
- _current = std::make_unique<ViewAutoConfiguration>();
- break;
- case VIEW_CONNECTED_TO_SOFTAP:
- _current = std::make_unique<ViewConnectedToSoftAP>();
- break;
- case VIEW_PIN:
- _current = std::make_unique<ViewPin>(viewData.pin);
- break;
- case VIEW_START:
- _current = std::make_unique<ViewStart>();
- break;
- case VIEW_ERROR:
- _current = std::make_unique<ViewError>(viewData.errorType);
- break;
- default:
- LOG_WRN("Unknown view was tried to be set");
- break;
- }
- if(_current)
- {
- LOG_DBG("Showing view %d", view);
- _currentEnum = view;
- _current->show();
- _current->attach(_viewEventObserver);
- }
-}
-
-void ViewManager::processInfo(std::string info)
-{
- LOG_DBG("Event from view %d : %s", _currentEnum, info.c_str());
- notify(ViewEvent{_currentEnum, info});
-}
-
-void ViewManager::showPopup(popup_e popup)
-{
- if(popup == POPUP_NONE)
- {
- hidePopup();
- return;
- }
-
- LOG_DBG("Hiding popup %d", _currentPopupEnum);
- if(_currentPopup)
- {
- _currentPopup->detach(_popupEventObserver);
- _currentPopup->hide();
- }
-
- switch(popup)
- {
- case POPUP_SKIP:
- _currentPopup = std::make_unique<PopupSkip>();
- break;
- case POPUP_NONE:
- //Impossible, since check for this happens before
- break;
- }
-
- if(_currentPopup)
- {
- LOG_DBG("Showing popup %d", popup);
- _currentPopupEnum = popup;
- _currentPopup->show();
- _currentPopup->attach(_popupEventObserver);
- }
-}
-
-void ViewManager::hidePopup()
-{
- LOG_DBG("Hiding popup %d", _currentPopupEnum);
- if(_currentPopup)
- {
- _currentPopup->detach(_popupEventObserver);
- _currentPopup->hide();
- _currentPopup = nullptr;
- }
-
- _currentPopupEnum = POPUP_NONE;
-}
\ No newline at end of file
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "connectivity/TizenHomeAP.hpp"
-#include "logger.h"
-#include <tizen/network/wifi/Manager.hpp>
-#include <memory>
-
-using namespace tizen::network::wifi;
-
-TizenHomeAP::TizenHomeAP()
-{
- wifi_mgr.setConnectedCallback([this](wifi_manager_error_e res) {
- LOG_DBG("AP Connected callback");
- if (res != WIFI_MANAGER_ERROR_NONE) {
- LOG_ERR("Connection atttempt failed: %s", get_error_message(res));
- return;
- }
- notify(CONNECTED);
- });
- wifi_mgr.setDisconnectedCallback([this](wifi_manager_error_e res) {
- LOG_DBG("AP Disconnected callback: %s", get_error_message(res));
- if (res != WIFI_MANAGER_ERROR_NONE)
- return;
- notify(DISCONNECTED);
- });
-}
-
-bool TizenHomeAP::connect(const std::string &ssid, const std::string& passwd)
-{
- LOG_DBG("TizenHomeAP::connect(%s, %s)", ssid.c_str(), passwd.c_str());
-
- if (ssid.empty()) {
- LOG_ERR("Invalid ssid.");
- return false;
- }
-
- auto res = softap_mgr.isEnabled();
- if (!res) return false;
-
- if (res.result()) {
- softap_mgr.setDisabledCallback([this, ssid, passwd](softap_error_e, softap_disabled_cause_e) {
- LOG_DBG("SoftAP disabled cb");
- connectNow(ssid, passwd);
- });
- softap_mgr.disable();
- } else {
- connectNow(ssid, passwd);
- }
-
- return true;
-}
-
-bool TizenHomeAP::connectNow(const std::string &ssid, const std::string& passwd)
-{
- LOG_DBG("TizenHomeAP::connectNow(%s, %s)", ssid.c_str(), passwd.c_str());
- wifi_mgr.setActivatedCallback([this, ssid](wifi_manager_error_e result) {
- LOG_DBG("Activated callback.");
- if (result != WIFI_MANAGER_ERROR_NONE) {
- LOG_ERR("Activation attempt failed:");
- return;
- }
- auto sr = wifi_mgr.scanSpecificAp(ssid);
- if (!sr) LOG_ERR("scanSpecificAp failed: %s", sr.error().message());
- LOG_DBG("Scan specific done.");
- });
-
- wifi_mgr.setScanSpecificFinishedCallback([this, ssid, passwd](wifi_manager_error_e result) {
- LOG_DBG("Scan specific callback");
- if (result != WIFI_MANAGER_ERROR_NONE) {
- LOG_ERR("Scan specific attempt failed:");
- return;
- }
- auto res = wifi_mgr.specificFoundAps();
- if (!res) {
- LOG_ERR("Unable to get specific found APs.");
- return;
- }
- if (res.result().size() != 1) {
- LOG_ERR("Multiple aps for the single ssid. Abort connection");
- return;
- }
- for(auto& ap : res.result()) {
- auto res = ap.setPassphrase(passwd);
- if (!res) {
- LOG_ERR("Unable to set AP password: %s", res.error().message());
- return;
- }
- auto conn = wifi_mgr.connect(ap);
- if (!conn) LOG_ERR("Connect attemp failed: %s", conn.error().message());
- }
- });
-
- if (auto res = wifi_mgr.activated()) {
- if (res.result()) { // already activated
- LOG_DBG("Wifi already activated.");
- wifi_mgr.scanSpecificAp(ssid);
- } else {
- LOG_DBG("Activating wifi");
- auto res = wifi_mgr.activate();
- if (!res) {
- LOG_ERR("Failed do activate wifimanager");
- return false;
- }
- LOG_DBG("Successfully activated.");
- }
- }
-
- return true;
-}
-
-void TizenHomeAP::disconnect()
-{
- auto res = wifi_mgr.deactivate();
- if (res)
- LOG_DBG("wifi decativated");
- else
- LOG_ERR("wifi decativation failed: %s", res.error().message());
-}
-
-bool TizenHomeAP::activated()
-{
- auto res = wifi_mgr.activated();
- if (res) return res.result();
- else return false;
-}
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "connectivity/TizenSoftAP.hpp"
-#include "logger.h"
-
-constexpr char ssid[] = "ChairRPi3_E30AJT020";
-constexpr char passwd[] = "1111122222";
-
-TizenSoftAP::TizenSoftAP()
-{
- softap_mgr.setEnabledCallback([this](softap_error_e error, bool is_requested) {
- LOG_DBG("SoftAp enabled, error: %s, is_requestd: %d", get_error_message(error), is_requested);
- this->notify(SoftAPState::ENABLED);
- });
- softap_mgr.setDisabledCallback([this](softap_error_e error, softap_disabled_cause_e cause) {
- LOG_DBG("SoftAp disabled, error: %s, cause: %d", get_error_message(error), cause);
- this->notify(SoftAPState::DISABLED);
- });
-}
-
-void TizenSoftAP::enableNow()
-{
- LOG_DBG("TizenSoftAP::enableNow()");
- auto res = softap_mgr.isEnabled();
-
- if (!res) {
- LOG_ERR("isEnabled failed: %s", res.error().message());
- return;
- }
-
- if (res.result()) {
- if (softap_mgr.ssid().result() == ssid) {
- LOG_DBG("softap already enabled");
- return;
- }
- }
-
- softap_mgr.setSsid(ssid);
- softap_mgr.setPassphrase(passwd);
- softap_mgr.enable();
-}
-
-void TizenSoftAP::enable()
-{
- LOG_DBG("TizenSoftAP::enable()");
-
- if (auto res = wifi_mgr.activated()) {
- if (res.result()) {
- wifi_mgr.setDeactivatedCallback([this](wifi_manager_error_e err) {
- LOG_DBG("deactivate_cb, error: %d", err);
- enableNow();
- });
- wifi_mgr.deactivate();
- } else {
- enableNow();
- }
- }
-}
-
-void TizenSoftAP::disable()
-{
- LOG_DBG("TizenSoftAP::disable()");
- auto res = softap_mgr.isEnabled();
-
- if (!res) {
- LOG_ERR("isEnabled failed: %s", res.error().message());
- return;
- }
-
- if (!res.result())
- return;
-
- auto disRes = softap_mgr.disable();
- if (!disRes) {
- LOG_ERR("softap_mgr.disable failed: %s", disRes.error().message());
- }
-}
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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.
-*/
-
-#include "popups/PopupSkip.hpp"
-#include "AppUtils.hpp"
-
-const std::string PopupSkip::POPUP_SKIP_EDJE_FILE("edje/skip_popup.edj");
-const std::string PopupSkip::POPUP_SKIP_TEXT_KEY("SKIP_CONTENT");
-const std::string PopupSkip::POPUP_SKIP_NO("NO");
-const std::string PopupSkip::POPUP_SKIP_YES("YES");
-
-void PopupSkip::show()
-{
- popup = elm_popup_add(AppUtils::getWindow());
-
- evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-
- AppUtils::setTranslatableText(popup, POPUP_SKIP_TEXT_KEY.c_str());
-
- elm_object_part_text_set(popup, "title,text", "");
-
- Evas_Object *btn_no = elm_button_add(popup);
- elm_object_style_set(btn_no, "no");
- AppUtils::setTranslatableText(btn_no, POPUP_SKIP_NO);
- evas_object_smart_callback_add(btn_no, "clicked", [](void *data, Evas_Object *obj, void *event_info){
- static_cast<PopupSkip*>(data)->notify("popup_no");
- }, this);
- elm_object_part_content_set(popup, "button1", btn_no);
-
- Evas_Object *btn_yes = elm_button_add(popup);
- elm_object_style_set(btn_yes, "yes");
- AppUtils::setTranslatableText(btn_yes, POPUP_SKIP_YES);
- evas_object_smart_callback_add(btn_yes, "clicked", [](void *data, Evas_Object *obj, void *event_info){
- static_cast<PopupSkip*>(data)->notify("popup_yes");
- }, this);
- elm_object_part_content_set(popup, "button2", btn_yes);
-
- evas_object_show(popup);
-}
-
-void PopupSkip::hide()
-{
- evas_object_del(popup);
-}
\ No newline at end of file
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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.
-*/
-
-#include "views/ViewAdvertisement.hpp"
-#include "logger.h"
-#include "AppUtils.hpp"
-
-const std::string ViewAdvertisement::VIEW_ADVERTISEMENT_EDJE_FILE("edje/advertisement.edj");
-const std::string ViewAdvertisement::VIEW_ADVERTISEMENT_TEXT_KEY("ADVERTISEMENT_CONTENT");
-const std::string ViewAdvertisement::VIEW_ADVERTISEMENT_SKIP_TEXT_KEY("SKIP");
-
-void ViewAdvertisement::show()
-{
- std::string edj_path = AppUtils::getResource(VIEW_ADVERTISEMENT_EDJE_FILE);
- dlog_print(DLOG_DEBUG, LOG_TAG, "Edje path: %s", edj_path.c_str());
- Evas_Object *layout = elm_layout_add(AppUtils::getConformant());
- elm_layout_file_set(layout, edj_path.c_str(), GRP_MAIN);
-
- Evas_Object *btn_skip = elm_button_add(layout);
- elm_object_style_set(btn_skip, "skip");
- AppUtils::setTranslatableText(btn_skip, VIEW_ADVERTISEMENT_SKIP_TEXT_KEY);
- evas_object_smart_callback_add(btn_skip, "clicked", [](void *data, Evas_Object *obj, void *event_info){
- static_cast<ViewAdvertisement*>(data)->notify("skip");
- }, this);
- elm_layout_content_set(layout, ADVERTISEMENT_SKIP_PLACEHOLDER, btn_skip);
-
- evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_object_content_set(AppUtils::getConformant(), layout);
-
- AppUtils::setTranslatableText(layout, ADVERTISEMENT_TEXT, VIEW_ADVERTISEMENT_TEXT_KEY);
-
- evas_object_show(layout);
-}
-
-void ViewAdvertisement::hide()
-{
-}
\ No newline at end of file
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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.
-*/
-
-#include "views/ViewAutoConfiguration.hpp"
-#include "AppUtils.hpp"
-
-const std::string ViewAutoConfiguration::VIEW_AUTO_CONFIGURATION_EDJE_FILE("edje/auto_configuration.edj");
-const std::string ViewAutoConfiguration::VIEW_AUTO_CONFIGURATION_TEXT_KEY("AUTO_CONFIGURATION_CONTENT");
-const std::string ViewAutoConfiguration::VIEW_AUTO_CONFIGURATION_SKIP_TEXT_KEY("SKIP");
-
-void ViewAutoConfiguration::show()
-{
- std::string edj_path = AppUtils::getResource(VIEW_AUTO_CONFIGURATION_EDJE_FILE);
- dlog_print(DLOG_DEBUG, LOG_TAG, "Edje path: %s", edj_path.c_str());
- Evas_Object *layout = elm_layout_add(AppUtils::getConformant());
- elm_layout_file_set(layout, edj_path.c_str(), GRP_MAIN);
-
- Evas_Object *btn_skip = elm_button_add(layout);
- elm_object_style_set(btn_skip, "skip");
- AppUtils::setTranslatableText(btn_skip, VIEW_AUTO_CONFIGURATION_SKIP_TEXT_KEY);
- evas_object_smart_callback_add(btn_skip, "clicked", [](void *data, Evas_Object *obj, void *event_info){
- static_cast<ViewAutoConfiguration*>(data)->notify("skip");
- }, this);
- elm_layout_content_set(layout, AUTO_CONFIGURATION_SKIP_PLACEHOLDER, btn_skip);
-
- AppUtils::setTranslatableText(layout, AUTO_CONFIGURATION_TEXT, VIEW_AUTO_CONFIGURATION_TEXT_KEY);
-
- evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_object_content_set(AppUtils::getConformant(), layout);
-
- evas_object_show(layout);
-}
-
-void ViewAutoConfiguration::hide()
-{
-
-}
\ No newline at end of file
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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.
-*/
-
-#include "views/ViewConnectedToSoftAP.hpp"
-#include "AppUtils.hpp"
-
-const std::string ViewConnectedToSoftAP::VIEW_CONNECTED_TO_SOFTAP_EDJE_FILE("edje/connected_to_softap.edj");
-const std::string ViewConnectedToSoftAP::VIEW_CONNECTED_TO_SOFTAP_TEXT_KEY("CONNECTED_TO_SOFTAP_CONTENT");
-const std::string ViewConnectedToSoftAP::VIEW_CONNECTED_TO_SOFTPA_SKIP_TEXT_KEY("SKIP");
-
-void ViewConnectedToSoftAP::show()
-{
- std::string edj_path = AppUtils::getResource(VIEW_CONNECTED_TO_SOFTAP_EDJE_FILE);
- dlog_print(DLOG_DEBUG, LOG_TAG, "Edje path: %s", edj_path.c_str());
- Evas_Object *layout = elm_layout_add(AppUtils::getConformant());
- elm_layout_file_set(layout, edj_path.c_str(), GRP_MAIN);
-
- Evas_Object *btn_skip = elm_button_add(layout);
- elm_object_style_set(btn_skip, "skip");
- AppUtils::setTranslatableText(btn_skip, VIEW_CONNECTED_TO_SOFTPA_SKIP_TEXT_KEY);
- evas_object_smart_callback_add(btn_skip, "clicked", [](void *data, Evas_Object *obj, void *event_info){
- static_cast<ViewConnectedToSoftAP*>(data)->notify("skip");
- }, this);
- elm_layout_content_set(layout, CONNECTED_TO_SOFTAP_SKIP_PLACEHOLDER, btn_skip);
-
- AppUtils::setTranslatableText(layout, CONNECTED_TO_SOFTAP_TEXT, VIEW_CONNECTED_TO_SOFTAP_TEXT_KEY);
-
- evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_object_content_set(AppUtils::getConformant(), layout);
-
- evas_object_show(layout);
-}
-
-void ViewConnectedToSoftAP::hide()
-{
-
-}
\ No newline at end of file
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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.
-*/
-
-#include "views/ViewError.hpp"
-#include "AppUtils.hpp"
-
-const std::string ViewError::VIEW_ERROR_EDJE_FILE("edje/error.edj");
-const std::string ViewError::VIEW_ERROR_RESETABLE_MAIN_TEXT_KEY("RETRY");
-const std::string ViewError::VIEW_ERROR_UNRECOVERABLE_MAIN_TEXT_KEY("SKIP");
-const std::string ViewError::VIEW_ERROR_SKIP_TEXT_KEY("SKIP");
-const std::string ViewError::VIEW_ERROR_RESETABLE_TEXT_KEY("ERROR_CONTENT_RESETABLE");
-const std::string ViewError::VIEW_ERROR_UNRECOVERABLE_TEXT_KEY("ERROR_CONTENT_UNRECOVERABLE");
-
-ViewError::ViewError(ErrorType errorType) : _errorType(errorType)
-{
-}
-
-void ViewError::show()
-{
- std::string edj_path = AppUtils::getResource(VIEW_ERROR_EDJE_FILE);
- dlog_print(DLOG_DEBUG, LOG_TAG, "Edje path: %s", edj_path.c_str());
- Evas_Object *layout = elm_layout_add(AppUtils::getConformant());
- elm_layout_file_set(layout, edj_path.c_str(), GRP_MAIN);
-
- if (_errorType == ErrorType::RESETABLE)
- {
- Evas_Object *btn_main = elm_button_add(layout);
- elm_object_style_set(btn_main, "start");
- AppUtils::setTranslatableText(btn_main, VIEW_ERROR_RESETABLE_MAIN_TEXT_KEY);
- evas_object_smart_callback_add(btn_main, "clicked", [](void *data, Evas_Object *obj, void *event_info) {
- static_cast<ViewError *>(data)->notify("retry");
- }, this);
- elm_layout_content_set(layout, ERROR_MAIN_BUTTON_PLACEHOLDER, btn_main);
- Evas_Object *btn_extra = elm_button_add(layout);
- elm_object_style_set(btn_extra, "skip");
- AppUtils::setTranslatableText(btn_extra, VIEW_ERROR_SKIP_TEXT_KEY);
- evas_object_smart_callback_add(btn_extra, "clicked", [](void *data, Evas_Object *obj, void *event_info) {
- static_cast<ViewError *>(data)->notify("skip");
- }, this);
- elm_layout_content_set(layout, ERROR_EXTRA_BUTTON_PLACEHOLDER, btn_extra);
-
- AppUtils::setTranslatableText(layout, ERROR_TEXT, VIEW_ERROR_RESETABLE_TEXT_KEY);
-
- evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- }
- else if (_errorType == ErrorType::UNRECOVERABLE)
- {
- Evas_Object *btn_main = elm_button_add(layout);
- elm_object_style_set(btn_main, "start");
- AppUtils::setTranslatableText(btn_main, VIEW_ERROR_UNRECOVERABLE_MAIN_TEXT_KEY);
- evas_object_smart_callback_add(btn_main, "clicked", [](void *data, Evas_Object *obj, void *event_info) {
- static_cast<ViewError *>(data)->notify("force_skip");
- },this);
- elm_layout_content_set(layout, ERROR_MAIN_BUTTON_PLACEHOLDER, btn_main);
-
- AppUtils::setTranslatableText(layout, ERROR_TEXT, VIEW_ERROR_UNRECOVERABLE_TEXT_KEY);
-
- evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- }
-
- elm_object_content_set(AppUtils::getConformant(), layout);
-
- evas_object_show(layout);
-}
-
-void ViewError::hide()
-{
-}
\ No newline at end of file
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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.
-*/
-
-#include "views/ViewPin.hpp"
-#include "AppUtils.hpp"
-
-const std::string ViewPin::VIEW_PIN_EDJE_FILE("edje/pin.edj");
-const std::string ViewPin::VIEW_PIN_TEXT_KEY("PIN_CONTENT");
-const std::string ViewPin::VIEW_PIN_SKIP_TEXT_KEY("SKIP");
-
-ViewPin::ViewPin(const std::string &pin) : _pin(pin)
-{
-
-}
-
-void ViewPin::show()
-{
- std::string edj_path = AppUtils::getResource(VIEW_PIN_EDJE_FILE);
- dlog_print(DLOG_DEBUG, LOG_TAG, "Edje path: %s", edj_path.c_str());
- _layout = elm_layout_add(AppUtils::getConformant());
- elm_layout_file_set(_layout, edj_path.c_str(), GRP_MAIN);
-
- Evas_Object *btn_skip = elm_button_add(_layout);
- elm_object_style_set(btn_skip, "skip");
- AppUtils::setTranslatableText(btn_skip, VIEW_PIN_SKIP_TEXT_KEY);
- evas_object_smart_callback_add(btn_skip, "clicked", [](void *data, Evas_Object *obj, void *event_info){
- static_cast<ViewPin*>(data)->notify("skip");
- }, this);
- elm_layout_content_set(_layout, PIN_SKIP_PLACEHOLDER, btn_skip);
-
- AppUtils::setTranslatableText(_layout, PIN_TEXT, VIEW_PIN_TEXT_KEY);
-
- evas_object_size_hint_weight_set(_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_object_content_set(AppUtils::getConformant(), _layout);
- _setPinOnView();
-
- evas_object_show(_layout);
-}
-
-void ViewPin::hide()
-{
-
-}
-
-void ViewPin::_setPinOnView()
-{
- _setPinOnView(_pin);
-}
-
-void ViewPin::_setPinOnView(const std::string & pin)
-{
- elm_layout_text_set(_layout, PIN_PIN_TEXT1, _pin.substr(0,1).c_str());
- elm_layout_text_set(_layout, PIN_PIN_TEXT2, _pin.substr(1,1).c_str());
- elm_layout_text_set(_layout, PIN_PIN_TEXT3, _pin.substr(2,1).c_str());
- elm_layout_text_set(_layout, PIN_PIN_TEXT4, _pin.substr(3,1).c_str());
- elm_layout_text_set(_layout, PIN_PIN_TEXT5, _pin.substr(4,1).c_str());
- elm_layout_text_set(_layout, PIN_PIN_TEXT6, _pin.substr(5,1).c_str());
- elm_layout_text_set(_layout, PIN_PIN_TEXT7, _pin.substr(6,1).c_str());
- elm_layout_text_set(_layout, PIN_PIN_TEXT8, _pin.substr(7,1).c_str());
-}
-
+++ /dev/null
-/*
-* Copyright (c) 2018 Samsung Electronics Co., Ltd.
-*
-* 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/license/
-*
-* 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.
-*/
-
-#include "views/ViewStart.hpp"
-#include "AppUtils.hpp"
-
-const std::string ViewStart::VIEW_START_EDJE_FILE("edje/start.edj");
-const std::string ViewStart::VIEW_START_SKIP_TEXT_KEY("SKIP");
-const std::string ViewStart::VIEW_START_START_TEXT_KEY("START");
-const std::string ViewStart::VIEW_START_TEXT_KEY("START_CONTENT");
-
-void ViewStart::show()
-{
- std::string edj_path = AppUtils::getResource(VIEW_START_EDJE_FILE);
- dlog_print(DLOG_DEBUG, LOG_TAG, "Edje path: %s", edj_path.c_str());
- Evas_Object *layout = elm_layout_add(AppUtils::getConformant());
- elm_layout_file_set(layout, edj_path.c_str(), GRP_MAIN);
-
- Evas_Object *btn_start = elm_button_add(layout);
- elm_object_style_set(btn_start, "start");
- AppUtils::setTranslatableText(btn_start, VIEW_START_START_TEXT_KEY);
- evas_object_smart_callback_add(btn_start, "clicked", [](void *data, Evas_Object *obj, void *event_info){
- static_cast<ViewStart*>(data)->notify("next");
- }, this);
- elm_layout_content_set(layout, START_START_PLACEHOLDER, btn_start);
-
- Evas_Object *btn_skip = elm_button_add(layout);
- elm_object_style_set(btn_skip, "skip");
- AppUtils::setTranslatableText(btn_skip, VIEW_START_SKIP_TEXT_KEY);
- evas_object_smart_callback_add(btn_skip, "clicked", [](void *data, Evas_Object *obj, void *event_info){
- static_cast<ViewStart*>(data)->notify("skip");
- }, this);
- elm_layout_content_set(layout, START_SKIP_PLACEHOLDER, btn_skip);
-
- AppUtils::setTranslatableText(layout, START_TEXT, VIEW_START_TEXT_KEY);
- evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- elm_object_content_set(AppUtils::getConformant(), layout);
-
- evas_object_show(layout);
-}
-
-void ViewStart::hide()
-{
-
-}
\ No newline at end of file
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<manifest xmlns="http://tizen.org/ns/packages" api-version="5.0" package="org.tizen.oobe-easy-setup" version="1.0.0">
- <profile name="iot-headed"/>
- <ui-application appid="org.tizen.oobe-easy-setup" exec="oobe-easy-setup" launch_mode="single" multiple="false" nodisplay="true" taskmanage="true" type="capp">
- <label>oobe-easy-setup</label>
- <icon>oobe-easy-setup.png</icon>
- <metadata key="http://tizen.org/iot/metadata/master" value="shared/res/master.json"/>
- <metadata key="samsung-experience-service-api-level" value="1"/>
- </ui-application>
- <privileges>
- <privilege>http://tizen.org/privilege/mediastorage</privilege>
- <privilege>http://tizen.org/privilege/network.get</privilege>
- <privilege>http://tizen.org/privilege/appmanager.launch</privilege>
- <privilege>http://tizen.org/privilege/network.set</privilege>
- <privilege>http://tizen.org/privilege/account.read</privilege>
- <privilege>http://tizen.org/privilege/softap.admin</privilege>
- <privilege>http://tizen.org/privilege/account.write</privilege>
- <privilege>http://tizen.org/privilege/softap</privilege>
- <privilege>http://tizen.org/privilege/internet</privilege>
- <privilege>http://tizen.org/privilege/datasharing</privilege>
- <privilege>http://tizen.org/privilege/network.profile</privilege>
- <privilege>http://tizen.org/privilege/externalstorage</privilege>
- <appdefined-privilege>http://com.samsung.tizen.smartthings-thing/appdefined/smartthings-thing.master</appdefined-privilege>
- </privileges>
-</manifest>
<project>oobe-country</project>
<project>oobe-wifi</project>
<project>oobe-language</project>
- <project>oobe-easy-setup</project>
</projects>
<buildSpec>
<buildCommand>
<resFallback autoGen="true"/>
<subProjects>
<tizenProject project="oobe-country"/>
- <tizenProject project="oobe-easy-setup"/>
<tizenProject project="oobe-language"/>
<tizenProject project="oobe-terms"/>
<tizenProject project="oobe-wifi"/>
void country_show(void);
void terms_show(void);
void wifi_show(void);
-void easy_setup_show(void);
void finish(void);
profile = mobile-5.0
# C/CPP Sources
-USER_SRCS = src/wifi.c src/app-control.c src/country.c src/view.c src/done.c src/oobe-setup.c src/easy-setup.c src/terms.c src/language.c
+USER_SRCS = src/wifi.c src/app-control.c src/country.c src/view.c src/done.c src/oobe-setup.c src/terms.c src/language.c
# EDC Sources
USER_EDCS =
+++ /dev/null
-/*
- * Copyright (c) 2019 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#include "oobe-setup.h"
-#include <log.h>
-#include <app.h>
-#include <app-control.h>
-
-static void _easy_setup_reply(const char *reply)
-{
- if(!reply)
- {
- LOGE("did not get any reply from easy-setup app");
- ui_app_exit();
-
- } else {
- LOGI("easy setup reply: %s", reply);
- if(0 == strcmp(reply, "done")) {
- done_show();
-
- } else if(0 == strcmp(reply, "connected")) {
- done_show();
-
- } else if(0 == strcmp(reply, "failed")) {
- wifi_show();
-
- } else {
- LOGE("unknown reply: %s", reply);
- ui_app_exit();
-
- }
- }
-}
-
-void easy_setup_show()
-{
- app_control_launch_app("org.tizen.oobe-easy-setup", _easy_setup_reply);
-}
{
wifi_show();
}
- else if (0 == strcmp(caller, "easy-setup"))
- {
- easy_setup_show();
- }
free(caller);
}
}
}
return ret;
-}
\ No newline at end of file
+}
language_show();
} else if (!strcmp(reply, "next")) {
- easy_setup_show();
+ wifi_show();
} else {
LOGE("unknown reply: %s", reply);
} else {
if (!strcmp(reply, "back")) {
- easy_setup_show();
+ terms_show();
} else if (!strcmp(reply, "next")) {
done_show();
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<manifest xmlns="http://tizen.org/ns/packages" api-version="5.0" package="org.tizen.oobe" version="1.0.3">
+<manifest xmlns="http://tizen.org/ns/packages" api-version="5.0" package="org.tizen.oobe" version="1.0.4">
<profile name="mobile"/>
<ui-application appid="org.tizen.oobe" exec="oobe-setup" launch_mode="single" multiple="false" nodisplay="true" taskmanage="true" type="capp">
<label>oobe-setup</label>