- Problem: The function of recording the detection time is required
- Cause: The function to record the recent detection time does not support
in the plugin.
- Solution: Add a function to record the latest detection time.
Change-Id: I3ecfd30706df893293009ccbe37437cbcf1c34f4
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
void _wifi_plugin_util_uas_device_info_free(uas_device_info_t *device);
+unsigned long long _wifi_plugin_util_get_curr_time(void);
+
#ifdef __cplusplus
}
#endif
# should anchor any reverse-dependencies
Name: ua-plugin-wifi-dummy
-Summary: Wi-Fi User awareness plugin for VD
-Version: 0.12.0
+Summary: Wi-Fi User awareness plugin
+Version: 0.13.0
Release: 1
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
UA_WIFI_ERR("Unable to get dev_info");
break;
}
+ /* Save current time */
+ dev_info->last_seen = _wifi_plugin_util_get_curr_time();
uas_cbs->device_detected_cb(UAS_PRESENCE, dev_info);
UA_WIFI_INFO("Called uas_cbs->device_detected_cb(UAS_PRESENCE)");
free(wifi_info);
break;
}
-
+ /* Save current time */
+ dev_info->last_seen = _wifi_plugin_util_get_curr_time();
uas_cbs->device_added_cb(UAS_STATUS_SUCCESS, dev_info);
_wifi_plugin_util_uas_device_info_free(dev_info);
break;
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <error.h>
+#include <sys/time.h>
#include <glib.h>
#include <wifi-plugin.h>
FUNC_EXIT;
}
+
+unsigned long long _wifi_plugin_util_get_curr_time(void)
+{
+ int ret;
+ struct timespec t;
+
+ ret = clock_gettime(CLOCK_REALTIME, &t);
+ if (-1 == ret) {
+ UA_WIFI_ERR("Failed to call clock_gettime [%d]", errno);
+ return 0;
+ }
+ return ((unsigned long long)(t.tv_sec) * 1000000000LL + t.tv_nsec) / 1000000;
+}