From cdb452220228c4b18778872b3fb46c99f172c1ad Mon Sep 17 00:00:00 2001 From: Jin Yoon Date: Tue, 29 Aug 2017 08:04:00 +0900 Subject: [PATCH] Time interval : 5.0 sec Change-Id: Ic3639cb5b1875a2e118a27b4f41d3ebcf99555f3 --- packaging/org.tizen.position-finder-server.spec | 1 + src/connectivity.c | 36 ++++++++++++++++++++++--- src/controller.c | 2 +- 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/packaging/org.tizen.position-finder-server.spec b/packaging/org.tizen.position-finder-server.spec index 1487fb0..27acd6a 100644 --- a/packaging/org.tizen.position-finder-server.spec +++ b/packaging/org.tizen.position-finder-server.spec @@ -23,6 +23,7 @@ BuildRequires: pkgconfig(ecore) BuildRequires: pkgconfig(eina) BuildRequires: pkgconfig(iotcon) BuildRequires: pkgconfig(gio-2.0) +BuildRequires: pkgconfig(glib-2.0) %description Server for Position Finder diff --git a/src/connectivity.c b/src/connectivity.c index 1554737..ce5d2da 100644 --- a/src/connectivity.c +++ b/src/connectivity.c @@ -185,6 +185,24 @@ error: return NULL; } +static void _print_iotcon_error(int err_no) +{ + switch (err_no) { + case IOTCON_ERROR_NOT_SUPPORTED: + _E("IOTCON_ERROR_NOT_SUPPORTED"); + break; + case IOTCON_ERROR_PERMISSION_DENIED: + _E("IOTCON_ERROR_PERMISSION_DENIED"); + break; + case IOTCON_ERROR_INVALID_PARAMETER: + _E("IOTCON_ERROR_INVALID_PARAMETER"); + break; + default: + _E("Error : [%d]", err_no); + break; + } +} + int connectivity_notify_bool(connectivity_resource_s *resource_info, const char *key, bool value) { iotcon_representation_h representation; @@ -199,7 +217,11 @@ int connectivity_notify_bool(connectivity_resource_s *resource_info, const char retv_if(!representation, -1); ret = iotcon_resource_notify(resource_info->res, representation, resource_info->observers, IOTCON_QOS_HIGH); - retv_if(IOTCON_ERROR_NONE != ret, -1); + if (IOTCON_ERROR_NONE != ret) { + _I("There are some troubles for notifying value[%d]", ret); + _print_iotcon_error(ret); + return -1; + } _destroy_representation(representation); @@ -220,7 +242,11 @@ int connectivity_notify_int(connectivity_resource_s *resource_info, const char * retv_if(!representation, -1); ret = iotcon_resource_notify(resource_info->res, representation, resource_info->observers, IOTCON_QOS_HIGH); - retv_if(IOTCON_ERROR_NONE != ret, -1); + if (IOTCON_ERROR_NONE != ret) { + _I("There are some troubles for notifying value[%d]", ret); + _print_iotcon_error(ret); + return -1; + } _destroy_representation(representation); @@ -241,7 +267,11 @@ int connectivity_notify_double(connectivity_resource_s *resource_info, const cha retv_if(!representation, -1); ret = iotcon_resource_notify(resource_info->res, representation, resource_info->observers, IOTCON_QOS_HIGH); - retv_if(IOTCON_ERROR_NONE != ret, -1); + if (IOTCON_ERROR_NONE != ret) { + _I("There are some troubles for notifying value[%d]", ret); + _print_iotcon_error(ret); + return -1; + } _destroy_representation(representation); diff --git a/src/controller.c b/src/controller.c index b00b4c9..2d4a9cf 100644 --- a/src/controller.c +++ b/src/controller.c @@ -31,7 +31,7 @@ #include "controller.h" #define CONNECTIVITY_KEY "opened" -#define SENSORING_TIME_INTERVAL 1.0f +#define SENSORING_TIME_INTERVAL 5.0f typedef struct app_data_s { Ecore_Timer *getter_timer; -- 2.7.4