summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt5
-rw-r--r--packaging/org.tizen.position-finder-server.spec11
-rw-r--r--src/connectivity.c6
-rw-r--r--src/controller.c1
4 files changed, 12 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b70de1b..6862abd 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,7 +3,8 @@ PROJECT(position-finder-server C)
SET(INSTALL_EXEC_PREFIX "${INSTALL_PREFIX}/bin")
SET(INSTALL_RESDIR "${INSTALL_PREFIX}/res")
-SET(INSTALL_RESDIR "/home/owner/apps_rw/org.tizen.position-finder-server/res")
+SET(INSTALL_OWNER_RESDIR "/home/owner/apps_rw/org.tizen.position-finder-server/res")
+SET(INSTALL_OWNER_DATADIR "/home/owner/apps_rw/org.tizen.position-finder-server/data")
SET(CMAKE_VERBOSE_MAKEFILE 0)
SET(PROJECT_ROOT_DIR "${CMAKE_SOURCE_DIR}")
@@ -53,6 +54,6 @@ INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${INSTALL_EXEC_PREFIX})
INSTALL(FILES ${PROJECT_ROOT_DIR}/tizen-manifest.xml DESTINATION ${SYS_PACKAGES_DIR} RENAME org.tizen.position-finder-server.xml)
INSTALL(DIRECTORY DESTINATION ${PREFIX}/data)
INSTALL(FILES ${PROJECT_ROOT_DIR}/shared/res/position_finder_server.png DESTINATION ${SYS_ICONS_DIR})
-INSTALL(FILES ${PROJECT_ROOT_DIR}/res/iotcon-test-svr-db-server.dat DESTINATION ${INSTALL_RESDIR})
+INSTALL(FILES ${PROJECT_ROOT_DIR}/res/iotcon-test-svr-db-server.dat DESTINATION ${INSTALL_OWNER_RESDIR})
# End of a file
diff --git a/packaging/org.tizen.position-finder-server.spec b/packaging/org.tizen.position-finder-server.spec
index 1bb7a67..76835bb 100644
--- a/packaging/org.tizen.position-finder-server.spec
+++ b/packaging/org.tizen.position-finder-server.spec
@@ -31,8 +31,8 @@ Server for Position Finder
%define _pkg_dir %{TZ_SYS_RO_APP}/%{alias}
%define _pkg_shared_dir %{_pkg_dir}/shared
%define _pkg_data_dir %{_pkg_dir}/data
-%define _pkg_rw_res_dir /home/owner/apps_rw/org.tizen.position-finder-server/res
%define _pkg_rw_data_dir /home/owner/apps_rw/org.tizen.position-finder-server/data
+%define _pkg_res_dir /home/owner/apps_rw/org.tizen.position-finder-server/res
%define _sys_icons_dir %{_pkg_shared_dir}/res
%define _sys_packages_dir %{TZ_SYS_RO_PACKAGES}
%define _sys_license_dir %{TZ_SYS_SHARE}/license
@@ -64,10 +64,11 @@ make %{?jobs:-j%jobs}
%post
/sbin/ldconfig
-chsmack -a "User::Pkg::org.tizen.position-finder-server" %{_pkg_rw_res_dir}/*.dat
-chmod 666 %{_pkg_rw_res_dir}/*.dat
+chsmack -a "User::Pkg::org.tizen.position-finder-server" %{_pkg_res_dir}/*.dat
+chmod 666 %{_pkg_res_dir}/*.dat
-touch %{_pkg_rw_data_dir}/*.dat
+mkdir -p %{_pkg_rw_data_dir}
+touch %{_pkg_rw_data_dir}/iotcon-test-svr-db-server.dat
chsmack -a "User::Pkg::org.tizen.position-finder-server" %{_pkg_rw_data_dir}/*.dat
chmod 666 %{_pkg_rw_data_dir}/*.dat
@@ -75,7 +76,7 @@ chmod 666 %{_pkg_rw_data_dir}/*.dat
%files
%manifest org.tizen.position-finder-server.manifest
-%{_pkg_rw_res_dir}/*.dat
+%{_pkg_res_dir}/*.dat
%defattr(-,root,root,-)
%{_pkg_dir}/bin/position-finder-server
%{_sys_packages_dir}/org.tizen.position-finder-server.xml
diff --git a/src/connectivity.c b/src/connectivity.c
index 9165cb9..b0c6d10 100644
--- a/src/connectivity.c
+++ b/src/connectivity.c
@@ -30,12 +30,10 @@
#include "log.h"
#include "connectivity.h"
-#define ULTRASONIC_RESOURCE_1_URI "/door/1"
-#define ULTRASONIC_RESOURCE_2_URI "/door/2"
#define ULTRASONIC_RESOURCE_TYPE "org.tizen.door"
+#define CBOR_FILE_IN_RES "/home/owner/apps_rw/org.tizen.position-finder-server/res/iotcon-test-svr-db-server.dat"
+#define CBOR_FILE_IN_DATA "/home/owner/apps_rw/org.tizen.position-finder-server/data/iotcon-test-svr-db-server.dat"
#define BUFSIZE 1024
-#define CBOR_FILE_IN_RES "/home/owner/apps_rw/org.tizen.position-finder-server/res/iotcon-test-svr-db-server.dat"
-#define CBOR_FILE_IN_DATA "/home/owner/apps_rw/org.tizen.position-finder-server/data/iotcon-test-svr-db-server.dat"
static void _request_resource_handler(iotcon_resource_h resource, iotcon_request_h request, void *user_data);
diff --git a/src/controller.c b/src/controller.c
index e662a99..53571c1 100644
--- a/src/controller.c
+++ b/src/controller.c
@@ -132,6 +132,7 @@ int main(int argc, char* argv[])
app_event_handler_h handlers[5] = {NULL, };
ad = calloc(1, sizeof(app_data));
+ retv_if(!ad, -1);
event_callback.create = service_app_create;
event_callback.terminate = service_app_terminate;