From c14e9c6e79f52bcbeb4e0eb86d90a5f255bb657f Mon Sep 17 00:00:00 2001 From: "saerome.kim" Date: Wed, 6 Nov 2019 12:54:25 +0900 Subject: 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: Ieeada0d9a714dfdbfe74b6599bba77e1107ef90c Signed-off-by: saerome.kim --- src/user-awareness-event-handler.c | 11 +++++++++++ src/user-awareness-monitors.c | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) mode change 100755 => 100644 src/user-awareness-event-handler.c (limited to 'src') diff --git a/src/user-awareness-event-handler.c b/src/user-awareness-event-handler.c old mode 100755 new mode 100644 index 5fd129b..a36ba8c --- 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; -- cgit v1.2.3