From: Abhay Agarwal Date: Fri, 29 Jan 2021 06:51:27 +0000 (+0530) Subject: Move deprecated API's to internal header X-Git-Tag: submit/tizen/20210131.225751~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=64d24c313cb7c5c9e553e6cc9fbcefd95ab20e3d;p=platform%2Fcore%2Fapi%2Fuser-awareness.git Move deprecated API's to internal header Change-Id: Ib3407d9861aecc04d7fdf5e3b00a82996f643491 Signed-off-by: Abhay Agarwal --- diff --git a/include/user-awareness-internal.h b/include/user-awareness-internal.h index 681cb98..d6fef7b 100755 --- a/include/user-awareness-internal.h +++ b/include/user-awareness-internal.h @@ -34,6 +34,17 @@ extern "C" { * @{ */ +/** + * @ingroup CAPI_NETWORK_UA_MODULE + * @brief Enumerations of logical conjunction operation in between + * AND and OR user detection conditions. + * @since_tizen 6.5 + */ +typedef enum { + UA_OR_OPERATION = 0x00, /**< AND | OR */ + UA_AND_OPERATION = 0x01 /**< AND & OR */ +} ua_condition_conjunction_e; + /** * @ingroup CAPI_NETWORK_UA_MODULE * @brief Callback to get all user handles. @@ -55,6 +66,282 @@ typedef bool (*ua_registered_user_cb)( ua_user_h user_handle, void *user_data); +/** + * @internal + * @ingroup CAPI_NETWORK_UA_MODULE + * @brief Gets default user handle. + * @since_tizen 6.5 + * + * @remarks The @a user_handle should be released using #ua_user_destroy(). + * + * @param[out] user_handle The user handle + * + * @return 0 on success, otherwise a negative error value + * @retval #UA_ERROR_NONE Successful + * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #UA_ERROR_OPERATION_FAILED Operation failed + * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet + * + * @exception + * @pre + * @post + * + * @see ua_user_get_account() + */ +int ua_get_default_user(ua_user_h *user_handle); + +/** + * @internal + * @ingroup CAPI_NETWORK_UA_MODULE + * @brief Retrieves the user handle of all the registered users. + * @since_tizen 6.5 + * + * @param[in] foreach_cb Callback function to be invoked with user handle. + * @param[in] user_data The user data to be passed when callback is called. + * + * @return 0 on success, otherwise a negative error value + * @retval #UA_ERROR_NONE Successful + * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #UA_ERROR_OUT_OF_MEMORY Out of memory + * @retval #UA_ERROR_OPERATION_FAILED Operation failed + * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet + * + * @exception + * @pre + * @post + * + * @see ua_registered_user_cb() + */ +int ua_foreach_users( + ua_registered_user_cb foreach_cb, + void *user_data); + +/** + * @ingroup CAPI_NETWORK_UA_MODULE + * @brief Retrieves the device handle of all the registered devices. + * @since_tizen 6.5 + * + * @param[in] foreach_cb Callback function to be invoked with all device handle. + * @param[in] user_data The user data to be passed when callback is called. + * + * @return 0 on success, otherwise a negative error value + * @retval #UA_ERROR_NONE Successful + * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #UA_ERROR_OUT_OF_MEMORY Out of memory + * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet + * + * @exception + * @pre + * @post + * + * @see ua_registered_dev_cb() + */ +int ua_foreach_devices( + ua_registered_dev_cb foreach_cb, + void *user_data); + +/** + * @internal + * @ingroup CAPI_NETWORK_UA_MODULE + * @brief Sets the brightness absence and presence threshold level. + * @since_tizen 6.5 + * + * @param[in] handle The monitor handle + * @param[in] presence_threshold Presence threshold (Unit. Lux). + * @param[in] absence_threshold Absence threshold (Unit. Lux). + * + * @return 0 on success, otherwise a negative error value + * @retval #UA_ERROR_NONE Successful + * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet + */ +int ua_monitor_set_brightness_threshold(ua_monitor_h handle, + int presence_threshold, int absence_threshold); + +/** + * @internal + * @ingroup CAPI_NETWORK_UA_MODULE + * @brief Enables low power mode for host device. + * @since_tizen 6.5 + * + * @return 0 on success, otherwise a negative error value + * @retval #UA_ERROR_NONE Successful + * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet + */ +int ua_enable_low_power_mode(void); + +/** + * @internal + * @ingroup CAPI_NETWORK_UA_MODULE + * @brief Disables low power mode for host device. + * @since_tizen 6.5 + * + * @return 0 on success, otherwise a negative error value + * @retval #UA_ERROR_NONE Successful + * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet + */ +int ua_disable_low_power_mode(void); + +/** + * @internal + * @ingroup CAPI_NETWORK_UA_MODULE + * @brief Sets low power mode for each sensor. + * @since_tizen 6.5 + * + * @param[in] bitmask The sensor bitmask + * @param[in] on_off Low power mode enable or not + * + * @return 0 on success, otherwise a negative error value + * @retval #UA_ERROR_NONE Successful + * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet + */ +int ua_set_low_power_mode(unsigned int bitmask, bool on_off); + +/** + * @internal + * @ingroup CAPI_NETWORK_UA_MODULE + * @brief Gets the current detection parameter set for sensors. + * @since_tizen 6.5 + * + * @param[out] cycle Time in seconds after which user detection procedure + * (BLE scan/ARPing etc.) is repeated. + * @param[out] period Time in second for which User detection procedure is executed. + * @param[out] retries Number of retries to detect users before reporting absence. + * A non-detection count is maintained against each user. After + * each detection cycle, if presence is detected, then count is + * reset to 0 and Presence is reported. Else, the count is incremented + * and once count reaches the retries value, Absence is reported. + * + * @return 0 on success, otherwise a negative error value + * @retval #UA_ERROR_NONE Successful + * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet + */ +int ua_get_detection_params(int *cycle, int *period, int *retries); + +/** + * @internal + * @ingroup CAPI_NETWORK_UA_MODULE + * @brief Sets the detection parameter for sensors. Invoking this will stop any onging + * detection and set the new detection parameters and the restart detection again. + * @since_tizen 6.5 + * + * @param[in] cycle Time in seconds after which user detection procedure + * (BLE scan/ARPing etc.) is repeated. + * @param[in] period Time in second for which User detection procedure is executed. + * @param[in] retries Number of retries to detect users before reporting absence. + * A non-detection count is maintained against each user. After + * each detection cycle, if presence is detected, then count is + * reset to 0 and Presence is reported. Else, the count is incremented + * and once count reaches the retries value, Absence is reported. + * + * @return 0 on success, otherwise a negative error value + * @retval #UA_ERROR_NONE Successful + * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet + */ +int ua_set_detection_params(int cycle, int period, int retries); + +/** + * @internal + * @ingroup CAPI_NETWORK_UA_MODULE + * @brief Sets the detection cycle parameter for service. + * @since_tizen 6.5 + * + * @remarks The value will be reset to default after reboot. + * + * @param[in] service Service handle for which detection cycle is getting configure. + * @param[in] cycle_time Time in seconds after which user detection procedure + * (BLE scan/ARPing etc) is repeated. Minimum value of cycle_time + * is 300 seconds, Applications to send multiplier of 300 seconds only + * in this parameter. Example : 1*300 = 300 secs, 2*300 = 600 secs etc.). + * + * @return 0 on success, otherwise a negative error value + * @retval #UA_ERROR_NONE Successful + * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet + * + * @see #UA_DETECTION_CYCLE_STEP + * @see #UA_MIN_DETECTION_CYCLE + * @see ua_get_detection_cycle() + */ +int ua_set_detection_cycle(ua_service_h service, unsigned int cycle_time); + +/** + * @internal + * @ingroup CAPI_NETWORK_UA_MODULE + * @brief Gets the current detection cycle parameter set for particular service. + * @since_tizen 6.5 + * + * @param[in] service Service handle for which detection cycle is getting configure. + * @param[in] cycle_time Time in second after which user detection procedure + * (BLE scan/ARPing etc.) is repeated. + * + * @return 0 on success, otherwise a negative error value + * @retval #UA_ERROR_NONE Successful + * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet + * + * @see ua_set_detection_cycle() + */ +int ua_get_detection_cycle(ua_service_h service, unsigned int* cycle_time); + +/** + * @internal + * @ingroup CAPI_NETWORK_UA_MODULE + * @brief Sets the detection window parameter for sensors. + * @since_tizen 6.5 + * + * @remarks The value will be reset to default after reboot. + * + * @param[in] window Time in seconds for which User detection procedure is executed. + * Maximum value of window is 290 seconds, Applications to send multiplier of + * 10 seconds only in this parameter. Example : 1*10 = 10 secs, 2*10 = 20 + * secs etc.). + * + * @return 0 on success, otherwise a negative error value + * @retval #UA_ERROR_NONE Successful + * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter + * + * @see #UA_DETECTION_WINDOW_STEP + * @see #UA_MAX_DETECTION_WINDOW + * @see ua_get_detection_window() + * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet + */ +int ua_set_detection_window(unsigned int window); + +/** + * @internal + * @ingroup CAPI_NETWORK_UA_MODULE + * @brief Gets the current detection window parameter. + * @since_tizen 6.5 + * + * @param[in] window Time for which User detection procedure is executed. + * + * @return 0 on success, otherwise a negative error value + * @retval #UA_ERROR_NONE Successful + * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet + * + * @see ua_set_detection_window() + */ +int ua_get_detection_window(unsigned int* window); + +/** + * @internal + * @ingroup CAPI_NETWORK_UA_MODULE + * @brief Resets database. + * @since_tizen 6.5 + * + * @return 0 on success, otherwise a negative error value + * @retval #UA_ERROR_NONE Successful + * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet + */ +int ua_reset_database(void); + + +/* Depricated API's */ + /** * @ingroup CAPI_NETWORK_UA_MODULE * @brief Callback to get the device handle added to the service. @@ -83,40 +370,34 @@ typedef bool (*ua_service_added_device_cb)( /** * @internal * @ingroup CAPI_NETWORK_UA_MODULE - * @brief Clones user handle if application wants to store it after foreach user - * handles. It should be call before foreach callback return. + * @brief Adds device for a specific service. * @since_tizen 6.5 * - * @remarks The @a cloned should be released using #ua_user_destroy(). - * - * @param[out] cloned The cloned device handle. - * @param[in] origin The input device handle + * @param[in] service_handle The service handle. + * @param[in] device_handle The device handle. * * @return 0 on success, otherwise a negative error value * @retval #UA_ERROR_NONE Successful * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #UA_ERROR_OUT_OF_MEMORY Out of memory * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet * * @exception * @pre * @post * - * @see ua_foreach_users() - * @see ua_service_foreach_added_user() - * @see ua_user_destroy() + * @see ua_service_remove_device() */ -int ua_user_clone(ua_user_h *cloned, ua_user_h origin) TIZEN_DEPRECATED_API; +int ua_service_add_device(ua_service_h service_handle, + ua_device_h device_handle) TIZEN_DEPRECATED_API; /** * @internal * @ingroup CAPI_NETWORK_UA_MODULE - * @brief Gets default user handle. + * @brief Removes the device from a specific service handle. * @since_tizen 6.5 * - * @remarks The @a user_handle should be released using #ua_user_destroy(). - * - * @param[out] user_handle The user handle + * @param[in] service_handle The service handle. + * @param[in] device_handle The device handle. * * @return 0 on success, otherwise a negative error value * @retval #UA_ERROR_NONE Successful @@ -128,19 +409,45 @@ int ua_user_clone(ua_user_h *cloned, ua_user_h origin) TIZEN_DEPRECATED_API; * @pre * @post * - * @see ua_user_get_account() + * @see ua_service_add_device() */ -int ua_user_get_default_user(ua_user_h *user_handle) TIZEN_DEPRECATED_API; +int ua_service_remove_device(ua_service_h service_handle, + ua_device_h device_handle) TIZEN_DEPRECATED_API; /** * @internal * @ingroup CAPI_NETWORK_UA_MODULE - * @brief Gets default user handle. + * @brief Retrieves the device handle of all the added devices for a specific service. * @since_tizen 6.5 * - * @remarks The @a user_handle should be released using #ua_user_destroy(). + * @param[in] service_handle The service handle. + * @param[in] foreach_cb Callback function to be invoked with device handle. + * @param[in] user_data The user data to be passed when callback is called. * - * @param[out] user_handle The user handle + * @return 0 on success, otherwise a negative error value + * @retval #UA_ERROR_NONE Successful + * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet + * + * @exception + * @pre + * @post + * + * @see ua_service_added_device_cb() + */ +int ua_service_foreach_added_devices(ua_service_h service_handle, + ua_service_added_device_cb foreach_cb, + void *user_data) TIZEN_DEPRECATED_API; + +/** + * @ingroup CAPI_NETWORK_UA_MODULE + * @brief Gets service handle by service name. + * @since_tizen 6.5 + * + * @remarks The @a service_handle should be destroyed by using #ua_service_destroy(). + * + * @param[in] name The service name information + * @param[out] service_handle The service handle * * @return 0 on success, otherwise a negative error value * @retval #UA_ERROR_NONE Successful @@ -152,18 +459,21 @@ int ua_user_get_default_user(ua_user_h *user_handle) TIZEN_DEPRECATED_API; * @pre * @post * - * @see ua_user_get_account() + * @see ua_service_get_name() + * @see ua_service_set_name() */ -int ua_get_default_user(ua_user_h *user_handle); +int ua_service_get_by_name( + const char *name, + ua_service_h *service_handle) TIZEN_DEPRECATED_API; /** - * @internal * @ingroup CAPI_NETWORK_UA_MODULE - * @brief Sets account info for device handle. + * @brief Gets detection threshold info for service handle. * @since_tizen 6.5 * - * @param[in] user_handle The user handle - * @param[in] account Account information + * @param[in] service_handle The service handle + * @param[out] presence_threshold The service presence threshold information + * @param[out] absence_threshold The service absence threshold information * * @return 0 on success, otherwise a negative error value * @retval #UA_ERROR_NONE Successful @@ -174,18 +484,162 @@ int ua_get_default_user(ua_user_h *user_handle); * @pre * @post * - * @see ua_user_get_account() + * @see ua_service_set_detection_threshold() */ -int ua_user_set_account(ua_user_h user_handle, const char *account) TIZEN_DEPRECATED_API; +int ua_service_get_detection_threshold( + ua_service_h service_handle, + unsigned int *presence_threshold, + unsigned int *absence_threshold) TIZEN_DEPRECATED_API; /** - * @internal * @ingroup CAPI_NETWORK_UA_MODULE - * @brief Sets name info for user handle. + * @brief Sets name info for service handle. * @since_tizen 6.5 * - * @param[in] user_handle The user handle - * @param[in] name The user name information + * @param[in] service_handle The service handle + * @param[in] name The service name information + * + * @return 0 on success, otherwise a negative error value + * @retval #UA_ERROR_NONE Successful + * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet + * + * @exception + * @pre + * @post + * + * @see ua_service_get_name() + */ +int ua_service_set_name( + ua_service_h service_handle, + const char *name) TIZEN_DEPRECATED_API; + +/** + * @ingroup CAPI_NETWORK_UA_MODULE + * @brief Gets name info for service handle. + * @since_tizen 6.5 + * + * @remarks You must release @a name using g_free(). + * + * @param[in] service_handle The service handle + * @param[out] name The service name information + * + * @return 0 on success, otherwise a negative error value + * @retval #UA_ERROR_NONE Successful + * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet + * + * @exception + * @pre + * @post + * + * @see ua_service_set_name() + */ +int ua_service_get_name( + ua_service_h service_handle, + char **name) TIZEN_DEPRECATED_API; + +/** + * @ingroup CAPI_NETWORK_UA_MODULE + * @brief Sets a device type info for a device. + * @since_tizen 6.5 + * + * @param[in] device_handle The device handle + * @param[in] mac_type The MAC address type of the device + * + * @return 0 on success, otherwise a negative error value + * @retval #UA_ERROR_NONE Successful + * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet + * + * @exception + * @pre + * @post + * + * @see ua_device_get_mac_type() + */ +int ua_device_set_mac_type( + ua_device_h device_handle, + ua_mac_type_e mac_type) TIZEN_DEPRECATED_API; + +/** + * @ingroup CAPI_NETWORK_UA_MODULE + * @brief Gets device type info from the device. + * @since_tizen 6.5 + * + * @param[in] device_handle The device handle + * @param[out] mac_type The MAC address type of the device + * + * @return 0 on success, otherwise a negative error value + * @retval #UA_ERROR_NONE Successful + * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet + * + * @exception + * @pre + * @post + * + * @see ua_device_set_mac_type() + */ +int ua_device_get_mac_type( + ua_device_h device_handle, + ua_mac_type_e *mac_type) TIZEN_DEPRECATED_API; + +/** + * @ingroup CAPI_NETWORK_UA_MODULE + * @brief Gets device's operating system info. + * @since_tizen 6.5 + * + * @param[in] device_handle The device handle + * @param[out] os_info Device's operating system info. + * + * @return 0 on success, otherwise a negative error value + * @retval #UA_ERROR_NONE Successful + * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet + * + * @exception + * @pre + * @post + * + * @see ua_device_set_os_info() + */ +int ua_device_get_os_info( + ua_device_h device_handle, + ua_os_type_e *os_info) TIZEN_DEPRECATED_API; + +/** + * @ingroup CAPI_NETWORK_UA_MODULE + * @brief Sets device's MAC address. + * @since_tizen 6.5 + * + * @param[in] device_handle The device handle + * @param[in] mac_address The device's MAC address. + * + * @return 0 on success, otherwise a negative error value + * @retval #UA_ERROR_NONE Successful + * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet + * + * @exception + * @pre + * @post + * + * @see ua_device_get_mac_address() + */ +int ua_device_set_mac_address( + ua_device_h device_handle, + const char *mac_address) TIZEN_DEPRECATED_API; + +/** + * @ingroup CAPI_NETWORK_UA_MODULE + * @brief Gets device's MAC address. + * @since_tizen 6.5 + * + * @remarks You must release @a mac_address using g_free(). + * + * @param[in] device_handle The device handle + * @param[out] mac_address The device's MAC address. * * @return 0 on success, otherwise a negative error value * @retval #UA_ERROR_NONE Successful @@ -195,88 +649,89 @@ int ua_user_set_account(ua_user_h user_handle, const char *account) TIZEN_DEPREC * @exception * @pre * @post + * + * @see ua_device_set_mac_address() */ -int ua_user_set_name(ua_user_h user_handle, const char *name) TIZEN_DEPRECATED_API; +int ua_device_get_mac_address( + ua_device_h device_handle, + char **mac_address) TIZEN_DEPRECATED_API; /** - * @internal * @ingroup CAPI_NETWORK_UA_MODULE - * @brief Removes the device ID. + * @brief Sets device ID. * @since_tizen 6.5 * + * @param[in] device_handle The device handle * @param[in] device_id The device ID. - * @param[in] mac_type The device's MAC address type. * - * @return 0 on success, otherwise a negative error value + * @return 0 on success, otherwise a negative error value * @retval #UA_ERROR_NONE Successful - * @retcal #UA_ERROR_RESOURCE_BUSY Remove done. but another service uses thie device. * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet * * @exception * @pre * @post + * + * @see ua_device_get_device_id() */ -int ua_user_remove_device_by_device_id(const char *device_id, ua_mac_type_e mac_type) TIZEN_DEPRECATED_API; +int ua_device_set_device_id( + ua_device_h device_handle, + const char *device_id) TIZEN_DEPRECATED_API; /** - * @internal * @ingroup CAPI_NETWORK_UA_MODULE - * @brief Retrieves the user handle of all the registered users. + * @brief Gets device ID. * @since_tizen 6.5 * - * @param[in] foreach_cb Callback function to be invoked with user handle. - * @param[in] user_data The user data to be passed when callback is called. + * @remarks You must release @a device_id using g_free(). + * @param[in] device_handle The device handle + * @param[out] device_id The device ID. * * @return 0 on success, otherwise a negative error value * @retval #UA_ERROR_NONE Successful * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #UA_ERROR_OUT_OF_MEMORY Out of memory - * @retval #UA_ERROR_OPERATION_FAILED Operation failed * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet * - * @exception - * @pre - * @post - * - * @see ua_registered_user_cb() + * @see ua_device_set_device_id() */ -int ua_user_foreach_added(ua_registered_user_cb foreach_cb, void *user_data) TIZEN_DEPRECATED_API; +int ua_device_get_device_id( + ua_device_h device_handle, + char **device_id) TIZEN_DEPRECATED_API; /** - * @internal * @ingroup CAPI_NETWORK_UA_MODULE - * @brief Retrieves the user handle of all the registered users. + * @brief Gets device's Wi-Fi BSSID. * @since_tizen 6.5 * - * @param[in] foreach_cb Callback function to be invoked with user handle. - * @param[in] user_data The user data to be passed when callback is called. + * @remarks You must release @a bssid using g_free(). + * @param[in] device_handle The device handle + * @param[out] bssid The device's Wi-Fi BSSID. * * @return 0 on success, otherwise a negative error value * @retval #UA_ERROR_NONE Successful * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #UA_ERROR_OUT_OF_MEMORY Out of memory - * @retval #UA_ERROR_OPERATION_FAILED Operation failed * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet * * @exception * @pre * @post * - * @see ua_registered_user_cb() + * @see ua_device_set_wifi_bssid() */ -int ua_foreach_users( - ua_registered_user_cb foreach_cb, - void *user_data); +int ua_device_get_wifi_bssid( + ua_device_h device_handle, + char **bssid) TIZEN_DEPRECATED_API; /** - * @internal * @ingroup CAPI_NETWORK_UA_MODULE - * @brief Adds device for a specific service. + * @brief Gets device's Wi-Fi IPv4 address. * @since_tizen 6.5 * - * @param[in] service_handle The service handle. - * @param[in] device_handle The device handle. + * @remarks You must release @a ipv4_address using g_free(). + * + * @param[in] device_handle The device handle + * @param[out] ipv4_address The device's Wi-Fi IPv4 address. * * @return 0 on success, otherwise a negative error value * @retval #UA_ERROR_NONE Successful @@ -287,43 +742,41 @@ int ua_foreach_users( * @pre * @post * - * @see ua_service_remove_device() + * @see ua_device_set_wifi_ipv4_address() */ -int ua_service_add_device(ua_service_h service_handle, ua_device_h device_handle) TIZEN_DEPRECATED_API; +int ua_device_get_wifi_ipv4_address( + ua_device_h device_handle, + char **ipv4_address) TIZEN_DEPRECATED_API; /** - * @internal * @ingroup CAPI_NETWORK_UA_MODULE - * @brief Removes the device from a specific service handle. + * @brief Gets last presence time for device handle. * @since_tizen 6.5 * - * @param[in] service_handle The service handle. - * @param[in] device_handle The device handle. + * @param[in] device_handle The device handle + * @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 * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter - * @retval #UA_ERROR_OPERATION_FAILED Operation failed * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet * * @exception * @pre * @post * - * @see ua_service_add_device() */ -int ua_service_remove_device(ua_service_h service_handle, - ua_device_h device_handle) TIZEN_DEPRECATED_API; +int ua_device_get_last_presence( + ua_device_h device_handle, + unsigned long long *last_seen) TIZEN_DEPRECATED_API; /** - * @internal * @ingroup CAPI_NETWORK_UA_MODULE - * @brief Retrieves the device handle of all the added devices for a specific service. + * @brief Gets whether pairing is required for the user device. * @since_tizen 6.5 * - * @param[in] service_handle The service handle. - * @param[in] foreach_cb Callback function to be invoked with device handle. - * @param[in] user_data The user data to be passed when callback is called. + * @param[in] device_handle The device handle + * @param[out] pairing_required TRUE if pairing is required, FALSE otherwise. * * @return 0 on success, otherwise a negative error value * @retval #UA_ERROR_NONE Successful @@ -334,11 +787,10 @@ int ua_service_remove_device(ua_service_h service_handle, * @pre * @post * - * @see ua_service_added_device_cb() */ -int ua_service_foreach_added_devices(ua_service_h service_handle, - ua_service_added_device_cb foreach_cb, - void *user_data) TIZEN_DEPRECATED_API; +int ua_device_get_pairing_required( + ua_device_h device_handle, + bool *pairing_required) TIZEN_DEPRECATED_API; /** * @internal @@ -358,7 +810,6 @@ int ua_service_foreach_added_devices(ua_service_h service_handle, * @pre * @post */ - int ua_device_set_discriminant(ua_device_h device_handle, bool discriminant) TIZEN_DEPRECATED_API; @@ -391,11 +842,14 @@ int ua_device_foreach_added_by_user( /** * @ingroup CAPI_NETWORK_UA_MODULE - * @brief Retrieves the device handle of all the registered devices. + * @brief Clones device handle if application wants to store it after foreach device + * handles. It should be call before foreach callback return. * @since_tizen 6.5 * - * @param[in] foreach_cb Callback function to be invoked with all device handle. - * @param[in] user_data The user data to be passed when callback is called. + * @remarks The @a cloned should be released using #ua_device_destroy(). + * + * @param[out] cloned The cloned device handle. + * @param[in] origin The input device handle * * @return 0 on success, otherwise a negative error value * @retval #UA_ERROR_NONE Successful @@ -408,209 +862,199 @@ int ua_device_foreach_added_by_user( * @post * * @see ua_registered_dev_cb() + * @see ua_device_destroy() */ -int ua_foreach_devices( - ua_registered_dev_cb foreach_cb, - void *user_data); +int ua_device_clone( + ua_device_h *cloned, + ua_device_h origin) TIZEN_DEPRECATED_API; /** - * @internal * @ingroup CAPI_NETWORK_UA_MODULE - * @brief Sets the brightness absence and presence threshold level. + * @brief Gets account info for user handle. * @since_tizen 6.5 * - * @param[in] handle The monitor handle - * @param[in] presence_threshold Presence threshold (Unit. Lux). - * @param[in] absence_threshold Absence threshold (Unit. Lux). + * @remarks You must release @a account using g_free(). + * @param[in] user_handle The user handle + * @param[out] account Account information * * @return 0 on success, otherwise a negative error value * @retval #UA_ERROR_NONE Successful * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet - */ -int ua_monitor_set_brightness_threshold(ua_monitor_h handle, - int presence_threshold, int absence_threshold); - -/** - * @internal - * @ingroup CAPI_NETWORK_UA_MODULE - * @brief Enables low power mode for host device. - * @since_tizen 6.5 * - * @return 0 on success, otherwise a negative error value - * @retval #UA_ERROR_NONE Successful - * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet - */ -int ua_enable_low_power_mode(void); - -/** - * @internal - * @ingroup CAPI_NETWORK_UA_MODULE - * @brief Disables low power mode for host device. - * @since_tizen 6.5 + * @exception + * @pre + * @post * - * @return 0 on success, otherwise a negative error value - * @retval #UA_ERROR_NONE Successful - * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet + * @see ua_user_set_account() */ -int ua_disable_low_power_mode(void); +int ua_user_get_account(ua_user_h user_handle, + char **account) TIZEN_DEPRECATED_API; /** - * @internal * @ingroup CAPI_NETWORK_UA_MODULE - * @brief Sets low power mode for each sensor. + * @brief Gets user handle by account. * @since_tizen 6.5 * - * @param[in] bitmask The sensor bitmask - * @param[in] on_off Low power mode enable or not - * - * @return 0 on success, otherwise a negative error value - * @retval #UA_ERROR_NONE Successful - * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet - */ -int ua_set_low_power_mode(unsigned int bitmask, bool on_off); - -/** - * @internal - * @ingroup CAPI_NETWORK_UA_MODULE - * @brief Gets the current detection parameter set for sensors. - * @since_tizen 6.5 + * @remarks The @a user_handle should not be released. + * @remarks The @a user_handle can be used only in the function. * - * @param[out] cycle Time in seconds after which user detection procedure - * (BLE scan/ARPing etc.) is repeated. - * @param[out] period Time in second for which User detection procedure is executed. - * @param[out] retries Number of retries to detect users before reporting absence. - * A non-detection count is maintained against each user. After - * each detection cycle, if presence is detected, then count is - * reset to 0 and Presence is reported. Else, the count is incremented - * and once count reaches the retries value, Absence is reported. + * @param[in] account The user account information + * @param[out] user_handle The user handle * * @return 0 on success, otherwise a negative error value * @retval #UA_ERROR_NONE Successful * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet + * + * @exception + * @pre + * @post + * */ -int ua_get_detection_params(int *cycle, int *period, int *retries); +int ua_user_get_handle_by_account(const char* account, + ua_user_h *user_handle) TIZEN_DEPRECATED_API; /** * @internal * @ingroup CAPI_NETWORK_UA_MODULE - * @brief Sets the detection parameter for sensors. Invoking this will stop any onging - * detection and set the new detection parameters and the restart detection again. + * @brief Clones user handle if application wants to store it after foreach user + * handles. It should be call before foreach callback return. * @since_tizen 6.5 * - * @param[in] cycle Time in seconds after which user detection procedure - * (BLE scan/ARPing etc.) is repeated. - * @param[in] period Time in second for which User detection procedure is executed. - * @param[in] retries Number of retries to detect users before reporting absence. - * A non-detection count is maintained against each user. After - * each detection cycle, if presence is detected, then count is - * reset to 0 and Presence is reported. Else, the count is incremented - * and once count reaches the retries value, Absence is reported. + * @remarks The @a cloned should be released using #ua_user_destroy(). + * + * @param[out] cloned The cloned device handle. + * @param[in] origin The input device handle * * @return 0 on success, otherwise a negative error value * @retval #UA_ERROR_NONE Successful * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #UA_ERROR_OUT_OF_MEMORY Out of memory * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet + * + * @exception + * @pre + * @post + * + * @see ua_foreach_users() + * @see ua_service_foreach_added_user() + * @see ua_user_destroy() */ -int ua_set_detection_params(int cycle, int period, int retries); +int ua_user_clone(ua_user_h *cloned, ua_user_h origin) TIZEN_DEPRECATED_API; /** * @internal * @ingroup CAPI_NETWORK_UA_MODULE - * @brief Sets the detection cycle parameter for service. + * @brief Gets default user handle. * @since_tizen 6.5 * - * @remarks The value will be reset to default after reboot. + * @remarks The @a user_handle should be released using #ua_user_destroy(). * - * @param[in] service Service handle for which detection cycle is getting configure. - * @param[in] cycle_time Time in seconds after which user detection procedure - * (BLE scan/ARPing etc) is repeated. Minimum value of cycle_time - * is 300 seconds, Applications to send multiplier of 300 seconds only - * in this parameter. Example : 1*300 = 300 secs, 2*300 = 600 secs etc.). + * @param[out] user_handle The user handle * * @return 0 on success, otherwise a negative error value * @retval #UA_ERROR_NONE Successful * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #UA_ERROR_OPERATION_FAILED Operation failed * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet * - * @see #UA_DETECTION_CYCLE_STEP - * @see #UA_MIN_DETECTION_CYCLE - * @see ua_get_detection_cycle() + * @exception + * @pre + * @post + * + * @see ua_user_get_account() */ -int ua_set_detection_cycle(ua_service_h service, unsigned int cycle_time); +int ua_user_get_default_user(ua_user_h *user_handle) TIZEN_DEPRECATED_API; /** * @internal * @ingroup CAPI_NETWORK_UA_MODULE - * @brief Gets the current detection cycle parameter set for particular service. + * @brief Sets account info for device handle. * @since_tizen 6.5 * - * @param[in] service Service handle for which detection cycle is getting configure. - * @param[in] cycle_time Time in second after which user detection procedure - * (BLE scan/ARPing etc.) is repeated. + * @param[in] user_handle The user handle + * @param[in] account Account information * * @return 0 on success, otherwise a negative error value * @retval #UA_ERROR_NONE Successful * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet * - * @see ua_set_detection_cycle() + * @exception + * @pre + * @post + * + * @see ua_user_get_account() */ -int ua_get_detection_cycle(ua_service_h service, unsigned int* cycle_time); +int ua_user_set_account(ua_user_h user_handle, const char *account) TIZEN_DEPRECATED_API; /** * @internal * @ingroup CAPI_NETWORK_UA_MODULE - * @brief Sets the detection window parameter for sensors. + * @brief Sets name info for user handle. * @since_tizen 6.5 * - * @remarks The value will be reset to default after reboot. - * - * @param[in] window Time in seconds for which User detection procedure is executed. - * Maximum value of window is 290 seconds, Applications to send multiplier of - * 10 seconds only in this parameter. Example : 1*10 = 10 secs, 2*10 = 20 - * secs etc.). + * @param[in] user_handle The user handle + * @param[in] name The user name information * * @return 0 on success, otherwise a negative error value * @retval #UA_ERROR_NONE Successful * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter - * - * @see #UA_DETECTION_WINDOW_STEP - * @see #UA_MAX_DETECTION_WINDOW - * @see ua_get_detection_window() * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet + * + * @exception + * @pre + * @post */ -int ua_set_detection_window(unsigned int window); +int ua_user_set_name(ua_user_h user_handle, const char *name) TIZEN_DEPRECATED_API; /** * @internal * @ingroup CAPI_NETWORK_UA_MODULE - * @brief Gets the current detection window parameter. + * @brief Removes the device ID. * @since_tizen 6.5 * - * @param[in] window Time for which User detection procedure is executed. + * @param[in] device_id The device ID. + * @param[in] mac_type The device's MAC address type. * - * @return 0 on success, otherwise a negative error value + * @return 0 on success, otherwise a negative error value * @retval #UA_ERROR_NONE Successful + * @retcal #UA_ERROR_RESOURCE_BUSY Remove done. but another service uses thie device. * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet * - * @see ua_set_detection_window() + * @exception + * @pre + * @post */ -int ua_get_detection_window(unsigned int* window); +int ua_user_remove_device_by_device_id(const char *device_id, + ua_mac_type_e mac_type) TIZEN_DEPRECATED_API; /** * @internal * @ingroup CAPI_NETWORK_UA_MODULE - * @brief Resets database. + * @brief Retrieves the user handle of all the registered users. * @since_tizen 6.5 * + * @param[in] foreach_cb Callback function to be invoked with user handle. + * @param[in] user_data The user data to be passed when callback is called. + * * @return 0 on success, otherwise a negative error value * @retval #UA_ERROR_NONE Successful + * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #UA_ERROR_OUT_OF_MEMORY Out of memory + * @retval #UA_ERROR_OPERATION_FAILED Operation failed * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet + * + * @exception + * @pre + * @post + * + * @see ua_registered_user_cb() */ -int ua_reset_database(void); +int ua_user_foreach_added(ua_registered_user_cb foreach_cb, + void *user_data) TIZEN_DEPRECATED_API; /** * @} diff --git a/include/user-awareness-private.h b/include/user-awareness-private.h index 966d847..b4481c8 100755 --- a/include/user-awareness-private.h +++ b/include/user-awareness-private.h @@ -186,6 +186,17 @@ typedef enum { UA_USER_EVENT_MAX /**< Event Max. */ } ua_user_event_e; +/** + * @ingroup CAPI_NETWORK_UA_MODULE + * @brief Enumerations of device presence state. + * @since_tizen 6.5 + */ +typedef enum { + UA_PRESENCE_STATE_INACTIVATE = 0x00, /**< User state is inactive */ + UA_PRESENCE_STATE_ACTIVATE, /**< User state is active */ + UA_PRSENCE_STATE_INVALID = 0xFF /**< User state invalid */ +} ua_presence_state_e; + /** * @brief Callback data structure. * @since_tizen 6.5 diff --git a/include/user-awareness.h b/include/user-awareness.h index fe19015..7b7f7a7 100755 --- a/include/user-awareness.h +++ b/include/user-awareness.h @@ -193,17 +193,6 @@ typedef enum { UA_MAC_TYPE_INVALID /**<