int ua_reset_database(void);
-/* Depricated API's */
+/* Deprecated API's */
/**
* @ingroup CAPI_NETWORK_UA_MODULE
const char *name,
ua_service_h *service_handle) TIZEN_DEPRECATED_API;
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Gets detection threshold info for service handle.
- * @since_tizen 6.5
- *
- * @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
- * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet
- *
- * @exception
- * @pre
- * @post
- *
- * @see ua_service_set_detection_threshold()
- */
-int ua_service_get_detection_threshold(
- ua_service_h service_handle,
- unsigned int *presence_threshold,
- unsigned int *absence_threshold) TIZEN_DEPRECATED_API;
-
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Sets name info for service handle.
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.
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.
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
- * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet
- *
- * @exception
- * @pre
- * @post
- *
- * @see ua_device_set_mac_address()
- */
-int ua_device_get_mac_address(
- ua_device_h device_handle,
- char **mac_address) TIZEN_DEPRECATED_API;
-
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Sets device ID.
ua_device_h device_handle,
const char *device_id) TIZEN_DEPRECATED_API;
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Gets device ID.
- * @since_tizen 6.5
- *
- * @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_NOT_INITIALIZED Not initialized yet
- *
- * @see ua_device_set_device_id()
- */
-int ua_device_get_device_id(
- ua_device_h device_handle,
- char **device_id) TIZEN_DEPRECATED_API;
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Gets device's Wi-Fi BSSID.
- * @since_tizen 6.5
- *
- * @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_NOT_INITIALIZED Not initialized yet
- *
- * @exception
- * @pre
- * @post
- *
- * @see ua_device_set_wifi_bssid()
- */
-int ua_device_get_wifi_bssid(
- ua_device_h device_handle,
- char **bssid) TIZEN_DEPRECATED_API;
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Gets device's Wi-Fi IPv4 address.
- * @since_tizen 6.5
- *
- * @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
- * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet
- *
- * @exception
- * @pre
- * @post
- *
- * @see ua_device_set_wifi_ipv4_address()
- */
-int ua_device_get_wifi_ipv4_address(
- ua_device_h device_handle,
- char **ipv4_address) TIZEN_DEPRECATED_API;
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Gets last presence time for device handle.
- * @since_tizen 6.5
- *
- * @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_NOT_INITIALIZED Not initialized yet
- *
- * @exception
- * @pre
- * @post
- *
- */
-int ua_device_get_last_presence(
- ua_device_h device_handle,
- unsigned long long *last_seen) TIZEN_DEPRECATED_API;
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Gets whether pairing is required for the user device.
- * @since_tizen 6.5
- *
- * @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
- * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter
- * @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet
- *
- * @exception
- * @pre
- * @post
- *
- */
-int ua_device_get_pairing_required(
- ua_device_h device_handle,
- bool *pairing_required) TIZEN_DEPRECATED_API;
-
/**
* @internal
* @ingroup CAPI_NETWORK_UA_MODULE
ua_device_h *cloned,
ua_device_h origin) TIZEN_DEPRECATED_API;
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Gets account info for user handle.
- * @since_tizen 6.5
- *
- * @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
- *
- * @exception
- * @pre
- * @post
- *
- * @see ua_user_set_account()
- */
-int ua_user_get_account(ua_user_h user_handle,
- char **account) TIZEN_DEPRECATED_API;
-
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Gets user handle by account.
ua_device_h dev_handle,
void *user_data);
-/**
- * @brief User info. data structure.
- * @since_tizen 6.5
- */
-typedef struct {
- char *account; /**< Account */
- char *name; /**< User name */
- unsigned long long last_seen ; /*last seen */
-} ua_user_information_s;
-
-/**
- * @brief Service info. data structure.
- * @since_tizen 6.5
- */
-typedef struct {
- char *name; /**< Service name */
- int presence_threshold; /**< Presence detection threshold */
- int absence_threshold; /**<Absence detection threshold */
-} ua_service_information_s;
-
-/**
- * @brief Device info data structure.
- * @since_tizen 6.5
- */
-typedef struct {
- char *device_id; /**< Mobile id (e.g. BT MAC or UUID) */
- ua_mac_type_e type; /**< Connectivity technology type using this MAC address */
- char *mac; /**< MAC address */
- ua_os_type_e os; /**< OS type */
- char *bssid; /**< BSSID */
- char *ipv4; /**< IPv4 address */
- char *ipv6; /**< IPv6 address */
- unsigned long long last_seen; /**< The time of last presence */
- int rssi; /* RSSI value for device */
- bool pairing_required; /**< Does it need pairing? */
-} ua_dev_information_s;
-
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Initializes an user awareness framework.
*/
int ua_deinitialize(void);
+/**
+ * @ingroup CAPI_NETWORK_UA_MODULE
+ * @brief Retrieves the service handle of all the added services.
+ * @since_tizen 6.5
+ *
+ * @param[in] foreach_cb Callback function to be invoked with service 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_NOT_INITIALIZED Not initialized yet
+ *
+ * @exception
+ * @pre
+ * @post
+ *
+ * @see ua_service_added_cb()
+ */
+int ua_foreach_services(
+ ua_service_added_cb foreach_cb,
+ void *user_data);
+
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Creates the ua monitor's handle.
*
* @see ua_user_add()
*/
-int ua_user_remove(
- ua_user_h user_handle);
+int ua_user_remove(ua_user_h user_handle);
/**
* @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Gets user info for user handle.
+ * @brief Gets account info for user handle.
* @since_tizen 6.5
*
- * @remarks You must release user_info.
+ * @remarks You must release @a account using g_free().
* @param[in] user_handle The user handle
- * @param[out] user_info The user information
+ * @param[out] account Account information
*
* @return 0 on success, otherwise a negative error value
* @retval #UA_ERROR_NONE Successful
*
* @see ua_user_create()
*/
-int ua_user_get_information(ua_user_h user_handle,
- ua_user_information_s **user_info);
+int ua_user_get_account(ua_user_h user_handle, char **account);
/**
* @ingroup CAPI_NETWORK_UA_MODULE
/**
* @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Gets service info for service handle.
+ * @brief Gets service handle by service name.
* @since_tizen 6.5
*
- * @remarks You must release service_info.
- * @param[in] service_handle The service handle
- * @param[out] service_info The service information
+ * @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
* @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
*
* @see ua_service_create()
*/
-int ua_service_get_information(ua_service_h service_handle,
- ua_service_information_s **service_info);
+int ua_get_service_by_name(
+ const char *name,
+ ua_service_h *service_handle);
/**
* @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Gets service handle by service name.
+ * @brief Gets name info for service handle.
* @since_tizen 6.5
*
- * @remarks The @a service_handle should be destroyed by using #ua_service_destroy().
+ * @remarks You must release @a name using g_free().
*
- * @param[in] name The service name information
- * @param[out] service_handle The service handle
+ * @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_OPERATION_FAILED Operation failed
* @retval #UA_ERROR_NOT_INITIALIZED Not initialized yet
*
* @exception
* @pre
* @post
*
- * @see ua_service_create()
+ * @see ua_service_set_name()
*/
-int ua_get_service_by_name(
- const char *name,
- ua_service_h *service_handle);
+int ua_service_get_name(
+ ua_service_h service_handle,
+ char **name);
/**
* @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Gets user handle by account.
+ * @brief Sets detection threshold for service handle.
* @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[in] service_handle The service handle
- * @param[in] account The user account information
- * @param[out] user_handle The user handle
+ * @param[in] presence_threshold The service presence threshold information
+ * @param[in] absence_threshold The service absence threshold information
*
* @return 0 on success, otherwise a negative error value
* @retval #UA_ERROR_NONE Successful
* @post
*
*/
-int ua_service_get_user_by_account(ua_service_h service_handle,
- const char* account, ua_user_h *user_handle);
+int ua_service_set_detection_threshold(
+ ua_service_h service_handle,
+ unsigned int presence_threshold,
+ unsigned int absence_threshold);
/**
* @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Sets detection threshold for service handle.
+ * @brief Gets detection threshold for service handle.
* @since_tizen 6.5
*
* @param[in] service_handle The service handle
- * @param[in] presence_threshold The service presence threshold information
- * @param[in] absence_threshold The service absence threshold information
+ * @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
* @pre
* @post
*
+ * @see ua_service_set_detection_threshold()
*/
-int ua_service_set_detection_threshold(
+int ua_service_get_detection_threshold(
ua_service_h service_handle,
- unsigned int presence_threshold,
- unsigned int absence_threshold);
+ unsigned int *presence_threshold,
+ unsigned int *absence_threshold);
+
+/**
+ * @ingroup CAPI_NETWORK_UA_MODULE
+ * @brief Sets name info for service handle.
+ * @since_tizen 6.5
+ *
+ * @param[in] service_handle The service handle
+ * @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_service_get_user_by_account(ua_service_h service_handle,
+ const char* account, ua_user_h *user_handle);
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @pre
* @post
*
- * @see ua_service_add_user()
- * @see ua_service_remove_user()
+ * @see ua_service_add_device()
+ * @see ua_service_remove_device()
*/
int ua_service_get_device_discriminant(
ua_service_h service_handle,
ua_device_h device_handle,
gboolean *discriminant);
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Retrieves the service handle of all the added services.
- * @since_tizen 6.5
- *
- * @param[in] foreach_cb Callback function to be invoked with service 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_NOT_INITIALIZED Not initialized yet
- *
- * @exception
- * @pre
- * @post
- *
- * @see ua_service_added_cb()
- */
-int ua_foreach_services(
- ua_service_added_cb foreach_cb,
- void *user_data);
-
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Retrieves the user handle of all the added users for a specific service.
int ua_device_destroy(
ua_device_h device_handle);
+/**
+ * @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
+ *
+ * @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);
+
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Sets device's operating system info.
ua_device_h device_handle,
ua_os_type_e os);
+/**
+ * @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
+ *
+ * @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);
+
+/**
+ * @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
+ * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @exception
+ * @pre
+ * @post
+ *
+ * @see ua_device_set_mac_address()
+ */
+int ua_device_get_mac_address(
+ ua_device_h device_handle,
+ char **mac_address);
+
+/**
+ * @ingroup CAPI_NETWORK_UA_MODULE
+ * @brief Gets device ID.
+ * @since_tizen 6.5
+ *
+ * @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
+ *
+ * @see ua_device_set_device_id()
+ */
+int ua_device_get_device_id(
+ ua_device_h device_handle,
+ char **device_id);
+
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Sets device's Wi-Fi BSSID.
ua_device_h device_handle,
const char *bssid);
+/**
+ * @ingroup CAPI_NETWORK_UA_MODULE
+ * @brief Gets device's Wi-Fi BSSID.
+ * @since_tizen 6.5
+ *
+ * @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
+ *
+ * @exception
+ * @pre
+ * @post
+ *
+ * @see ua_device_set_wifi_bssid()
+ */
+int ua_device_get_wifi_bssid(
+ ua_device_h device_handle,
+ char **bssid);
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Sets device's Wi-Fi IPv4 address.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Gets device info for device handle.
+ * @brief Gets device's Wi-Fi IPv4 address.
+ * @since_tizen 6.5
+ *
+ * @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
+ * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter
+ *
+ * @exception
+ * @pre
+ * @post
+ *
+ * @see ua_device_set_wifi_ipv4_address()
+ */
+int ua_device_get_wifi_ipv4_address(
+ ua_device_h device_handle,
+ char **ipv4_address);
+
+/**
+ * @ingroup CAPI_NETWORK_UA_MODULE
+ * @brief Gets last presence time for device handle.
+ * @since_tizen 6.5
+ *
+ * @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
+ *
+ * @exception
+ * @pre
+ * @post
+ *
+ */
+int ua_device_get_last_presence(
+ ua_device_h device_handle,
+ unsigned long long *last_seen);
+
+/**
+ * @ingroup CAPI_NETWORK_UA_MODULE
+ * @brief Gets whether pairing is required for the user device.
* @since_tizen 6.5
*
- * @remarks You must release device_info.
* @param[in] device_handle The device handle
- * @param[out] device_info The device information
+ * @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
*
* @see ua_device_create()
*/
-int ua_device_get_information(ua_device_h device_handle,
- ua_dev_information_s **device_info);
+int ua_device_get_pairing_required(
+ ua_device_h device_handle,
+ bool *pairing_required);
/**
* @ingroup CAPI_NETWORK_UA_MODULE
{
FUNC_ENTRY;
- UA_DEPRECATED_LOG(__FUNCTION__, "ua_device_get_information");
UA_CHECK_INIT_STATUS();
UA_VALIDATE_INPUT_PARAMETER(handle);
FUNC_ENTRY;
UA_DEPRECATED_LOG(__FUNCTION__, "");
+
UA_CHECK_INIT_STATUS();
UA_VALIDATE_INPUT_PARAMETER(device_handle);
ua_dev_info_s *device = (ua_dev_info_s *)device_handle;
{
FUNC_ENTRY;
- UA_DEPRECATED_LOG(__FUNCTION__, "ua_device_get_information");
UA_CHECK_INIT_STATUS();
UA_VALIDATE_INPUT_PARAMETER(device_handle);
UA_VALIDATE_INPUT_PARAMETER(mac_address);
{
FUNC_ENTRY;
- UA_DEPRECATED_LOG(__FUNCTION__, "ua_device_get_information");
UA_CHECK_INIT_STATUS();
UA_VALIDATE_INPUT_PARAMETER(device_handle);
UA_VALIDATE_INPUT_PARAMETER(os_info);
{
FUNC_ENTRY;
- UA_DEPRECATED_LOG(__FUNCTION__, "ua_device_get_information");
UA_CHECK_INIT_STATUS();
UA_VALIDATE_INPUT_PARAMETER(device_handle);
UA_PRINT_DEVICE_HANDLE(device_handle);
{
FUNC_ENTRY;
- UA_DEPRECATED_LOG(__FUNCTION__, "ua_device_get_information");
UA_CHECK_INIT_STATUS();
UA_VALIDATE_INPUT_PARAMETER(device_handle);
UA_VALIDATE_INPUT_PARAMETER(bssid);
{
FUNC_ENTRY;
- UA_DEPRECATED_LOG(__FUNCTION__, "ua_device_get_information");
UA_CHECK_INIT_STATUS();
UA_VALIDATE_INPUT_PARAMETER(device_handle);
UA_VALIDATE_INPUT_PARAMETER(ipv4_address);
{
FUNC_ENTRY;
- UA_DEPRECATED_LOG(__FUNCTION__, "ua_device_get_information");
UA_CHECK_INIT_STATUS();
UA_VALIDATE_INPUT_PARAMETER(device_handle);
UA_VALIDATE_INPUT_PARAMETER(timestamp);
gboolean is_registered = FALSE;
uam_device_info_s uam_device;
- UA_DEPRECATED_LOG(__FUNCTION__, "ua_device_get_information");
UA_CHECK_INIT_STATUS();
UA_VALIDATE_INPUT_PARAMETER(handle);
UA_VALIDATE_INPUT_PARAMETER(pairing_required);
FUNC_EXIT;
return UA_ERROR_NONE;
}
-
-int ua_device_get_information(ua_device_h device_handle,
- ua_dev_information_s **device_info)
-{
- FUNC_ENTRY;
- ua_dev_info_s *device = (ua_dev_info_s *)device_handle;
-
- UA_CHECK_INIT_STATUS();
- UA_VALIDATE_INPUT_PARAMETER(device_handle);
- UA_VALIDATE_INPUT_PARAMETER(device_info);
- UA_VALIDATE_HANDLE(device_handle, ua_devices_list);
- UA_PRINT_USER_HANDLE(device_handle);
-
- retv_if(NULL == device->device_id, UA_ERROR_INVALID_PARAMETER);
-
- *device_info = g_malloc0(sizeof(ua_dev_information_s));
- if (!*device_info) {
- /* LCOV_EXCL_START */
- UA_ERR("g_malloc0 failed");
- return UA_ERROR_OUT_OF_MEMORY;
- /* LCOV_EXCL_STOP */
- }
- (*device_info)->device_id = g_strdup(device->device_id);
- (*device_info)->type = device->type;
- (*device_info)->mac = g_strdup(device->mac);
- (*device_info)->os = device->os;
- (*device_info)->last_seen = device->last_seen;
- (*device_info)->bssid = g_strdup(device->bssid);
- (*device_info)->ipv4 = g_strdup(device->ipv4);
- (*device_info)->ipv6 = g_strdup(device->ipv6);
- (*device_info)->pairing_required = device->pairing_required;
- (*device_info)->rssi = device->rssi;
-
- FUNC_EXIT;
- return UA_ERROR_NONE;
-}
ua_service_info_s *service = (ua_service_info_s *)service_handle;
- UA_DEPRECATED_LOG(__FUNCTION__, "ua_service_get_information");
UA_CHECK_INIT_STATUS();
UA_VALIDATE_INPUT_PARAMETER(name);
UA_VALIDATE_INPUT_PARAMETER(service_handle);
ua_service_info_s *service = (ua_service_info_s *)service_handle;
- UA_DEPRECATED_LOG(__FUNCTION__, "ua_service_get_information");
UA_CHECK_INIT_STATUS();
UA_VALIDATE_INPUT_PARAMETER(service_handle);
UA_VALIDATE_HANDLE(service_handle, ua_services_list);
GSList *l;
ua_service_info_s *s;
- UA_DEPRECATED_LOG(__FUNCTION__, "ua_get_service_by_name");
UA_CHECK_INIT_STATUS();
+ UA_DEPRECATED_LOG(__FUNCTION__, "ua_get_service_by_name");
+
UA_VALIDATE_INPUT_PARAMETER(name);
UA_VALIDATE_INPUT_PARAMETER(service_handle);
ua_service_info_s *service = (ua_service_info_s *)service_handle;
UA_DEPRECATED_LOG(__FUNCTION__, "");
+
UA_CHECK_INIT_STATUS();
UA_VALIDATE_INPUT_PARAMETER(foreach_cb);
UA_VALIDATE_INPUT_PARAMETER(service_handle);
FUNC_EXIT;
return UA_ERROR_NONE;
}
-
-int ua_service_get_information(ua_service_h service_handle,
- ua_service_information_s **service_info)
-{
- FUNC_ENTRY;
- ua_service_info_s *service = (ua_service_info_s *)service_handle;
-
- UA_CHECK_INIT_STATUS();
- UA_VALIDATE_INPUT_PARAMETER(service_handle);
- UA_VALIDATE_INPUT_PARAMETER(service_info);
- UA_VALIDATE_HANDLE(service_handle, ua_services_list);
- UA_PRINT_USER_HANDLE(service_handle);
-
- retv_if(NULL == service->name, UA_ERROR_INVALID_PARAMETER);
-
- *service_info = g_malloc0(sizeof(ua_service_information_s));
- if (!*service_info) {
- /* LCOV_EXCL_START */
- UA_ERR("g_malloc0 failed");
- return UA_ERROR_OUT_OF_MEMORY;
- /* LCOV_EXCL_STOP */
- }
- (*service_info)->name = g_strdup(service->name);
- (*service_info)->presence_threshold = service->presence_threshold;
- (*service_info)->absence_threshold = service->absence_threshold;
-
- FUNC_EXIT;
- return UA_ERROR_NONE;
-}
return UA_ERROR_NONE;
}
-int ua_user_get_information(ua_user_h user_handle,
- ua_user_information_s **user_info)
-{
- FUNC_ENTRY;
- ua_user_info_s *user = (ua_user_info_s *)user_handle;
-
- UA_CHECK_INIT_STATUS();
- UA_VALIDATE_INPUT_PARAMETER(user_handle);
- UA_VALIDATE_INPUT_PARAMETER(user_info);
- UA_VALIDATE_HANDLE(user_handle, ua_users_list);
- UA_PRINT_USER_HANDLE(user_handle);
-
- retv_if(NULL == user->account, UA_ERROR_INVALID_PARAMETER);
-
- *user_info = g_malloc0(sizeof(ua_user_information_s));
- if (!*user_info) {
- /* LCOV_EXCL_START */
- UA_ERR("g_malloc0 failed");
- return UA_ERROR_OUT_OF_MEMORY;
- /* LCOV_EXCL_STOP */
- }
- (*user_info)->account = g_strdup(user->account);
- (*user_info)->name = g_strdup(user->name);
-
- /* TO-DO: update user last seen */
- (*user_info)->last_seen = 0;
-
- FUNC_EXIT;
- return UA_ERROR_NONE;
-}
-
int ua_user_get_account(ua_user_h user_handle, char **account)
{
FUNC_ENTRY;
ua_user_info_s *user = (ua_user_info_s *)user_handle;
- UA_DEPRECATED_LOG(__FUNCTION__, "ua_user_get_information");
UA_CHECK_INIT_STATUS();
UA_VALIDATE_INPUT_PARAMETER(user_handle);
UA_VALIDATE_INPUT_PARAMETER(account);
static void __sensor_presence_detected_device(ua_device_h device_handle)
{
int ret;
- ua_dev_information_s *device = NULL;
+ char *mac = NULL;
+ ua_mac_type_e mac_type;
- ret = ua_device_get_information(device_handle, &device);
+ ret = ua_device_get_mac_address(device_handle, &mac);
if (UA_ERROR_NONE != ret) {
- msg(" - ua_device_get_information() ret: [0x%X] [%s]",
+ msg(" - ua_device_get_mac_address() ret: [0x%X] [%s]",
+ ret, uat_get_error_str(ret));
+ }
+ ret = ua_device_get_mac_type(device_handle, &mac_type);
+ if (UA_ERROR_NONE != ret) {
+ msg(" - ua_device_get_mac_type() ret: [0x%X] [%s]",
ret, uat_get_error_str(ret));
}
msgb("[%s] Presence detected on [%s]",
- uat_convert_device_mac_type_to_txt(device->type), device->mac);
+ uat_convert_device_mac_type_to_txt(mac_type), mac);
+
+ g_free(mac);
}
static void __sensor_detected_sensor_info(int type,
msgb("\n[%s]", pbuf);
free(pbuf);
int ret;
- ua_service_information_s* service = NULL;
+ char *service_name = NULL;
- ret = ua_service_get_information(g_service_h, &service);
+ ret = ua_service_get_name(g_service_h, &service_name);
if (UA_ERROR_NONE != ret) {
- msg(" - ua_service_get_information() ret: [0x%X] [%s]",
+ msg(" - ua_service_get_name() ret: [0x%X] [%s]",
ret, uat_get_error_str(ret));
}
- msgb("Presence detected for service [%s]", service->name);
- if (service)
- g_free(service->name);
- g_free(service);
-
+ msgb("Presence detected for service [%s]", service_name);
if (UA_SENSOR_BLE == (UA_SENSOR_BLE & sensor)) {
msgb("[%s] PRESENCE detected [%s]",
msgp("\n[%s]", pbuf);
free(pbuf);
int ret;
- ua_service_information_s* service = NULL;
+ char *service_name = NULL;
- ret = ua_service_get_information(g_service_h, &service);
+ ret = ua_service_get_name(g_service_h, &service_name);
if (UA_ERROR_NONE != ret) {
- msg(" - ua_service_get_information() ret: [0x%X] [%s]",
+ msg(" - ua_service_get_name() ret: [0x%X] [%s]",
ret, uat_get_error_str(ret));
}
- msgb("Absence detected for service [%s]", service->name);
- if (service)
- g_free(service->name);
- g_free(service);
+ msgb("Absence detected for service [%s]", service_name);
if (UA_SENSOR_BLE == (UA_SENSOR_BLE & sensor)) {
msgp("[%s] ABSENCE detected [%s]",
bool _foreach_added_device_cb(
ua_device_h device_handle, void *user_data)
{
- int ret_temp;
+ int ret, ret_temp;
ua_device_h handle = NULL;
- ua_dev_information_s *device = NULL;
+
+ ua_mac_type_e mac_type = UA_MAC_TYPE_INVALID;
+ ua_os_type_e ostype = UA_OS_TYPE_NOT_DEFINE;
+ char *device_id = NULL;
+ char *mac = NULL;
+ char *wifi_bssid = NULL;
+ char *ipv4 = NULL;
+ bool required = false;
+ unsigned long long last_seen = 0;
if (!device_handle) {
msgr("device_handle is NULL");
return true;
}
+
+ ret = ua_device_clone(&handle, device_handle);
+ if (UA_ERROR_NONE != ret) {
+ msgr("ua_device_clone() result: [0x%X] [%s]",
+ ret, uat_get_error_str(ret));
+ }
+
msgb("\n[%d]", ++g_device_count);
- ret_temp = ua_device_get_information(device_handle, &device);
+ ret_temp = ua_device_get_mac_type(handle, &mac_type);
+ if (UA_ERROR_NONE == ret_temp)
+ msgb("Device MAC Type : %s", uat_get_mac_type_str(mac_type));
+
+ ret_temp = ua_device_get_os_info(handle, &ostype);
if (UA_ERROR_NONE == ret_temp) {
- msgb("Device MAC Type : %s",
- uat_get_mac_type_str(device->type));
msgb("Device OS Type : %s",
- device->os == 1 ? "Tizen" :
- device->os == 2 ? "Android" :
- device->os == 3 ? "iOS" : "N/A");
- msgb("Device ID : %s", device->device_id);
- msgb("Device MAC : %s", device->mac);
- msgb("Device BSSID : %s", device->bssid);
- msgb("Device IPv4 Addr : %s", device->ipv4);
- msgb("Pairing Required : %s",
- device->pairing_required ? "YES" : "NO");
- msgb("Last present at : %llu", device->last_seen);
+ ostype == 1 ? "Tizen" :
+ ostype == 2 ? "Android" :
+ ostype == 3 ? "iOS" : "N/A");
}
- g_device_list = g_slist_append(g_device_list, handle);
- if (device) {
- g_free(device->device_id);
- g_free(device->mac);
- g_free(device->bssid);
- g_free(device->ipv4);
- g_free(device->ipv6);
+ ret_temp = ua_device_get_device_id(handle, &device_id);
+ if (UA_ERROR_NONE == ret_temp) {
+ msgb("Device ID : %s", device_id);
+ g_free(device_id);
}
- g_free(device);
+
+ ret_temp = ua_device_get_mac_address(handle, &mac);
+ if (UA_ERROR_NONE == ret_temp) {
+ msgb("Device MAC : %s", mac);
+ g_free(mac);
+ }
+
+ ret_temp = ua_device_get_wifi_bssid(handle, &wifi_bssid);
+ if (UA_ERROR_NONE == ret_temp) {
+ msgb("Device BSSID : %s", wifi_bssid);
+ g_free(wifi_bssid);
+ }
+
+ ret_temp = ua_device_get_wifi_ipv4_address(handle, &ipv4);
+ if (UA_ERROR_NONE == ret_temp) {
+ msgb("Device IPv4 Addr : %s", ipv4);
+ g_free(ipv4);
+ }
+
+ ret_temp = ua_device_get_pairing_required(handle, &required);
+ if (UA_ERROR_NONE == ret_temp)
+ msgb("Pairing Required : %s", required ? "YES" : "NO");
+
+ ret_temp = ua_device_get_last_presence(handle, &last_seen);
+ if (UA_ERROR_NONE == ret_temp)
+ msgb("Last present at : %llu", last_seen);
+
+ g_device_list = g_slist_append(g_device_list, handle);
return true;
}
void uat_update_device_info(void)
{
int ret = UA_ERROR_NONE;
- ua_dev_information_s *device = NULL;
+ ua_mac_type_e mac_type = UA_MAC_TYPE_INVALID;
+ ua_os_type_e ostype = UA_OS_TYPE_NOT_DEFINE;
+ char *device_id = NULL;
+ char *mac = NULL;
+ char *wifi_bssid = NULL;
+ char *ipv4 = NULL;
+ bool required = false;
check_if(NULL == g_device_h);
- ret = ua_device_get_information(g_device_h, &device);
+ ret = ua_device_get_mac_type(g_device_h, &mac_type);
if (UA_ERROR_NONE == ret) {
memset(g_device_type_str, 0, MENU_DATA_SIZE + 1);
snprintf(g_device_type_str, MENU_DATA_SIZE, "%s",
- uat_get_mac_type_str(device->type));
+ uat_get_mac_type_str(mac_type));
snprintf(g_device_type, MENU_DATA_SIZE, "%d",
- uat_convert_device_type_to_idx(device->type));
- snprintf(g_os_type_str, MENU_DATA_SIZE, "%s",
- device->os == 1 ? "Tizen" :
- device->os == 2 ? "Android" :
- device->os == 3 ? "iOS" : "N/A");
+ uat_convert_device_type_to_idx(mac_type));
+ }
+
+ ret = ua_device_get_os_info(g_device_h, &ostype);
+ snprintf(g_os_type_str, MENU_DATA_SIZE, "%s",
+ ostype == 1 ? "Tizen" :
+ ostype == 2 ? "Android" :
+ ostype == 3 ? "iOS" : "N/A");
+
+ ret = ua_device_get_device_id(g_device_h, &device_id);
+ if (UA_ERROR_NONE == ret && device_id) {
memset(g_device_id_str, 0, MENU_DATA_SIZE + 1);
- memcpy(g_device_id_str, device->device_id, MENU_DATA_SIZE);
+ memcpy(g_device_id_str, device_id, MENU_DATA_SIZE);
+ g_free(device_id);
+ }
+
+ ret = ua_device_get_mac_address(g_device_h, &mac);
+ if (UA_ERROR_NONE == ret && mac) {
memset(g_mac_addr_str, 0, MENU_DATA_SIZE + 1);
- memcpy(g_mac_addr_str, device->mac, MENU_DATA_SIZE);
+ memcpy(g_mac_addr_str, mac, MENU_DATA_SIZE);
+ g_free(mac);
+ }
+
+ ret = ua_device_get_wifi_bssid(g_device_h, &wifi_bssid);
+ if (UA_ERROR_NONE == ret && wifi_bssid) {
memset(g_bss_id_str, 0, MENU_DATA_SIZE + 1);
- memcpy(g_bss_id_str, device->bssid, MENU_DATA_SIZE);
+ memcpy(g_bss_id_str, wifi_bssid, MENU_DATA_SIZE);
+ g_free(wifi_bssid);
+ }
+
+ ret = ua_device_get_wifi_ipv4_address(g_device_h, &ipv4);
+ if (UA_ERROR_NONE == ret && ipv4) {
memset(g_ipv4_address_str, 0, MENU_DATA_SIZE + 1);
- memcpy(g_ipv4_address_str, device->ipv4, MENU_DATA_SIZE);
+ memcpy(g_ipv4_address_str, ipv4, MENU_DATA_SIZE);
+ g_free(ipv4);
+ }
+
+ ret = ua_device_get_pairing_required(g_device_h, &required);
+ if (UA_ERROR_NONE == ret) {
memset(g_is_paring_required_str, 0, MENU_DATA_SIZE + 1);
memcpy(g_is_paring_required_str,
- device->pairing_required ? "YES" : "NO ", sizeof("YES"));
- }
- if (device) {
- g_free(device->device_id);
- g_free(device->mac);
- g_free(device->bssid);
- g_free(device->ipv4);
- g_free(device->ipv6);
+ required ? "YES" : "NO ", sizeof("YES"));
}
- g_free(device);
}
ret = ua_service_add_device(g_service_h, handle);
msg(" - ua_service_add_device() ret: [0x%X] [%s]",
ret, uat_get_error_str(ret));
+
+ ua_mac_type_e device_type = UA_MAC_TYPE_INVALID;
+ ret = ua_device_get_mac_type(handle, &device_type);
}
static int __create_add_device(int device_type, int ostype,
int ret = UA_ERROR_NONE;
ua_user_h handle = NULL;
- ua_user_information_s *user = NULL;
- ua_service_information_s *service = NULL;
+ char *service_name = NULL;
+ char *account = NULL;
- ret = ua_service_get_information(service_handle, &service);
+ ret = ua_service_get_name(service_handle, &service_name);
if (UA_ERROR_NONE == ret)
- msgp("Cur. Service name : %s\n", service->name);
+ msgp("Cur. Service name : %s\n", service_name);
- if (service)
- g_free(service->name);
- g_free(service);
+ g_free(service_name);
if (!user_handle) {
msgr("user_handle is NULL");
user_list = g_slist_append(user_list, handle);
idx_user++;
- ret = ua_user_get_information(handle, &user);
+ ret = ua_user_get_account(handle, &account);
if (UA_ERROR_NONE == ret) {
msglr("[%d]", idx_user);
- msglr("User account info %s", user->account);
+ msglr("User account info %s", account);
+ g_free(account);
}
- if (user) {
- g_free(user->account);
- g_free(user->name);
- }
- g_free(user);
return true;
}
static void __update_service_info(void)
{
int ret = UA_ERROR_NONE;
- ua_service_information_s *service = NULL;
+ char *name = NULL;
if (1 == g_service_count) {
if (g_service_h) {
ua_service_get_default_service(&g_service_h);
}
- ret = ua_service_get_information(g_service_h, &service);
+ ret = ua_service_get_name(g_service_h, &name);
if (UA_ERROR_NONE == ret) {
- msgp("Cur. Service name : %s\n", service->name);
memset(g_service_str, 0, MENU_DATA_SIZE + 1);
- memcpy(g_service_str, service->name, MENU_DATA_SIZE);
+ memcpy(g_service_str, name, MENU_DATA_SIZE);
+ g_free(name);
}
-
- if (service)
- g_free(service->name);
- g_free(service);
}
static void ___free_service(gpointer data)
ua_service_h service_handle, void *user_data)
{
int ret = UA_ERROR_NONE;
- ua_service_information_s *service = NULL;
+ char *name = NULL;
+ unsigned int presence_threshold = 0;
+ unsigned int absence_threshold = 0;
if (NULL == service_handle) {
msgr("service_handle is NULL");
return true;
}
- ret = ua_service_get_information(service_handle, &service);
+ ret = ua_service_get_name(service_handle, &name);
+ if (UA_ERROR_NONE != ret) {
+ msg(" - ua_service_get_name() ret: [0x%X] [%s]",
+ ret, uat_get_error_str(ret));
+ return RET_SUCCESS;
+ }
+
+ ret = ua_service_get_detection_threshold(service_handle,
+ &presence_threshold, &absence_threshold);
if (UA_ERROR_NONE != ret) {
- msg(" - ua_service_get_information() ret: [0x%X] [%s]",
+ msg(" - ua_service_get_detection_threshold() ret: [0x%X] [%s]",
ret, uat_get_error_str(ret));
+ g_free(name);
return RET_SUCCESS;
}
- msgr("[%d] %s ", ++g_service_count, service->name);
+ msgr("[%d] %s ", ++g_service_count, name);
msgr("presence threshold :[%d] absence threshold :[%d]",
- service->presence_threshold, service->absence_threshold);
+ presence_threshold, absence_threshold);
g_service_list = g_slist_append(g_service_list, service_handle);
- if (service)
- g_free(service->name);
- g_free(service);
+
+ g_free(name);
return true;
}
int ret = UA_ERROR_NONE;
int ret_temp = UA_ERROR_NONE;
ua_device_h handle = NULL;
- ua_service_information_s *service = NULL;
- ua_dev_information_s *device = NULL;
+ char *service_name = NULL;
+
+ ua_mac_type_e mac_type = UA_MAC_TYPE_INVALID;
+ ua_os_type_e ostype = UA_OS_TYPE_NOT_DEFINE;
+ char *device_id = NULL;
+ char *mac = NULL;
+ char *wifi_bssid = NULL;
+ char *ipv4 = NULL;
+ bool required = false;
+ unsigned long long last_seen = 0;
if (!service_handle) {
msgr("service_handle is NULL");
return true;
}
- ret = ua_service_get_information(service_handle, &service);
+ ret = ua_service_get_name(service_handle, &service_name);
if (UA_ERROR_NONE == ret)
- msgp("Cur. Service name : %s\n", service->name);
-
- if (service)
- g_free(service->name);
- g_free(service);
+ msgb("Cur. Service name : %s", service_name);
+ g_free(service_name);
if (!device_handle) {
msgr("device_handle is NULL");
return true;
}
+
+ ret = ua_device_clone(&handle, device_handle);
+ if (UA_ERROR_NONE != ret) {
+ msgr(" - ua_device_clone() ret: [0x%X] [%s]",
+ ret, uat_get_error_str(ret));
+ return true;
+ }
+
msgb("\n[%d]", ++g_device_count);
- ret = ua_device_get_information(g_device_h, &device);
+ ret_temp = ua_device_get_mac_type(handle, &mac_type);
+ if (UA_ERROR_NONE == ret_temp)
+ msgb("Device MAC Type : %s", uat_get_mac_type_str(mac_type));
+
+ ret_temp = ua_device_get_os_info(handle, &ostype);
if (UA_ERROR_NONE == ret_temp) {
- msgb("Device MAC Type : %s",
- uat_get_mac_type_str(device->type));
msgb("Device OS Type : %s",
- device->os == 1 ? "Tizen" :
- device->os == 2 ? "Android" :
- device->os == 3 ? "iOS" : "N/A");
- msgb("Device ID : %s", device->device_id);
- msgb("Device MAC : %s", device->mac);
- msgb("Device BSSID : %s", device->bssid);
- msgb("Device IPv4 Addr : %s", device->ipv4);
- msgb("Pairing Required : %s",
- device->pairing_required ? "YES" : "NO");
- msgb("Last present at : %llu", device->last_seen);
+ ostype == 1 ? "Tizen" :
+ ostype == 2 ? "Android" :
+ ostype == 3 ? "iOS" : "N/A");
+ }
+
+ ret_temp = ua_device_get_device_id(handle, &device_id);
+ if (UA_ERROR_NONE == ret_temp) {
+ msgb("Device ID : %s", device_id);
+ g_free(device_id);
}
- if (device) {
- g_free(device->device_id);
- g_free(device->mac);
- g_free(device->bssid);
- g_free(device->ipv4);
- g_free(device->ipv6);
+
+ ret_temp = ua_device_get_mac_address(handle, &mac);
+ if (UA_ERROR_NONE == ret_temp) {
+ msgb("Device MAC : %s", mac);
+ g_free(mac);
}
- g_free(device);
+
+ ret_temp = ua_device_get_wifi_bssid(handle, &wifi_bssid);
+ if (UA_ERROR_NONE == ret_temp) {
+ msgb("Device BSSID : %s", wifi_bssid);
+ g_free(wifi_bssid);
+ }
+
+ ret_temp = ua_device_get_wifi_ipv4_address(handle, &ipv4);
+ if (UA_ERROR_NONE == ret_temp) {
+ msgb("Device IPv4 Addr : %s", ipv4);
+ g_free(ipv4);
+ }
+
+ ret_temp = ua_device_get_pairing_required(handle, &required);
+ if (UA_ERROR_NONE == ret_temp)
+ msgb("Pairing Required : %s", required ? "YES" : "NO");
+
+ ret_temp = ua_device_get_last_presence(handle, &last_seen);
+ if (UA_ERROR_NONE == ret_temp)
+ msgb("Last present at : %llu", last_seen);
g_device_list = g_slist_append(g_device_list, handle);
static void update_user_info(void)
{
int ret = UA_ERROR_NONE;
- ua_user_information_s *user = NULL;
+ char *account = NULL;
if (0 == idx_user) {
if (g_user_h) {
ua_get_default_user(&g_user_h);
}
- ret = ua_user_get_information(g_user_h, &user);
+ ret = ua_user_get_account(g_user_h, &account);
if (UA_ERROR_NONE == ret) {
memset(g_user_account_str, 0, MENU_DATA_SIZE + 1);
- memcpy(g_user_account_str, user->account, MENU_DATA_SIZE);
+ memcpy(g_user_account_str, account, MENU_DATA_SIZE);
+ g_free(account);
}
- if (user) {
- g_free(user->account);
- g_free(user->name);
- }
- g_free(user);
}
static void ___free_users(gpointer data)
{
int ret = UA_ERROR_NONE;
ua_user_h handle = NULL;
- ua_user_information_s *user = NULL;
+ char *account = NULL;
if (!user_handle) {
msgr("user_handle is NULL");
user_list = g_slist_append(user_list, handle);
idx_user++;
- ret = ua_user_get_information(handle, &user);
+ ret = ua_user_get_account(handle, &account);
if (UA_ERROR_NONE == ret) {
msglr("[%d]", idx_user);
- msglr("User account info %s", user->account);
- }
- if (user) {
- g_free(user->account);
- g_free(user->name);
+ msglr("User account info %s", account);
+ g_free(account);
}
- g_free(user);
return true;
}
void _print_device_info(ua_device_h handle)
{
int ret;
- ua_dev_information_s *device = NULL;
+ ua_mac_type_e mac_type = UA_MAC_TYPE_INVALID;
+ ua_os_type_e ostype = UA_OS_TYPE_NOT_DEFINE;
+ char *device_id = NULL;
+ char *mac = NULL;
+ char *ipv4 = NULL;
if (NULL == handle) {
msgr("Device handle is NULL");
return;
}
- ret = ua_device_get_information(handle, &device);
+ ret = ua_device_get_mac_type(handle, &mac_type);
+ if (UA_ERROR_NONE == ret)
+ msg("Device MAC Type : %s", uat_get_mac_type_str(mac_type));
+
+ ret = ua_device_get_os_info(handle, &ostype);
+ if (UA_ERROR_NONE == ret)
+ msg("Device OS Type : %s",
+ ostype == 1 ? "Tizen" :
+ ostype == 2 ? "Android" :
+ ostype == 3 ? "iOS" : "N/A");
+
+ ret = ua_device_get_device_id(handle, &device_id);
if (UA_ERROR_NONE == ret) {
- msgb("Device MAC Type : %s",
- uat_get_mac_type_str(device->type));
- msgb("Device OS Type : %s",
- device->os == 1 ? "Tizen" :
- device->os == 2 ? "Android" :
- device->os == 3 ? "iOS" : "N/A");
- msgb("Device ID : %s", device->device_id);
- msgb("Device MAC : %s", device->mac);
- msgb("Device BSSID : %s", device->bssid);
- msgb("Device IPv4 Addr : %s", device->ipv4);
- msgb("Pairing Required : %s",
- device->pairing_required ? "YES" : "NO");
- msgb("Last present at : %llu", device->last_seen);
+ msg("Device ID : %s", device_id);
+ g_free(device_id);
}
- if (device) {
- g_free(device->device_id);
- g_free(device->mac);
- g_free(device->bssid);
- g_free(device->ipv4);
- g_free(device->ipv6);
+
+ ret = ua_device_get_mac_address(handle, &mac);
+ if (UA_ERROR_NONE == ret) {
+ msg("Device MAC : %s", mac);
+ g_free(mac);
+ }
+
+ ret = ua_device_get_wifi_ipv4_address(handle, &ipv4);
+ if (UA_ERROR_NONE == ret) {
+ msg("Device IPv4 Addr : %s", ipv4);
+ g_free(ipv4);
}
- g_free(device);
}
static void __device_added_cb(int result,
static bool _user_foreach_added_device_cb(ua_device_h device_handle,
void *user_data)
{
- ua_device_h handle = NULL;
-
if (!device_handle) {
msgr("device_handle is NULL");
return true;
}
+
msgc("\n[%d]", ++g_device_count);
_print_device_info(device_handle);
- g_device_list = g_slist_append(g_device_list, handle);
+ g_device_list = g_slist_append(g_device_list, device_handle);
return true;
}