Change a parameter in ua_device_get_last_presence()
authorsaerome.kim <saerome.kim@samsung.com>
Fri, 15 Nov 2019 07:48:03 +0000 (16:48 +0900)
committersaerome.kim <saerome.kim@samsung.com>
Fri, 15 Nov 2019 09:44:36 +0000 (18:44 +0900)
- Problem: The meaning of timestamp does not express the recent detection time.
- Cause: The timestamp in the API that was not originally intended
- Solution: Change the timestamp to last_seen.

Change-Id: I3a2f85111f817c0c112fc3dcea52bb7185aaf8d3
Signed-off-by: saerome.kim <saerome.kim@samsung.com>
include/user-awareness-private.h
include/user-awareness.h
packaging/capi-network-ua.spec
packaging/capi-network-ua.spec.orig [deleted file]
test/uat-devices.c

index f4b77f0fe5801ccc0625f5305d03dcc6b44fa4ea..0cd5353874d93ebb10e958195aa4aa82d76e99d6 100644 (file)
@@ -191,7 +191,7 @@ typedef struct {
        gboolean presence_detection_started; /**< Is presence detection started */
        gboolean absence_detection_started; /**< Is absence detection started */
        gboolean scan_device_started; /**< Is scan device started */
-       gboolean internal_presence_started; /**< Is Internally scan device started */
+       int internal_presence_started; /**< Is Internally scan device started */
        unsigned int presence_detection_timer; /**< Presence detection timer */
        unsigned int absence_detection_timer; /**< Absence detection timer */
        ua_callback_s sensor_state_cb; /**< Callback to let apps know sensors added or not */
index b40f071e1a8ad3600b5ad3f1846af76362c928d1..55beb7139a3cdcde08af1ac2764e5f40f8e036ba 100644 (file)
@@ -2512,11 +2512,11 @@ int ua_device_get_wifi_ipv4_address(
 
 /**
  * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Gets last presence timestamp info for device handle.
+ * @brief Gets last presence time for device handle.
  * @since_tizen 5.5
  *
  * @param[in] device_handle The device handle
- * @param[out] timestamp The last presence timestamp information for UA device
+ * @param[out] last_seen The last presence time for UA device
  *
  * @return 0 on success, otherwise a negative error value
  * @retval #UA_ERROR_NONE Successful
@@ -2529,7 +2529,7 @@ int ua_device_get_wifi_ipv4_address(
  */
 int ua_device_get_last_presence(
                ua_device_h device_handle,
-               unsigned long long *timestamp);
+               unsigned long long *last_seen);
 
 /**
  * @ingroup CAPI_NETWORK_UA_MODULE
index f94588bf615a0ebdb5846867be82835b5e63eee6..f1f702f31faacb31b45603b0365bafd53c2c66c6 100644 (file)
@@ -1,6 +1,6 @@
 Name: capi-network-ua
 Summary: User Awareness Framework CAPI
-Version: 0.12.17
+Version: 0.13.0
 Release: 1
 License: Apache-2.0
 Source0: %{name}-%{version}.tar.gz
diff --git a/packaging/capi-network-ua.spec.orig b/packaging/capi-network-ua.spec.orig
deleted file mode 100644 (file)
index 0cc7e26..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-Name: capi-network-ua
-Summary: User Awareness Framework CAPI
-<<<<<<< HEAD
-Version: 0.12.16
-=======
-Version: 0.12.15
->>>>>>> Start detection only on sensor available in monitor
-Release: 1
-License: Apache-2.0
-Source0: %{name}-%{version}.tar.gz
-
-BuildRequires: cmake
-BuildRequires:  pkgconfig(dlog)
-BuildRequires:  pkgconfig(glib-2.0)
-BuildRequires:  pkgconfig(ua-api)
-
-%if 0%{?ptest:1}
-BuildRequires:  pkgconfig(deviced)
-BuildRequires:  pkgconfig(power-defs)
-%endif
-
-%define _confdir /opt/data
-
-%description
-Activity API Library
-
-%package devel
-Summary: User Awareness Framework CAPI (devel)
-Requires: %{name} = %{version}
-
-%description devel
-User Awareness Framework CAPI
-
-%package test
-Summary: User Awareness Framework test application
-Group:   TO_BE/FILLED
-Requires: %{name} = %{version}-%{release}
-
-%description test
-This package is for User Awareness Framework CAPI test application
-
-%if 0%{?gcov:1}
-%package gcov
-Summary:    A User Awareness gcov Tool
-Group:      Network & Connectivity/Development
-
-%description gcov
-User Awareness gcov objects
-%endif
-
-%prep
-%setup -q
-
-%build
-
-%if 0%{?gcov:1}
-export LDFLAGS+=" -lgcov"
-%endif
-
-MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
-cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} \
-       -DLIB_INSTALL_DIR=%{_libdir} \
-       -DBIN_INSTALL_DIR=%{_bindir} \
-       -DINCLUDE_INSTALL_DIR=%{_includedir} \
-       -DLIB_PATH=%{_lib} \
-       -DSUSPEND_RESUME_TEST=%{?ptest:1}%{!?ptest:0} \
-       -DFULLVER=%{version} \
-       -DMAJORVER=${MAJORVER} \
-       -DBUILD_GCOV=%{?gcov:1}%{!?gcov:0}
-
-make %{?jobs:-j%jobs}
-
-%if 0%{?gcov:1}
-mkdir -p gcov-obj
-find . -name '*.gcno' -exec cp '{}' gcov-obj ';'
-%endif
-
-%install
-%make_install
-
-%if 0%{?gcov:1}
-mkdir -p %{buildroot}%{_datadir}/gcov/obj
-install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
-%endif
-
-%post -p /sbin/ldconfig
-
-%postun -p /sbin/ldconfig
-
-%files
-%manifest %{name}.manifest
-%defattr(-,root,root,-)
-%license LICENSE
-%attr(644,-,-) %{_libdir}/lib%{name}.so
-%attr(644,-,-) %{_libdir}/lib%{name}.so.*
-
-%files devel
-%manifest %{name}-devel.manifest
-%defattr(-,root,root,-)
-%{_libdir}/pkgconfig/%{name}.pc
-%{_includedir}/*
-
-%files test
-%manifest %{name}.manifest
-%attr(777,network_fw,network_fw) %{_bindir}/ua-test
-
-%if 0%{?gcov:1}
-%files gcov
-%{_datadir}/gcov/obj/*
-%endif
index e124d43036002f86c2a270bb7638440fec1c5a81..99a22251d8dca02d042e61976d9874fc27e4f558 100644 (file)
@@ -68,7 +68,7 @@ static bool __foreach_added_device_cb(
        char *wifi_bssid = NULL;
        char *ipv4 = NULL;
        bool required = false;
-       unsigned long long timestamp = 0;
+       unsigned long long last_seen = 0;
        bool discriminant = false;
        char service_id = 0;
        char device_icon = 0;
@@ -132,9 +132,9 @@ static bool __foreach_added_device_cb(
        if (UA_ERROR_NONE == ret_temp)
                msgb("Pairing Required : %s", required ? "YES" : "NO");
 
-       ret_temp = ua_device_get_last_presence(handle, &timestamp);
+       ret_temp = ua_device_get_last_presence(handle, &last_seen);
        if (UA_ERROR_NONE == ret_temp)
-               msgb("Last present at : %llu", timestamp);
+               msgb("Last present at : %llu", last_seen);
 
        ret_temp = ua_device_get_payload_service_id(handle, &service_id);
        if (UA_ERROR_NONE == ret_temp)