[SSM] Upload Tizen sample for 2.3 public sdk IDE
authorjk13 <jihyeok13.kim@samsung.com>
Fri, 6 Feb 2015 05:34:40 +0000 (14:34 +0900)
committerUze Choi <uzchoi@samsung.com>
Mon, 9 Feb 2015 08:45:31 +0000 (08:45 +0000)
1. Change existing Tizen gbs sample app
   to using Tizen 2.3_rev1 IDE env

Change-Id: I12977bcd4de66d925f6e98f5382f1227d218c72c
Signed-off-by: jk13 <jihyeok13.kim@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/313
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
24 files changed:
service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/.exportMap [new file with mode: 0644]
service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/.gitignore [new file with mode: 0644]
service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/.rds_delta [new file with mode: 0644]
service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/.sdk_delta.info [new file with mode: 0644]
service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/.tproject [new file with mode: 0644]
service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/CMakeLists.txt [deleted file]
service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/README [deleted file]
service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/RELEASE.txt [deleted file]
service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/inc/ssmtesterapp.h [new file with mode: 0644]
service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/makefile_org [deleted file]
service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/oic-sample/CMakeLists.txt [deleted file]
service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/oic-sample/com.samsung.ssmtester.rule [deleted file]
service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/oic-sample/com.samsung.ssmtester.xml [deleted file]
service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/oic-sample/src/oicapp-log.h [deleted file]
service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/oic-sample/src/oicapp-test.cpp [deleted file]
service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/oic-sample/src/oicapp-test.h [deleted file]
service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/oic-sample/src/oicapp-utils.c [deleted file]
service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/oic-sample/src/oicapp-utils.h [deleted file]
service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/packaging/ssm.manifest [deleted file]
service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/packaging/ssm.spec [deleted file]
service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/res/ui_controls.edc [new file with mode: 0644]
service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/shared/res/ssmtesterapp.png [new file with mode: 0644]
service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/src/ssmtesterapp.cpp [new file with mode: 0644]
service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/tizen-manifest.xml [new file with mode: 0644]

diff --git a/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/.exportMap b/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/.exportMap
new file mode 100644 (file)
index 0000000..43e310e
--- /dev/null
@@ -0,0 +1,4 @@
+{
+       global: main;
+       local: *;
+};
diff --git a/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/.gitignore b/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/.gitignore
new file mode 100644 (file)
index 0000000..98bbc31
--- /dev/null
@@ -0,0 +1 @@
+/Debug
diff --git a/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/.rds_delta b/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/.rds_delta
new file mode 100644 (file)
index 0000000..3eac727
--- /dev/null
@@ -0,0 +1,6 @@
+#delete
+#add
+#modify
+author-signature.xml
+signature1.xml
+bin/ssmtesterapp
diff --git a/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/.sdk_delta.info b/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/.sdk_delta.info
new file mode 100644 (file)
index 0000000..9017e05
Binary files /dev/null and b/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/.sdk_delta.info differ
diff --git a/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/.tproject b/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/.tproject
new file mode 100644 (file)
index 0000000..f1cc1fd
--- /dev/null
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<tproject xmlns="http://www.tizen.org/tproject">
+    <platforms>
+        <platform>
+            <name>mobile-2.3</name>
+        </platform>
+    </platforms>
+    <package>
+        <blacklist/>
+    </package>
+</tproject>
diff --git a/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/CMakeLists.txt b/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/CMakeLists.txt
deleted file mode 100644 (file)
index 7aa6d40..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-PROJECT(ssm)
-
-SET(CMAKE_SHARED_LINKER_FLAGS " -Wl,--as-needed")
-SET(CMAKE_EXE_LINKER_FLAGS " -Wl,--as-needed -Wl,--hash-style=both")
-#SET(EX_SERVER "simpleserver")
-#SET(EX_CLIENT "simpleclient")
-#SET(EX_CLIENTSERVER "simpleclientserver")
-#SET(OCTBSTACK "octbstack")
-
-#INCLUDE_DIRECTORIES(include)
-#INCLUDE_DIRECTORIES(csdk/stack/include)
-#INCLUDE_DIRECTORIES(csdk/ocsocket/include)
-#INCLUDE_DIRECTORIES(csdk/ocrandom/include)
-#INCLUDE_DIRECTORIES(csdk/logger/include)
-#INCLUDE_DIRECTORIES(${INCLUDE_INSTALL_DIR}/boost)
-#LINK_DIRECTORIES(${CMAKE_BINARY_DIR})
-
-#SET(EXTRA_CXXFLAGS "-std=c++11")
-#SET(EXTRA_CXXFLAGS "-g3 -std=c++0x")
-SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${EXTRA_CXXFLAGS}")
-
-#SET(SRCS
-#      OCLib/OCReflect.cpp
-#      OCLib/OCPlatform.cpp
-#      OCLib/OCResource.cpp
-#      OCLib/InProcServerWrapper.cpp
-#      OCLib/InProcClientWrapper.cpp)
-#ADD_LIBRARY(${PROJECT_NAME} STATIC ${SRCS})
-
-#ADD_EXECUTABLE(${EX_SERVER} examples/simpleserver.cpp)
-#TARGET_LINK_LIBRARIES(${EX_SERVER} ${PROJECT_NAME} ${OCTBSTACK} pthread)
-#INSTALL(TARGETS ${EX_SERVER} DESTINATION ${BIN_INSTALL_DIR})
-
-#ADD_EXECUTABLE(${EX_CLIENT} examples/simpleclient.cpp)
-#TARGET_LINK_LIBRARIES(${EX_CLIENT} ${PROJECT_NAME} ${OCTBSTACK} pthread)
-#INSTALL(TARGETS ${EX_CLIENT} DESTINATION ${BIN_INSTALL_DIR})
-
-#ADD_EXECUTABLE(${EX_CLIENTSERVER} examples/simpleclientserver.cpp)
-#TARGET_LINK_LIBRARIES(${EX_CLIENTSERVER} ${PROJECT_NAME} ${OCTBSTACK} pthread)
-#INSTALL(TARGETS ${EX_CLIENTSERVER} DESTINATION ${BIN_INSTALL_DIR})
-
-#ADD_SUBDIRECTORY(csdk)
-#ADD_SUBDIRECTORY(examples)
-ADD_SUBDIRECTORY(oic-sample)
diff --git a/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/README b/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/README
deleted file mode 100644 (file)
index 2f789a5..0000000
+++ /dev/null
@@ -1,75 +0,0 @@
-
-
-Builds with g++ 4.6, 4.8, 4.9.
-
-Run "make" to build OCLib.a, the examples, and TBStack in RELEASE mode.
-
-Run "make BUILD=debug" to build OCLib.a, the examples, and TBStack in DEBUG mode.
-
-OCProject/
-├── csdk
-│   ├── examples  :: TODO :: Unused remove??
-│   │   ├── occlient.c
-│   │   └── ocserver.c
-│   ├── ocstack.h
-│   └── ocstack_stub.c
-├── examples
-│   ├── client 
-│   │   ├── MyMultiResourceHandler.cpp
-│   │   ├── MyMultiResourceHandler.h
-│   │   ├── MyObserverHandler.cpp
-│   │   ├── MyObserverHandler.h
-│   │   ├── MyResourceHandler.cpp
-│   │   ├── MyResourceHandler.h
-│   │   └── OCClient.cpp
-│   ├── Makefile
-│   ├── OCWrapper :: TODO :: Unused remove??
-│   │   ├── Makefile
-│   │   ├── parsetest.cpp
-│   │   ├── testClient.cpp
-│   │   ├── testServerApp.cpp
-│   │   └── testServer.cpp
-│   ├── server
-│   │   ├── multiple_resources.cpp
-│   │   └── single_resource.cpp
-│   ├── test_OCClient.cpp
-│   ├── test_OCReflect.cpp
-│   └── test_properties.cpp
-├── include - TODO : Seperate what we expose and what we don't
-│   ├── IClientWrapper.h
-│   ├── InitializeException.h
-│   ├── InProcClientWrapper.h
-│   ├── InProcServerWrapper.h
-│   ├── IServerWrapper.h
-│   ├── OCApi.h
-│   ├── OCException.h
-│   ├── OCObject.h
-│   ├── OCObserver.h
-│   ├── OCObserverHandler.h
-│   ├── OCPlatform.h
-│   ├── OCPlatformHandler.h
-│   ├── OCProperties.h
-│   ├── OCReflect.h
-│   ├── OCResource.h
-│   ├── OCResourceHandler.h
-│   ├── OCSecurityModel.h
-│   ├── OCServer.h :: TODO :: Unused remove??
-│   ├── OutOfProcClientWrapper.h
-│   ├── OutOfProcServerWrapper.h
-│   ├── ResourceInitException.h
-│   └── WrapperFactory.h
-├── Makefile
-├── OCLib
-│   ├── InProcClientWrapper.cpp
-│   ├── InProcServerWrapper.cpp
-│   ├── OCApi.cpp
-│   ├── OCObject.cpp
-│   ├── OCObserver.cpp
-│   ├── OCPlatform.cpp
-│   ├── OCProperties.cpp
-│   ├── OCReflect.cpp
-│   ├── OCResource.cpp
-│   ├── OCSecurityModel.cpp
-│   └── OCServer.cpp :: TODO :: Unused remove??
-└── README - You are reading this.
-
diff --git a/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/RELEASE.txt b/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/RELEASE.txt
deleted file mode 100644 (file)
index c9f9a61..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-Release notes
-Release date: Aug 5th, 2014. 
-OS: Ubuntu 12.0.4 and above
-Requires boost version 1.55 to build. 
-NOTE: Boost is not distributed but should be installed in the Ubuntu machine. 
-
-What\92s new?
-Class OCPlatform (Header file: OCPlatform.h)
-registerResource API (signature update)
-\95This API provides the ability to register the resource with its name, type and list of properties
-\95Signature of this API has changed. The API takes reference to resource handle which will be filled upon successful registration. Other parameters include resource URI, resource Type, resource interface, entity handler address and resource property (whether discoverable, observable etc.). 
-\95NOTE: This applies to server side functionality. 
-\95NOTE: This API might get modified to accommodate for resource collection in future.
-
-notifyObservers API
-\95This new API provides the ability to notify core that resource\92s attributes have changed. When entity handler is ready to indicate core that a resource has changed, notifyObservers API needs to be invoked.
-\95This API takes resource handle as the only parameter. 
-\95NOTE: This applies to server side functionality. 
-\95NOTE: This API might get modified to accommodate for resource collection in future.
-
-Class OCResource (Header file: OCResource.h)
-
-get API
-\95This new API provides the ability to get the attributes of a resource. This API takes a callback as parameter. Callback will be invoked with Attribute map which will provide representation of the resource. Callback will also include error code for GET operation. 
-\95NOTE: This applies to client side functionality. 
-\95NOTE: This API might get modified to accommodate for resource collection in future.
-
-put API
-\95This new API provides the ability to set the attributes of a resource via PUT. 
-\95This API takes Attribute map, query parameter map and a callback as parameters. Callback will be invoked with Attribute map which will provide current representation of the resource. Callback will also include error code for PUT operation. 
-\95NOTE: This applies to client side functionality. 
-\95NOTE: This API might get modified to accommodate for resource collection in future.
-
-Observe API
-\95This new API provides the ability for the client to set observation on a resource
-\95This API provides callback as a parameter. Callback will be invoked with attribute map and with an error code for this operation. 
-\95NOTE: This applies to client side functionality. 
-
-cancelObserve API
-\95This new API provides the ability for the client to cancel observation on a resource
-\95This API provides callback as a parameter. Callback will be invoked with error code for this operation. 
-\95NOTE: This applies to client side functionality. 
-Class OCResourceRequest (Header file: OCResourceRequest.h)
-NOTE: This applies to server side functionality. 
-
-getRequestType API
-\95This new API provides the ability to retrieve the type of request. This could be GET, PUT (and in future POST and DELETE).
-
-getQueryParams API
-\95This new API provides the ability to retrieve the query parameters from the URL request. 
-
-getRequestHandlerFlag API
-\95This new API provides the ability to retrieve the request handler flag on the URL request. This could be either INIT, REQUEST or OBSERVE flag. 
-
-getResourceRepresentation API
-\95This new API provides the ability to retrieve attribute representation of the resource. 
-
-Class OCResourceResponse (Header file: OCResourceResponse.h)
-NOTE: This applies to server side functionality. 
-
-setErrorCode API
-\95This new API provides the ability to set the error code
-
-setResourceRepresentation API
-\95This new API provides the ability to set the attribute representation of a resource.  
-
-Other Notes:
-1.     Security model is still open. 
-2.     APIs have OCStackResult as return type. This is will indicate success or failure for the API operation. 
-3.     Resource collection/hierarchy APIs are not checked into the code base. They will be given as separate header files.  
-4.     Query parameters are not used in this deliverable.
-5.     Only single client observer has been tested.
-6.     Maximum length of URI supported is 64 bytes
-7.     Maximum length of response (for GET, PUT) from server is 128 bytes.
-
-
-How to build:
-1.     Root folder oic-resource consists of \91OIC\92 folder.  Inside OIC folder there is a Makefile. 
-2.     Before building, make sure to have contents from oic-utilities repo at the folder level where oic-resource is.  
-3.     Use \91make\92 to build the entire OIC code. This would build the C++ SDK, stack and samples. 
-
-Samples:
-1.     We have a sample for hosting a resource on a server and a sample for client which will be able to discover resources. 
-2.     Server sample location: OIC/examples/simpleserver.cpp
-3.     Client sample location: OIC/examples/simpleclient.cpp
-4.     In simpleserver.cpp, inside main, 
-
-PlatformConfig cfg;
-cfg.ipAddress = "134.134.161.33";
-
-Modify the above IP address to the IP address of the machine where this server is running. 
-
-Similarly, in simpleclient.cpp, inside main, modify the IP address to the IP address of the machine where the client is running. 
-
-The server and client can run in same machine or in different machines.
-
-5. To run simpleServer do \91./simpleServer\92 and to run simpleClient do \91./simpleClient\92.
-
diff --git a/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/inc/ssmtesterapp.h b/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/inc/ssmtesterapp.h
new file mode 100644 (file)
index 0000000..20f8e61
--- /dev/null
@@ -0,0 +1,19 @@
+#ifndef __ssmtesterapp_H__
+#define __ssmtesterapp_H__
+
+#include <app.h>
+#include <Elementary.h>
+#include <system_settings.h>
+#include <efl-extension/efl_extension.h>
+#include <dlog.h>
+
+#ifdef  LOG_TAG
+#undef  LOG_TAG
+#endif
+#define LOG_TAG "ssmtesterapp"
+
+#if !defined(PACKAGE)
+#define PACKAGE "org.iotivity.service.ssm.ssmtesterapp"
+#endif
+
+#endif /* __ssmtesterapp_H__ */
diff --git a/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/makefile_org b/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/makefile_org
deleted file mode 100644 (file)
index 85ece27..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-# override with `make BUILD=release`
-# default to release build
-BUILD    := release
-CXX      := g++
-#CXX     := clang
-OUT_DIR          := $(PWD)/$(BUILD)
-OBJ_DIR          := $(OUT_DIR)/obj
-SAMPLES_OUT_DIR := $(OUT_DIR)/samples
-
-CXX_FLAGS.debug     := -g3 -std=c++0x -Wall -pthread
-
-CXX_FLAGS.release   := -std=c++0x -Wall -pthread
-
-CXX_INC          := -I./include/
-CXX_INC          += -I./csdk/stack/include
-CXX_INC          += -I./csdk/ocsocket/include
-CXX_INC          += -I./csdk/ocrandom/include
-CXX_INC          += -I./csdk/logger/include
-CXX_INC   += -I/usr/local/boost_1_51_0
-
-# Force metatargets to build:
-.PHONY: prep_dirs c_sdk simpleserver simpleclient simpleclientserver
-
-all:   .PHONY
-
-prep_dirs:
-       -mkdir $(OUT_DIR)
-       -mkdir $(OBJ_DIR)
-       -mkdir $(SAMPLES_OUT_DIR)
-
-c_sdk:
-       cd csdk && $(MAKE) "BUILD=$(BUILD)"
-
-examples:
-       cd examples && $(MAKE) "BUILD=$(BUILD)"
-
-simpleserver: OCLib.a
-       $(CXX) $(CXX_FLAGS.$(BUILD)) -o $(SAMPLES_OUT_DIR)/$@ examples/simpleserver.cpp $(CXX_INC) $(OBJ_DIR)/OCLib.a csdk/$(BUILD)/liboctbstack.a
-
-simpleclient: OCLib.a
-       $(CXX) $(CXX_FLAGS.$(BUILD)) -o $(SAMPLES_OUT_DIR)/$@ examples/simpleclient.cpp $(CXX_INC) $(OBJ_DIR)/OCLib.a csdk/$(BUILD)/liboctbstack.a
-
-simpleclientserver: OCLib.a
-       $(CXX) $(CXX_FLAGS.$(BUILD)) -o $(SAMPLES_OUT_DIR)/$@ examples/simpleclientserver.cpp $(CXX_INC) $(OBJ_DIR)/OCLib.a csdk/$(BUILD)/liboctbstack.a
-
-OCLib.a: OCPlatform.o OCResource.o OCReflect.o InProcServerWrapper.o InProcClientWrapper.o
-       ar -cvq $(OBJ_DIR)/OCLib.a $(OBJ_DIR)/OCPlatform.o $(OBJ_DIR)/OCResource.o $(OBJ_DIR)/OCReflect.o $(OBJ_DIR)/InProcServerWrapper.o $(OBJ_DIR)/InProcClientWrapper.o
-
-OCReflect.o: OCLib/OCReflect.cpp
-       $(CXX) $(CXX_FLAGS.$(BUILD)) -o $(OBJ_DIR)/$@ -c OCLib/OCReflect.cpp $(CXX_INC)
-
-OCPlatform.o: OCLib/OCPlatform.cpp
-       $(CXX) $(CXX_FLAGS.$(BUILD)) -o $(OBJ_DIR)/$@ -c OCLib/OCPlatform.cpp $(CXX_INC)
-
-OCResource.o: OCLib/OCResource.cpp
-       $(CXX) $(CXX_FLAGS.$(BUILD)) -o $(OBJ_DIR)/$@ -c OCLib/OCResource.cpp $(CXX_INC)
-
-InProcServerWrapper.o: OCLib/InProcServerWrapper.cpp
-       $(CXX) $(CXX_FLAGS.$(BUILD)) -o $(OBJ_DIR)/$@ -c OCLib/InProcServerWrapper.cpp $(CXX_INC)
-
-InProcClientWrapper.o: OCLib/InProcClientWrapper.cpp
-       $(CXX) $(CXX_FLAGS.$(BUILD)) -o $(OBJ_DIR)/$@ -c OCLib/InProcClientWrapper.cpp $(CXX_INC)
-
-clean: clean_legacy
-       -rm -rf release
-       -rm -rf debug
-       cd csdk && $(MAKE) clean
-       cd csdk && $(MAKE) deepclean
-clean_legacy:
-       -rm -f -v OCLib.a *.o simpleserver simpleclient simpleclientserver
diff --git a/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/oic-sample/CMakeLists.txt b/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/oic-sample/CMakeLists.txt
deleted file mode 100644 (file)
index 982cff1..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-SET(TESTAPP "ssmtester")
-
-FILE(GLOB SRCS src/*.c src/*.cpp)
-
-SET(VENDOR "samsung")
-SET(PACKAGE ${TESTAPP})
-SET(PKGNAME "com.${VENDOR}.${PACKAGE}")
-SET(PREFIX "/usr/apps/com.samsung.ssmtester")
-SET(BINDIR "${PREFIX}/bin")
-SET(RESDIR "${PREFIX}/res")
-SET(DATADIR "${PREFIX}/data")
-SET(LOCALEDIR "${RESDIR}/locale")
-SET(ICONDIR "${RESDIR}/icons/default/small")
-
-IF("${CMAKE_BUILD_TYPE}" STREQUAL "")
-       SET(CMAKE_BUILD_TYPE "Release")
-ENDIF("${CMAKE_BUILD_TYPE}" STREQUAL "")
-MESSAGE("Build type: ${CMAKE_BUILD_TYPE}")
-
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/include)
-
-INCLUDE(FindPkgConfig)
-pkg_check_modules(pkgs REQUIRED dlog appcore-efl ecore-x elementary efl-assist capi-network-wifi)
-INCLUDE_DIRECTORIES(${pkgs_INCLUDE_DIRS})
-
-SET(CMAKE_C_FLAGS_DEBUG "-O0 -g")
-SET(CMAKE_C_FLAGS_RELEASE "-O2")
-
-ADD_DEFINITIONS("-DVENDOR=\"${VENDOR}\"")
-ADD_DEFINITIONS("-DPACKAGE=\"${PACKAGE}\"")
-ADD_DEFINITIONS("-DPACKAGE_NAME=\"${PKGNAME}\"")
-ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"")
-ADD_DEFINITIONS("-DRESDIR=\"${RESDIR}\"")
-ADD_DEFINITIONS("-DDATADIR=\"${DATADIR}\"")
-ADD_DEFINITIONS("-DLOCALEDIR=\"${LOCALEDIR}\"")
-ADD_DEFINITIONS("-DICONDIR=\"${ICONDIR}\"")
-ADD_DEFINITIONS("-DEDJDIR=\"${EDJDIR}\"")
-
-SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed")
-
-LINK_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/lib)
-
-ADD_EXECUTABLE(${TESTAPP} ${SRCS})
-TARGET_LINK_LIBRARIES(${TESTAPP} ${pkgs_LDFLAGS} ssmcore oc octbstack oc_logger pthread dl)
-
-INSTALL(TARGETS ${TESTAPP} DESTINATION ${BINDIR})
-
-# install desktop file & icon
-#INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${PKGNAME}.png DESTINATION "/usr/share/icons/default/small")
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${PKGNAME}.xml DESTINATION "/usr/share/packages")
-INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${PKGNAME}.rule DESTINATION /etc/smack/accesses2.d)
diff --git a/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/oic-sample/com.samsung.ssmtester.rule b/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/oic-sample/com.samsung.ssmtester.rule
deleted file mode 100644 (file)
index 701ef6f..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-com.samsung.ssmtester system::use_internet r
-
-system::use_internet com.samsung.ssmtester r
diff --git a/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/oic-sample/com.samsung.ssmtester.xml b/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/oic-sample/com.samsung.ssmtester.xml
deleted file mode 100644 (file)
index ea0671f..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns="http://tizen.org/ns/packages" package="com.samsung.ssmtester" version="0.1.0" install-location="internal-only">
-       <label>OIC test</label>
-       <author email="email@samsung.com" href="www.samsung.com">Name</author>
-       <description>SSM test Application</description>
-       <ui-application appid="com.samsung.ssmtester" exec="/usr/apps/com.samsung.ssmtester/bin/ssmtester" nodisplay="false" multiple="false" type="capp" taskmanage="true" mainapp="true">
-               <icon>com.samsung.oicapp-test.png</icon>
-               <label>SSM test</label>
-       </ui-application>
-</manifest>
diff --git a/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/oic-sample/src/oicapp-log.h b/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/oic-sample/src/oicapp-log.h
deleted file mode 100644 (file)
index a0b3484..0000000
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Copyright (c) 2010 Samsung Electronics, Inc.
- * All rights reserved.
- *
- * This software is a confidential and proprietary information
- * of Samsung Electronics, Inc. ("Confidential Information").  You
- * shall not disclose such Confidential Information and shall use
- * it only in accordance with the terms of the license agreement
- * you entered into with Samsung Electronics.
- */
-#ifndef __OICAPP_LOG_H__
-#define __OICAPP_LOG_H__
-
-#define TIZEN_DEBUG_ENABLE
-#define LOG_TAG "OIC_TEST"
-#include <dlog.h>
-
-#define LOG_COLOR_RED       "\033[0;31m"
-#define LOG_COLOR_BROWN     "\033[0;33m"
-#define LOG_COLOR_BLUE      "\033[0;34m"
-#define LOG_COLOR_END       "\033[0;m"
-
-
-#if 1
-#define _DBG(fmt, arg...) SLOGD(fmt, ##arg)
-#define _INFO(fmt, arg...) SLOGI(fmt, ##arg)
-#define _WARN(fmt, arg...) SLOGW(fmt, ##arg)
-#define _ERR(fmt, arg...) SLOGE(fmt, ##arg)
-#else
-#define _DBG(fmt, arg...) \
-    printf("[OIC_TEST]%s(%d):" fmt "\n", __FUNCTION__, __LINE__, ##arg)
-#define _INFO(fmt, arg...) \
-    printf("[OIC_TEST]%s(%d):" fmt "\n", __FUNCTION__, __LINE__, ##arg)
-#define _WARN(fmt, arg...) \
-    printf("[OIC_TEST]%s(%d):" fmt "\n", __FUNCTION__, __LINE__, ##arg)
-#define _ERR(fmt, arg...) \
-    printf("[OIC_TEST]%s(%d):" fmt "\n", __FUNCTION__, __LINE__, ##arg)
-#endif
-
-#define DBG(fmt, arg...) _DBG(fmt, ##arg)
-#define WARN(fmt, arg...) _WARN(LOG_COLOR_BROWN fmt LOG_COLOR_END, ##arg)
-#define ERR(fmt, arg...) _ERR(LOG_COLOR_RED fmt LOG_COLOR_END, ##arg)
-#define INFO(fmt, arg...) _INFO(LOG_COLOR_BLUE fmt LOG_COLOR_END, ##arg)
-
-#define ret_if(expr) \
-    do { \
-        if (expr) { \
-            ERR("(%s)", #expr); \
-            return; \
-        }\
-    } while(0)
-#define retv_if(expr, val) \
-    do {\
-        if (expr) { \
-            ERR("(%s)", #expr); \
-            return (val); \
-        } \
-    } while(0)
-#define retm_if(expr, fmt, arg...) \
-    do {\
-        if (expr) { \
-            ERR(fmt, ##arg); \
-            return; \
-        }\
-    } while(0)
-#define retvm_if(expr, val, fmt, arg...) \
-    do {\
-        if (expr) { \
-            ERR(fmt, ##arg); \
-            return (val); \
-        } \
-    } while(0)
-#define warn_if(expr) \
-    do { \
-        if (expr) { \
-            WARN("(%s)", #expr); \
-        } \
-    } while (0)
-
-
-#endif //__OICAPP_LOG_H__
-
diff --git a/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/oic-sample/src/oicapp-test.cpp b/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/oic-sample/src/oicapp-test.cpp
deleted file mode 100644 (file)
index 3fb4288..0000000
+++ /dev/null
@@ -1,496 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics, Inc.
- * All rights reserved.
- *
- * This software is a confidential and proprietary information
- * of Samsung Electronics, Inc. ("Confidential Information").  You
- * shall not disclose such Confidential Information and shall use
- * it only in accordance with the terms of the license agreement
- * you entered into with Samsung Electronics.
- */
-
-#include <appcore-efl.h>
-#include <Ecore_X.h>
-#include <efl_assist.h>
-
-#include <string>
-#include <sstream>
-
-#include "oicapp-test.h"
-#include "oicapp-utils.h"
-
-#include "SSMInterface.h"
-
-using namespace OIC;
-
-static oicapp_data *g_ad = NULL;
-
-int g_CQID = 9999;
-
-class CQueryEngineEvent : public IQueryEngineEvent
-{
-    public:
-
-        SSMRESULT onQueryEngineEvent(int cqid, IDataReader *pResult)
-        {
-            std::stringstream sstream;
-
-            int     dataCount = 0;
-            IModelData      *pModelData = NULL;
-            std::vector<std::string>        affectedModels;
-
-            pResult->getAffectedModels(&affectedModels);
-
-            for (std::vector<std::string>::iterator itor = affectedModels.begin();
-                 itor != affectedModels.end(); ++itor)
-            {
-                printf("Printing %s\n", itor->c_str());
-                pResult->getModelDataCount(*itor, &dataCount);
-                for (int i = 0; i < dataCount; i++)
-                {
-                    pResult->getModelData(*itor, i, &pModelData);
-                    printf("dataId: %d\n", pModelData->getDataId());
-                    for (int j = 0; j < pModelData->getPropertyCount(); j++)
-                    {
-                        sstream << "Type: " << pModelData->getPropertyName(j).c_str() <<
-                                " Value: " << pModelData->getPropertyValue(j).c_str() << "<br>";
-                    }
-                }
-            }
-
-            sstream << std::ends;
-
-            oicapp_util_put_msg(g_ad, sstream.str().c_str());
-
-            return SSM_S_OK;
-        }
-};
-
-CQueryEngineEvent   *g_SSMClientListener = new CQueryEngineEvent();
-
-static Elm_Object_Item *oicapp_append_separator(Evas_Object *genlist,
-        oicapp_data *ad)
-{
-    Elm_Object_Item *item = NULL;
-
-    item = elm_genlist_item_append(genlist, &ad->itc_seperator, NULL, NULL,
-                                   ELM_GENLIST_ITEM_NONE, NULL, NULL);
-    //elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
-
-    return item;
-}
-
-static void _win_del(void *data, Evas_Object *obj, void *event)
-{
-    DBG("test _win_del()");
-
-    elm_exit();
-}
-
-static Evas_Object *oicapp_create_win(const char *name)
-{
-    Evas_Object *eo;
-    int w, h;
-
-    eo = elm_win_add(NULL, name, ELM_WIN_BASIC);
-    if (eo)
-    {
-        elm_win_title_set(eo, name);
-        elm_win_borderless_set(eo, EINA_TRUE);
-        evas_object_smart_callback_add(eo, "delete,request", _win_del, NULL);
-        ecore_x_window_size_get(ecore_x_window_root_first_get(), &w, &h);
-        evas_object_resize(eo, w, h);
-        elm_win_indicator_mode_set(eo, ELM_WIN_INDICATOR_SHOW);
-        elm_win_indicator_opacity_set(eo, ELM_WIN_INDICATOR_OPAQUE);
-    }
-
-    evas_object_show(eo);
-
-    return eo;
-}
-
-static Evas_Object *oicapp_create_bg(Evas_Object *parent)
-{
-    Evas_Object *bg;
-
-    bg = elm_bg_add(parent);
-    evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-    elm_win_resize_object_add(parent, bg);
-    //elm_object_part_content_set(parent, "elm.swallow.bg", bg);
-    evas_object_show(bg);
-
-    return bg;
-}
-
-static Evas_Object *oicapp_create_base_layout(Evas_Object *parent)
-{
-    Evas_Object *base;
-
-    base = elm_layout_add(parent);
-    elm_layout_theme_set(base, "layout", "application", "default");
-    evas_object_size_hint_weight_set(base, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-    evas_object_show(base);
-
-    return base;
-}
-
-void __gl_realized_cb(void *data, Evas_Object *obj, void *event_info)
-{
-    Elm_Object_Item *item = (Elm_Object_Item *)event_info;
-    /*
-        list_item = elm_object_item_data_get(item);
-        if (NULL == list_item)
-        {
-            elm_object_item_signal_emit(item, "elm,state,center", "");
-            return;
-        }
-        if (list_item->group_style == OICAPP_GENLIST_GRP_TOP)
-            elm_object_item_signal_emit(item, "elm,state,top", "");
-        else if (list_item->group_style == OICAPP_GENLIST_GRP_CENTER)
-            elm_object_item_signal_emit(item, "elm,state,center", "");
-        else if (list_item->group_style == OICAPP_GENLIST_GRP_BOTTOM)
-            elm_object_item_signal_emit(item, "elm,state,bottom", "");
-        else
-    */
-    elm_object_item_signal_emit(item, "elm,state,normal", "");
-}
-
-
-static Evas_Object *oicapp_create_genlist(Evas_Object *parent)
-{
-    Evas_Object *genlist;
-
-    genlist = elm_genlist_add(parent);
-    if (NULL == genlist)
-    {
-        ERR("elm_genlist_add() Fail");
-        return NULL;
-    }
-
-    elm_object_style_set(genlist, "dialogue");
-    elm_genlist_mode_set(genlist, ELM_LIST_COMPRESS);
-    evas_object_size_hint_weight_set(genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-    evas_object_show(genlist);
-
-    evas_object_smart_callback_add(genlist, "realized", __gl_realized_cb, NULL);
-
-    return genlist;
-}
-
-static Elm_Object_Item *_gl_append_item(oicapp_data *ad, Elm_Genlist_Item_Class *itc)
-{
-    Elm_Object_Item *item;
-
-    item = elm_genlist_item_append(ad->genlist, itc, ad, NULL,
-                                   ELM_GENLIST_ITEM_NONE, NULL, NULL);
-
-    elm_genlist_item_select_mode_set(item, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
-
-    return item;
-}
-
-static void oicapp_append_contents(oicapp_data *ad)
-{
-    Elm_Object_Item *item;
-    /*
-    oicapp_append_separator(ad->genlist, ad);
-
-    _gl_append_item(ad, &ad->itc_edit);
-
-    oicapp_append_separator(ad->genlist, ad);
-
-    _gl_append_item(ad, &ad->itc_btn);
-
-    oicapp_append_separator(ad->genlist, ad);
-
-    item = _gl_append_item(ad, &ad->itc_multiline);
-    ad->item_multiline = item;
-
-    oicapp_append_separator(ad->genlist, ad);
-    */
-    oicapp_append_separator(ad->genlist, ad);
-
-    elm_genlist_item_append(ad->genlist, &ad->itc_edit, ad, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
-
-    oicapp_append_separator(ad->genlist, ad);
-
-    elm_genlist_item_append(ad->genlist, &ad->itc_btn, ad, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
-
-    oicapp_append_separator(ad->genlist, ad);
-
-    oicapp_append_separator(ad->genlist, ad);
-
-    oicapp_append_separator(ad->genlist, ad);
-
-    item = _gl_append_item(ad, &ad->itc_multiline);
-
-    ad->item_multiline = item;
-
-    oicapp_append_separator(ad->genlist, ad);
-}
-
-static Evas_Object *oicapp_create_conform(Evas_Object *win)
-{
-    Evas_Object *conform = NULL;
-    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);
-
-    Evas_Object *bg_indicator = elm_bg_add(conform);
-    elm_object_style_set(bg_indicator, "indicator/headerbg");
-    elm_object_part_content_set(conform, "elm.swallow.indicator_bg", bg_indicator);
-    evas_object_show(bg_indicator);
-
-    return conform;
-}
-
-static Eina_Bool _back_cb(void *data, Elm_Object_Item *item)
-{
-    elm_exit();
-
-    return EINA_FALSE;
-}
-
-static char *_gl_multiline_text_get(void *data, Evas_Object *obj, const char *part)
-{
-    oicapp_data *ad = (oicapp_data *)data;
-
-    if (ad->output_msg)
-        return strdup(ad->output_msg);
-    else
-        return strdup("");
-}
-
-static void _btn_clicked(void *data, Evas_Object *obj, void *event_info)
-{
-    oicapp_data *ad = (oicapp_data *)data;
-
-    std::string str = std::string(ad->input_msg);
-
-    std::string strGT = "&gt;";
-
-    std::string strLT = "&lt;";
-
-    std::size_t foundGT = str.find(strGT);
-
-    std::size_t foundLT = str.find(strLT);
-
-    std::stringstream sstream;
-
-    if (foundGT != std::string::npos)
-    {
-        str.replace(foundGT, strGT.length(), ">");
-    }
-
-    if (foundLT != std::string::npos)
-    {
-        str.replace(foundLT, strLT.length(), "<");
-    }
-
-    RegisterQuery(str, g_SSMClientListener, g_CQID);
-
-    sstream << "Query executed! cqid = " << g_CQID << std::ends;
-
-    oicapp_util_put_msg(ad, sstream.str().c_str());
-
-    ERR("button clicked(%s)", ad->input_msg);
-}
-
-static Evas_Object *_gl_btn_content_get(void *data, Evas_Object *obj,
-                                        const char *part)
-{
-    Evas_Object *button;
-    oicapp_data *ad = (oicapp_data *)data;
-
-    button = elm_button_add(obj);
-    //elm_object_style_set(button, "");
-    elm_object_part_text_set(button, NULL, "Send Query");
-    evas_object_propagate_events_set(button, EINA_FALSE);
-    evas_object_smart_callback_add(button, "clicked", _btn_clicked, ad);
-
-    return button;
-}
-
-static void _edit_unfocused(void *data, Evas_Object *obj, void *event_info)
-{
-    oicapp_data *ad = (oicapp_data *)data;
-
-    ad->input_msg = strdup(elm_entry_entry_get(obj));
-
-    DBG("Clicked : %s", ad->input_msg);
-
-}
-static Evas_Object *_gl_edit_content_get(void *data, Evas_Object *obj,
-        const char *part)
-{
-    oicapp_data *ad = (oicapp_data *)data;
-
-    Evas_Object *entry = ea_editfield_add(obj, EA_EDITFIELD_MULTILINE);
-    ea_editfield_clear_button_disabled_set(entry, EINA_TRUE);
-    elm_entry_entry_set(entry, ad->input_msg);
-    evas_object_smart_callback_add(entry, "unfocused", _edit_unfocused, ad);
-
-    return entry;
-}
-
-static char *_item_Text_get(void *data, Evas_Object *obj, const char *part)
-{
-    char *buf =
-        "subscribe Device.DiscomfortIndexSensor if Device.DiscomfortIndexSensor.discomfortIndex > 0";
-
-    return strdup(buf);
-}
-
-static inline void oicapp_init_itcs(oicapp_data *ad)
-{
-    ad->itc_seperator.item_style = "dialogue/separator";
-    ad->itc_seperator.func.text_get = NULL;
-    ad->itc_seperator.func.content_get = NULL;
-    ad->itc_seperator.func.state_get = NULL;
-    ad->itc_seperator.func.del = NULL;
-
-    ad->itc_edit.item_style = "dialogue/editfield";
-    ad->itc_edit.func.text_get = _item_Text_get;
-    ad->itc_edit.func.content_get = _gl_edit_content_get;
-    ad->itc_edit.func.state_get = NULL;
-    ad->itc_edit.func.del = NULL;
-
-    ad->itc_btn.item_style = "dialogue/1icon";
-    ad->itc_btn.func.text_get = NULL;
-    ad->itc_btn.func.content_get = _gl_btn_content_get;
-    ad->itc_btn.func.state_get = NULL;
-    ad->itc_btn.func.del = NULL;
-
-    ad->itc_multiline.item_style = "multiline/1text";
-    ad->itc_multiline.func.text_get = _gl_multiline_text_get;
-    ad->itc_multiline.func.content_get = NULL;
-    ad->itc_multiline.func.state_get = NULL;
-    ad->itc_multiline.func.del = NULL;
-}
-
-static int oicapp_create(void *data)
-{
-    oicapp_data *ad = (oicapp_data *)data;
-    Elm_Object_Item *it;
-
-    g_ad = (oicapp_data *)data;
-
-    oicapp_init_itcs(ad);
-
-    /* create window */
-    ad->win = oicapp_create_win(PACKAGE);
-    if (NULL == ad->win)
-        return -1;
-
-    ad->bg = oicapp_create_bg(ad->win);
-    if (NULL == ad->bg)
-        return -1;
-
-    ad->conform = oicapp_create_conform(ad->win);
-    if (NULL == ad->conform)
-        return -1;
-
-    /* create layout */
-    ad->base = oicapp_create_base_layout(ad->conform);
-    if (NULL == ad->base)
-        return -1;
-    elm_object_content_set(ad->conform, ad->base);
-
-    ad->navi = elm_naviframe_add(ad->base);
-    elm_object_part_content_set(ad->base, "elm.swallow.content", ad->navi);
-    ea_object_event_callback_add(ad->navi, EA_CALLBACK_BACK, ea_naviframe_back_cb, NULL);
-
-    ad->genlist = oicapp_create_genlist(ad->navi);
-
-    it = elm_naviframe_item_push(ad->navi, "SSM Tester", NULL, NULL, ad->genlist, NULL);
-    elm_naviframe_item_pop_cb_set(it, _back_cb, ad);
-
-    ad->ip_addr = oicapp_util_wifi();
-    if (NULL == ad->ip_addr)
-    {
-        ERR("wifi is not connected");
-        oicapp_fail_popup(ad, (char *)"Error", (char *)"No WIFI connection", 3);
-    }
-    else
-    {
-        INFO("IP Address = %s", ad->ip_addr);
-    }
-
-    oicapp_append_contents(ad);
-
-    return 0;
-}
-
-static int oicapp_terminate(void *data)
-{
-    oicapp_data *ad = (oicapp_data *)data;
-
-    if (g_CQID != 9999)
-        UnregisterQuery(g_CQID);
-
-    if (ad->win)
-        evas_object_del(ad->win);
-
-    free(ad->ip_addr);
-    free(ad->output_msg);
-    return 0;
-}
-
-static int oicapp_pause(void *data)
-{
-    return 0;
-}
-
-static int oicapp_resume(void *data)
-{
-    /*
-    static int tmpCnt = 0;
-    oicapp_data *ad = (oicapp_data *)data;
-    char buf[1024];
-
-    snprintf(buf, sizeof(buf), "Test %d", tmpCnt++);
-
-    oicapp_util_put_msg(ad, buf);
-    */
-    return 0;
-}
-
-static int oicapp_reset(bundle *b, void *data)
-{
-    oicapp_data *ad = (oicapp_data *)data;
-
-    if (ad->win)
-        elm_win_activate(ad->win);
-
-    return 0;
-}
-
-int main(int argc, char *argv[])
-{
-    oicapp_data ad;
-
-    /*
-    struct appcore_ops ops = {
-        .create = oicapp_create,
-        .terminate = oicapp_terminate,
-        .pause = oicapp_pause,
-        .resume = oicapp_resume,
-        .reset = oicapp_reset,
-    };*/
-
-    appcore_ops ops;
-
-    ops.create = oicapp_create;
-    ops.terminate = oicapp_terminate;
-    ops.pause = oicapp_pause;
-    ops.resume = oicapp_resume;
-    ops.reset = oicapp_reset;
-
-    memset(&ad, 0x0, sizeof(oicapp_data));
-    ops.data = &ad;
-
-    return appcore_efl_main(PACKAGE, &argc, &argv, &ops);
-}
-
diff --git a/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/oic-sample/src/oicapp-test.h b/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/oic-sample/src/oicapp-test.h
deleted file mode 100644 (file)
index 839d164..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * Copyright (c) 2010 Samsung Electronics, Inc.
- * All rights reserved.
- *
- * This software is a confidential and proprietary information
- * of Samsung Electronics, Inc. ("Confidential Information").  You
- * shall not disclose such Confidential Information and shall use
- * it only in accordance with the terms of the license agreement
- * you entered into with Samsung Electronics.
- */
-
-#ifndef __OICAPP_TEST_H__
-#define __OICAPP_TEST_H__
-
-#include <Elementary.h>
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-#include "oicapp-log.h"
-
-#if !defined(PACKAGE)
-#  define PACKAGE "oicapp-test"
-#endif
-
-#if !defined(LOCALEDIR)
-#  define LOCALEDIR "/usr/apps/com.samsung.oicapp-test/res/locale"
-#endif
-
-#if !defined(EDJDIR)
-#  define EDJDIR "/usr/apps/com.samsung.oicapp-test/res/edje"
-#endif
-
-#define GRP_MAIN "main"
-
-typedef enum
-{
-    OICAPP_MODE_NONE = 0,
-    OICAPP_MODE_CLIENT,
-    OICAPP_MODE_SERVER,
-    OICAPP_MODE_MAX
-} oicapp_mode;
-
-enum
-{
-    OICAPP_GENLIST_GRP_NONE = 0,
-    OICAPP_GENLIST_GRP_TOP,
-    OICAPP_GENLIST_GRP_CENTER,
-    OICAPP_GENLIST_GRP_BOTTOM
-};
-
-
-typedef struct
-{
-    Evas_Object *win;
-    Evas_Object *base;
-    Evas_Object *bg;
-    Evas_Object *navi;
-    Evas_Object *genlist;
-    Evas_Object *popup;
-    Evas_Object *conform;
-
-    Elm_Object_Item *item_multiline;
-    Elm_Object_Item *item_client_pwr;
-    Elm_Object_Item *item_client_lev;
-    Elm_Object_Item *item_server;
-    Elm_Object_Item *item_server_pwr;
-    Elm_Object_Item *item_server_lev;
-
-    Elm_Genlist_Item_Class itc_seperator;
-    Elm_Genlist_Item_Class itc_edit;
-    Elm_Genlist_Item_Class itc_btn;
-    Elm_Genlist_Item_Class itc_multiline;
-
-    char *ip_addr;
-    char *input_msg;
-    char *output_msg;
-} oicapp_data;
-#ifdef __cplusplus
-}
-#endif
-
-#endif //__OICAPP_TEST_H__
-
diff --git a/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/oic-sample/src/oicapp-utils.c b/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/oic-sample/src/oicapp-utils.c
deleted file mode 100644 (file)
index 8b0b822..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Copyright (c) 2014 Samsung Electronics, Inc.
- * All rights reserved.
- *
- * This software is a confidential and proprietary information
- * of Samsung Electronics, Inc. ("Confidential Information").  You
- * shall not disclose such Confidential Information and shall use
- * it only in accordance with the terms of the license agreement
- * you entered into with Samsung Electronics.
- */
-#include <appcore-efl.h>
-#include <wifi.h>
-
-#include "oicapp-utils.h"
-
-static void _popup_timeout_cb(void *data, Evas_Object *obj, void *event_info)
-{
-       oicapp_data *ad = data;
-
-       ret_if(data == NULL);
-
-       //evas_object_del(ad->popup);
-       ad->popup = NULL;
-}
-
-void oicapp_fail_popup(oicapp_data *ad, char *title, char *text, int timeout)
-{
-       if (ad->popup)
-       {
-               evas_object_del(ad->popup);
-               ad->popup = NULL;
-       }
-
-       Evas_Object *popup = elm_popup_add(ad->win);
-       evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
-
-       if (title)
-               elm_object_part_text_set(popup, "title,text", title);
-
-       if (text)
-               elm_object_text_set(popup, text);
-
-       if (0 < timeout)
-               elm_popup_timeout_set(popup, timeout);
-       else
-               elm_popup_timeout_set(popup, 3);
-
-       evas_object_smart_callback_add(popup, "timeout", _popup_timeout_cb, ad);
-
-       evas_object_show(popup);
-
-       ad->popup = popup;
-}
-
-void oicapp_util_put_msg(oicapp_data *ad, const char *msg)
-{
-       ret_if(NULL == msg);
-
-       if (ad->output_msg)
-               free(ad->output_msg);
-       ad->output_msg = strdup(msg);
-
-       DBG("Output msg : %s", ad->output_msg);
-
-       elm_genlist_item_update(ad->item_multiline);
-       elm_genlist_item_item_class_update(ad->item_multiline, &(ad->itc_multiline));
-}
-
-char* oicapp_util_wifi()
-{
-       int ret;
-       wifi_ap_h ap;
-       char *ip_addr = NULL;
-
-       ret = wifi_initialize();
-       if (WIFI_ERROR_NONE != ret)
-       {
-               ERR("wifi_initialize() Fail");
-               return NULL;
-       }
-
-       ret = wifi_get_connected_ap(&ap);
-       if (WIFI_ERROR_NONE != ret)
-       {
-               ERR("wifi_get_connected_ap() Fail");
-               return NULL;
-       }
-
-       ret = wifi_ap_get_ip_address(ap, WIFI_ADDRESS_FAMILY_IPV4, &ip_addr);
-       if (WIFI_ERROR_NONE != ret)
-       {
-               ERR("wifi_ap_get_ip_address() Fail");
-               return NULL;
-       }
-
-       return ip_addr;
-}
-
diff --git a/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/oic-sample/src/oicapp-utils.h b/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/oic-sample/src/oicapp-utils.h
deleted file mode 100644 (file)
index c92f77f..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2010 Samsung Electronics, Inc.
- * All rights reserved.
- *
- * This software is a confidential and proprietary information
- * of Samsung Electronics, Inc. ("Confidential Information").  You
- * shall not disclose such Confidential Information and shall use
- * it only in accordance with the terms of the license agreement
- * you entered into with Samsung Electronics.
- */
-#ifndef __OICAPP_UTILS_H__
-#define __OICAPP_UTILS_H__
-
-#include "oicapp-test.h"
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-void oicapp_fail_popup(oicapp_data *ad, char *title, char *text, int timeout);
-void oicapp_util_put_msg(oicapp_data *ad, const char *msg);
-char *oicapp_util_wifi();
-
-/*
-int oicapp_client_start(oicapp_data *ad);
-void oicapp_client_stop();
-int oicapp_client_put(int power, int level);
-
-int oicapp_server_start(oicapp_data *ad);
-void oicapp_server_stop();
-void oicapp_server_put(int power, int level);
-*/
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif //__OICAPP_UTILS_H__
-
diff --git a/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/packaging/ssm.manifest b/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/packaging/ssm.manifest
deleted file mode 100644 (file)
index 017d22d..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<manifest>
- <request>
-    <domain name="_"/>
- </request>
-</manifest>
diff --git a/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/packaging/ssm.spec b/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/packaging/ssm.spec
deleted file mode 100644 (file)
index 827571d..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-Name:       ssm
-Summary:    Open Interconnect Consortium
-Version:       0.0.1
-Release:    0
-Group:      Network & Connectivity/Service
-License:    Apache-2.0
-Source0:    %{name}-%{version}.tar.gz
-Source1:    libDiscomfortIndexSensor.so
-Source2:    SoftSensorDescription.xml
-Source1001:    %{name}.manifest
-BuildRequires: cmake
-#BuildRequires: boost-devel
-#BuildRequires: pkgconfig(glib-2.0)
-#Buildrequires: gettext-tools
-BuildRequires: pkgconfig(appcore-efl)
-BuildRequires: pkgconfig(ecore-x)
-BuildRequires: pkgconfig(elementary)
-BuildRequires: pkgconfig(efl-assist)
-BuildRequires: pkgconfig(dlog)
-BuildRequires: pkgconfig(capi-network-wifi)
-
-%description
-Tizen Open Interconnect Consortium Service.
-
-
-%prep
-%setup -q
-cp %{SOURCE1001} .
-
-
-%build
-%cmake . -DBIN_INSTALL_DIR:PATH=%{_bindir}
-
-
-%install
-rm -rf %{buildroot}/BUILD/ssm*
-#%make_install
-cp -af %{SOURCE1} %{buildroot}/usr/apps/com.samsung.ssmtester/bin/
-cp -af %{SOURCE2} %{buildroot}/usr/apps/com.samsung.ssmtester/bin/
-
-%post
-
-
-%postun
-
-
-%files
-%manifest %{name}.manifest
-%defattr(-,root,root,-)
-/usr/apps/com.samsung.ssmtester/*
-/usr/share/*
-/etc/smack/accesses2.d/com.samsung.ssmtester.rule
-#%%license LICENSE.APLv2
diff --git a/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/res/ui_controls.edc b/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/res/ui_controls.edc
new file mode 100644 (file)
index 0000000..cd6c582
--- /dev/null
@@ -0,0 +1,251 @@
+/*
+ * Copyright (c) 2014 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.
+ *
+ */
+
+collections {
+   base_scale: 1.8;
+   group { name: "mainpage_layout";
+   parts{
+          part { name: "query_text_bg";
+                type: RECT;
+                scale: 1;
+                description { state: "default" 0.0;
+                   color: 220 220 220 255;
+                                   
+                     align: 0.0 0.02;
+                     // set the size to 200x200
+                     min: 200 200;
+                     max: 350 250;     
+                }
+             }
+          
+        part { name: "query_text";
+                  type: SWALLOW;
+                  description 
+                  { 
+                     state: "default" 0.0;                   
+                     rel1.to: "query_text_bg";
+              rel2.to: "query_text_bg";             
+                       }
+       }
+       part { name: "register";
+                  type: SWALLOW;
+                  description 
+                  { 
+                     state: "default" 0.0;
+                     align: 0.2 0.01;
+
+                     min: 100 100;
+                     max: 275 100;               
+
+                     rel1.relative: 1.0 0.1;
+                     rel1.to: "query_text";
+                     //rel2.relative: 1.0 1.0;                                  
+                       }
+       }
+       part { name: "clear";
+                  type: SWALLOW;
+                  description 
+                  { 
+                     state: "default" 0.0;
+                     align: 0.0 0.02;
+                     // set the size to 200x200
+                     min: 100 100;
+                     max: 275 100;                                  
+                     rel1.relative: 0.0 1.0;
+                     rel1.to: "register";
+                    // rel2.relative: 1.0 1.0;   
+                       }
+       }
+       
+       part { name: "example_queries";
+                  type: SWALLOW;
+                  description 
+                  { 
+                     state: "default" 0.0;
+                     align: 0.0 0.02;
+                     // set the size to 200x200
+                     min: 100 100;
+                     max: 500 100;                                  
+                     rel1.relative: 0.0 1.0;
+                     rel1.to: "query_text";
+                     rel2.relative: 1.0 1.0;   
+                       }
+       }
+       
+       part { name: "search_devices";
+                  type: SWALLOW;
+                  description 
+                  { 
+                     state: "default" 0.0;
+                     align: 0.0 0.0;
+                     // set the size to 200x200
+                     min: 100 100;
+                     max: 360 100;                                  
+                     rel1.relative: 0.0 0.7;
+                     rel1.to: "example_queries";
+                     rel2.relative: 1.0 1.0;   
+                       }
+       }
+       
+       part { name: "discomfort_index";
+                  type: SWALLOW;
+                  description 
+                  { 
+                     state: "default" 0.0;
+                     align: 0.1 0.0;
+                     // set the size to 200x200
+                     min: 100 100;
+                     max: 360 100;                                  
+                     rel1.relative: 1.0 0.0;
+                     rel1.to: "search_devices";
+                     rel2.relative: 1.0 1.0;   
+                       }
+       }
+       
+       part { name: "unregister_query_label";
+                  type: SWALLOW;
+                  description 
+                  { 
+                     state: "default" 0.0;
+                     align: 0.0 0.02;
+                     // set the size to 200x200
+                     min: 100 100;
+                     max: 500 100;                                  
+                     rel1.relative: 0.0 1.0;
+                     rel1.to: "search_devices";
+                     rel2.relative: 1.0 1.0;   
+                       }
+       }
+       
+       part { name: "minus";
+                  type: SWALLOW;
+                  description 
+                  { 
+                     state: "default" 0.0;
+                     align: 0.0 0.02;
+                     // set the size to 200x200
+                     min: 100 100;
+                     max: 100 100;                                  
+                     rel1.relative: 0.0 0.7;
+                     rel1.to: "unregister_query_label";
+                     rel2.relative: 1.0 1.0;   
+                       }
+       }
+       
+       part { name: "unregister_query_id_bg";
+                type: RECT;
+                scale: 1;
+                description { state: "default" 0.0;
+                   color: 220 220 220 255;
+                                   
+                     align: 0.02 0.0;
+                     // set the size to 200x200
+                     min: 100 75;
+                     max: 175 75;      
+                     
+                     rel1.relative: 1.0 0.0;
+                     rel1.to: "minus";
+                     rel2.relative: 1.0 1.0;  
+                }
+             }
+       
+       
+       part { name: "unregister_query_id";
+                  type: SWALLOW;
+                  description 
+                  { 
+                     state: "default" 0.0;
+                         rel1.to: "unregister_query_id_bg";
+              rel2.to: "unregister_query_id_bg";                                                                             
+                       }
+       }
+       
+       part { name: "plus";
+                  type: SWALLOW;
+                  description 
+                  { 
+                     state: "default" 0.0;
+                     align: 0.02 0.0;
+                     // set the size to 200x200
+                     min: 100 100;
+                     max: 100 100;                                  
+                     rel1.relative: 1.0 0.0;
+                     rel1.to: "unregister_query_id";
+                     rel2.relative: 1.0 1.0;   
+                       }
+       }
+       
+       part { name: "unregister_button";
+                  type: SWALLOW;
+                  description 
+                  { 
+                     state: "default" 0.0;
+                     align: 0.2 0.0;
+                     // set the size to 200x200
+                     min: 100 100;
+                     max: 250 100;                                  
+                     rel1.relative: 1.0 0.0;
+                     rel1.to: "plus";
+                     rel2.relative: 1.0 1.0;   
+                       }
+       }
+       
+       part { name: "log_button";
+                  type: SWALLOW;
+                  description 
+                  { 
+                     state: "default" 0.0;
+                     align: 0.0 0.05;
+                     // set the size to 200x200
+                     min: 100 100;
+                     max: 720 100;                                  
+                     rel1.relative: 0.0 1.0;
+                     rel1.to: "minus";
+                     rel2.relative: 1.0 1.0;   
+                       }
+       }
+       
+       part { name: "log_text_bg";
+                  type: RECT;
+                  scale: 1;
+                  description 
+                  { 
+                     state: "default" 0.0;
+                     align: 0.02 0.02;
+                      color: 220 220 220 255;
+                     // set the size to 200x200
+                     min: 100 400;
+                     max: 720 200;                                  
+                     rel1.relative: 0.0 1.0;
+                     rel1.to: "log_button";
+                     rel2.relative: 1.0 1.0;   
+                       }
+       }
+               
+       part { name: "log_text";
+                  type: SWALLOW;
+                  description 
+                  { 
+                     state: "default" 0.0;
+                       rel1.to: "log_text_bg";
+              rel2.to: "log_text_bg";
+                       }
+       }
+   }
+}
+}
+
diff --git a/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/shared/res/ssmtesterapp.png b/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/shared/res/ssmtesterapp.png
new file mode 100644 (file)
index 0000000..9765b1b
Binary files /dev/null and b/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/shared/res/ssmtesterapp.png differ
diff --git a/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/src/ssmtesterapp.cpp b/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/src/ssmtesterapp.cpp
new file mode 100644 (file)
index 0000000..caa3abe
--- /dev/null
@@ -0,0 +1,557 @@
+#include <tizen.h>
+#include <wifi.h>
+#include <algorithm>
+#include "string.h"
+#include "ssmtesterapp.h"
+#include "SSMInterface.h"
+
+typedef struct appdata {
+       Evas_Object *win;
+       Evas_Object *conform;
+       Evas_Object *naviframe;
+       Evas_Object *layout;
+       Evas_Object *scroller;
+       Evas_Object *box;
+
+       Evas_Object *query_text;
+       Evas_Object *log;
+       Evas_Object *unregister_query_id;
+
+       Evas_Object *register_button;
+       Evas_Object *clear_button;
+       Evas_Object *unregister_button;
+       Evas_Object *search_devices_button;
+       Evas_Object *discomfort_index_button;
+       Evas_Object *plus_button;
+       Evas_Object *minus_button;
+       Evas_Object *clear_log_button;
+
+       Evas_Object *example_queries_label;
+       Evas_Object *unregister_query_label;
+} appdata_s;
+
+#define ELM_DEMO_EDJ "opt/usr/apps/org.iotivity.service.ssm.ssmtesterapp/res/ui_controls.edj"
+
+char log_buffer[10000];
+void updateLog(appdata_s *ad , char *newlog)
+{
+       const char *log_text = NULL;
+
+       log_text = elm_entry_entry_get(ad->log);
+       strcpy(log_buffer,log_text);
+       strcat(log_buffer,newlog);
+       elm_entry_entry_set(ad->log,log_buffer);
+}
+
+class CQueryEngineEvent : public OIC::IQueryEngineEvent
+{
+private:
+       appdata_s *m_pAppData;
+
+public:
+       CQueryEngineEvent(appdata_s *pAppData)
+       {
+               m_pAppData = pAppData;
+       }
+
+       OIC::SSMRESULT onQueryEngineEvent(int cqid, OIC::IDataReader *pResult)
+       {
+               int     dataCount = 0;
+               char log[2000],buf[100];
+               OIC::IModelData      *pModelData = NULL;
+               std::vector<std::string>        affectedModels;
+
+               dlog_print(DLOG_ERROR,LOG_TAG,"Event received!");
+
+               sprintf(buf,"Event received! cqid = %d<br>", cqid);
+               strcpy(log,buf);
+
+               pResult->getAffectedModels(&affectedModels);
+
+               for (std::vector<std::string>::iterator itor = affectedModels.begin();
+                               itor != affectedModels.end(); ++itor)
+               {
+                       sprintf(buf,"Printing = %s model<br>", (*itor).c_str());
+                       strcat(log,buf);
+
+                       pResult->getModelDataCount(*itor, &dataCount);
+                       for (int i = 0; i < dataCount; i++)
+                       {
+                               pResult->getModelData(*itor, i, &pModelData);
+                               sprintf(buf,"dataId: %d<br>", pModelData->getDataId());
+                               strcat(log,buf);
+                               for (int j = 0; j < pModelData->getPropertyCount(); j++)
+                               {
+                                       sprintf(buf,"Type: %s Value: %s<br>", (pModelData->getPropertyName(j)).c_str(), (pModelData->getPropertyValue(j)).c_str());
+                                       strcat(log,buf);
+                               }
+                               updateLog(m_pAppData, log);
+                       }
+               }
+
+               return OIC::SSM_S_OK;
+       }
+};
+
+CQueryEngineEvent              *g_pQueryEngineEvent = NULL;
+
+
+static void
+win_delete_request_cb(void *data , Evas_Object *obj , void *event_info)
+{
+       ui_app_exit();
+}
+
+static void
+win_back_cb(void *data, Evas_Object *obj, void *event_info)
+{
+       //appdata_s *ad = (appdata_s *)data;
+       /* Let window go to hide state. */
+       //elm_win_lower(ad->win);
+       ui_app_exit();
+}
+
+
+static void
+register_cb(void *data , Evas_Object *obj , void *event_info)
+{
+       appdata_s *ad = (appdata_s *)data;
+       const char *main_text = NULL;
+       if (!ad->query_text)
+               return;
+       main_text = elm_entry_entry_get(ad->query_text);
+       if (!main_text || (strlen(main_text) == 0))
+               return;
+
+       //invoke registerQuery
+       int qid = 0;
+       char log[50];
+
+       dlog_print(DLOG_ERROR,LOG_TAG,"registering query");
+
+       OIC::SSMRESULT res = OIC::RegisterQuery(main_text, g_pQueryEngineEvent, qid);
+       if(res == OIC::SSM_S_OK)
+       {
+               updateLog(ad, "The query has been registered!<br>");
+               sprintf(log, "QID : %d<br>", qid);
+               updateLog(ad, log);
+       }
+       else
+       {
+               sprintf(log,"Error occured(%d)<br>", res);
+               updateLog(ad, log);
+       }
+
+       dlog_print(DLOG_ERROR,LOG_TAG,"registering query done");
+}
+
+static void
+search_devices_cb(void *data , Evas_Object *obj , void *event_info)
+{
+       appdata_s *ad = (appdata_s *)data;
+       elm_entry_entry_set(ad->query_text, "subscribe Device if Device.dataId != 0");
+}
+
+static void
+discomfort_index_cb(void *data , Evas_Object *obj , void *event_info)
+{
+       appdata_s *ad = (appdata_s *)data;
+       elm_entry_entry_set(ad->query_text, "subscribe Device.DiscomfortIndexSensor "\
+                       "if Device.DiscomfortIndexSensor.discomfortIndex > 0");
+}
+
+static void
+minus_cb(void *data , Evas_Object *obj , void *event_info)
+{
+       appdata_s *ad = (appdata_s *)data;
+       char output[10];
+       const char *query_id_str = elm_entry_entry_get(ad->unregister_query_id);
+       if (!query_id_str || (strlen(query_id_str) == 0))
+               return;
+       try{
+               int val = atoi(query_id_str);
+               sprintf(output,"%d",val-1);
+               elm_entry_entry_set(ad->unregister_query_id,output);
+       }
+       catch(...){
+               dlog_print(DLOG_ERROR,LOG_TAG,"#### atoi() conversion error");
+       }
+}
+
+static void
+plus_cb(void *data , Evas_Object *obj , void *event_info)
+{
+       appdata_s *ad = (appdata_s *)data;
+       char output[10];
+       const char *query_id_str = elm_entry_entry_get(ad->unregister_query_id);
+       if (!query_id_str || (strlen(query_id_str) == 0))
+               return;
+       try{
+               int val = atoi(query_id_str);
+               sprintf(output,"%d",val+1);
+               elm_entry_entry_set(ad->unregister_query_id,output);
+       }
+       catch(...){
+               dlog_print(DLOG_ERROR,LOG_TAG,"#### atoi() conversion error");
+       }
+}
+
+static void
+unregister_cb(void *data , Evas_Object *obj , void *event_info)
+{
+       appdata_s *ad = (appdata_s *)data;
+       const char *qidstr = NULL;
+       if (!ad->unregister_query_id)
+               return;
+       qidstr = elm_entry_entry_get(ad->unregister_query_id);
+       if (!qidstr || (strlen(qidstr) == 0))
+               return;
+       char log[50];
+       int qid;
+       try{
+               qid = atoi(qidstr);
+               //invoke unregisterQuery
+               OIC::SSMRESULT res = OIC::UnregisterQuery(qid);
+               if(res == OIC::SSM_S_OK)
+               {
+                       updateLog(ad, "The query has been unregistered!<br>");
+                       sprintf(log, "QID : %d<br>", qid);
+                       updateLog(ad, log);
+               }
+               else
+               {
+                       sprintf(log,"Error occured(%d)<br>", res);
+                       updateLog(ad, log);
+               }
+       }
+       catch(...){
+               dlog_print(DLOG_ERROR,LOG_TAG,"#### atoi() conversion error");
+       }
+}
+
+static void
+clear_log_cb(void *data , Evas_Object *obj , void *event_info)
+{
+       appdata_s *ad = (appdata_s *)data;
+       elm_entry_entry_set(ad->log,"");
+}
+
+static void
+clear_cb(void *data , Evas_Object *obj , void *event_info)
+{
+       appdata_s *ad = (appdata_s *)data;
+       elm_entry_entry_set(ad->query_text,"");
+}
+
+char* oicapp_util_wifi()
+{
+       int ret;
+       wifi_ap_h ap;
+       char *ip_addr = NULL;
+
+       ret = wifi_initialize();
+       if (WIFI_ERROR_NONE != ret)
+       {
+               dlog_print(DLOG_ERROR,LOG_TAG,"#### wifi_initialize() Fail");
+               return NULL;
+       }
+
+       ret = wifi_get_connected_ap(&ap);
+       if (WIFI_ERROR_NONE != ret)
+       {
+               dlog_print(DLOG_ERROR,LOG_TAG,"#### wifi_get_connected_ap() Fail");
+               return NULL;
+       }
+
+       ret = wifi_ap_get_ip_address(ap, WIFI_ADDRESS_FAMILY_IPV4, &ip_addr);
+       if (WIFI_ERROR_NONE != ret)
+       {
+               dlog_print(DLOG_ERROR,LOG_TAG,"#### wifi_ap_get_ip_address() Fail");
+               return NULL;
+       }
+
+       return ip_addr;
+}
+
+static void
+create_base_gui(appdata_s *ad)
+{
+       /* Window */
+       ad->win = elm_win_util_standard_add(PACKAGE, PACKAGE);
+       elm_win_conformant_set(ad->win, EINA_TRUE);
+       elm_win_autodel_set(ad->win, EINA_TRUE);
+
+       if (elm_win_wm_rotation_supported_get(ad->win)) {
+               int rots[4] = { 0, 90, 180, 270 };
+               elm_win_wm_rotation_available_rotations_set(ad->win, (const int *)(&rots), 4);
+       }
+
+       evas_object_smart_callback_add(ad->win, "delete,request", win_delete_request_cb, NULL);
+       eext_object_event_callback_add(ad->win, EEXT_CALLBACK_BACK, win_back_cb, ad);
+
+       /* Conformant */
+       ad->conform = elm_conformant_add(ad->win);
+       evas_object_size_hint_weight_set(ad->conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       elm_win_resize_object_add(ad->win, ad->conform);
+       evas_object_show(ad->conform);
+
+       /* naviframe */
+       ad->naviframe = elm_naviframe_add(ad->conform);
+       elm_object_content_set(ad->conform,ad->naviframe);
+       evas_object_show(ad->naviframe);
+
+       /* scroller */
+       ad->scroller = elm_scroller_add(ad->naviframe);
+
+       /* Box container */
+       ad->box = elm_box_add(ad->scroller);
+       evas_object_size_hint_align_set(ad->box, EVAS_HINT_FILL, 0.0);
+       evas_object_size_hint_weight_set(ad->box, EVAS_HINT_EXPAND, 0.0);
+       elm_object_content_set(ad->scroller, ad->box);
+
+       ad->layout = elm_layout_add(ad->box);
+       evas_object_size_hint_weight_set(ad->layout, EVAS_HINT_EXPAND, 0.0);
+       //elm_layout_theme_set(ad->layout, "layout", "application", "default");
+       evas_object_size_hint_align_set(ad->layout, EVAS_HINT_FILL, 0.0);
+       elm_layout_file_set(ad->layout,ELM_DEMO_EDJ,"mainpage_layout");
+
+       ad->query_text = elm_entry_add(ad->layout);
+       elm_object_part_text_set(ad->query_text, "elm.guide", "Enter the query here!!!");
+       evas_object_size_hint_align_set(ad->query_text, EVAS_HINT_FILL, EVAS_HINT_FILL);
+       evas_object_size_hint_weight_set(ad->query_text, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       elm_object_part_content_set(ad->layout,"query_text",ad->query_text);
+       elm_entry_scrollable_set(ad->query_text,EINA_TRUE);
+       //evas_object_show(ad->query_text);
+       elm_entry_input_panel_show_on_demand_set(ad->query_text,EINA_TRUE);
+
+       ad->register_button = elm_button_add(ad->layout);
+       elm_object_text_set(ad->register_button, "Register");
+       evas_object_size_hint_weight_set(ad->register_button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       evas_object_size_hint_align_set(ad->register_button, EVAS_HINT_FILL, EVAS_HINT_FILL);
+       evas_object_smart_callback_add(ad->register_button, "clicked", register_cb, ad);
+       elm_object_part_content_set(ad->layout,"register",ad->register_button);
+       //evas_object_show(ad->register_button);
+
+       ad->clear_button = elm_button_add(ad->layout);
+       elm_object_text_set(ad->clear_button, "Clear");
+       evas_object_size_hint_weight_set(ad->search_devices_button, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       evas_object_size_hint_align_set(ad->search_devices_button, EVAS_HINT_FILL, EVAS_HINT_FILL);
+       evas_object_smart_callback_add(ad->clear_button, "clicked", clear_cb, ad);
+       elm_object_part_content_set(ad->layout,"clear",ad->clear_button);
+       //evas_object_show(ad->clear_button);
+
+       ad->example_queries_label = elm_label_add(ad->layout);
+       elm_object_text_set(ad->example_queries_label, _("<color=#00008BFF><b><align=left>Example Queries</align></b></color>"));
+       elm_object_part_content_set(ad->layout,"example_queries",ad->example_queries_label);
+       //evas_object_show(ad->example_queries_label);
+
+       ad->search_devices_button = elm_button_add(ad->layout);
+       //evas_object_size_hint_align_set(ad->search_devices_button, EVAS_HINT_FILL, 0.0);
+       elm_object_text_set(ad->search_devices_button, "Search Devices");
+       evas_object_smart_callback_add(ad->search_devices_button, "clicked", search_devices_cb, ad);
+       elm_object_part_content_set(ad->layout,"search_devices",ad->search_devices_button);
+       //evas_object_show(ad->search_devices_button);
+
+       ad->discomfort_index_button = elm_button_add(ad->layout);
+       //evas_object_size_hint_align_set(ad->discomfort_index_button, EVAS_HINT_FILL, 0.0);
+       elm_object_part_content_set(ad->layout,"discomfort_index",ad->discomfort_index_button);
+       elm_object_text_set(ad->discomfort_index_button, "Discomfort Index");
+       evas_object_smart_callback_add(ad->discomfort_index_button, "clicked", discomfort_index_cb, ad);
+       //evas_object_show(ad->discomfort_index_button);
+
+       ad->unregister_query_label = elm_label_add(ad->layout);
+       elm_object_text_set(ad->unregister_query_label,_("<color=#00008BFF><b><align=left>Unregister Query</align></b></color>"));
+       //evas_object_size_hint_weight_set(ad->unregister_query_label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+       elm_object_part_content_set(ad->layout,"unregister_query_label",ad->unregister_query_label);
+       //evas_object_show(ad->unregister_query_label);
+
+
+       ad->minus_button = elm_button_add(ad->layout);
+       //evas_object_size_hint_align_set(ad->discomfort_index_button, EVAS_HINT_FILL, 0.0);
+       elm_object_part_content_set(ad->layout,"minus",ad->minus_button);
+       elm_object_text_set(ad->minus_button, "-");
+       evas_object_smart_callback_add(ad->minus_button, "clicked", minus_cb, ad);
+       //evas_object_show(ad->minus_button);
+
+       ad->unregister_query_id = elm_entry_add(ad->layout);
+       elm_object_part_text_set(ad->unregister_query_id, "elm.guide", "Query id!!!");
+       //evas_object_size_hint_align_set(ad->unregister_query_id, EVAS_HINT_FILL, EVAS_HINT_FILL);
+       elm_object_part_content_set(ad->layout,"unregister_query_id",ad->unregister_query_id);
+       elm_entry_input_panel_show_on_demand_set(ad->unregister_query_id,EINA_TRUE);
+       elm_entry_input_panel_layout_set(ad->unregister_query_id,ELM_INPUT_PANEL_LAYOUT_NUMBER);
+       evas_object_show(ad->unregister_query_id);
+
+       ad->plus_button = elm_button_add(ad->layout);
+       //evas_object_size_hint_align_set(ad->discomfort_index_button, EVAS_HINT_FILL, 0.0);
+       elm_object_part_content_set(ad->layout,"plus",ad->plus_button);
+       elm_object_text_set(ad->plus_button, "+");
+       evas_object_smart_callback_add(ad->plus_button, "clicked", plus_cb, ad);
+       //evas_object_show(ad->plus_button);
+
+       ad->unregister_button = elm_button_add(ad->layout);
+       //evas_object_size_hint_align_set(ad->unregister_button, EVAS_HINT_FILL, 0.0);
+       elm_object_part_content_set(ad->layout,"unregister_button",ad->unregister_button);
+       elm_object_text_set(ad->unregister_button, "Unregister");
+       evas_object_smart_callback_add(ad->unregister_button, "clicked", unregister_cb, ad);
+       //evas_object_show(ad->unregister_button);
+
+       ad->clear_log_button = elm_button_add(ad->layout);
+       //evas_object_size_hint_align_set(ad->clear_log_button, EVAS_HINT_FILL, 0.0);
+       elm_object_part_content_set(ad->layout,"log_button",ad->clear_log_button);
+       elm_object_text_set(ad->clear_log_button, "Clear Log");
+       evas_object_smart_callback_add(ad->clear_log_button, "clicked", clear_log_cb, ad);
+       //evas_object_show(ad->clear_log_button);
+
+       ad->log = elm_entry_add(ad->layout);
+       elm_object_part_content_set(ad->layout,"log_text",ad->log);
+       elm_object_part_text_set(ad->log, "elm.guide", "Log messages will be update here!!!");
+       elm_entry_scrollable_set(ad->log,EINA_TRUE);
+       elm_entry_editable_set(ad->log,EINA_FALSE);
+       //evas_object_size_hint_align_set(ad->log, EVAS_HINT_FILL, EVAS_HINT_FILL);
+       //evas_object_show(ad->log);
+
+       elm_box_pack_end(ad->box, ad->layout);
+       evas_object_show(ad->layout);
+       elm_naviframe_item_push(ad->naviframe, "Soft Sensor Manager App", NULL, NULL, ad->scroller, NULL);
+
+       //Show window after base gui is set up
+       evas_object_show(ad->win);
+
+       dlog_print(DLOG_ERROR, LOG_TAG, oicapp_util_wifi());
+}
+
+static bool
+app_create(void *data)
+{
+       /* Hook to take necessary actions before main event loop starts
+               Initialize UI resources and application's data
+               If this function returns true, the main loop of application starts
+               If this function returns false, the application is terminated */
+       appdata_s *ad = (appdata_s *)data;
+
+       std::string xmlDescription = "<SSMCore>"
+                               "<Device>"
+                               "<UDN>abcde123-31f8-11b4-a222-08002b34c050</UDN>"
+                               "<Name>MyPC</Name>"
+                               "<Type>PC</Type>"
+                               "</Device>"
+                               "</SSMCore>";
+
+       g_pQueryEngineEvent = new CQueryEngineEvent(ad);
+
+       if (OIC::InitializeSSM(xmlDescription) == OIC::SSM_S_OK){
+               dlog_print(DLOG_DEBUG, LOG_TAG, "#### InitializeSSM() returned SSM_S_OK");
+       }
+       else{
+               dlog_print(DLOG_DEBUG, LOG_TAG, "#### InitializeSSM() failed");
+       }
+
+       create_base_gui(ad);
+
+       return true;
+}
+
+static void
+app_control(app_control_h app_control, void *data)
+{
+       /* Handle the launch request. */
+       dlog_print(DLOG_INFO,LOG_TAG,"#### in app_control");
+}
+
+static void
+app_pause(void *data)
+{
+       /* Take necessary actions when application becomes invisible. */
+       dlog_print(DLOG_INFO,LOG_TAG,"#### in app_pause");
+}
+
+static void
+app_resume(void *data)
+{
+       /* Take necessary actions when application becomes visible. */
+       dlog_print(DLOG_INFO,LOG_TAG,"#### in app_resume");
+}
+
+static void
+app_terminate(void *data)
+{
+       /* Release all resources. */
+       dlog_print(DLOG_INFO,LOG_TAG,"#### in app_terminate");
+
+       if (OIC::TerminateSSM() == OIC::SSM_S_OK){
+               dlog_print(DLOG_DEBUG, LOG_TAG, "#### TerminateSSM() returned SSM_S_OK");
+       }
+       else{
+               dlog_print(DLOG_DEBUG, LOG_TAG, "#### TerminateSSM() failed");
+       }
+
+       delete g_pQueryEngineEvent;
+}
+
+static void
+ui_app_lang_changed(app_event_info_h event_info, void *user_data)
+{
+       /*APP_EVENT_LANGUAGE_CHANGED*/
+       char *locale = NULL;
+       system_settings_get_value_string(SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &locale);
+       elm_language_set(locale);
+       free(locale);
+       return;
+}
+
+static void
+ui_app_orient_changed(app_event_info_h event_info, void *user_data)
+{
+       /*APP_EVENT_DEVICE_ORIENTATION_CHANGED*/
+       dlog_print(DLOG_INFO,LOG_TAG,"#### app orient changed");
+       return;
+}
+
+static void
+ui_app_region_changed(app_event_info_h event_info, void *user_data)
+{
+       /*APP_EVENT_REGION_FORMAT_CHANGED*/
+}
+
+static void
+ui_app_low_battery(app_event_info_h event_info, void *user_data)
+{
+       /*APP_EVENT_LOW_BATTERY*/
+}
+
+static void
+ui_app_low_memory(app_event_info_h event_info, void *user_data)
+{
+       /*APP_EVENT_LOW_MEMORY*/
+}
+
+int
+main(int argc, char *argv[])
+{
+       appdata_s ad = {0,};
+       int ret = 0;
+
+       ui_app_lifecycle_callback_s event_callback = {0,};
+       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, &ad);
+       ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, ui_app_low_memory, &ad);
+       ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, ui_app_orient_changed, &ad);
+       ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, ui_app_lang_changed, &ad);
+       ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, ui_app_region_changed, &ad);
+       ui_app_remove_event_handler(handlers[APP_EVENT_LOW_MEMORY]);
+
+       ret = ui_app_main(argc, argv, &event_callback, &ad);
+
+       if (ret != APP_ERROR_NONE) {
+               dlog_print(DLOG_ERROR, LOG_TAG, "app_main() is failed. err = %d", ret);
+       }
+
+       return ret;
+}
diff --git a/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/tizen-manifest.xml b/service/soft-sensor-manager/SampleApp/tizen/SSMTesterApp/tizen-manifest.xml
new file mode 100644 (file)
index 0000000..837f70e
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns="http://tizen.org/ns/packages" api-version="2.3" package="org.iotivity.service.ssm.ssmtesterapp" version="1.0.0">
+    <profile name="mobile" />
+    <ui-application appid="org.iotivity.service.ssm.ssmtesterapp" exec="ssmtesterapp" type="capp" multiple="false" taskmanage="true" nodisplay="false">
+        <icon>ssmtesterapp.png</icon>
+        <label>ssmtesterapp</label>
+       </ui-application>
+       <privileges>
+        <privilege>http://tizen.org/privilege/internet</privilege>
+    </privileges>
+    <feature name="http://tizen.org/feature/network.wifi">true</feature>
+</manifest>