Fix the problem that timestamp is not included in user_presence_detected_cb
authorsaerome.kim <saerome.kim@samsung.com>
Wed, 6 Nov 2019 03:54:25 +0000 (12:54 +0900)
committersaerome.kim <saerome.kim@samsung.com>
Wed, 6 Nov 2019 04:27:19 +0000 (13:27 +0900)
- 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: Ieeada0d9a714dfdbfe74b6599bba77e1107ef90c
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
include/user-awareness-private.h
packaging/capi-network-ua.spec
src/user-awareness-event-handler.c [changed mode: 0755->0644]
src/user-awareness-monitors.c

index d67d3a932b44eb4b5bc01c610ff9fea63f6a5284..a436cdc348037dd6885edb3809e315798d1a3871 100644 (file)
@@ -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.
index 38f5c9f4439164e0983513d097d10e4ceaba11ad..5974fa8a438e49140e1ae5277bbaa0082f473998 100644 (file)
@@ -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
old mode 100755 (executable)
new mode 100644 (file)
index 5fd129b..a36ba8c
@@ -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);
index 15a1de568e885b6804a50354c2814eb7008de7c3..8ef4b88e44d9819f0ebb88268ee992bbeff5420c 100644 (file)
@@ -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;