SET(INSTALL_EXEC_PREFIX "${INSTALL_PREFIX}/bin")
SET(INSTALL_RESDIR "${INSTALL_PREFIX}/res")
+SET(INSTALL_DATADIR "/home/owner/apps_rw/org.tizen.position-finder-client/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-client.xml)
INSTALL(DIRECTORY DESTINATION ${PREFIX}/data)
INSTALL(FILES ${PROJECT_ROOT_DIR}/shared/res/position_finder_client.png DESTINATION ${SYS_ICONS_DIR})
-INSTALL(FILES ${PROJECT_ROOT_DIR}/res/iotcon-test-svr-db-client.dat DESTINATION ${INSTALL_RESDIR})
+INSTALL(FILES ${PROJECT_ROOT_DIR}/res/iotcon-test-svr-db-client.dat DESTINATION ${INSTALL_DATADIR})
# End of a file
typedef struct _connectivity_resource_s connectivity_resource_s;
typedef void (*connectivity_observe_resource_cb)(connectivity_resource_s *resource_info, void *resource_data, void *user_data);
-extern int connectivity_observe_resource(connectivity_observe_resource_cb cb, void *user_data);
+extern int connectivity_observe_resource(const char *type, connectivity_observe_resource_cb cb, void *user_data);
#endif /* __POSITION_FINDER_CONNECTIVITY_H__ */
%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-client/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_data_dir}/*.dat
-chmod 666 %{_pkg_data_dir}/*.dat
+chsmack -a "User::Pkg::org.tizen.position-finder-client" %{_pkg_rw_data_dir}/*.dat
+chmod 666 %{_pkg_rw_data_dir}/*.dat
%postun -p /sbin/ldconfig
%files
%manifest org.tizen.position-finder-client.manifest
-%{_pkg_dir}/res/*.dat
+%{_pkg_rw_data_dir}/*.dat
%defattr(-,root,root,-)
%{_pkg_dir}/bin/position-finder-client
%{_sys_packages_dir}/org.tizen.position-finder-client.xml
#include "log.h"
#include "connectivity.h"
+#define CBOR_FILE "/home/owner/apps_rw/org.tizen.position-finder-client/data/iotcon-test-svr-db-client.dat"
#define DOOR_RESOURCE_URI_PREFIX "/door"
-#define DOOR_RESOURCE_TYPE "org.tizen.door"
struct _connectivity_observe_resource_cb_s {
connectivity_observe_resource_cb cb;
char *device_id;
char *host_address;
char *device_name;
+ char *type;
char *uri_path;
iotcon_presence_h presence;
iotcon_remote_resource_h resource;
/* FIXME : We need to remove presence_cb when not needed */
ret = iotcon_add_presence_cb(resource_host,
connectivity_type,
- DOOR_RESOURCE_TYPE,
+ info->type,
_presence_cb,
NULL,
&info->presence);
{
int ret = -1;
- ret = iotcon_initialize("/usr/apps/org.tizen.position-finder-client/res/iotcon-test-svr-db-client.dat");
+ ret = iotcon_initialize(CBOR_FILE);
if (IOTCON_ERROR_NONE != ret) {
_E("iotcon_initialize() Fail(%d)", ret);
return -1;
return 0;
}
-int connectivity_observe_resource(connectivity_observe_resource_cb cb, void *user_data)
+int connectivity_observe_resource(const char *type, connectivity_observe_resource_cb cb, void *user_data)
{
int ret = -1;
iotcon_query_h query = NULL;
ret = iotcon_query_create(&query);
goto_if(IOTCON_ERROR_NONE != ret, error);
- ret = iotcon_query_set_resource_type(query, DOOR_RESOURCE_TYPE);
+ ret = iotcon_query_set_resource_type(query, type);
goto_if(IOTCON_ERROR_NONE != ret, error);
ret = iotcon_find_resource(IOTCON_MULTICAST_ADDRESS,
error:
iotcon_query_destroy(query);
- if (cb_info) free(cb_info);
+ if (cb_info) {
+ free(cb_info);
+ }
return -1;
}
#include "log.h"
#include "connectivity.h"
-#define MAX_QUEUE_ELEMENTS 20
+#define MAX_QUEUE_ELEMENTS 120
+#define DOOR_RESOURCE_TYPE "org.tizen.door"
static void _start_internal_function(void);
static void _stop_internal_function(void);
_start_internal_function();
- ret = connectivity_observe_resource(_observe_resource_cb, NULL);
+ ret = connectivity_observe_resource(DOOR_RESOURCE_TYPE, _observe_resource_cb, NULL);
retv_if(ret == -1, false);
return true;
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<manifest xmlns="http://tizen.org/ns/packages" api-version="3.0" package="org.tizen.position-finder-client" version="1.0.0">
<profile name="mobile"/>
- <service-application appid="org.tizen.position-finder-client" auto-restart="false" exec="position-finder-client" multiple="false" nodisplay="false" on-boot="false" taskmanage="true" type="capp">
+ <service-application appid="org.tizen.position-finder-client" auto-restart="false" exec="position-finder-client" multiple="false" nodisplay="false" on-boot="true" taskmanage="true" type="capp">
<label>Position Filnder Client</label>
<icon>position_finder_client.png</icon>
</service-application>