summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsaerome kim <saerome.kim@samsung.com>2019-07-04 20:14:14 +0900
committersaerome kim <saerome.kim@samsung.com>2019-07-05 09:24:00 +0900
commited40bceaa9a49c34cf228ed3d9019bbd44161358 (patch)
tree8a71d827a5f9500534f3b89ecc228be2844f20dc
parentd8648c9252c8627c3debc6ecbd3f5752d19fa7f6 (diff)
downloaduser-awareness-ed40bceaa9a49c34cf228ed3d9019bbd44161358.tar.gz
user-awareness-ed40bceaa9a49c34cf228ed3d9019bbd44161358.tar.bz2
user-awareness-ed40bceaa9a49c34cf228ed3d9019bbd44161358.zip
Modified client library which can detect both presence and absence.submit/tizen/20190705.042311accepted/tizen/unified/20190705.110645
Change-Id: I085b610df5724307f1afebf3cd62fab0c06756e6 Signed-off-by: saerome kim <saerome.kim@samsung.com>
-rw-r--r--src/user-awareness-monitors.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/user-awareness-monitors.c b/src/user-awareness-monitors.c
index 5695886..d9efc1b 100644
--- a/src/user-awareness-monitors.c
+++ b/src/user-awareness-monitors.c
@@ -514,7 +514,12 @@ int ua_monitor_start_presence_detection(
UA_VALIDATE_INPUT_PARAMETER(handle);
UA_VALIDATE_HANDLE(handle, ua_monitor_list);
retv_if(TRUE == monitor->presence_detection_started, UA_ERROR_NOW_IN_PROGRESS);
- retv_if(monitor->service != NULL && g_strcmp0(monitor->service, service), UA_ERROR_NOT_PERMITTED);
+
+ if (service && !g_strcmp0(monitor->service, service))
+ return UA_ERROR_NOT_PERMITTED;
+ else if (monitor->service && g_strcmp0(monitor->service, UA_SERVICE_DEFAULT))
+ return UA_ERROR_NOT_PERMITTED;
+
retv_if(UA_DETECT_MODE_INVALID <= mode, UA_ERROR_INVALID_PARAMETER);
retv_if(0 == monitor->sensor_bitmask, UA_ERROR_NO_DATA);
@@ -562,7 +567,12 @@ int ua_monitor_start_absence_detection(
UA_VALIDATE_INPUT_PARAMETER(handle);
UA_VALIDATE_HANDLE(handle, ua_monitor_list);
retv_if(TRUE == monitor->absence_detection_started, UA_ERROR_NOW_IN_PROGRESS);
- retv_if(monitor->service != NULL && g_strcmp0(monitor->service, service), UA_ERROR_NOT_PERMITTED);
+
+ if (service && !g_strcmp0(monitor->service, service))
+ return UA_ERROR_NOT_PERMITTED;
+ else if (monitor->service && g_strcmp0(monitor->service, UA_SERVICE_DEFAULT))
+ return UA_ERROR_NOT_PERMITTED;
+
retv_if(UA_DETECT_MODE_INVALID <= mode, UA_ERROR_INVALID_PARAMETER);
retv_if(0 == monitor->sensor_bitmask, UA_ERROR_NO_DATA);