* @{
*/
+/**
+ * @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.
+ * @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
+ *
+ * @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
+ *
+ * @exception
+ * @pre
+ * @post
+ *
+ * @see ua_user_foreach_added()
+ * @see ua_service_foreach_added_user()
+ * @see ua_user_destroy()
+ */
+int ua_user_clone(ua_user_h *cloned, ua_user_h origin);
+
+/**
+ * @internal
+ * @ingroup CAPI_NETWORK_UA_MODULE
+ * @brief Gets default user handle.
+ * @since_tizen 6.5
+ *
+ *TODO lk, shall we destroy??
+ * @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
+ *
+ * @exception
+ * @pre
+ * @post
+ *
+ * @see ua_user_get_account()
+ */
+int ua_user_get_default_user(ua_user_h *user_handle);
+
+/**
+ * @internal
+ * @ingroup CAPI_NETWORK_UA_MODULE
+ * @brief Sets account info for device handle.
+ * @since_tizen 6.5
+ *
+ * @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
+ *
+ * @exception
+ * @pre
+ * @post
+ *
+ * @see ua_user_get_account()
+ */
+int ua_user_set_account(
+ ua_user_h user_handle,
+ const char *account);
+
+/**
+ * @internal
+ * @ingroup CAPI_NETWORK_UA_MODULE
+ * @brief Sets name info for user handle.
+ * @since_tizen 6.5
+ *
+ * @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
+ *
+ * @exception
+ * @pre
+ * @post
+ */
+int ua_user_set_name(
+ ua_user_h user_handle,
+ const char *name);
+
+/**
+ * @internal
+ * @ingroup CAPI_NETWORK_UA_MODULE
+ * @brief Removes the device ID.
+ * @since_tizen 6.5
+ *
+ * @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
+ * @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
+ *
+ * @exception
+ * @pre
+ * @post
+ */
+int ua_user_remove_device_by_device_id(
+ const char *device_id,
+ ua_mac_type_e mac_type);
+
+/**
+ * @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
+ *
+ * @exception
+ * @pre
+ * @post
+ *
+ * @see ua_registered_user_cb()
+ */
+int ua_user_foreach_added(
+ ua_registered_user_cb foreach_cb,
+ void *user_data);
+
+/**
+ * @internal
+ * @ingroup CAPI_NETWORK_UA_MODULE
+ * @brief Adds device for a specific service.
+ * @since_tizen 6.5
+ *
+ * @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
+ *
+ * @exception
+ * @pre
+ * @post
+ *
+ * @see ua_service_remove_device()
+ */
+int ua_service_add_device(
+ ua_service_h service_handle,
+ ua_device_h device_handle);
+
+/**
+ * @internal
+ * @ingroup CAPI_NETWORK_UA_MODULE
+ * @brief Removes the device from a specific service handle.
+ * @since_tizen 6.5
+ *
+ * @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_OPERATION_FAILED Operation failed
+ *
+ * @exception
+ * @pre
+ * @post
+ *
+ * @see ua_service_add_device()
+ */
+int ua_service_remove_device(
+ ua_service_h service_handle,
+ ua_device_h device_handle);
+
+/**
+ * @internal
+ * @ingroup CAPI_NETWORK_UA_MODULE
+ * @brief Retrieves the device handle of all the added devices for a specific service.
+ * @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.
+ *
+ * @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_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);
+
+/**
+ * @internal
+ * @ingroup CAPI_NETWORK_UA_MODULE
+ * @brief Sets discriminant for a device.
+ * @since_tizen 6.5
+ *
+ * @param[in] device_handle The device handle
+ * @param[in] discriminant Determines whether to judge PRESENCE/ABSENCE.
+ *
+ * @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_set_discriminant(
+ ua_device_h device_handle,
+ bool discriminant);
+
+/**
+ * @internal
+ * @ingroup CAPI_NETWORK_UA_MODULE
+ * @brief Retrieves the device handle of all the registered devices for one specific user.
+ * @since_tizen 6.5
+ *
+ * @param[in] user_handle The user handle.
+ * @param[in] foreach_cb Callback function to be invoked with user 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
+ *
+ * @exception
+ * @pre
+ * @post
+ *
+ * @see ua_registered_dev_cb()
+ */
+int ua_device_foreach_added_by_user(
+ ua_user_h user_handle,
+ 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 5.5
+ * @since_tizen 6.5
*
* @param[in] handle The monitor handle
* @param[in] presence_threshold Presence threshold (Unit. Lux).
* @internal
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Enables low power mode for host device.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @return 0 on success, otherwise a negative error value
* @retval #UA_ERROR_NONE Successful
* @internal
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Disables low power mode for host device.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @return 0 on success, otherwise a negative error value
* @retval #UA_ERROR_NONE Successful
* @internal
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Sets low power mode for each sensor.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] bitmask The sensor bitmask
* @param[in] on_off Low power mode enable or not
* @internal
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Gets the current detection parameter set for sensors.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[out] cycle Time in seconds after which user detection procedure
* (BLE scan/ARPing etc.) is repeated.
* @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 5.5
+ * @since_tizen 6.5
*
* @param[in] cycle Time in seconds after which user detection procedure
* (BLE scan/ARPing etc.) is repeated.
* @internal
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Sets the detection cycle parameter for service.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The value will be reset to default after reboot.
*
* @internal
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Gets the current detection cycle parameter set for particular service.
- * @since_tizen 5.5
+ * @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
* @internal
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Sets the detection window parameter for sensors.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The value will be reset to default after reboot.
*
* @internal
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Gets the current detection window parameter.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] window Time for which User detection procedure is executed.
*
* @internal
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Resets database.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @return 0 on success, otherwise a negative error value
* @retval #UA_ERROR_NONE Successful
/**
* @brief Returns if expr is true.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
#define ret_if(expr) \
do { \
/**
* @brief Returns val if expr is true.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
#define retv_if(expr, val) \
do { \
/**
* @brief Returns error code if expr is NULL.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
#define UA_VALIDATE_INPUT_PARAMETER(arg) \
if (arg == NULL) { \
/**
* @brief Returns error code if expr is NULL.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
#define UA_IS_EXIST(arg) \
if (arg == NULL) { \
/**
* @brief Prints arg.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
#define UA_PRINT_DEVICE_HANDLE(arg) \
UA_INFO("Device Handle [%p]", #arg); \
/**
* @brief Prints arg.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
#define UA_PRINT_PAYLOAD_HANDLE(arg) \
UA_INFO("Payload Handle [%p]", #arg); \
/**
* @brief Prints arg.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
#define UA_PRINT_USER_HANDLE(arg) \
UA_INFO("User Handle [%p]", #arg); \
/**
* @brief Checks if h1 is not in the list.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
#define UA_VALIDATE_HANDLE(h1, list) \
{ \
/**
* @brief Returns true if h1 is in the list, else return false.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
#define UA_EXIST_HANDLE(h1, list) \
{ \
/**
* @brief Minimum detection window size.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
#define UA_MAX_DETECTION_WINDOW 55 /**< 55 seconds */
/**
* @brief Minimum detection cycle.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
#define UA_MIN_DETECTION_CYCLE 60 /**< 1 min */
/**
* @brief Maximum sensor values count.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
#define UA_SENSOR_MAX_VALUES 4 /**< 4 values */
/**
* @brief Default service name.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
#define UA_SERVICE_DEFAULT "ua.service.default" /**< Default service name */
+/**
+ * @brief Device's BLE payload DEVICE_UID length.
+ * @since_tizen 6.5
+ */
+#define UA_BLE_PAYLOAD_DEVICE_UID_MAX_LEN 17
+
+/**
+ * @brief The handle of payload information.
+ * @since_tizen 6.5
+ */
+typedef void *ua_payload_h;
+
/**
* @brief Event type for user event callback data structure.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
typedef enum {
UA_USER_EVENT_DEVICE_ADDED = 0, /**< Device added for a user */
/**
* @brief Callback data structure.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
typedef struct {
const void *callback; /**< Callback function pointer */
/**
* @brief Monitor data structure.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
typedef struct {
unsigned int sensor_bitmask; /**< Bit-mask for sensors which be supported */
gboolean absence_detection_started; /**< Is absence detection started */
gboolean scan_device_started; /**< Is scan device started */
int internal_presence_started; /**< Is Internally scan device started */
- ua_callback_s sensor_state_cb; /**< Callback to let apps know sensors added or not */
ua_callback_s absence_user_cb; /**< Callback to let apps know user is absence */
ua_callback_s presence_user_cb; /**< Callback to let apps know user is presence */
ua_scan_completed_cb scan_device_cb; /**< Callback to let apps know scanned registered devices */
/**
* @brief sensor info data structure.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
typedef struct {
unsigned int status; /**< Sensor status 1:PRESENCE 2:ABSENCE */
/**
* @brief User state data structure.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
typedef struct {
char *account; /**< Account */
//TODO Unused struct.
/**
* @brief Sensor state data structure.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
typedef struct {
ua_monitor_s *monitor; /**< Monitor handle */
/**
* @brief User info. data structure.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
typedef struct {
ua_user_h user_handle; /**< User handle */
gboolean isadded; /**< Is the user addition completed? */
gboolean default_user; /**< Is it a default user? */
gboolean create_by_app; /**< Did app add this user information? */
- unsigned long long last_seen; /**< The time of last presence */
} ua_user_info_s;
/**
* @brief Service info. data structure.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
typedef struct {
ua_service_h service_handle; /**< Service handle */
/**
* @brief Detection type.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
typedef enum {
UA_PRESENCE_DETECTION = 0x00, /**< Presence detcection */
/**
* @brief BLE payload data structure, used for filter.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
typedef struct {
ua_payload_h handle; /**< Payload handle */
/**
* @brief Device info data structure.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
typedef struct {
ua_user_h user; /**< User handle */
int rssi; /* RSSI value for device */
} ua_dev_info_s;
+/**
+ * @brief Callback to be invoked on absence detection for one user.
+ * @since_tizen 6.5
+ *
+ * @remarks The @a handle should not be released.
+ * @remarks The @a handle can be used only in the callback.
+ * @remarks The @a user_handle should not be released.
+ * @remarks The @a user_handle can be used only in the callback.
+ * @remarks The @a sensor_handles should not be released.
+ * @remarks The @a sensor_handles can be used only in the callback.
+ *
+ * @param[in] result The result of the requested operation.
+ * @param[in] handle The monitor handle with which absence detection start was invoked.
+ * @param[in] user_handle The user handle to detected user's information.
+ * In case monitor has more than one sensor and detection mode is not
+ * #UA_DETECT_MODE_ANY_SENSOR, sensor will be set to #UA_SENSOR_MAX before invoking
+ * callback.
+ * @param[in] sensor_handles The list of sensor handles on which user is not detected.
+ *
+ * @exception
+ * @pre
+ * @post
+ */
+typedef void (*ua_absence_user_detected_cb)(
+ int result,
+ ua_monitor_h handle,
+ ua_user_h user_handle,
+ GSList *sensor_handles,
+ void *user_data);
+
+/**
+ * @brief Callback to be invoked on presence detection for one user.
+ * @since_tizen 6.5
+ *
+ * @remarks The @a handle should not be released.
+ * @remarks The @a handle can be used only in the callback.
+ * @remarks The @a user_handle should not be released.
+ * @remarks The @a user_handle can be used only in the callback.
+ * @remarks The @a device_handles should not be released.
+ * @remarks The @a device_handles can be used only in the callback.
+ * @remarks The @a sensor_handles should not be released.
+ * @remarks The @a sensor_handles can be used only in the callback.
+ *
+ * @param[in] result The result of the requested operation.
+ * @param[in] handle The monitor handle with which presence detection start was invoked.
+ * @param[in] user_handle The user handle to detected user's information.
+ * @param[in] device_handles The list of device handles on which user is detected.
+ * @param[in] sensor_handles The list of sensor handles on which user is detected.
+ *
+ * @exception
+ * @pre
+ * @post
+ */
+typedef void (*ua_presence_user_detected_cb)(
+ int result,
+ ua_monitor_h handle,
+ ua_user_h user_handle,
+ GSList *device_handles,
+ GSList *sensor_handles,
+ void *user_data);
+
+/**
+ * @brief Callback to get all payload handles.
+ * @since_tizen 6.5
+ *
+ * @remarks The @a payload_handle should not be released.
+ * @remarks The @a payload_handle can be used only in the callback.
+ *
+ * @param[in] payload_handle The payload handle.
+ * @param[in] user_data User data passed in ua_payload_foreach_added().
+ *
+ * @exception
+ * @pre
+ * @post
+ *
+ * @see ua_payload_foreach_added()
+ */
+typedef bool (*ua_added_payload_cb)(
+ ua_payload_h payload_handle,
+ void *user_data);
+
/**
* @brief Calls the scan callback when the scan is complete.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] result Result code
* @param[in] uam_info Device information
/**
* @brief Clears data related to scan in the monitor.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] result Result code.
*
/**
* @brief Calls the presence callback when detected registerd devices.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] sensor_info Sensor info for detected sensors.
* @param[in] service Service information.
/**
* @brief Stops monitoring detection.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] svc_name Service name.
* @param[in] cycle_state Detection cycle in mid or end.
/**
* @brief Changes sensor state.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] bitmask Bitmask for sensors.
* @param[in] ready Ready or not.
/**
* @brief Calls the absence callback when detected registerd devices.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] bitmask Bitmask for sensors
* @param[in] service Service information
/**
* @brief Calls the sensor status changed callback when notified of sensor status changed.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] info Sensor information
*
/**
* @brief Destroys a monitor handle.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] data Monitor handle.
*
/**
* @brief Gets a user handle.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] account User account.
*
/**
* @brief Destroys a user handle.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] user User handle.
*
/**
* @brief Destroys a service handle.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] service Service handle.
*
*/
void _ua_clear_service_list(void);
-/**
- * @brief Create a payload handle.
- * @since_tizen 5.5
- *
- * @param[out] payload_handle Payload handle.
- *
- * @exception
- * @pre
- * @post
- *
- * @see _ua_free_ua_payload_info_s()
- */
-void _ua_create_ua_payload_info_s(ua_payload_info_s **payload_handle);
-
-/**
- * @brief Destroys a payload handle.
- * @since_tizen 5.5
- *
- * @param[in] payload Payload handle.
- *
- * @exception
- * @pre
- * @post
- *
- * @see _ua_create_ua_payload_info_s()
- */
-void _ua_free_ua_payload_info_s(gpointer data);
-
-/**
- * @brief Clears payload handle list.
- * @since_tizen 6.5
- *
- * @exception
- * @pre
- * @post
- */
-void _ua_clear_payload_list(void);
-
-/**
- * @brief Return payload handle from uam_ble_payload_s.
- * @since_tizen 5.5
- *
- * @param[in] uam_payload Payload handle.
- *
- * @return Payload handle
- * @exception
- * @pre
- * @post
- *
- * @see _ua_free_ua_payload_info_s()
- */
-ua_payload_info_s* _ua_get_payload_from_uam(uam_ble_payload_s *uam_payload);
-
-/**
- * @brief Creates payload handle of uam_ble_payload_s type from ua_payload_info_s.
- * @since_tizen 5.5
- *
- * @param[in] payload Payload handle.
- * @param[out] uam_payload Payload handle.
- *
- * @exception
- * @pre
- * @post
- */
-void _ua_get_uam_payload_from_ua(uam_ble_payload_s *uam_payload, ua_payload_info_s *payload);
-
-/**
- * @brief Returns a cloned copy of payload handle.
- * @since_tizen 5.5
- *
- * @param[in] org_payload Payload handle.
- *
- * @return Payload handle
- * @exception
- * @pre
- * @post
- */
-ua_payload_info_s* _ua_payload_clone(ua_payload_info_s *org_payload);
-
-/**
- * @brief Retrieves the payload handle of all the added payloads.
- * @since_tizen 5.5
- *
- * @param[in] foreach_cb Callback function to be invoked with payload 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
- *
- * @exception
- * @pre
- * @post
- *
- * @see ua_added_payload_cb()
- */
-int _ua_foreach_added_payload(ua_added_payload_cb foreach_cb,
- void *user_data);
-
/**
* @brief Add a device handle to internal device-list.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] dev_info Device handle.
*
/**
* @brief Gets a device handle.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] account User account.
*
/**
* @brief Destroys a device handle.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] data Device handle.
*
/**
* @brief Gets a device handle.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The returned value should not be released.
* @remarks The returned value is managed by the platform and will be released when destrying user list.
/**
* @brief Sets data in user info. state callback.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] account Account.
* @param[in] state #UA_PRESENCE_STATE_ACTIVE or #UA_PRESECE_STATE_INACTIVE.
/**
* @brief Checks whether user's detection type.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] bitmask Sensor bitmask.
*
/**
* @brief Adds a user info to the list.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] ua_info User info.
*
/**
* @brief Adds a user info to the list in ua-manager.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] uam_info User info.
*
/**
* @brief Removes a user info to the list.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] account User account.
*
/**
* @brief Adds a service info to the list.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] ua_info Service info.
*
/**
* @brief Adds a service info of initial type as uam_service_info_s to the list.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] uam_info Service info.
*
/**
* @brief Gets a service info as uam_service_info_s from the the list.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] service_name Service name.
*
/**
* @brief Removes a service info from the list.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] uam_info Service info.
*
/**
* @brief Adds a device info. to DB in ua-manager.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] result Result code.
* @param[in] uam_info Device information.
/**
* @brief Removes a device info. from DB in ua-manager.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] result Result code.
* @param[in] uam_info Device information.
/**
* @brief Callback to get the service handle.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The @a service_handle should not be released.
* @remarks The @a service_handle can be used only in the callback.
/**
* @brief Retrieves the service handle of all the registered services in ua-manager.
- * @since_tizen 5.5
+ * @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.
/**
* @brief Retrieves the service handle of all the registered services.
- * @since_tizen 5.5
+ * @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.
/**
* @brief Gets default service data.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @return 0 on success, otherwise a negative error value
* @retval #UA_ERROR_NONE Successful
/**
* @brief Callback to get the user handle added to the service.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The @a user_handle should not be released.
* @remarks The @a user_handle can be used only in the callback.
/**
* @brief Retrieves the user handle of all the registered users in ua-manager.
- * @since_tizen 5.5
+ * @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.
/**
* @brief Retrieves the user handle of all the registered users.
- * @since_tizen 5.5
+ * @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.
/**
* @brief Gets default user data.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @return 0 on success, otherwise a negative error value
* @retval #UA_ERROR_NONE Successful
/**
* @brief Gets a user handle by the account.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The returned value should not be released.
* @remarks The returned value is managed by the platform and will be released when destrying user list.
*/
ua_user_h _ua_get_user_handle_by_account(const char *account);
-/**
- * @brief set last presence time in user handle.
- * @since_tizen 5.5
- *
- * @param[in] user_handle User handle.
- * @param[in] last_seen The lastest time which updated in user handle.
- *
- * @return not null on success, otherwise error
- *
- * @exception
- * @pre
- * @post
- */
-void _ua_set_user_last_seen(ua_user_h user_handle,
- unsigned long long last_seen);
-
/**
* @brief Checks whether a device exists in device list.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] device_id The device id.
* @param[in] mac The device MAC address.
/**
* @brief Gets the service list.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The returned value should not be released.
* @remarks The returned value is managed by the platform and will be released when destroying service list.
/**
* @brief Gets the user list.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The returned value should not be released.
* @remarks The returned value is managed by the platform and will be released when destroying user list.
* @ingroup CAPI_NETWORK_UA_MODULE
* @internal
* @brief Returns changed technology type for ua-manager.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] ua_error Error code to be converted.
*
* @ingroup CAPI_NETWORK_UA_MODULE
* @internal
* @brief Converts the error code of ua-manager to the error code of user-awareness.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] ua_error Error code to be converted.
*
* @ingroup CAPI_NETWORK_UA_MODULE
* @internal
* @brief Converts the error code to a string.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The returned value can be used until return call function is valid.
*
* @ingroup CAPI_NETWORK_UA_MODULE
* @internal
* @brief Converts the tect. type used in the client-library to the type used by the ua-manager.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The returned value can be used until return call function is valid.
*
* @ingroup CAPI_NETWORK_UA_MODULE
* @internal
* @brief Converts device's tech. type enum to sensor bitmask enum.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The returned value can be used until return call function is valid.
*
* @ingroup CAPI_NETWORK_UA_MODULE
* @internal
* @brief Converts uam sensor bitmask to ua sensor bitmask enum.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The returned value can be used until return call function is valid.
*
* @ingroup CAPI_NETWORK_UA_MODULE
* @internal
* @brief Converts uam sensor info to ua sensor info.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The returned value can be used until return call function is valid.
*
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Gets sensor handle by sensor info.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The @a sensor_handle should not be released.
* @remarks The @a sensor_handle can be used only in the function.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Gets sensor handle by sensor info.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The @a sensor_handle should not be released.
* @remarks The @a sensor_handle can be used only in the function.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Releases sensor info.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] sensor_info The sensor information to be freed.
*
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Max. MAC address length.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
#define UA_MAC_ADDRESS_STRING_LEN 18
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Max. IPv4 address length.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
#define UA_IPV4_ADDRESS_STRING_LEN 16
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Max. IP address length (e.g. IPv6).
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
#define UA_IP_ADDRESS_MAX_STRING_LEN 50
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Max. device ID length (e.g. UUID).
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
#define UA_MOBILE_ID_STRING_LEN 50
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Max. user name length.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
#define UA_USER_NAME_MAX_STRING_LEN 50
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Max. user account length.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
#define UA_USER_ACCOUNT_MAX_STRING_LEN 70
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Device's BLE iBeacon advertisement length.
- * @since_tizen 5.5
- */
-#define UA_IBEACON_ADV_MAX_LEN 31
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Device's BLE payload DEVICE_UID length.
- * @since_tizen 5.5
- */
-#define UA_BLE_PAYLOAD_DEVICE_UID_MAX_LEN 17
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Device's BT mac address(payload) length.
- * @since_tizen 5.5
- */
-#define UA_BT_MAC_MAX_LEN 18
-
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Device scan time multiplier.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
#define UA_SCAN_TIME_MULTIPLIER 10
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Max. service name length.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
#define UA_MAX_SERVICE_LEN 50
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Window step multiplier.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
#define UA_DETECTION_WINDOW_STEP 5 /* 5 seconds */
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Detection cycle multiplier.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
#define UA_DETECTION_CYCLE_STEP 60 /* 1 min */
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Enumerations of UA framework error codes.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
typedef enum {
UA_ERROR_NONE = TIZEN_ERROR_NONE, /**< Successful*/
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Enumerations of UA framework supported sensors.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
typedef enum {
UA_SENSOR_BT = 0x00000001, /**< BT Sensor */
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Enumerations of UA framework user detection modes.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
typedef enum {
UA_DETECT_MODE_ALL_SENSOR = 0x01, /**< Detection mode all */
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Enumerations of User device Operating Systems.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
typedef enum {
UA_OS_TYPE_NOT_DEFINE = 0x00, /**< OS not defined */
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Enumerations of User device mac address types.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
typedef enum {
UA_MAC_TYPE_NONE = 0x00, /**< None */
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Enumerations of device presence state.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
typedef enum {
UA_PRESENCE_STATE_INACTIVATE = 0x00, /**< User state is inactive */
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Enumerations of active scan type.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
typedef enum {
UA_ACTIVE_SCAN_TYPE_DEVICE_FOUND = 0x00, /**< Device found */
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Enumerations of logical conjunction operation in between
* AND and OR user detection conditions.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
typedef enum {
UA_OR_OPERATION = 0x00, /**< AND | OR */
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Enumerations for sensor status.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
typedef enum {
UA_SENSOR_PRESENCE = 0x01, /**< Sensor reports PRESENCE status */
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief The handle of sensor information.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
typedef void *ua_sensor_h;
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief The handle of user presence/absence monitor.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
typedef void *ua_monitor_h;
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief The handle of user information.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
typedef void *ua_user_h;
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief The handle of service information.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
typedef void *ua_service_h;
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief The handle of device information.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*/
typedef void *ua_device_h;
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief The handle of payload information.
- * @since_tizen 5.5
- */
-typedef void *ua_payload_h;
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Callback to be invoked if a sensor state changed (ready <-> not ready).
- * @since_tizen 5.5
- *
- * @remarks The @a handle should not be released.
- * @remarks The @a handle can be used only in the callback.
- *
- * @param[in] ready TRUE is sensor is ready FALSE otherwise.
- * @param[in] sensor Sensor type for which state was changed.
- * @param[in] handle The monitor handle for which sensor type was added.
- * @param[in] user_data The user data passed in ua_monitor_set_sensor_state_cb().
- *
- * @exception
- * @pre
- * @post
- *
- * @see ua_monitor_set_sensor_state_cb()
- */
-typedef void (*ua_monitor_sensor_state_changed_cb)(
- bool ready,
- ua_sensor_e sensor,
- ua_monitor_h handle,
- void *user_data);
-
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Callback to be invoked if a sensor status changed (presence <-> absence)
* immediately during detection operation.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The @a handle should not be released.
* @remarks The @a handle can be used only in the callback.
* @exception
* @pre
* @post
- *
- * @see ua_monitor_set_sensor_state_cb()
*/
typedef void (*ua_sensor_status_changed_cb)(
ua_monitor_h handle,
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Callback to get all sensors for a handle.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] sensor Sensor type which is present in UA monitor.
* @param[in] user_data User data passed in ua_monitor_foreach_sensor().
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Callback to be invoked on completion scan for each device one by one.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The @a handle should not be released.
* @remarks The @a handle can be used only in the callback.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Callback to be invoked on detection of user presence.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The @a handle should not be released.
* @remarks The @a handle can be used only in the callback.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Callback to be invoked on detection of user absence.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The @a handle should not be released.
* @remarks The @a handle can be used only in the callback.
ua_sensor_h sensor_handle,
void *user_data);
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Callback to be invoked on absence detection for one user.
- * @since_tizen 5.5
- *
- * @remarks The @a handle should not be released.
- * @remarks The @a handle can be used only in the callback.
- * @remarks The @a user_handle should not be released.
- * @remarks The @a user_handle can be used only in the callback.
- * @remarks The @a sensor_handles should not be released.
- * @remarks The @a sensor_handles can be used only in the callback.
- *
- * @param[in] result The result of the requested operation.
- * @param[in] handle The monitor handle with which absence detection start was invoked.
- * @param[in] user_handle The user handle to detected user's information.
- * In case monitor has more than one sensor and detection mode is not
- * #UA_DETECT_MODE_ANY_SENSOR, sensor will be set to #UA_SENSOR_MAX before invoking
- * callback.
- * @param[in] sensor_handles The list of sensor handles on which user is not detected.
- * @param[in] user_data The user data passed in ua_monitor_set_user_absence_detected_cb()
- *
- * @exception
- * @pre
- * @post
- *
- * @see ua_monitor_set_user_absence_detected_cb()
- */
-typedef void (*ua_absence_user_detected_cb)(
- int result,
- ua_monitor_h handle,
- ua_user_h user_handle,
- GSList *sensor_handles,
- void *user_data);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Callback to be invoked on presence detection for one user.
- * @since_tizen 5.5
- *
- * @remarks The @a handle should not be released.
- * @remarks The @a handle can be used only in the callback.
- * @remarks The @a user_handle should not be released.
- * @remarks The @a user_handle can be used only in the callback.
- * @remarks The @a device_handles should not be released.
- * @remarks The @a device_handles can be used only in the callback.
- * @remarks The @a sensor_handles should not be released.
- * @remarks The @a sensor_handles can be used only in the callback.
- *
- * @param[in] result The result of the requested operation.
- * @param[in] handle The monitor handle with which presence detection start was invoked.
- * @param[in] user_handle The user handle to detected user's information.
- * @param[in] device_handles The list of device handles on which user is detected.
- * @param[in] sensor_handles The list of sensor handles on which user is detected.
- * @param[in] user_data The user data passed in ua_monitor_set_user_presence_detected_cb()
- *
- * @exception
- * @pre
- * @post
- *
- * @see ua_monitor_set_user_presence_detected_cb()
- */
-typedef void (*ua_presence_user_detected_cb)(
- int result,
- ua_monitor_h handle,
- ua_user_h user_handle,
- GSList *device_handles,
- GSList *sensor_handles,
- void *user_data);
-
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Callback to get all registered devices one by one.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The @a device_handle should not be released.
* @remarks The @a device_handle can be used only in the callback.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Callback to get all user handles.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The @a user_handle should not be released.
* @remarks The @a user_handle can be used only in the callback.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Callback to get all service handles.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The @a service_handle should not be released.
* @remarks The @a service_handle can be used only in the callback.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Callback to get the user handle added to the service.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The @a service_handle should not be released.
* @remarks The @a service_handle can be used only in the callback.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Callback to get the device handle added to the service.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The @a service_handle should not be released.
* @remarks The @a service_handle can be used only in the callback.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Initializes an user awareness framework.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @return 0 on success, otherwise a negative error value
* @retval #UA_ERROR_NONE Successful
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief De-initializes an user awareness framework.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @return 0 on success, otherwise a negative error value
* @retval #UA_ERROR_NONE Successful
*/
int ua_deinitialize(void);
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Registers the application for wakeup before dbus event.
- * @since_tizen 5.5
- *
- * @param[in] app_id Application id
- * @param[in] uid User 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_PERMITTED Operation not permitted
- *
- * @exception
- * @pre
- * @post
- *
- * @see ua_unset_app_info()
- */
-int ua_set_app_info(const char *app_id, unsigned short uid);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Unregisters an application, if it no more require wakeup to receive dbus events.
- * @since_tizen 5.5
- *
- * @param[in] app_id Application id
- * @param[in] uid User 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_PERMITTED Operation not permitted
- *
- * @exception
- * @pre
- * @post
- *
- * @see ua_set_app_info()
- */
-int ua_unset_app_info(const char *app_id, unsigned short uid);
-
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Creates the ua monitor's handle.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The @a handle should be destroyed by using #ua_monitor_destroy().
*
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Destroys the ua monitor's handle.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] handle The monitor handle
*
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Adds sensors to UA monitor for which monitoring is to be done.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] handle The monitor handle
* @param[in] sensor The sensor to be added to monitor
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Removes sensors from UA monitor.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] handle The monitor handle
* @param[in] sensor Sensor to be removed from monitor
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Retrieves all sensors present in UA monitor.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] handle The monitor handle
* @param[in] foreach_cb Callback function to be invoked foreach sensor present in monitor handle.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Checks if sensor is available or not.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] sensor The sensor for which status to be checked.
* @param[out] available TRUE if sensor is available FALSE otherwise.
ua_sensor_e sensor,
bool *available);
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Sets sensor state changed callback.
- * @since_tizen 5.5
- *
- * @param[in] handle The monitor handle
- * @param[in] callback Sensor state changed callback
- * @param[in] user_data The user data to be passed in sensor state changed callback.
- *
- * @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_monitor_unset_sensor_state_cb()
- */
-int ua_monitor_set_sensor_state_cb(
- ua_monitor_h handle,
- ua_monitor_sensor_state_changed_cb callback,
- void *user_data);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Unsets sensor state changed callback.
- * @since_tizen 5.5
- *
- * @param[in] handle The monitor handle
- *
- * @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_monitor_set_sensor_state_cb()
- */
-int ua_monitor_unset_sensor_state_cb(
- ua_monitor_h handle);
-
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Sets sensor status changed callback.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] handle The monitor handle
* @param[in] callback Sensor status changed callback
* @exception
* @pre
* @post
- *
- * @see ua_monitor_unset_sensor_state_cb()
*/
int ua_monitor_set_sensor_status_cb(
ua_monitor_h handle,
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Unsets sensor status changed callback.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] handle The monitor handle
*
* @exception
* @pre
* @post
- *
- * @see ua_monitor_set_sensor_state_cb()
*/
int ua_monitor_unset_sensor_status_cb(
ua_monitor_h handle);
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Sets absence detected callback for all users.
- * @since_tizen 5.5
- *
- * @param[in] handle The monitor handle
- * @param[in] callback Absence detected callback
- * @param[in] user_data The user data
- *
- * @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_monitor_unset_user_absence_detected_cb()
- */
-int ua_monitor_set_user_absence_detected_cb(
- ua_monitor_h handle,
- ua_absence_user_detected_cb callback,
- void *user_data);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Sets presence detected callback for all users.
- * @since_tizen 5.5
- *
- * @param[in] handle The monitor handle
- * @param[in] callback Presence detected callback
- * @param[in] user_data The user data
- *
- * @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_monitor_unset_user_presence_detected_cb()
- */
-int ua_monitor_set_user_presence_detected_cb(
- ua_monitor_h handle,
- ua_presence_user_detected_cb callback,
- void *user_data);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Unsets absence detected callback for all users.
- * @since_tizen 5.5
- *
- * @param[in] handle The monitor handle
- *
- * @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_monitor_set_user_absence_detected_cb()
- */
-int ua_monitor_unset_user_absence_detected_cb(
- ua_monitor_h handle);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Unsets presence detected callback for all users.
- * @since_tizen 5.5
- *
- * @param[in] handle The monitor handle
- *
- * @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_monitor_set_user_presence_detected_cb()
- */
-int ua_monitor_unset_user_presence_detected_cb(
- ua_monitor_h handle);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Sets user presence detected condition to UA monitor.
- * @since_tizen 5.5
- *
- * @remarks bitmask_and and bitmask_or must contain different set of sensors.
- *
- * @param[in] handle The monitor handle.
- * @param[in] bitmask_and Bitmask for sensors which will be AND operated for checking User presence.
- * @param[in] bitmask_or Bitmask for sensors which will be OR operated for checking User presence.
- * @param[in] conjunction_op Logical operator in between AND and OR user presence condition.
- *
- * @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_condition_conjunction_e
- */
-int ua_monitor_set_user_presence_condition(
- ua_monitor_h handle,
- unsigned int bitmask_and,
- unsigned int bitmask_or,
- ua_condition_conjunction_e conjunction_op);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Sets user absence detected condition to UA monitor.
- * @since_tizen 5.5
- *
- * @remarks bitmask_and and bitmask_or must contain different set of sensors.
- *
- * @param[in] handle The monitor handle.
- * @param[in] bitmask_and Bitmask for sensors which will be AND operated for checking User absence.
- * @param[in] bitmask_or Bitmask for sensors which will be OR operated for checking User absence.
- * @param[in] conjunction_op Logical operator in between AND and OR user absence condition.
- *
- * @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_condition_conjunction_e
- */
-int ua_monitor_set_user_absence_condition(
- ua_monitor_h handle,
- unsigned int bitmask_and,
- unsigned int bitmask_or,
- ua_condition_conjunction_e conjunction_op);
-
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Starts scan of registered devices.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks Only one scan can run at one time.
*
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Stops ua_monitor_start_scan_devices().
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] monitor UA monitor's handle
*
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Starts user presence detection.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks This function is not specific for any particular user's presence detection.
* Therefore, the callback will be invoked when any user is detected by sensors.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Stops user presence detection.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] monitor UA monitor's handle
*
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Starts user absence detection.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks This function is not specific for any particular user's absence detection.
* Therefore, the callback will be invoked only when no user is detected by sensors.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Stops user absence detection.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] handle The monitor handle
*
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Creates the user handle.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The @a user_handle should be destroyed by using #ua_user_destroy().
*
/**
* @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.
- * @since_tizen 5.5
+ * @brief Destroys the user handle.
+ * @since_tizen 6.5
*
- * @remarks The @a cloned should be released using #ua_user_destroy().
+ * @remarks User context will removed and all allocated memory (if any) will be released.
*
- * @param[out] cloned The cloned device handle.
- * @param[in] origin The input device handle
+ * @param[in] 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_OUT_OF_MEMORY Out of memory
*
* @exception
* @pre
* @post
*
- * @see ua_user_foreach_added()
- * @see ua_service_foreach_added_user()
- * @see ua_user_destroy()
+ * @see ua_user_create()
*/
-int ua_user_clone(
- ua_user_h *cloned, ua_user_h origin);
+int ua_user_destroy(
+ ua_user_h user_handle);
/**
* @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Destroys the user handle.
- * @since_tizen 5.5
- *
- * @remarks User context will removed and all allocated memory (if any) will be released.
+ * @brief Adds the user.
+ * @since_tizen 6.5
*
* @param[in] 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
- *
- * @exception
- * @pre
- * @post
- *
- * @see ua_user_create()
- */
-int ua_user_destroy(
- ua_user_h user_handle);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Adds the user.
- * @since_tizen 5.5
- *
- * @param[in] 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_OPERATION_FAILED Operation failed
*
* @exception
* @pre
* @post
*
* @see ua_user_remove()
- * @see ua_user_update()
*/
int ua_user_add(
ua_user_h user_handle);
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Removes the user.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] user_handle The user handle
*
* @post
*
* @see ua_user_add()
- * @see ua_user_update()
*/
int ua_user_remove(
ua_user_h user_handle);
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Updates the user.
- * @since_tizen 5.5
- *
- * @param[in] 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
- *
- * @exception
- * @pre
- * @post
- *
- * @see ua_user_add()
- * @see ua_user_remove()
- */
-int ua_user_update(
- ua_user_h user_handle);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Gets default user handle.
- * @since_tizen 5.5
- *
- *TODO lk, shall we destroy??
- * @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
- *
- * @exception
- * @pre
- * @post
- *
- * @see ua_user_get_account()
- * @see ua_user_get_name()
- */
-int ua_user_get_default_user(
- ua_user_h * user_handle);
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Sets account info for device handle.
- * @since_tizen 5.5
- *
- * @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
- *
- * @exception
- * @pre
- * @post
- *
- * @see ua_user_get_account()
- */
-int ua_user_set_account(
- ua_user_h user_handle,
- const char *account);
-
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Gets account info for user handle.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks You must release @a account using g_free().
* @param[in] user_handle The user handle
ua_user_h user_handle,
char **account);
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Sets name info for user handle.
- * @since_tizen 5.5
- *
- * @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
- *
- * @exception
- * @pre
- * @post
- *
- * @see ua_user_get_name()
- */
-int ua_user_set_name(
- ua_user_h user_handle,
- const char *name);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Gets name info for user handle.
- * @since_tizen 5.5
- *
- * @remarks You must release @a name using g_free().
- *
- * @param[in] user_handle The user handle
- * @param[out] 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
- *
- * @exception
- * @pre
- * @post
- *
- * @see ua_user_set_name()
- */
-int ua_user_get_name(
- ua_user_h user_handle,
- char **name);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Gets last presence time info for user handle.
- * @since_tizen 5.5
- *
- * @param[in] user_handle The user handle.
- * @param[out] last_seen The last presence time information for UA user.
- *
- * @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_user_get_last_presence(ua_user_h user_handle, unsigned long long *last_seen);
-
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Gets user handle by account.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The @a user_handle should not be released.
* @remarks The @a user_handle can be used only in the fuction.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Callback to be invoked if a new device added to UA.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The @a dev_handle should not be released.
* @remarks The @a dev_handle can be used only in the callback.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Adds device for a user.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] user_handle The user handle.
* @param[in] device_handle The device handle.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Removes the device handle for a user handle.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] user_handle The user handle.
* @param[in] device_handle The device handle.
ua_user_h user_handle,
ua_device_h device_handle);
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Retrieves the user handle of all the registered users.
- * @since_tizen 5.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
- *
- * @exception
- * @pre
- * @post
- *
- * @see ua_registered_user_cb()
- */
-int ua_user_foreach_added(
- ua_registered_user_cb foreach_cb,
- void *user_data);
-
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Retrieves the device handle of all the registered devices for a specific user.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] user_handle The user handle.
* @param[in] foreach_cb Callback function to be invoked with user device handle.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Creates the service handle.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The @a service_handle should be destroyed by using #ua_service_destroy().
*
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Destroys the service handle.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks Service context will removed and all allocated memory (if any) will be released.
*
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Adds the service.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] service_handle The service handle
*
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Updates the service.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] service_handle The service handle
*
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Removes the service.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] service_handle The service handle
*
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Gets default service handle.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The @a service_handle is managed by the platform and will be released
* when #ua_deinitialize() is called.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Gets service handle by service name.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The @a service_handle should be destroyed by using #ua_service_destroy().
*
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Sets detection threshold for service handle.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] service_handle The service handle
* @param[in] presence_threshold The service presence threshold information
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Gets detection threshold info for service handle.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] service_handle The service handle
* @param[out] presence_threshold The service presence threshold information
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Sets name info for service handle.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] service_handle The service handle
* @param[in] name The service name information
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Gets name info for service handle.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks You must release @a name using g_free().
*
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Adds a user for a specific service.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] service_handle The service handle.
* @param[in] user_handle The user handle.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Removes the user for the specific service handle.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] service_handle The service handle.
* @param[in] user_handle The user handle.
ua_service_h service_handle,
ua_user_h user_handle);
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Adds device for a specific service.
- * @since_tizen 5.5
- *
- * @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
- *
- * @exception
- * @pre
- * @post
- *
- * @see ua_service_remove_device()
- */
-int ua_service_add_device(
- ua_service_h service_handle,
- ua_device_h device_handle);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Removes the device from a specific service handle.
- * @since_tizen 5.5
- *
- * @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_OPERATION_FAILED Operation failed
- *
- * @exception
- * @pre
- * @post
- *
- * @see ua_service_add_device()
- */
-int ua_service_remove_device(
- ua_service_h service_handle,
- ua_device_h device_handle);
-
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Sets device discriminant for a specific service.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] service_handle The service handle.
* @param[in] device_handle The device handle.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Gets device discriminant for a specific service.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] service_handle The service handle.
* @param[in] device_handle The device handle.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Retrieves the service handle of all the added services.
- * @since_tizen 5.5
+ * @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.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Retrieves the user handle of all the added users for a specific service.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] service_handle The service handle.
* @param[in] foreach_cb Callback function to be invoked with user handle.
ua_service_added_user_cb foreach_cb,
void *user_data);
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Retrieves the device handle of all the added devices for a specific service.
- * @since_tizen 5.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.
- *
- * @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_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);
-
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Creates the device handle.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The @a device_handle should be destroyed by using #ua_user_destroy().
*
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Clones device handle if application wants to store it after foreach device
* handles. It should be call before foreach callback return.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The @a cloned should be released using #ua_device_destroy().
*
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Destroys the device handle.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks Device context will removed and all allocated memory (if any) will be released.
*
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Sets a device type info for a device.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] device_handle The device handle
* @param[in] mac_type The MAC address type of the device
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Gets device type info from the device.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] device_handle The device handle
* @param[out] mac_type The MAC address type of the device
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Sets device's operating system info.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] device_handle The device handle
* @param[in] os The device's operating system.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Gets device's operating system info.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] device_handle The device handle
* @param[out] os_info Device's operating system info.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Sets device's MAC address.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] device_handle The device handle
* @param[in] mac_address The device's MAC address.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Gets device's MAC address.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks You must release @a mac_address using g_free().
*
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Sets device ID.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] device_handle The device handle
* @param[in] device_id The device ID.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Gets device ID.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks You must release @a device_id using g_free().
* @param[in] device_handle The device handle
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Sets device's Wi-Fi BSSID.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] device_handle The device handle
* @param[in] bssid The device's Wi-Fi BSSID.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Gets device's Wi-Fi BSSID.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks You must release @a bssid using g_free().
* @param[in] device_handle The device handle
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Sets device's Wi-Fi IPv4 address.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] device_handle The device handle
* @param[in] ipv4_address The device's wifi IPv4 address.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Gets device's Wi-Fi IPv4 address.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks You must release @a ipv4_address using g_free().
*
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Gets last presence time for device handle.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] device_handle The device handle
* @param[out] last_seen The last presence time for UA device
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Gets whether pairing is required for the user device.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] device_handle The device handle
* @param[out] pairing_required TRUE if pairing is required, FALSE otherwise.
ua_device_h device_handle,
bool *pairing_required);
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Sets discriminant for a device.
- * @since_tizen 5.5
- *
- * @param[in] device_handle The device handle
- * @param[in] discriminant Determines whether to judge PRESENCE/ABSENCE.
- *
- * @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_get_discriminant()
- */
-
-int ua_device_set_discriminant(
- ua_device_h device_handle,
- bool discriminant);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Gets discriminant from the device.
- * @since_tizen 5.5
- *
- * @param[in] device_handle The device handle
- * @param[out] discriminant Determines whether to judge PRESENCE/ABSENCE.
- *
- * @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_discriminant()
- */
-int ua_device_get_discriminant(
- ua_device_h device_handle,
- bool *discriminant);
-
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Updates the device.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] device_handle The device handle
*
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Gets device handle by MAC address.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The @a device_handle should not be released.
* @remarks The @a device_handle can be used only in the function.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Gets device handle by device ID.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The @a device_handle should not be released.
* @remarks The @a device_handle can be used only in the function.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Removes the device by MAC address.
- * @since_tizen 5.5
+ * @brief Retrieves the device handle of all the registered devices.
+ * @since_tizen 6.5
*
- * @param[in] mac The device's MAC address.
+ * @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
- * @retcal #UA_ERROR_RESOURCE_BUSY Remove done. but another service uses thie device.
- * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter
- *
- * @exception
- * @pre
- * @post
- *
- * @see ua_user_remove_device_by_device_id()
- */
-int ua_user_remove_device_by_mac_address(
- const char *mac);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Removes the device ID.
- * @since_tizen 5.5
- *
- * @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
- * @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_OUT_OF_MEMORY Out of memory
*
* @exception
* @pre
* @post
*
- * @see ua_user_remove_device_by_mac_address()
- */
-int ua_user_remove_device_by_device_id(
- const char *device_id,
- ua_mac_type_e mac_type);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Retrieves the device handle of all the registered devices.
- * @since_tizen 5.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
- *
- * @exception
- * @pre
- * @post
- *
- * @see ua_registered_dev_cb()
+ * @see ua_registered_dev_cb()
*/
int ua_device_foreach_added(
ua_registered_dev_cb foreach_cb,
void *user_data);
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Retrieves the device handle of all the registered devices for one specific user.
- * @since_tizen 5.5
- *
- * @param[in] user_handle The user handle.
- * @param[in] foreach_cb Callback function to be invoked with user 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
- *
- * @exception
- * @pre
- * @post
- *
- * @see ua_registered_dev_cb()
- */
-int ua_device_foreach_added_by_user(
- ua_user_h user_handle,
- ua_registered_dev_cb foreach_cb,
- void *user_data);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Creates the payload handle.
- * @since_tizen 5.5
- *
- * @remarks The @a payload_handle should be destroyed by using #ua_payload_destroy().
- *
- * @param[out] payload_handle The payload 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
- *
- * @exception
- * @pre
- * @post
- *
- * @see ua_payload_destroy()
- */
-int ua_payload_create(
- ua_payload_h *payload_handle);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Clones payload handle if application wants to store it after foreach user
- * handles. It should be call before foreach callback return.
- * @since_tizen 5.5
- *
- * @remarks The @a cloned should be released using #ua_payload_destroy().
- *
- * @param[out] cloned The cloned payload handle.
- * @param[in] origin The input payload 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
- *
- * @exception
- * @pre
- * @post
- *
- * @see ua_payload_add()
- * @see ua_payload_add_service()
- * @see ua_payload_destroy()
- */
-int ua_payload_clone(
- ua_payload_h *cloned, ua_payload_h origin);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Destroys the payload handle.
- * @since_tizen 5.5
- *
- * @remarks Payload context will removed and all allocated memory (if any) will be released.
- *
- * @param[in] payload_handle The payload handle
- *
- * @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_payload_create()
- */
-int ua_payload_destroy(
- ua_payload_h payload_handle);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Sets BLE payload primary_key for device.
- * @since_tizen 5.5
- *
- * @param[in] handle The payload handle.
- * @param[in] primary_key The BLE payload primary_key.
- *
- * @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_payload_get_primary_key()
- */
-int ua_payload_set_primary_key(
- ua_payload_h handle,
- const char primary_key);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Sets BLE payload device_icon for device.
- * @since_tizen 5.5
- *
- * @param[in] handle The payload handle.
- * @param[in] device_icon The BLE payload device_icon.
- *
- * @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_payload_get_device_icon()
- */
-int ua_payload_set_device_icon(
- ua_payload_h handle,
- const char device_icon);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Sets BLE payload secondary_key for device.
- * @since_tizen 5.5
- *
- * @param[in] handle The payload handle.
- * @param[in] secondary_key The BLE payload secondary_key.
- *
- * @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_payload_get_secondary_key()
- */
-int ua_payload_set_secondary_key(
- ua_payload_h handle,
- const char secondary_key);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Sets BLE payload DEVICE_UID for device.
- * @since_tizen 5.5
- *
- * @remarks The @a device_uid is expected to be exact 17 bytes long data
- * and may have intermediate NULLs
- *
- * @param[in] handle The payload handle.
- * @param[in] device_uid_len The BLE payload DEVICE_UID's length.
- * @param[in] device_uid The BLE payload DEVICE_UID.
- *
- * @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_payload_get_device_uid()
- */
-int ua_payload_set_device_uid(
- ua_payload_h handle,
- unsigned int device_uid_len,
- const char *device_uid);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Sets iBeacon adevertising data.
- * @since_tizen 5.5
- *
- * @param[in] adv_len The iBeacon adevertising data's length.
- * @param[in] ibeacon_adv The iBeacon adevertising data.
- *
- * @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_add_ibeacon_adv_data(
- unsigned int adv_len,
- const char *ibeacon_adv);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Gets device's BLE payload primary_key.
- * @since_tizen 5.5
- *
- * @param[in] handle The payload handle.
- * @param[out] primary_key The BLE payload primary_key.
- *
- * @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_payload_set_primary_key()
- */
-int ua_payload_get_primary_key(
- ua_payload_h handle,
- char *primary_key);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Gets device's BLE payload device_icon.
- * @since_tizen 5.5
- *
- * @param[in] handle The payload handle.
- * @param[out] device_icon The BLE payload device_icon.
- *
- * @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_payload_set_device_icon()
- */
-int ua_payload_get_device_icon(
- ua_payload_h handle,
- char *device_icon);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Gets device's BLE payload secondary_key.
- * @since_tizen 5.5
- *
- * @param[in] handle The payload handle.
- * @param[out] secondary_key The BLE payload secondary_key.
- *
- * @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_payload_set_secondary_key()
- */
-int ua_payload_get_secondary_key(
- ua_payload_h handle,
- char *secondary_key);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Gets device's BLE payload user_data.
- * @since_tizen 5.5
- *
- * @remarks You must release @a user_data using g_free()
- *
- * @param[in] handle The payload handle.
- * @param[out] user_data The BLE payload user_data.
- *
- * @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_payload_get_user_data(
- ua_payload_h handle,
- char **user_data);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Gets device's BLE payload DEVICE_UID length.
- * @since_tizen 5.5
- *
- * @param[in] handle The payload handle.
- * @param[out] device_uid_len The BLE payload DEVICE_UID length.
- *
- * @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_payload_get_device_uid_len(
- ua_payload_h handle,
- int *device_uid_len);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Gets device's BLE payload DEVICE_UID.
- * @since_tizen 5.5
- *
- * @remarks You must release @a device_uid using g_free().
- *
- * @param[in] handle The payload handle.
- * @param[out] device_uid The BLE payload DEVICE_UID.
- *
- * @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_payload_set_device_uid()
- */
-int ua_payload_get_device_uid(
- ua_payload_h handle,
- char **device_uid);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Adds device's payload.
- * @since_tizen 5.5
- *
- * @param[in] payload_handle The payload 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
- *
- * @exception
- * @pre
- * @post
- *
- */
-int ua_payload_add(
- ua_payload_h payload_handle,
- ua_device_h device_handle);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Adds device's payload to a service.
- * @since_tizen 5.5
- *
- * @param[in] payload_handle The payload handle.
- * @param[in] 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
- *
- * @exception
- * @pre
- * @post
- *
- */
-int ua_payload_add_service(
- ua_payload_h payload_handle,
- ua_service_h service_handle);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Callback to get all payload handles.
- * @since_tizen 5.5
- *
- * @remarks The @a payload_handle should not be released.
- * @remarks The @a payload_handle can be used only in the callback.
- *
- * @param[in] payload_handle The payload handle.
- * @param[in] user_data User data passed in ua_payload_foreach_added().
- *
- * @exception
- * @pre
- * @post
- *
- * @see ua_payload_foreach_added()
- */
-typedef bool (*ua_added_payload_cb)(
- ua_payload_h payload_handle,
- void *user_data);
-
-/**
- * @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Retrieves the payload handle of all the registered payloads.
- * @since_tizen 5.5
- *
- * @param[in] foreach_cb Callback function to be invoked with payload 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
- *
- * @exception
- * @pre
- * @post
- *
- * @see ua_added_payload_cb()
- */
-int ua_payload_foreach_added(
- ua_added_payload_cb foreach_cb,
- void *user_data);
-
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Gets sensor's status.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] sensor_handle The sensor handle
* @param[out] status The sensor's status.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Gets sensor's timestamp.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] sensor_handle The sensor handle
* @param[out] timestamp The sensor's timestamp.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Gets sensor's bitmask.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] sensor_handle The sensor handle
* @param[out] bitmask The sensor's bitmask.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Gets sensor's information values count.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @param[in] sensor_handle The sensor handle
* @param[out] info_count The sensor's information count.
/**
* @ingroup CAPI_NETWORK_UA_MODULE
* @brief Gets sensor's information values.
- * @since_tizen 5.5
+ * @since_tizen 6.5
*
* @remarks The @a info_values should not be released.
* @remarks The returned value is available until sensor_handle is released.
ua_mac_type_e dev_type;
UA_DBG("Add device result [%s]", _ua_get_error_string(result));
- ret_if (!uam_info);
+ ret_if(!uam_info);
/* Get device type */
dev_type = _to_ua_mac_type(uam_info->type);
return UA_ERROR_NONE;
}
-int ua_device_get_discriminant(
- ua_device_h device_handle,
- bool *discriminant)
-{
- FUNC_ENTRY;
-
- UA_CHECK_INIT_STATUS();
- UA_VALIDATE_INPUT_PARAMETER(device_handle);
- UA_VALIDATE_INPUT_PARAMETER(discriminant);
- UA_PRINT_DEVICE_HANDLE(device_handle);
- ua_dev_info_s *device = (ua_dev_info_s *)device_handle;
-
- *discriminant = device->discriminant;
-
- FUNC_EXIT;
- return UA_ERROR_NONE;
-}
-
int ua_device_get_last_presence(
ua_device_h device_handle,
unsigned long long *timestamp)
_ua_clear_user_list();
_ua_clear_device_list();
_ua_clear_sensor_list();
- _ua_clear_payload_list();
}
/* LCOV_EXCL_START */
event_data->cycle_state);
break;
}
- case UAM_EVENT_SENSOR_STATE_READY: {
- unsigned int *sensor_bitmask = event_param->data;
-
- ret_if(NULL == sensor_bitmask);
-
- _ua_monitor_handle_sensor_state(*sensor_bitmask, TRUE);
- break;
- }
- case UAM_EVENT_SENSOR_STATE_NOT_READY: {
- unsigned int *sensor_bitmask = event_param->data;
-
- ret_if(NULL == sensor_bitmask);
- ret_if(0 == *sensor_bitmask);
-
- _ua_monitor_handle_sensor_state(*sensor_bitmask, FALSE);
- break;
- }
case UAM_EVENT_USER_ADDED: {
uam_user_info_s *event_data = NULL;
if (device_handle)
user_state->found_devices = g_slist_prepend(user_state->found_devices,
device_handle);
-
- ua_user_h user_handle = _ua_get_user_handle_by_account(user_state->account);
- _ua_set_user_last_seen(user_handle, last_seen);
}
if (!monitor->presence_detection_started) {
FUNC_EXIT;
}
-void _ua_monitor_handle_sensor_state(unsigned int bitmask, gboolean ready)
-{
- FUNC_ENTRY;
- ua_sensor_e sensor_type;
- GSList *l;
-
- sensor_type = _uam_to_ua_sensor(bitmask);
- for (l = ua_monitor_list; l; l = g_slist_next(l)) {
- ua_monitor_s *monitor = l->data;
-
- if (!monitor)
- continue;
-
- if (monitor->sensor_state_cb.callback)
- ((ua_monitor_sensor_state_changed_cb)monitor->sensor_state_cb.callback)(
- (bool)ready, sensor_type, (ua_monitor_h)monitor,
- monitor->sensor_state_cb.user_data);
- }
- FUNC_EXIT;
-}
-
void _ua_monitor_handle_sensor_status_changed(uam_sensor_info_s *info)
{
FUNC_ENTRY;
if (monitor->sensor_status_cb.callback)
((ua_sensor_status_changed_cb)monitor->sensor_status_cb.callback)(
(ua_monitor_h)monitor, (ua_sensor_h)sensor_info,
- monitor->sensor_state_cb.user_data);
+ monitor->sensor_status_cb.user_data);
}
_ua_free_sensor_info(sensor_info);
return UA_ERROR_NONE;
}
-int ua_monitor_set_sensor_state_cb(ua_monitor_h handle,
- ua_monitor_sensor_state_changed_cb callback, void *user_data)
-{
- FUNC_ENTRY;
- ua_monitor_s *monitor = (ua_monitor_s *)handle;
-
- UA_CHECK_INIT_STATUS();
- UA_VALIDATE_INPUT_PARAMETER(callback);
- UA_VALIDATE_INPUT_PARAMETER(handle);
- UA_VALIDATE_HANDLE(handle, ua_monitor_list);
-
- monitor->sensor_state_cb.callback = callback;
- monitor->sensor_state_cb.user_data = user_data;
-
- FUNC_EXIT;
- return UA_ERROR_NONE;
-}
-
-int ua_monitor_unset_sensor_state_cb(ua_monitor_h handle)
-{
- FUNC_ENTRY;
- ua_monitor_s *monitor = (ua_monitor_s *)handle;
-
- UA_CHECK_INIT_STATUS();
- UA_VALIDATE_INPUT_PARAMETER(handle);
- UA_VALIDATE_HANDLE(handle, ua_monitor_list);
-
- monitor->sensor_state_cb.callback = NULL;
- monitor->sensor_state_cb.user_data = NULL;
-
- FUNC_EXIT;
- return UA_ERROR_NONE;
-}
-
-int ua_monitor_set_user_absence_detected_cb(ua_monitor_h handle,
- ua_absence_user_detected_cb callback, void *user_data)
-{
- FUNC_ENTRY;
- ua_monitor_s *monitor = (ua_monitor_s *)handle;
-
- UA_CHECK_INIT_STATUS();
- UA_VALIDATE_INPUT_PARAMETER(callback);
- UA_VALIDATE_INPUT_PARAMETER(handle);
- UA_VALIDATE_HANDLE(handle, ua_monitor_list);
-
- if (monitor->absence_user_cb.callback != NULL) {
- FUNC_EXIT;
- return UA_ERROR_INVALID_PARAMETER;
- }
-
- monitor->absence_user_cb.callback = callback;
- monitor->absence_user_cb.user_data = user_data;
-
- if (monitor->absence_detection_started && !monitor->internal_presence_started &&
- !monitor->presence_detection_started)
- __ua_start_monitoring(monitor->sensor_bitmask, monitor->service, UA_PRESENCE_DETECTION);
-
- __ua_monitor_internal_presence_ref(monitor);
-
- FUNC_EXIT;
- return UA_ERROR_NONE;
-}
-
-int ua_monitor_set_user_presence_detected_cb(ua_monitor_h handle,
- ua_presence_user_detected_cb callback, void *user_data)
-{
- FUNC_ENTRY;
- ua_monitor_s *monitor = (ua_monitor_s *)handle;
-
- UA_CHECK_INIT_STATUS();
- UA_VALIDATE_INPUT_PARAMETER(callback);
- UA_VALIDATE_INPUT_PARAMETER(handle);
- UA_VALIDATE_HANDLE(handle, ua_monitor_list);
-
- monitor->presence_user_cb.callback = callback;
- monitor->presence_user_cb.user_data = user_data;
-
- FUNC_EXIT;
- return UA_ERROR_NONE;
-}
-
-int ua_monitor_unset_user_absence_detected_cb(ua_monitor_h handle)
-{
- FUNC_ENTRY;
- ua_monitor_s *monitor = (ua_monitor_s *)handle;
-
- UA_CHECK_INIT_STATUS();
- UA_VALIDATE_INPUT_PARAMETER(handle);
- UA_VALIDATE_HANDLE(handle, ua_monitor_list);
-
- if (monitor->absence_user_cb.callback == NULL) {
- FUNC_EXIT;
- return UA_ERROR_NONE;
- }
-
- monitor->absence_user_cb.callback = NULL;
- monitor->absence_user_cb.user_data = NULL;
-
- __ua_monitor_internal_presence_unref(monitor);
-
- if (!monitor->internal_presence_started && !monitor->presence_detection_started) {
- if (monitor->service)
- __ua_stop_monitoring(monitor->sensor_bitmask,
- monitor->service, UA_PRESENCE_DETECTION);
- }
-
- FUNC_EXIT;
- return UA_ERROR_NONE;
-}
-
-int ua_monitor_unset_user_presence_detected_cb(ua_monitor_h handle)
-{
- FUNC_ENTRY;
- ua_monitor_s *monitor = (ua_monitor_s *)handle;
-
- UA_CHECK_INIT_STATUS();
- UA_VALIDATE_INPUT_PARAMETER(handle);
- UA_VALIDATE_HANDLE(handle, ua_monitor_list);
-
- monitor->presence_user_cb.callback = NULL;
- monitor->presence_user_cb.user_data = NULL;
-
- FUNC_EXIT;
- return UA_ERROR_NONE;
-}
-
int ua_monitor_set_user_presence_condition(
ua_monitor_h handle,
unsigned int bitmask_and,
FUNC_EXIT;
return UA_ERROR_NONE;
}
-
-int ua_add_ibeacon_adv_data(
- unsigned int adv_len,
- const char *ibeacon_adv)
-{
- FUNC_ENTRY;
- int ret;
-
- UA_CHECK_INIT_STATUS();
- UA_VALIDATE_INPUT_PARAMETER(ibeacon_adv);
- retv_if(!adv_len || adv_len > UA_IBEACON_ADV_MAX_LEN, UA_ERROR_INVALID_PARAMETER);
-
- ret = _ua_get_error_code(_uam_add_ibeacon_adv_data(adv_len, ibeacon_adv));
- if (UA_ERROR_NONE != ret) {
- UA_ERR("_uam_add_ibeacon_adv_data returned %s",
- _ua_get_error_string(ret));
- return ret;
- }
-
- FUNC_EXIT;
- return UA_ERROR_NONE;
-}
/* LCOV_EXCL_STOP */
return NULL;
}
-void _ua_set_user_last_seen(ua_user_h user_handle,
- unsigned long long last_seen)
-{
- FUNC_ENTRY;
- ua_user_info_s *user = (ua_user_info_s *)user_handle;
-
- if (user == NULL) {
- UA_INFO("user_handle is NULL");
- FUNC_EXIT;
- return;
- }
-
- user->last_seen = last_seen;
-
- FUNC_EXIT;
-}
-
int _ua_intr_foreach_registered_users(_ua_intr_registered_user_cb foreach_cb,
void *user_data)
{
}
user->state = UA_PRSENCE_STATE_INVALID;
user->account = NULL;
- user->last_seen = 0;
/* Add user to list of users*/
*user_handle = (ua_user_h)user;
user_dst->isadded = user_src->isadded;
user_dst->default_user = user_src->default_user;
user_dst->create_by_app = user_src->create_by_app;
- user_dst->last_seen = user_src->last_seen;
user_dst->name = g_strdup(user_src->name);
if (!user_dst->name) {
return UA_ERROR_NONE;
}
-int ua_user_update(ua_user_h user_handle)
-{
- FUNC_ENTRY;
- int ret;
- uam_user_info_s uam_user;
-
- UA_CHECK_INIT_STATUS();
- ua_user_info_s *user = (ua_user_info_s *)user_handle;
- UA_IS_EXIST(_ua_get_user_from_list(user->account));
-
- memset(&uam_user, 0, sizeof(uam_user_info_s));
- g_strlcpy(uam_user.account, user->account, UAM_USER_ACCOUNT_MAX_STRING_LEN);
- g_strlcpy(uam_user.name, user->name, UAM_USER_NAME_MAX_STRING_LEN);
-
- ret = _ua_get_error_code(_uam_update_user(&uam_user));
- if (UA_ERROR_NONE != ret) {
- /* LCOV_EXCL_START */
- UA_ERR("Failed with error: %s(0x%X)",
- _ua_get_error_string(ret), ret);
- return ret;
- /* LCOV_EXCL_STOP */
- }
-
- FUNC_EXIT;
- return UA_ERROR_NONE;
-}
-
-int ua_user_get_default_user(ua_user_h* user_handle)
+int ua_user_get_default_user(ua_user_h *user_handle)
{
FUNC_ENTRY;
int ret;
return UA_ERROR_NONE;
}
-int ua_user_get_name(
- ua_user_h user_handle,
- char **name)
-{
- 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(name);
- UA_PRINT_USER_HANDLE(user_handle);
-
- retv_if(NULL == user->name, UA_ERROR_INVALID_PARAMETER);
-
- *name = g_strdup(user->name);
-
- if (*name == NULL) {
- /* LCOV_EXCL_START */
- UA_ERR("g_malloc0 failed");
- return UA_ERROR_OUT_OF_MEMORY;
- /* LCOV_EXCL_STOP */
- }
-
- FUNC_EXIT;
- return UA_ERROR_NONE;
-}
-
-int ua_user_get_last_presence(ua_user_h user_handle, unsigned long long *last_seen)
-{
- 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(last_seen);
- UA_PRINT_USER_HANDLE(user_handle);
-
- /* TO-DO: update user list from uam_api for latest timestamp */
-
- *last_seen = user->last_seen;
-
- FUNC_EXIT;
- return UA_ERROR_NONE;
-}
-
int ua_user_set_name(
ua_user_h user_handle,
const char *name)
return UA_ERROR_NONE;
}
-int ua_user_remove_device_by_mac_address(const char *mac)
-{
- FUNC_ENTRY;
- int ret;
-
- UA_CHECK_INIT_STATUS();
- UA_VALIDATE_INPUT_PARAMETER(mac);
- ret = _ua_get_error_code(_uam_request_remove_device_by_mac(mac));
-
- if (UA_ERROR_NONE != ret) {
- UA_ERR("Failed with error: %s(0x%X)",
- _ua_get_error_string(ret), ret);
- return ret;
- }
-
- FUNC_EXIT;
- return UA_ERROR_NONE;
-}
-
int ua_user_remove_device_by_device_id(const char *device_id,
ua_mac_type_e mac_type)
{
FUNC_EXIT;
return UA_ERROR_NONE;
}
-
-int ua_sensor_get_info_count(
- ua_sensor_h sensor_handle,
- int *count)
-{
- FUNC_ENTRY;
- ua_sensor_info_s *sensor;
-
- UA_VALIDATE_INPUT_PARAMETER(sensor_handle);
- UA_INFO("Sensor Handle [%p]", sensor_handle);
- sensor = (ua_sensor_info_s *)sensor_handle;
-
- *count = sensor->count;
-
- FUNC_EXIT;
- return UA_ERROR_NONE;
-}
-
-int ua_sensor_get_info_values(
- ua_sensor_h sensor_handle, GSList **info_values)
-{
- FUNC_ENTRY;
- unsigned int i = 0;
- GSList *values = NULL;
- ua_sensor_info_s *sensor;
-
- if (!sensor_handle)
- return UA_ERROR_INVALID_PARAMETER;
-
- UA_INFO("Sensor Handle [%p]", sensor_handle);
- sensor = (ua_sensor_info_s *)sensor_handle;
-
- if (!sensor->values)
- return UA_ERROR_NO_DATA;
-
- for (i = 0; i < UA_SENSOR_MAX_VALUES; i++)
- values = g_slist_append(values, &sensor->values[i]);
-
- FUNC_EXIT;
- *info_values = values;
- return UA_ERROR_NONE;
-}
uat-sensors.c
uat-service.c
uat-detections.c
- uat-payload.c
uat-scenarios.c
)
#include "uat-common.h"
#define CASE_TO_STR(x) case x: return #x;
+#define UA_BLE_PAYLOAD_DEVICE_UID_MAX_LEN 17
const char* uat_get_error_str(int err)
{
int _uat_user_create();
int _uat_monitor_create();
-int _uat_monitor_set_sensor_state_cb();
int _uat_monitor_set_sensor_status_cb();
-int _uat_monitor_set_user_presence_detected_cb();
-int _uat_monitor_set_user_absence_detected_cb();
void _print_device_info(ua_device_h handle);
void _sensor_presence_detected_cb(int result, ua_monitor_h monitor,
static char cycle_time[MENU_DATA_SIZE + 1] = {"900", }; /**< cycle time */
static char window[MENU_DATA_SIZE + 1] = {"55", }; /**< Detection window */
-static char g_presence_and_cond[MENU_DATA_SIZE + 1] = {"16",}; /**< PRESENCE AND condition */
-static char g_presence_or_cond[MENU_DATA_SIZE + 1] = {"6",}; /**< PRESENCE OR condition */
-static char g_presence_conjunction_op[MENU_DATA_SIZE + 1] = {"1",}; /**< logical conjunction operation */
-static char g_absence_and_cond[MENU_DATA_SIZE + 1] = {"6",}; /**< ABSENCE AND condition */
-static char g_absence_or_cond[MENU_DATA_SIZE + 1] = {"16",}; /**< ABSENCE OR condition */
-static char g_absence_conjunction_op[MENU_DATA_SIZE + 1] = {"0",}; /**< logical conjunction operation */
-
static char g_presence_type[MENU_DATA_SIZE + 1] = "2"; /**< Selected PRESENCE type */
static char g_absence_type[MENU_DATA_SIZE + 1] = "2"; /**< Selected ABSENCE type */
static char g_scan_time_multiplier[MENU_DATA_SIZE + 1] = {0,}; /**< 10ms * what number */
ua_sensor_e sensor, ua_sensor_h sensor_handle)
{
int ret;
- double *value;
- GSList *l = 0;
- int info_count = 0;
- GSList *values = NULL;
unsigned long long timestamp;
- char buf[MENU_DATA_SIZE] = {0, };
- char final_buf[MENU_DATA_SIZE * 4] = {0, };
ret = ua_sensor_get_timestamp(sensor_handle, ×tamp);
if (UA_ERROR_NONE != ret) {
ret, uat_get_error_str(ret));
}
- ret = ua_sensor_get_info_count(sensor_handle, &info_count);
- if (UA_ERROR_NONE != ret) {
- msg(" - ua_sensor_get_info_count() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
- }
-
- ret = ua_sensor_get_info_values(sensor_handle, &values);
- if (UA_ERROR_NONE != ret)
- msg(" - ua_sensor_get_info_values() failed");
-
- for (l = values; l; l = g_slist_next(l)) {
- value = (double *)l->data;
- snprintf(buf, MENU_DATA_SIZE, "%lF ", *value);
- strncat(final_buf, buf, sizeof(buf) - strlen(buf) - 1);
- memset(buf, 0, MENU_DATA_SIZE);
- }
-
if (UAT_PRESENCE == type)
- msgb("[%s] timestamp [%llu] value [%s]",
- uat_get_sensor_bitmask_str(sensor), timestamp, final_buf);
+ msgb("[%s] timestamp [%llu]",
+ uat_get_sensor_bitmask_str(sensor), timestamp);
else
- msgp("[%s] timestamp [%llu] value [%s]",
- uat_get_sensor_bitmask_str(sensor), timestamp, final_buf);
-
- g_slist_free(values);
+ msgp("[%s] timestamp [%llu]",
+ uat_get_sensor_bitmask_str(sensor), timestamp);
}
void _sensor_presence_detected_cb(int result, ua_monitor_h monitor,
return RET_SUCCESS;
}
-static int run_ua_monitor_set_user_presence_condition(
- MManager *mm, struct menu_data *menu)
-{
- int ret = UA_ERROR_NONE;
- unsigned int bitmask_and = 0;
- unsigned int bitmask_or = 0;
- unsigned int op_value = 1;
- ua_condition_conjunction_e conjunction_op = UA_AND_OPERATION;
-
- msg("ua_monitor_set_user_presence_condition");
-
- if (strlen(g_presence_and_cond))
- bitmask_and = (unsigned int)strtol(g_presence_and_cond, NULL, 10);
- if (strlen(g_presence_or_cond))
- bitmask_or = (unsigned int)strtol(g_presence_or_cond, NULL, 10);
- if (strlen(g_presence_conjunction_op))
- op_value = (unsigned int)strtol(g_presence_conjunction_op, NULL, 10);
-
- conjunction_op = op_value ? UA_AND_OPERATION : UA_OR_OPERATION;
-
- msgb("AND [%u] [%s] OR [%u]", bitmask_and, op_value ? "and" : "or",
- bitmask_or);
-
- ret = ua_monitor_set_user_presence_condition(g_ua_mon_h,
- bitmask_and, bitmask_or, conjunction_op);
-
- msg(" - ua_monitor_set_user_presence_condition() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
-
- return RET_SUCCESS;
-}
-
-static int run_ua_monitor_set_user_absence_condition(
- MManager *mm, struct menu_data *menu)
-{
- int ret = UA_ERROR_NONE;
- unsigned int bitmask_and = 0;
- unsigned int bitmask_or = 0;
- unsigned int op_value = 1;
- ua_condition_conjunction_e conjunction_op = UA_AND_OPERATION;
-
- msg("ua_monitor_set_user_absence_condition");
-
- if (strlen(g_absence_and_cond))
- bitmask_and = (unsigned int)strtol(g_absence_and_cond, NULL, 10);
- if (strlen(g_absence_or_cond))
- bitmask_or = (unsigned int)strtol(g_absence_or_cond, NULL, 10);
- if (strlen(g_absence_conjunction_op))
- op_value = (unsigned int)strtol(g_absence_conjunction_op, NULL, 10);
-
- conjunction_op = op_value ? UA_AND_OPERATION : UA_OR_OPERATION;
-
- msgb("AND [%u] [%s] OR [%u]", bitmask_and, op_value ? "and" : "or",
- bitmask_or);
-
- ret = ua_monitor_set_user_absence_condition(g_ua_mon_h,
- bitmask_and, bitmask_or, conjunction_op);
-
- msg(" - ua_monitor_set_user_absence_condition() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
-
- return RET_SUCCESS;
-}
-
static int run_ua_monitor_start_presence_detection(
MManager *mm, struct menu_data *menu)
{
int ret = UA_ERROR_NONE;
- unsigned int bitmask_and = 0;
- unsigned int bitmask_or = 0;
- unsigned int op_value = 1;
- ua_condition_conjunction_e conjunction_op = UA_AND_OPERATION;
msg("ua_monitor_start_presence_detection");
check_if(NULL == g_ua_mon_h);
- if (strlen(g_presence_and_cond))
- bitmask_and = (unsigned int)strtol(g_presence_and_cond, NULL, 10);
- if (strlen(g_presence_or_cond))
- bitmask_or = (unsigned int)strtol(g_presence_or_cond, NULL, 10);
- if (strlen(g_presence_conjunction_op))
- op_value = (unsigned int)strtol(g_presence_conjunction_op, NULL, 10);
-
- conjunction_op = op_value ? UA_AND_OPERATION : UA_OR_OPERATION;
-
- msgb("AND [%u] [%s] OR [%u]", bitmask_and, op_value ? "and" : "or",
- bitmask_or);
-
- ret = ua_monitor_set_user_presence_condition(g_ua_mon_h,
- bitmask_and, bitmask_or, conjunction_op);
-
- if (UA_ERROR_NONE != ret)
- msgr(" - ua_monitor_set_user_presence_condition() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
-
if (strlen(g_presence_type))
detection_mode = (unsigned char)strtol(g_presence_type, NULL, 10);
{
int ret = UA_ERROR_NONE;
- unsigned int bitmask_and = 0;
- unsigned int bitmask_or = 0;
- unsigned int op_value = 1;
- ua_condition_conjunction_e conjunction_op = UA_AND_OPERATION;
-
msg("ua_monitor_start_absence_detection");
check_if(NULL == g_ua_mon_h);
- if (strlen(g_absence_and_cond))
- bitmask_and = (unsigned int)strtol(g_absence_and_cond, NULL, 10);
- if (strlen(g_absence_or_cond))
- bitmask_or = (unsigned int)strtol(g_absence_or_cond, NULL, 10);
- if (strlen(g_absence_conjunction_op))
- op_value = (unsigned int)strtol(g_absence_conjunction_op, NULL, 10);
-
- conjunction_op = op_value ? UA_AND_OPERATION : UA_OR_OPERATION;
-
- msgb("AND [%u] [%s] OR [%u]", bitmask_and, op_value ? "and" : "or",
- bitmask_or);
-
- ret = ua_monitor_set_user_absence_condition(g_ua_mon_h,
- bitmask_and, bitmask_or, conjunction_op);
-
- if (UA_ERROR_NONE != ret)
- msgr(" - ua_monitor_set_user_absence_condition() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
-
ua_detection_mode_e detection_mode = UA_DETECT_MODE_INVALID;
if (strlen(g_absence_type))
{ NULL, NULL, },
};
-static struct menu_data menu_ua_set_presence_condition[] = {
- { "1", "AND Bitmask (1:BT 2:BLE 4:Wi-Fi 8:Motion 16:Light 32:Audio)",
- NULL, NULL, g_presence_and_cond },
- { "2", "OR Bitmask (1:BT 2:BLE 4:Wi-Fi 8:Motion 16:Light 32:Audio)",
- NULL, NULL, g_presence_or_cond },
- { "3", "logical conjunction operation(0:OR, 1:AND)",
- NULL, NULL, g_presence_conjunction_op },
- { "4", "run", NULL,
- run_ua_monitor_set_user_presence_condition, NULL },
- { NULL, NULL, },
-};
-
-static struct menu_data menu_ua_set_absence_condition[] = {
- { "1", "AND Bitmask (1:BT 2:BLE 4:Wi-Fi 8:Motion 16:Light 32:Audio)",
- NULL, NULL, g_absence_and_cond },
- { "2", "OR Bitmask (1:BT 2:BLE 4:Wi-Fi 8:Motion 16:Light 32:Audio)",
- NULL, NULL, g_absence_or_cond },
- { "3", "logical conjunction operation(0:OR, 1:AND)",
- NULL, NULL, g_absence_conjunction_op },
- { "4", "run", NULL,
- run_ua_monitor_set_user_absence_condition, NULL },
- { NULL, NULL, },
-};
-
static struct menu_data menu_start_device_scan[] = {
{ "1", "Device scan time multiplier", NULL, NULL, g_scan_time_multiplier},
{ "2", "run", NULL, run_ua_monitor_start_scan_devices, NULL },
};
static struct menu_data menu_ua_start_presence[] = {
- { "1", "AND (1:BT 2:BLE 4:Wi-Fi 8:Motion 16:Light 32:Audio)",
- NULL, NULL, g_presence_and_cond },
- { "2", "OR (1:BT 2:BLE 4:Wi-Fi 8:Motion 16:Light 32:Audio)",
- NULL, NULL, g_presence_or_cond },
- { "3", "[1] cond. [2] (0:OR, 1:AND)",
- NULL, NULL, g_presence_conjunction_op },
- { "4", "type (1:ALL 2:ANY)",
+ { "1", "type (1:ALL 2:ANY)",
NULL, NULL, g_presence_type },
- { "5", "service(empty for default, else selected service)",
+ { "2", "service(empty for default, else selected service)",
NULL, NULL, g_service_str},
- { "6", "start",
+ { "3", "start",
NULL, run_ua_monitor_start_presence_detection, NULL },
- { "7", "stop",
+ { "4", "stop",
NULL, run_ua_monitor_stop_presence_detection, NULL },
{ NULL, NULL, },
};
static struct menu_data menu_ua_start_absence[] = {
- { "1", "AND (1:BT 2:BLE 4:Wi-Fi 8:Motion 16:Light 32:Audio)",
- NULL, NULL, g_absence_and_cond },
- { "2", "OR (1:BT 2:BLE 4:Wi-Fi 8:Motion 16:Light 32:Audio)",
- NULL, NULL, g_absence_or_cond },
- { "3", "[1] cond. [2] ( 0:OR, 1:AND)",
- NULL, NULL, g_absence_conjunction_op },
- { "4", "type (1:ALL 2:ANY)",
+ { "1", "type (1:ALL 2:ANY)",
NULL, NULL, g_absence_type },
- { "5", "service(empty for default, else selected service)",
+ { "2", "service(empty for default, else selected service)",
NULL, NULL, g_service_str},
- { "6", "start",
+ { "3", "start",
NULL, run_ua_monitor_start_absence_detection, NULL },
- { "7", "stop",
+ { "4", "stop",
NULL, run_ua_monitor_stop_absence_detection, NULL },
{ NULL, NULL, },
};
{ "4", "ua_get_detection_window",
NULL, run_ua_get_detection_window, NULL},
- { "5", "ua_monitor_set_user_presence_condition",
- menu_ua_set_presence_condition, NULL, NULL },
- { "6", "ua_monitor_set_user_absence_condition",
- menu_ua_set_absence_condition, NULL, NULL },
-
- { "7", "ua_monitor_start/stop_presence_detection",
+ { "5", "ua_monitor_start/stop_presence_detection",
menu_ua_start_presence, NULL, NULL },
- { "8", "ua_monitor_start/stop_absence_detection",
+ { "6", "ua_monitor_start/stop_absence_detection",
menu_ua_start_absence, NULL, NULL },
- { "9", "start/stop absence/presence simulataneously",
+ { "7", "start/stop absence/presence simulataneously",
menu_start_absence_presence, NULL, NULL },
- { "10", "ua_monitor_start_device_scan",
+ { "8", "ua_monitor_start_device_scan",
menu_start_device_scan, NULL, NULL },
- { "11", "ua_monitor_cancel_scan_devices",
+ { "9", "ua_monitor_cancel_scan_devices",
NULL, run_ua_monitor_cancel_scan_devices, NULL },
- { "12", "ua_enable_low_power_mode",
+ { "10", "ua_enable_low_power_mode",
NULL, run_ua_enable_low_power_mode, NULL },
- { "13", "ua_disable_low_power_mode",
+ { "11", "ua_disable_low_power_mode",
NULL, run_ua_disable_low_power_mode, NULL },
- { "14", "ua_set_low_power_mode",
+ { "12", "ua_set_low_power_mode",
menu_set_low_power_mode, NULL, NULL },
#ifdef SUSPEND_RESUME_TEST
{ "97", "request_power_off",
#include <gio/gio.h>
#include <user-awareness.h>
+#include <user-awareness-internal.h>
#include "uat-menu.h"
#include "uat-common.h"
char *ipv4 = NULL;
bool required = false;
unsigned long long last_seen = 0;
- bool discriminant = false;
if (!device_handle) {
msgr("device_handle is NULL");
g_free(ipv4);
}
- ret_temp = ua_device_get_discriminant(handle, &discriminant);
- if (UA_ERROR_NONE == ret_temp)
- msgb("Discriminant : %s", discriminant ? "Enabled" : "Disabled");
-
ret_temp = ua_device_get_pairing_required(handle, &required);
if (UA_ERROR_NONE == ret_temp)
msgb("Pairing Required : %s", required ? "YES" : "NO");
char *wifi_bssid = NULL;
char *ipv4 = NULL;
bool required = false;
- bool discriminant = false;
check_if(NULL == g_device_h);
g_free(wifi_bssid);
}
- ret = ua_device_get_discriminant(g_device_h, &discriminant);
- if (UA_ERROR_NONE == ret)
- snprintf(g_discriminant, MENU_DATA_SIZE + 1, "%d", discriminant ? 1 : 0);
-
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);
extern char g_sensor_list_str[MENU_DATA_SIZE + 1]; /**< Sendosr list string */
extern unsigned int g_sensor_list; /**< Added sensor list */
-static char g_app_id_str[MENU_DATA_SIZE + 1] = {0,}; /**< User app id */
-static char g_uid[MENU_DATA_SIZE + 1] = {0,}; /**< User id */
-static char g_ibeacon_adv_len[MENU_DATA_SIZE + 1] = {0,}; /**< iBeacon advertising data length */
-static char g_ibeacon_adv_str[MENU_DATA_SIZE + 1] = {0,}; /**< iBeacon advertising data */
-
-static void __user_detected_foreach_sensors(gpointer data,
- gpointer user_data)
-{
- int ret;
- double *value;
- GSList *l = 0;
- int info_count = 0;
- GSList *values = NULL;
- int type = (intptr_t)user_data;
- unsigned long long timestamp;
- char buf[MENU_DATA_SIZE] = {0, };
- char final_buf[MENU_DATA_SIZE * 4] = {0, };
-
- ua_sensor_e bitmask;
- ua_device_h sensor_handle = (ua_sensor_h)data;
-
- ret = ua_sensor_get_bitmask(sensor_handle, &bitmask);
- if (UA_ERROR_NONE != ret) {
- msg(" - ua_sensor_get_bitmask() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
- }
-
- ret = ua_sensor_get_timestamp(sensor_handle, ×tamp);
- if (UA_ERROR_NONE != ret) {
- msg(" - ua_sensor_get_timestamp() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
- }
-
- ret = ua_sensor_get_info_count(sensor_handle, &info_count);
- if (UA_ERROR_NONE != ret) {
- msg(" - ua_sensor_get_info_count() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
- }
-
- ret = ua_sensor_get_info_values(sensor_handle, &values);
- if (UA_ERROR_NONE != ret)
- msg(" - ua_sensor_get_info_values() failed");
-
- for (l = values; l; l = g_slist_next(l)) {
- value = (double *)l->data;
- snprintf(buf, MENU_DATA_SIZE, "%lF ", *value);
- strncat(final_buf, buf, sizeof(buf) - strlen(buf) - 1);
- memset(buf, 0, MENU_DATA_SIZE);
- }
-
- if (UAT_PRESENCE == type)
- msgbr("[%s] timestamp [%llu] value [%s]",
- uat_get_sensor_bitmask_str(bitmask), timestamp, final_buf);
- else
- msgr("[%s] timestamp [%llu] value [%s]",
- uat_get_sensor_bitmask_str(bitmask), timestamp, final_buf);
-
- g_slist_free(values);
-}
-
-static void __user_absence_detected_cb(int result, ua_monitor_h monitor,
- ua_user_h user_handle, GSList *sensor_handles, void *user_data)
-{
- int ret;
- char *account = NULL;
- char *pbuf = uat_get_time();
-
- msgr("\n[%s]", pbuf);
- free(pbuf);
-
- ret = ua_user_get_account(user_handle, &account);
- if (UA_ERROR_NONE != ret) {
- msg(" - ua_user_get_account() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
- }
- msgr("[%s] ABSENCE detected [%s]", account, uat_get_error_str(result));
-
- g_slist_foreach(sensor_handles,
- __user_detected_foreach_sensors, (void*)UAT_ABSENCE);
-
- if (account)
- free(account);
-}
-
const char * uat_convert_device_mac_type_to_txt(ua_mac_type_e mac_type)
{
switch (mac_type) {
}
}
-static void __user_presence_detected_foreach_devices(gpointer data,
- gpointer user_data)
-{
- int ret;
- ua_device_h device_handle = (ua_device_h)data;
- char *account = (char *)user_data;
- ua_mac_type_e mac_type;
- char *mac = NULL;
-
- ret = ua_device_get_mac_address(device_handle, &mac);
- if (UA_ERROR_NONE != ret) {
- 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));
- }
- msgbr("[%s] detected on [%s][%s]", account,
- uat_convert_device_mac_type_to_txt(mac_type), mac);
-
- g_free(mac);
-}
-
-static void __user_presence_detected_cb(int result, ua_monitor_h monitor,
- ua_user_h user_handle, GSList *device_handles, GSList *sensor_handles,
- void *user_data)
-{
- int ret;
- char *account = NULL;
- char *pbuf = uat_get_time();
-
- msgbr("\n[%s]", pbuf);
- free(pbuf);
-
- if (user_handle) {
- ret = ua_user_get_account(user_handle, &account);
- if (UA_ERROR_NONE != ret) {
- msg(" - ua_user_get_account() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
- }
- msgbr("[%s] PRESENCE detected [%s]", account, uat_get_error_str(result));
- g_slist_foreach(device_handles, __user_presence_detected_foreach_devices, account);
- }
-
- if (!account)
- msgbr("[No user information] PRESENCE detected [%s]", uat_get_error_str(result));
-
- g_slist_foreach(sensor_handles,
- __user_detected_foreach_sensors, (void *)UAT_PRESENCE);
-
- g_free(account);
-}
-
-static void __sensor_state_changed_cb(bool ready,
- ua_sensor_e sensor, ua_monitor_h monitor, void *user_data)
-{
- msgn("sensor: %s is %s",
- uat_get_sensor_bitmask_str(sensor), (ready ? "Ready" : "Not Ready"));
-}
static void __sensor_status_changed_cb(ua_monitor_h handle,
ua_sensor_h sensor_handle, void *user_data)
{
int ret;
- double *value;
- GSList *l = 0;
- int info_count = 0;
ua_sensor_e sensor;
- GSList *values = NULL;
ua_sensor_status_e status;
unsigned long long timestamp;
- char buf[MENU_DATA_SIZE] = {0, };
- char final_buf[MENU_DATA_SIZE * 4] = {0, };
char *pbuf = uat_get_time();
msgc("\n[%s]", pbuf);
ret, uat_get_error_str(ret));
}
- ret = ua_sensor_get_info_count(sensor_handle, &info_count);
- if (UA_ERROR_NONE != ret) {
- msg(" - ua_sensor_get_info_count() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
- }
-
- ret = ua_sensor_get_info_values(sensor_handle, &values);
- if (UA_ERROR_NONE != ret)
- msg(" - ua_sensor_get_info_values() failed");
-
- for (l = values; l; l = g_slist_next(l)) {
- value = (double *)l->data;
- snprintf(buf, MENU_DATA_SIZE, "%lF ", *value);
- strncat(final_buf, buf, sizeof(buf) - strlen(buf) - 1);
- memset(buf, 0, MENU_DATA_SIZE);
- }
- msgc("[%s] timestamp [%llu] value [%s]",
- uat_get_sensor_bitmask_str(sensor), timestamp, final_buf);
-
- g_slist_free(values);
+ msgc("[%s] timestamp [%llu]",
+ uat_get_sensor_bitmask_str(sensor), timestamp);
}
int _uat_monitor_create()
return RET_SUCCESS;
}
-int _uat_monitor_set_user_absence_detected_cb()
-{
- int ret = UA_ERROR_NONE;
-
- msg("ua_monitor_set_absence_detected_cb");
-
- ret = ua_monitor_set_user_absence_detected_cb(g_ua_mon_h,
- __user_absence_detected_cb, g_ua_mon_h);
-
- msg(" - ua_monitor_set_absence_detected_cb() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
-
- return ret;
-}
-
-static int run_ua_monitor_set_user_absence_detected_cb(
- MManager *mm, struct menu_data *menu)
-{
- _uat_monitor_set_user_absence_detected_cb();
-
- return RET_SUCCESS;
-}
-
-int _uat_monitor_set_user_presence_detected_cb()
-{
- int ret = UA_ERROR_NONE;
-
- msg("ua_monitor_set_presence_detected_cb");
-
- ret = ua_monitor_set_user_presence_detected_cb(g_ua_mon_h,
- __user_presence_detected_cb, g_ua_mon_h);
-
- msg(" - ua_monitor_set_presence_detected_cb() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
-
- return ret;
-}
-
-static int run_ua_monitor_set_user_presence_detected_cb(
- MManager *mm, struct menu_data *menu)
-{
- _uat_monitor_set_user_presence_detected_cb();
-
- return RET_SUCCESS;
-}
-
-int _uat_monitor_set_sensor_state_cb()
-{
- int ret = UA_ERROR_NONE;
-
- msg("ua_monitor_set_sensor_state_cb");
-
- ret = ua_monitor_set_sensor_state_cb(g_ua_mon_h,
- __sensor_state_changed_cb, g_ua_mon_h);
-
- msg(" - ua_monitor_set_sensor_state_cb() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
-
- return ret;
-}
-
-static int run_ua_monitor_set_sensor_state_cb(
- MManager *mm, struct menu_data *menu)
-{
- _uat_monitor_set_sensor_state_cb();
-
- return RET_SUCCESS;
-}
-
int _uat_monitor_set_sensor_status_cb()
{
int ret = UA_ERROR_NONE;
return RET_SUCCESS;
}
-static int run_ua_monitor_unset_user_absence_detected_cb(
- MManager *mm, struct menu_data *menu)
-{
- int ret = UA_ERROR_NONE;
-
- msg("ua_monitor_unset_absence_detected_cb");
-
- ret = ua_monitor_unset_user_absence_detected_cb(g_ua_mon_h);
-
- msg(" - ua_monitor_unset_absence_detected_cb() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
-
- return RET_SUCCESS;
-}
-
-static int run_ua_monitor_unset_user_presence_detected_cb(
- MManager *mm, struct menu_data *menu)
-{
- int ret = UA_ERROR_NONE;
-
- msg("ua_monitor_unset_presence_detected_cb");
-
- ret = ua_monitor_unset_user_presence_detected_cb(g_ua_mon_h);
-
- msg(" - ua_monitor_unset_presence_detected_cb() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
-
- return RET_SUCCESS;
-}
-
-static int run_ua_monitor_unset_sensor_state_cb(
- MManager *mm, struct menu_data *menu)
-{
- int ret = UA_ERROR_NONE;
-
- msg("ua_monitor_unset_sensor_state_cb");
-
- ret = ua_monitor_unset_sensor_state_cb(g_ua_mon_h);
-
- msg(" - ua_monitor_unset_sensor_state_cb() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
-
- return RET_SUCCESS;
-}
-
static int run_ua_monitor_unset_sensor_status_cb(
MManager *mm, struct menu_data *menu)
{
return RET_SUCCESS;
}
-static int run_ua_set_app_info(MManager *mm, struct menu_data *menu)
-{
- int ret = UA_ERROR_NONE;
- unsigned short uid_value = 0;
-
- msg("ua_set_app_info");
-
- if (strlen(g_uid))
- uid_value = (unsigned short)strtol(g_uid, NULL, 10);
-
- ret = ua_set_app_info(g_app_id_str, uid_value);
-
- msg(" - ua_set_app_info() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
-
- return RET_SUCCESS;
-}
-
-static int run_ua_unset_app_info(MManager *mm, struct menu_data *menu)
-{
- int ret = UA_ERROR_NONE;
- unsigned short uid_value = 0;
-
- msg("ua_unset_app_info");
-
- if (strlen(g_uid))
- uid_value = (unsigned short)strtol(g_uid, NULL, 10);
-
- ret = ua_unset_app_info(g_app_id_str, uid_value);
-
- msg(" - ua_unset_app_info() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
-
- return RET_SUCCESS;
-}
-
static int run_ua_reset_database(
MManager *mm, struct menu_data *menu)
{
return RET_SUCCESS;
}
-static int _scan_ibeacon_adv_str(
- MManager *mm, struct menu_data *menu)
-{
- int ret = UA_ERROR_NONE;
- int temp = 0;
- int length = 0;
-
- memset(g_ibeacon_adv_str, 0, MENU_DATA_SIZE + 1);
-
- if (strlen(g_ibeacon_adv_len))
- length = (unsigned int)strtol(g_ibeacon_adv_len, NULL, 10);
- if (length > UA_IBEACON_ADV_MAX_LEN) {
- msg("Error - iBeacon adv length is greater than %d", UA_IBEACON_ADV_MAX_LEN);
- return RET_SUCCESS;
- }
-
- for (int i = 0; i < length; i++) {
- ret = fscanf(stdin, "%d", &temp);
- if (!ret)
- msg(" - fscanf ret: %d", ret);
-
- g_ibeacon_adv_str[i] = (unsigned char)temp;
- }
-
- return RET_SUCCESS;
-}
-
-static int run_ua_add_ibeacon_adv_data(
- MManager *mm, struct menu_data *menu)
-{
- int ret = UA_ERROR_NONE;
- int length = 0;
-
- msg("ua_add_ibeacon_adv_data");
-
- if (strlen(g_ibeacon_adv_len))
- length = (unsigned int)strtol(g_ibeacon_adv_len, NULL, 10);
-
- ret = ua_add_ibeacon_adv_data(length, g_ibeacon_adv_str);
-
- msg(" - ua_add_ibeacon_adv_data() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
-
- return RET_SUCCESS;
-}
-
-static struct menu_data menu_ua_set_app_info[] = {
- { "1", "app_id (e.g. 'org.tizen.factory')",
- NULL, NULL, g_app_id_str },
- { "2", "uid (Uid found using 'ps -eo uid,gid,args | grep TheApp')",
- NULL, NULL, g_uid },
- { "3", "run", NULL,
- run_ua_set_app_info, NULL },
- { NULL, NULL, },
-};
-
-static struct menu_data menu_ua_unset_app_info[] = {
- { "1", "app_id (e.g. 'org.tizen.factory')",
- NULL, NULL, g_app_id_str },
- { "2", "uid (Uid found using 'ps -eo uid,gid,args | grep TheApp')",
- NULL, NULL, g_uid },
- { "3", "run", NULL,
- run_ua_unset_app_info, NULL },
- { NULL, NULL, },
-};
-
-static struct menu_data menu_ua_add_ibeacon_adv_data[] = {
- { "1", "Length of data(Max is 31)",
- NULL, NULL, g_ibeacon_adv_len },
- { "2", "iBeacon adv data (each byte is 0 to 255)",
- NULL, _scan_ibeacon_adv_str, NULL },
- { "3", "run", NULL,
- run_ua_add_ibeacon_adv_data, NULL },
- { NULL, NULL, },
-};
-
struct menu_data menu_ua_init[] = {
{ "1", "ua_monitor_create",
NULL, run_ua_monitor_create, NULL },
{ "2", "ua_monitor_destroy",
NULL, run_ua_monitor_destroy, NULL },
- { "3", "ua_monitor_set_sensor_state_cb",
- NULL, run_ua_monitor_set_sensor_state_cb, NULL },
- { "4", "ua_monitor_unset_sensor_state_cb",
- NULL, run_ua_monitor_unset_sensor_state_cb, NULL },
- { "5", "ua_monitor_set_sensor_status_cb",
+ { "3", "ua_monitor_set_sensor_status_cb",
NULL, run_ua_monitor_set_sensor_status_cb, NULL },
- { "6", "ua_monitor_unset_sensor_status_cb",
+ { "4", "ua_monitor_unset_sensor_status_cb",
NULL, run_ua_monitor_unset_sensor_status_cb, NULL },
- { "7", "ua_monitor_set_user_absence_detected_cb",
- NULL, run_ua_monitor_set_user_absence_detected_cb, NULL },
- { "8", "ua_monitor_unset_absence_detected_cb",
- NULL, run_ua_monitor_unset_user_absence_detected_cb, NULL },
- { "9", "ua_monitor_set_user_presence_detected_cb",
- NULL, run_ua_monitor_set_user_presence_detected_cb, NULL },
- { "10", "ua_monitor_unset_presence_detected_cb",
- NULL, run_ua_monitor_unset_user_presence_detected_cb, NULL },
- { "11", "ua_set_app_info",
- menu_ua_set_app_info, NULL, NULL},
- { "12", "ua_unset_app_info",
- menu_ua_unset_app_info, NULL, NULL},
- { "13", "ua_reset_database",
+ { "5", "ua_reset_database",
NULL, run_ua_reset_database, NULL},
- { "14", "ua_add_ibeacon_adv_data",
- menu_ua_add_ibeacon_adv_data, NULL, NULL},
{ NULL, NULL, },
};
extern struct menu_data menu_ua_devices[];
extern struct menu_data menu_ua_users[];
extern struct menu_data menu_ua_services[];
-extern struct menu_data menu_ua_payloads[];
extern struct menu_data menu_ua_sensors[];
extern struct menu_data menu_ua_detections[];
extern struct menu_data menu_ua_scenarios[];
{ "4", "Services", menu_ua_services, NULL, NULL },
{ "5", "Sensors", menu_ua_sensors, NULL, NULL },
{ "6", "Detection", menu_ua_detections, NULL, NULL },
- { "7", "Payload", menu_ua_payloads, NULL, NULL },
- { "8", "Scenario", menu_ua_scenarios, NULL, NULL },
+ { "7", "Scenario", menu_ua_scenarios, NULL, NULL },
{ NULL, NULL, },
};
+++ /dev/null
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-#include <glib.h>
-#include <gio/gio.h>
-
-#include <user-awareness.h>
-
-#include "uat-menu.h"
-#include "uat-common.h"
-
-extern ua_device_h g_device_h; /**< Device handle */
-extern ua_service_h g_service_h; /**< Service handle */
-ua_payload_h g_payload_h = NULL; /**< Payload handle */
-
-static char g_payload_primary_key[MENU_DATA_SIZE + 1] = {0,}; /**< payload primary_key for the selected device */
-static char g_payload_device_icon[MENU_DATA_SIZE + 1] = {0,}; /**< payload device_icon for the selected device */
-static char g_payload_secondary_key[MENU_DATA_SIZE + 1] = {0,}; /**< payload secondary_key for the selected device */
-static char g_payload_device_uid_len[MENU_DATA_SIZE + 1] = {0,}; /**< payload device_uid len for the selected device */
-static char g_payload_device_uid_str[MENU_DATA_SIZE + 1] = {0,}; /**< payload device_uid for the selected device */
-
-GSList *payload_list = NULL; /**< Payload List */
-int idx_payload = 0; /**< Found payload sequence number */
-
-char g_selected_payload_idx[MENU_DATA_SIZE + 1] = {0,}; /** Selected payload id */
-
-static void update_payload_info(void)
-{
- int ret = UA_ERROR_NONE;
- char primary_key = 0;
- char secondary_key = 0;
- char *device_uid = NULL;
- char device_icon = 0;
-
- if (0 == idx_payload) {
- if (g_payload_h) {
- ua_payload_destroy(g_payload_h);
- g_payload_h = NULL;
- }
- //TO-DO Add support for default payload
- //ua_payload_get_default_payload(&g_payload_h);
- }
-
- ret = ua_payload_get_primary_key(g_payload_h, &primary_key);
- if (UA_ERROR_NONE == ret) {
- memset(g_payload_primary_key, 0, MENU_DATA_SIZE + 1);
- memcpy(g_payload_primary_key, &primary_key, sizeof(primary_key));
- }
-
- ret = ua_payload_get_secondary_key(g_payload_h, &secondary_key);
- if (UA_ERROR_NONE == ret) {
- memset(g_payload_secondary_key, 0, MENU_DATA_SIZE + 1);
- memcpy(g_payload_secondary_key, &secondary_key, sizeof(secondary_key));
- }
-
- ret = ua_payload_get_device_uid(g_payload_h, &device_uid);
- if (UA_ERROR_NONE == ret) {
- memset(g_payload_device_uid_str, 0, MENU_DATA_SIZE + 1);
- memcpy(g_payload_device_uid_str, device_uid, MENU_DATA_SIZE);
- g_free(device_uid);
- }
-
- ret = ua_payload_get_device_icon(g_payload_h, &device_icon);
- if (UA_ERROR_NONE == ret) {
- memset(g_payload_device_icon, 0, MENU_DATA_SIZE + 1);
- memcpy(g_payload_device_icon, &device_icon, sizeof(device_icon));
- }
-}
-
-static void ___free_payload(gpointer data)
-{
- ua_payload_h handle = data;
- ua_payload_destroy(handle);
- handle = NULL;
-}
-
-void uat_clear_payload_list(void)
-{
- g_slist_free_full(payload_list, ___free_payload);
- payload_list = NULL;
- idx_payload = 0;
-}
-
-static int run_ua_payload_create(
- MManager *mm, struct menu_data *menu)
-{
- int ret = UA_ERROR_NONE;
-
- msg("ua_payload_create");
-
- if (g_payload_h) {
- ua_payload_destroy(g_payload_h);
- g_payload_h = NULL;
- }
-
- ret = ua_payload_create(&g_payload_h);
-
- msg(" - ua_payload_create() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
-
- return RET_SUCCESS;
-}
-
-static int run_ua_payload_destroy(MManager *mm, struct menu_data *menu)
-{
- int ret = UA_ERROR_NONE;
-
- msg("ua_payload_destroy");
-
- ret = ua_payload_destroy(g_payload_h);
- g_payload_h = NULL;
-
- msg(" - ua_payload_destroy() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
-
- return RET_SUCCESS;
-}
-
-#ifndef SUPPORT_STRING_DEVICE_UID
-static int _scan_payload_device_uid_str(
- MManager *mm, struct menu_data *menu)
-{
- int ret = UA_ERROR_NONE;
- int temp = 0;
- int device_uid_len = 0;
- int len = 0;
-
- msg("Input 17 bytes device_uid, each byte is 0 to 255 value");
- memset(g_payload_device_uid_str, 0, MENU_DATA_SIZE + 1);
-
- if (strlen(g_payload_device_uid_len))
- len = (unsigned char)strtol(g_payload_device_uid_len, NULL, 10);
- len = len < UA_BLE_PAYLOAD_DEVICE_UID_MAX_LEN ? len : UA_BLE_PAYLOAD_DEVICE_UID_MAX_LEN;
- device_uid_len = len > 0 ? len : 0;
-
- for (int i = 0; i < device_uid_len; i++) {
- ret = fscanf(stdin, "%d", &temp);
- if (!ret)
- msg(" - fscanf ret: %d", ret);
-
- g_payload_device_uid_str[i] = (unsigned char)temp;
- }
-
- return RET_SUCCESS;
-}
-#endif /* SUPPORT_STRING_DEVICE_UID */
-
-static int run_ua_payload_set_primary_key(
- MManager *mm, struct menu_data *menu)
-{
- int ret = UA_ERROR_NONE;
- char primary_key = 0;
-
- msg("ua_payload_set_primary_key");
-
- if (strlen(g_payload_primary_key))
- primary_key = (unsigned char)strtol(g_payload_primary_key, NULL, 10);
-
- ret = ua_payload_set_primary_key(g_payload_h, primary_key);
-
- msg(" - ua_payload_set_primary_key() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
-
- return RET_SUCCESS;
-}
-
-static int run_ua_payload_set_device_icon(
- MManager *mm, struct menu_data *menu)
-{
- int ret = UA_ERROR_NONE;
- char device_icon = 0;
-
- msg("ua_payload_set_device_icon");
-
- if (strlen(g_payload_device_icon))
- device_icon = (unsigned char)strtol(g_payload_device_icon, NULL, 10);
-
- ret = ua_payload_set_device_icon(g_payload_h, device_icon);
-
- msg(" - ua_payload_set_device_icon() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
-
- return RET_SUCCESS;
-}
-
-static int run_ua_payload_set_secondary_key(
- MManager *mm, struct menu_data *menu)
-{
- int ret = UA_ERROR_NONE;
- char secondary_key = 0;
-
- msg("ua_payload_set_secondary_key");
-
- if (strlen(g_payload_secondary_key))
- secondary_key = (unsigned char)strtol(g_payload_secondary_key, NULL, 10);
-
- ret = ua_payload_set_secondary_key(g_payload_h, secondary_key);
-
- msg(" - ua_payload_set_secondary_key() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
-
- return RET_SUCCESS;
-}
-
-static int run_ua_payload_set_device_uid(
- MManager *mm, struct menu_data *menu)
-{
- int ret = UA_ERROR_NONE;
- int device_uid_len = 0;
-
- msg("ua_payload_set_device_uid");
-
- if (strlen(g_payload_device_uid_len))
- device_uid_len = (unsigned char)strtol(g_payload_device_uid_len, NULL, 10);
-
- ret = ua_payload_set_device_uid(g_payload_h,
- device_uid_len, g_payload_device_uid_str);
-
- msg(" - ua_payload_set_device_uid() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
-
- return RET_SUCCESS;
-}
-
-static int run_ua_payload_add(
- MManager *mm, struct menu_data *menu)
-{
- int ret = UA_ERROR_NONE;
-
- msg("ua_payload_add");
-
- check_if(NULL == g_payload_h);
-
- ret = ua_payload_add(g_payload_h, g_device_h);
-
- msg(" - ua_payload_add() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
-
- return RET_SUCCESS;
-}
-
-static int run_ua_payload_add_service(
- MManager *mm, struct menu_data *menu)
-{
- int ret = UA_ERROR_NONE;
-
- msg("ua_payload_add_service");
-
- check_if(NULL == g_payload_h);
-
- ret = ua_payload_add_service(g_payload_h, g_service_h);
-
- msg(" - ua_payload_add_service() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
-
- return RET_SUCCESS;
-}
-
-static bool __foreach_added_payload_cb(
- ua_payload_h payload_handle, void *user_data)
-{
- int ret = UA_ERROR_NONE;
- ua_payload_h handle = NULL;
- char primary_key = 0;
- char secondary_key = 0;
- char *device_uid = NULL;
- int device_uid_len = 0;
- char device_icon = 0;
- char *payload_user_data = NULL;
-
- if (!payload_handle) {
- msgr("payload_handle is NULL");
- return true;
- }
-
- ret = ua_payload_clone(&handle, payload_handle);
- if (UA_ERROR_NONE != ret) {
- msgr("ua_payload_clone() result: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
- }
-
- payload_list = g_slist_append(payload_list, handle);
- idx_payload++;
-
- ret = ua_payload_get_primary_key(handle, &primary_key);
- if (UA_ERROR_NONE == ret) {
- msglr("[%d]", idx_payload);
- msglr("Payload primary_key : %d", primary_key);
- }
-
- ret = ua_payload_get_secondary_key(handle, &secondary_key);
- if (UA_ERROR_NONE == ret)
- msglr("Payload secondary key : %d", secondary_key);
-
- ret = ua_payload_get_device_uid_len(handle, &device_uid_len);
- if (UA_ERROR_NONE == ret)
- msglr("Payload device uid len %d", device_uid_len);
-
- ret = ua_payload_get_device_uid(handle, &device_uid);
- if (UA_ERROR_NONE == ret) {
- for (int i = 0; i < device_uid_len; i++)
- msglr("Payload device uid 0x%2.2X", device_uid[i]);
- g_free(device_uid);
- }
-
- ret = ua_payload_get_device_icon(handle, &device_icon);
- if (UA_ERROR_NONE == ret)
- msglr("Payload device icon : %d", device_icon);
-
- ret = ua_payload_get_user_data(handle, &payload_user_data);
- if (UA_ERROR_NONE == ret) {
- for (int i = 0; i < 17 - 1 - device_uid_len; i++)
- msglr("Payload user data : 0x%2.2X", payload_user_data[i]);
- g_free(payload_user_data);
- }
-
- return true;
-}
-
-static int run_ua_payload_foreach_added(
- MManager *mm, struct menu_data *menu)
-{
- int ret = UA_ERROR_NONE;
-
- msg("ua_payload_foreach_added");
-
- uat_clear_payload_list();
-
- ret = ua_payload_foreach_added(__foreach_added_payload_cb, NULL);
-
- msg(" - ua_payload_foreach_added() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
-
- return RET_SUCCESS;
-}
-
-int uat_select_payload(MManager *mm, struct menu_data *menu)
-{
- GSList *iter = payload_list;
-
- int id = 0;
- int selected_id = 0;
-
- if (strlen(g_selected_payload_idx))
- selected_id = (unsigned char)strtol(g_selected_payload_idx, NULL, 10);
-
- if (selected_id <= 0) {
- msg("Please select payload first");
- return RET_SUCCESS;
- }
-
- while (NULL != iter) {
- GSList *next = iter->next;
- ua_payload_h *handle = iter->data;
- if (handle && ++id == selected_id) {
- g_payload_h = handle; // Make selected payload as a current one
- update_payload_info(); // Update payload info.
- msg("Select payload done");
- return RET_SUCCESS;
- }
- iter = next;
- }
-
- return RET_SUCCESS;
-}
-
-static struct menu_data menu_ua_payload_set_primary_key[] = {
- { "1", "Primary Key (0 to 255)",
- NULL, NULL, g_payload_primary_key },
- { "2", "run", NULL,
- run_ua_payload_set_primary_key, NULL },
- { NULL, NULL, },
-};
-
-static struct menu_data menu_ua_payload_set_device_icon[] = {
- { "1", "device_icon (0 to 255)",
- NULL, NULL, g_payload_device_icon },
- { "2", "run", NULL,
- run_ua_payload_set_device_icon, NULL },
- { NULL, NULL, },
-};
-
-static struct menu_data menu_ua_payload_set_secondary_key[] = {
- { "1", "Secondary Key (0 to 255)",
- NULL, NULL, g_payload_secondary_key },
- { "2", "run", NULL,
- run_ua_payload_set_secondary_key, NULL },
- { NULL, NULL, },
-};
-
-static struct menu_data menu_ua_payload_set_device_uid[] = {
- { "1", "Device uid len (0 to 17)",
- NULL, NULL, g_payload_device_uid_len },
- { "2", "DEVICE_UID (Max. 17 bytes)",
-#ifdef SUPPORT_STRING_DEVICE_UID
- NULL, NULL, g_payload_device_uid_str },
-#else
- NULL, _scan_payload_device_uid_str, NULL },
-#endif
- { "3", "run", NULL,
- run_ua_payload_set_device_uid, NULL },
- { NULL, NULL, },
-};
-
-struct menu_data menu_sel_added_payload[] = {
- { "1", "Payload list", NULL,
- run_ua_payload_foreach_added, g_selected_payload_idx},
- { "2", "Apply", NULL, uat_select_payload, NULL },
- { NULL, NULL, },
-};
-
-struct menu_data menu_ua_payloads[] = {
- { "1", "ua_payload_create",
- NULL, run_ua_payload_create, NULL },
- { "2", "ua_payload_destroy",
- NULL, run_ua_payload_destroy, NULL },
- { "3", "ua_payload_set_primary_key",
- menu_ua_payload_set_primary_key, NULL, g_payload_primary_key },
- { "4", "ua_payload_set_device_icon",
- menu_ua_payload_set_device_icon, NULL, g_payload_device_icon },
- { "5", "ua_payload_set_secondary_key",
- menu_ua_payload_set_secondary_key, NULL, g_payload_secondary_key },
- { "6", "ua_payload_set_device_uid",
- menu_ua_payload_set_device_uid, NULL, g_payload_device_uid_str },
- { "7", ANSI_COLOR_LIGHTGREEN "ua_payload_add" ANSI_COLOR_NORMAL,
- NULL, run_ua_payload_add, NULL },
- { "8", ANSI_COLOR_LIGHTGREEN "ua_payload_add_service" ANSI_COLOR_NORMAL,
- NULL, run_ua_payload_add_service, NULL },
- { "9", ANSI_COLOR_LIGHTMAGENTA "ua_payload_foreach_added" ANSI_COLOR_NORMAL,
- menu_sel_added_payload, NULL, NULL },
- { NULL, NULL, },
-};
extern ua_monitor_h g_ua_mon_h; /**< Monitor handle */
extern ua_user_h g_user_h; /**< Monitor handle */
extern ua_device_h g_device_h; /**< Device handle */
-#if 0
-extern ua_payload_h g_payload_h = NULL; /**< Payload handle */
-#endif
extern char g_service_str[MENU_DATA_SIZE + 1]; /**< service name */
extern char g_user_account_str[MENU_DATA_SIZE + 1]; /**< user account */
ret = _uat_monitor_create();
retv_if(ret != UA_ERROR_NONE, ret);
- ret = _uat_monitor_set_sensor_state_cb();
- check_if(ret != UA_ERROR_NONE);
-
ret = _uat_monitor_set_sensor_status_cb();
check_if(ret != UA_ERROR_NONE);
- ret = _uat_monitor_set_user_presence_detected_cb();
- check_if(ret != UA_ERROR_NONE);
-
- ret = _uat_monitor_set_user_absence_detected_cb();
- check_if(ret != UA_ERROR_NONE);
-
return ret;
}
{
int ret;
- ret = ua_monitor_unset_sensor_state_cb(g_ua_mon_h);
- check_if(ret != UA_ERROR_NONE);
-
ret = ua_monitor_unset_sensor_status_cb(g_ua_mon_h);
check_if(ret != UA_ERROR_NONE);
- ret = ua_monitor_unset_user_absence_detected_cb(g_ua_mon_h);
- check_if(ret != UA_ERROR_NONE);
-
- ret = ua_monitor_unset_user_presence_detected_cb(g_ua_mon_h);
- check_if(ret != UA_ERROR_NONE);
-
if (g_ua_mon_h)
ret = ua_monitor_destroy(g_ua_mon_h);
check_if(ret != UA_ERROR_NONE);
return RET_SUCCESS;
}
-static int __create_add_payload(
- ua_device_h device_h,
- const char primary_key,
- const char device_icon,
- const char secondary_key,
- unsigned int device_uid_len,
- const char *device_uid_str)
-{
- int ret = UA_ERROR_NONE;
- ua_payload_h payload_h = NULL;
-
- /* Create payload info */
- ret = ua_payload_create(&payload_h);
- msg(" - ua_payload_create() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
-
- ret = ua_payload_set_primary_key(payload_h, primary_key);
- msg(" - ua_payload_set_primary_key() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
-
- ret = ua_payload_set_device_icon(payload_h, device_icon);
- msg(" - ua_payload_set_device_icon() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
-
- ret = ua_payload_set_secondary_key(payload_h, secondary_key);
- msg(" - ua_payload_set_secondary_key() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
-
- device_uid_len = device_uid_len < UA_BLE_PAYLOAD_DEVICE_UID_MAX_LEN ?
- device_uid_len : UA_BLE_PAYLOAD_DEVICE_UID_MAX_LEN;
- device_uid_len = device_uid_len > 0 ? device_uid_len : 0;
-
- ret = ua_payload_set_device_uid(payload_h,
- device_uid_len, device_uid_str);
- msg(" - ua_payload_set_device_uid() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
-
- /* Add payload to device */
- ret = ua_payload_add(payload_h, device_h);
- msg(" - ua_payload_add() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
-
- /* Add payload to service */
- ret = ua_payload_add_service(payload_h, g_service_h);
- msg(" - ua_payload_add_service() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
-
- return ret;
-}
-
static void __device_added_cb(int result,
ua_device_h handle, void *user_data)
{
ua_mac_type_e device_type = UA_MAC_TYPE_INVALID;
ret = ua_device_get_mac_type(handle, &device_type);
-
- /* For BLE add payload */
- if (device_type == UA_MAC_TYPE_BLE) {
- /* Set default payload values */
- const char primary_key = 0x0D;
- const char device_icon = 0x01;
- const char secondary_key = 0x01;
- unsigned int device_uid_len = 6;
- char device_uid_str[MENU_DATA_SIZE + 1];
- int temp[6] = {0x30, 0xAB, 0x6A, 0x09, 0x1B, 0x4C};
-
- memset(device_uid_str, 0, MENU_DATA_SIZE + 1);
- for (int i = 0; i < device_uid_len; i++) {
- device_uid_str[i] = (unsigned char)temp[i];
- }
-
- ret = __create_add_payload(handle, primary_key, device_icon,
- secondary_key, device_uid_len,
- device_uid_str);
- }
}
static int __create_add_device(int device_type, int ostype,
#include <glib.h>
#include <gio/gio.h>
+#include <user-awareness.h>
+#include <user-awareness-internal.h>
+
#include "uat-common.h"
extern ua_device_h g_device_h; /**< Device handle */
ua_user_h handle = NULL;
char *service_name = NULL;
char *account = NULL;
- char *name = NULL;
- unsigned long long last_seen = 0;
ret = ua_service_get_name(service_handle, &service_name);
if (UA_ERROR_NONE == ret)
g_free(account);
}
- ret = ua_user_get_name(handle, &name);
- if (UA_ERROR_NONE == ret) {
- msglr("User Name : %s", name);
- g_free(name);
- }
-
- ret = ua_user_get_last_presence(handle, &last_seen);
- if (UA_ERROR_NONE == ret)
- msglr("last present at %llu", last_seen);
-
-
return true;
}
char *wifi_bssid = NULL;
char *ipv4 = NULL;
bool required = false;
- bool discriminant = false;
unsigned long long last_seen = 0;
if (!service_handle) {
if (UA_ERROR_NONE == ret_temp)
msgb("Pairing Required : %s", required ? "YES" : "NO");
- ret_temp = ua_device_get_discriminant(handle, &discriminant);
- if (UA_ERROR_NONE == ret_temp)
- msgb("Discriminant : %s", discriminant ? "Enabled" : "Disabled");
-
ret_temp = ua_device_get_last_presence(handle, &last_seen);
if (UA_ERROR_NONE == ret_temp)
msgb("Last present at : %llu", last_seen);
#include <gio/gio.h>
#include <user-awareness.h>
+#include <user-awareness-internal.h>
#include "uat-menu.h"
#include "uat-common.h"
{
int ret = UA_ERROR_NONE;
char *account = NULL;
- char *name = NULL;
if (0 == idx_user) {
if (g_user_h) {
memcpy(g_user_account_str, account, MENU_DATA_SIZE);
g_free(account);
}
- ret = ua_user_get_name(g_user_h, &name);
- if (UA_ERROR_NONE == ret) {
- memset(g_user_name_str, 0, MENU_DATA_SIZE + 1);
- memcpy(g_user_name_str, name, MENU_DATA_SIZE);
- g_free(name);
- }
}
static void ___free_users(gpointer data)
int ret = UA_ERROR_NONE;
ua_user_h handle = NULL;
char *account = NULL;
- char *name = NULL;
- unsigned long long last_seen = 0;
if (!user_handle) {
msgr("user_handle is NULL");
g_free(account);
}
- ret = ua_user_get_name(handle, &name);
- if (UA_ERROR_NONE == ret) {
- msglr("User Name : %s", name);
- g_free(name);
- }
-
- ret = ua_user_get_last_presence(handle, &last_seen);
- if (UA_ERROR_NONE == ret)
- msglr("last present at %llu", last_seen);
-
return true;
}
char *ipv4 = NULL;
bool required = false;
unsigned long long last_seen = 0;
- bool discriminant = false;
if (!device_handle) {
msgr("device_handle is NULL");
g_free(ipv4);
}
- ret_temp = ua_device_get_discriminant(handle, &discriminant);
- if (UA_ERROR_NONE == ret_temp)
- msgc("Discriminant : %s", discriminant ? "Enabled" : "Disabled");
-
ret_temp = ua_device_get_pairing_required(handle, &required);
if (UA_ERROR_NONE == ret_temp)
msgc("Pairing Required : %s", required ? "YES" : "NO");
return RET_SUCCESS;
}
-static int run_ua_user_update(MManager *mm, struct menu_data *menu)
-{
- int ret = UA_ERROR_NONE;
-
- msg("ua_user_update");
-
- check_if(NULL == g_user_h);
-
- ret = ua_user_update(g_user_h);
-
- msg(" - ua_user_update() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
-
- return RET_SUCCESS;
-}
-
static int run_ua_user_get_default_user(MManager *mm, struct menu_data *menu)
{
int ret = UA_ERROR_NONE;
return RET_SUCCESS;
}
-static int run_ua_user_remove_device_by_mac_address(
- MManager *mm, struct menu_data *menu)
-{
- int ret = UA_ERROR_NONE;
- uat_mac_type_e idx = UAT_MAC_TYPE_MAX;
-
- msg("ua_user_remove_device_by_mac_address");
-
- if (strlen(g_device_type))
- idx = (unsigned char)strtol(g_device_type, NULL, 10);
-
- msgb("idx [%d] mac_type[%d]", idx, uat_convert_idx_to_device_type(idx));
-
- ret = ua_user_remove_device_by_mac_address(g_mac_addr_str);
-
- msg(" - ua_user_remove_device_by_mac_address() ret: [0x%X] [%s]",
- ret, uat_get_error_str(ret));
-
- return RET_SUCCESS;
-}
-
static int run_ua_user_foreach_added_devices(MManager *mm, struct menu_data *menu)
{
int ret = UA_ERROR_NONE;
{ NULL, NULL, },
};
-static struct menu_data menu_ua_rm_dev_by_addr[] = {
- { "1", "type (1:BT 2:BLE 3:Wi-Fi 4:P2P)",
- NULL, NULL, g_device_type },
- { "2", "MAC",
- NULL, NULL, g_mac_addr_str },
- { "3", "run", NULL,
- run_ua_user_remove_device_by_mac_address, NULL },
- { NULL, NULL, },
-};
-
struct menu_data menu_ua_user_added_devlist[] = {
{ "1", "Device list", NULL,
run_ua_user_foreach_added_devices, g_selected_device_idx},
NULL, run_ua_user_add, NULL },
{ "6", "ua_user_remove",
NULL, run_ua_user_remove, NULL},
- { "7", "ua_user_update",
- NULL, run_ua_user_update, NULL},
{ "8", "ua_user_get_default_user",
NULL, run_ua_user_get_default_user, NULL },
{ "9", "ua_user_get_handle_by_account",
NULL, run_ua_user_remove_device, NULL },
{ "13", "ua_user_remove_device_by_device_id",
menu_ua_rm_dev_by_device_id, NULL, NULL },
- { "14", "ua_user_remove_device_by_mac_address",
- menu_ua_rm_dev_by_addr, NULL, NULL },
- { "15", ANSI_COLOR_LIGHTMAGENTA "ua_user_foreach_added_devices" ANSI_COLOR_NORMAL,
+ { "14", ANSI_COLOR_LIGHTMAGENTA "ua_user_foreach_added_devices" ANSI_COLOR_NORMAL,
menu_ua_user_added_devlist, NULL, NULL },
{ NULL, NULL, },
};