SET(INSTALL_EXEC_PREFIX "${INSTALL_PREFIX}/bin")
SET(INSTALL_RESDIR "${INSTALL_PREFIX}/res")
+SET(INSTALL_DATADIR "/home/owner/apps_rw/org.tizen.position-finder-server/data")
SET(CMAKE_VERBOSE_MAKEFILE 0)
SET(PROJECT_ROOT_DIR "${CMAKE_SOURCE_DIR}")
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_DATADIR})
# End of a file
%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_data_dir /home/owner/apps_rw/org.tizen.position-finder-server/data
%define _sys_icons_dir %{_pkg_shared_dir}/res
%define _sys_packages_dir %{TZ_SYS_RO_PACKAGES}
%define _sys_license_dir %{TZ_SYS_SHARE}/license
%post
/sbin/ldconfig
-chsmack -a "User::App::Shared" %{_pkg_dir}/res/*.dat
-chmod 666 %{_pkg_dir}/res/*.dat
+chsmack -a "User::Pkg::org.tizen.position-finder-server" %{_pkg_rw_data_dir}/*.dat
+chmod 666 %{_pkg_rw_data_dir}/*.dat
%postun -p /sbin/ldconfig
%files
%manifest org.tizen.position-finder-server.manifest
-%{_pkg_dir}/res/*.dat
+%{_pkg_rw_data_dir}/*.dat
+/home/owner/apps_rw/org.tizen.position-finder-server/data/iotcon-test-svr-db-server.dat
%defattr(-,root,root,-)
%{_pkg_dir}/bin/position-finder-server
%{_sys_packages_dir}/org.tizen.position-finder-server.xml
{
int ret = -1;
- ret = iotcon_initialize("/usr/apps/org.tizen.position-finder-server/res/iotcon-test-svr-db-server.dat");
+ ret = iotcon_initialize("/home/owner/apps_rw/org.tizen.position-finder-server/data/iotcon-test-svr-db-server.dat");
retv_if(IOTCON_ERROR_NONE != ret, -1);
ret = iotcon_set_device_name(device_name);
int gpio_num[3] = { 16, 23, 26 };
int i = 0;
int value[3] = { 0, };
+ int detected = 0;
+ app_data *ad = data;
for (i = 0; i < 3; i++) {
if (resource_read_infrared_motion_sensor(gpio_num[i], &value[i]) == -1) {
_E("Failed to get Infrared Motion value [GPIO:%d]", gpio_num[i]);
continue;
}
- _I("[GPIO:%d] Infrared Motion Value is [%d]", gpio_num[i], value[i]);
+ detected |= value[i];
}
-
- //@TODO: Send the data to Analyzer using connectivity APIs
-
+ if (connectivity_notify(ad->resource_info, detected) == -1)
+ _E("Cannot notify message");
#else
int value = 0;