summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsaerome.kim <saerome.kim@samsung.com>2019-11-06 12:54:25 +0900
committersaerome.kim <saerome.kim@samsung.com>2019-11-06 13:27:47 +0900
commit374d3b24b6158ddae73cf348c73056ef975647c5 (patch)
tree61b5f40ed7599ca77fa9be3b9ee5c7e0449af8b0
parentf6b193ba7fd8bd25563994c43dbbb6323e671963 (diff)
downloaduser-awareness-374d3b24b6158ddae73cf348c73056ef975647c5.tar.gz
user-awareness-374d3b24b6158ddae73cf348c73056ef975647c5.tar.bz2
user-awareness-374d3b24b6158ddae73cf348c73056ef975647c5.zip
Fix the problem that timestamp is not included in user_presence_detected_cb
- Problem: Even if the user device is detected, the timestamp value is 0. - Cause: The timestamp value is not applied to the detected device. - Solution: Apply timestamp value to detected device info. Change-Id: I08536397aa2ad021231289661de969bfb872221d Signed-off-by: saerome.kim <saerome.kim@samsung.com>
-rw-r--r--include/user-awareness-private.h2
-rw-r--r--packaging/capi-network-ua.spec2
-rw-r--r--[-rwxr-xr-x]src/user-awareness-event-handler.c11
-rw-r--r--src/user-awareness-monitors.c2
4 files changed, 14 insertions, 3 deletions
diff --git a/include/user-awareness-private.h b/include/user-awareness-private.h
index d67d3a9..a436cdc 100644
--- a/include/user-awareness-private.h
+++ b/include/user-awareness-private.h
@@ -358,7 +358,7 @@ void _ua_monitor_handle_scan_complete(int result);
*/
void _ua_monitor_handle_user_presence_detected(uam_sensor_info_s *sensor_info,
char *service, char *account,
- long timestamp, char *device_id);
+ unsigned long long timestamp, char *device_id);
/**
* @brief Stops monitoring detection.
diff --git a/packaging/capi-network-ua.spec b/packaging/capi-network-ua.spec
index 38f5c9f..5974fa8 100644
--- a/packaging/capi-network-ua.spec
+++ b/packaging/capi-network-ua.spec
@@ -1,6 +1,6 @@
Name: capi-network-ua
Summary: User Awareness Framework CAPI
-Version: 0.12.9
+Version: 0.12.10
Release: 1
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
diff --git a/src/user-awareness-event-handler.c b/src/user-awareness-event-handler.c
index 5fd129b..a36ba8c 100755..100644
--- a/src/user-awareness-event-handler.c
+++ b/src/user-awareness-event-handler.c
@@ -57,6 +57,12 @@ static void __ua_event_handler(int event, uam_event_data_s *event_param,
ret_if(NULL == sensor_info);
sensor_info->sensor_bitmask = event_data->sensor_bitmask;
+ sensor_info->timestamp = event_data->timestamp;
+
+ UA_INFO("sensor: [%u], timestamp [%llu], accuracy [%d], value [%f]",
+ sensor_info->sensor_bitmask, sensor_info->timestamp,
+ sensor_info->accuracy, sensor_info->values[0]);
+
_ua_monitor_handle_user_presence_detected(
sensor_info, event_data->service,
event_data->account, event_data->timestamp,
@@ -78,6 +84,11 @@ static void __ua_event_handler(int event, uam_event_data_s *event_param,
ret_if(NULL == sensor_info);
sensor_info->sensor_bitmask = event_data->sensor_bitmask;
+
+ UA_INFO("sensor: [%u], timestamp [%llu], accuracy [%d], value [%f]",
+ sensor_info->sensor_bitmask, sensor_info->timestamp,
+ sensor_info->accuracy, sensor_info->values[0]);
+
_ua_monitor_handle_user_absence_detected(
sensor_info, event_data->service,
event_data->account);
diff --git a/src/user-awareness-monitors.c b/src/user-awareness-monitors.c
index 15a1de5..8ef4b88 100644
--- a/src/user-awareness-monitors.c
+++ b/src/user-awareness-monitors.c
@@ -821,7 +821,7 @@ void _ua_monitor_handle_scan_complete(int result)
}
void _ua_monitor_handle_user_presence_detected(uam_sensor_info_s *info,
- char *service, char *account, long timestamp, char *device_id)
+ char *service, char *account, unsigned long long timestamp, char *device_id)
{
FUNC_ENTRY;
GSList *l;