Added api documentation 92/209292/1 accepted/tizen/unified/20190705.110642 submit/tizen/20190705.042311
authorsaerome kim <saerome.kim@samsung.com>
Thu, 4 Jul 2019 10:45:43 +0000 (19:45 +0900)
committersaerome kim <saerome.kim@samsung.com>
Thu, 4 Jul 2019 10:56:30 +0000 (19:56 +0900)
- it is needed to describe how internal API work.

Change-Id: I209468bb99590686f25c1b4c0b3a13a8542d343c
Signed-off-by: saerome kim <saerome.kim@samsung.com>
30 files changed:
include/ua-api.h
include/ua-internal.h
packaging/ua-manager.conf
ua-api/include/ua-common.h
ua-api/include/ua-event-handler.h
ua-api/include/ua-request-sender.h
ua-api/src/ua-api.c
ua-api/src/ua-common.c
ua-api/src/ua-event-handler.c
ua-api/src/ua-request-sender.c
ua-daemon/include/ua-cloud-plugin-handler.h
ua-daemon/include/ua-manager-common.h
ua-daemon/include/ua-manager-core.h
ua-daemon/include/ua-manager-database.h
ua-daemon/include/ua-plugin-manager.h
ua-daemon/src/pm/ua-ble-plugin-handler.c
ua-daemon/src/pm/ua-cloud-plugin-handler.c
ua-daemon/src/pm/ua-plugin-manager.c
ua-daemon/src/pm/ua-pm-util.c
ua-daemon/src/pm/ua-pm-util.h
ua-daemon/src/pm/ua-power-plugin-manager.c
ua-daemon/src/pm/ua-wifi-plugin-handler.c
ua-daemon/src/ua-manager-common.c
ua-daemon/src/ua-manager-config-parser.c
ua-daemon/src/ua-manager-core.c
ua-daemon/src/ua-manager-device-db.c
ua-daemon/src/ua-manager-event-sender.c
ua-daemon/src/ua-manager-request-handler.c
ua-daemon/src/ua-manager-service-db.c
ua-daemon/src/ua-manager-user-db.c

index 60874cf..2dc45da 100644 (file)
  *
  */
 
-#ifndef __UAM_API_H__
-#define __UAM_API_H__
+#ifndef __TIZEN_UA_NETWORK_UA_API_H__
+#define __TIZEN_UA_NETWORK_UA_API_H__
 
 #include <gmodule.h>
 #include <tizen_error.h>
 
 #ifndef TIZEN_ERROR_UA
-#define TIZEN_ERROR_UA 0x10000000 /**< To-Do: This should move to tizen_error.h */
+#define TIZEN_ERROR_UA 0x11170000 /**< To-Do: This should move to tizen_error.h */
 #endif
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#define UAM_SENSOR_BITMASK_BT          0x00000001
-#define UAM_SENSOR_BITMASK_BLE         0x00000002
-#define UAM_SENSOR_BITMASK_WIFI                0x00000004
-#define UAM_SENSOR_BITMASK_MOTION      0x00000008
-#define UAM_SENSOR_BITMASK_LIGHT       0x00000010
-#define UAM_SENSOR_BITMASK_AUDIO       0x00000020
-#define UAM_SENSOR_ALL                 0xFFFFFFFF
-
+/**
+ * @brief Bitmask for sensors.
+ * @since_tizen 5.5
+ */
+typedef enum {
+       UAM_SENSOR_BITMASK_BT = 0x00000001, /**< Bitmask for BT */
+       UAM_SENSOR_BITMASK_BLE = 0x00000002, /**< Bitmask for BLE */
+       UAM_SENSOR_BITMASK_WIFI = 0x00000004, /**< Bitmask for Wi-Fi */
+       UAM_SENSOR_BITMASK_MOTION = 0x00000008, /**< Bitmask for motion */
+       UAM_SENSOR_BITMASK_LIGHT = 0x00000010, /**< Bitmask for light */
+       UAM_SENSOR_BITMASK_AUDIO = 0x00000020, /**< Bitmask for autio */
+       UAM_SENSOR_ALL = 0xFFFFFFFF, /**< Bitmask for all sensors */
+} uam_sensor_bitmask_e;
+
+/**
+ * @brief Max. MAC address length.
+ * @since_tizen 5.5
+ */
 #define UAM_MAC_ADDRESS_STRING_LEN 18
+
+/**
+ * @brief Max. device id length.
+ * @since_tizen 5.5
+ */
 #define UAM_DEVICE_ID_MAX_STRING_LEN 50
+
+/**
+ * @brief Max. IP address length.
+ * @since_tizen 5.5
+ */
 #define UAM_IP_ADDRESS_MAX_STRING_LEN 50
+
+/**
+ * @brief Max. user name length.
+ * @since_tizen 5.5
+ */
 #define UAM_USER_NAME_MAX_STRING_LEN 254
+
+/**
+ * @brief Max. user account length.
+ * @since_tizen 5.5
+ */
 #define UAM_USER_ACCOUNT_MAX_STRING_LEN 254
+
+/**
+ * @brief Max. application id length.
+ * @since_tizen 5.5
+ */
 #define UAM_APP_ID_MAX_STRING_LEN 100
+
+/**
+ * @brief Max. service id length.
+ * @since_tizen 5.5
+ */
 #define UAM_SERVICE_MAX_STRING_LEN 50
 
+/**
+ * @brief Default service name.
+ * @since_tizen 5.5
+ */
 #define UAM_SERVICE_DEFAULT "ua.service.default"
 
-#define FOREACH_EVENT(EVENT) \
-       EVENT(UAM_EVENT_USER_ADDED) \
-       EVENT(UAM_EVENT_USER_REMOVED) \
-       EVENT(UAM_EVENT_DEVICE_ADDED) \
-       EVENT(UAM_EVENT_DEVICE_REMOVED) \
-       EVENT(UAM_EVENT_PRESENCE_DETECTED) \
-       EVENT(UAM_EVENT_USER_PRESENCE_DETECTED) \
-       EVENT(UAM_EVENT_ABSENCE_DETECTED) \
-       EVENT(UAM_EVENT_USER_ABSENCE_DETECTED) \
-       EVENT(UAM_EVENT_AMBIANT_MODE_ENABLED) \
-       EVENT(UAM_EVENT_AMBIANT_MODE_DISABLED) \
-       EVENT(UAM_EVENT_SENSOR_STATE_READY) \
-       EVENT(UAM_EVENT_SENSOR_STATE_NOT_READY) \
-       EVENT(UAM_EVENT_DETECTION_STARTED) \
-       EVENT(UAM_EVENT_DETECTION_STOPPED) \
-       EVENT(UAM_EVENT_DEVICE_FOUND) \
-       EVENT(UAM_EVENT_SCAN_COMPLETED) \
-       EVENT(UAM_EVENT_MAX)
-
+/**
+ * @brief Macro for event enum.
+ * @since_tizen 5.5
+ */
 #define GENERATE_EVENT_ENUM(ENUM) ENUM,
+/**
+ * @brief Macro to print event string out.
+ * @since_tizen 5.5
+ */
 #define GENERATE_EVENT_STRING(STRING) #STRING,
 
+/**
+ * @brief Enumerations macro of UA framework event codes.
+ * @since_tizen 5.5
+ */
 typedef enum {
-       FOREACH_EVENT(GENERATE_EVENT_ENUM)
+       UAM_EVENT_USER_ADDED, /**< User added */
+       UAM_EVENT_USER_REMOVED, /**< User removed */
+       UAM_EVENT_DEVICE_ADDED, /**< Device added */
+       UAM_EVENT_DEVICE_REMOVED, /**< Device removed */
+       UAM_EVENT_PRESENCE_DETECTED, /**< Presence detected */
+       UAM_EVENT_USER_PRESENCE_DETECTED, /**< User presence detected */
+       UAM_EVENT_ABSENCE_DETECTED, /**< Absence detected */
+       UAM_EVENT_USER_ABSENCE_DETECTED, /**< User absence detected */
+       UAM_EVENT_AMBIANT_MODE_ENABLED, /**< Ambient mode enabled */
+       UAM_EVENT_AMBIANT_MODE_DISABLED, /**< Ambient mode disabled */
+       UAM_EVENT_SENSOR_STATE_READY, /**< Sensor state ready */
+       UAM_EVENT_SENSOR_STATE_NOT_READY, /**< Sensor state not ready */
+       UAM_EVENT_DETECTION_STARTED, /**< Detection started */
+       UAM_EVENT_DETECTION_STOPPED, /**< Detection stopped */
+       UAM_EVENT_DEVICE_FOUND, /**< Device found */
+       UAM_EVENT_SCAN_COMPLETED, /**< Scan completed */
+       UAM_EVENT_MAX, /**< Max. event number */
 } uam_event_e;
 
-#define FOREACH_ERROR(ERROR) \
-       ERROR(UAM_ERROR_NONE, TIZEN_ERROR_NONE) \
-       ERROR(UAM_ERROR_INVALID_PARAM, TIZEN_ERROR_INVALID_PARAMETER) \
-       ERROR(UAM_ERROR_PERMISSION_DENIED, TIZEN_ERROR_PERMISSION_DENIED) \
-       ERROR(UAM_ERROR_TIMEOUT, TIZEN_ERROR_TIMED_OUT) \
-       ERROR(UAM_ERROR_NOW_IN_PROGRESS, TIZEN_ERROR_NOW_IN_PROGRESS) \
-       ERROR(UAM_ERROR_NOT_SUPPORTED, TIZEN_ERROR_NOT_SUPPORTED) \
-       ERROR(UAM_ERROR_NOT_INITIALIZED, TIZEN_ERROR_UA | 0x01) \
-       ERROR(UAM_ERROR_NOT_IN_OPERATION, TIZEN_ERROR_UA | 0x02) \
-       ERROR(UAM_ERROR_ALREADY_DONE, TIZEN_ERROR_UA | 0x03) \
-       ERROR(UAM_ERROR_INTERNAL, TIZEN_ERROR_UA | 0x04) \
-       ERROR(UAM_ERROR_NOT_FOUND, TIZEN_ERROR_UA | 0x10) \
-       ERROR(UAM_ERROR_ALREADY_REGISTERED, TIZEN_ERROR_UA | 0x11) \
-       ERROR(UAM_ERROR_DB_FAILED, TIZEN_ERROR_UA | 0x12) \
-       ERROR(UAM_ERROR_NOT_REGISTERED, TIZEN_ERROR_UA | 0x13) \
-
-#define GENERATE_ERROR_ENUM(ENUM, offset) ENUM = -offset,
+/**
+ * @brief Macro to print error string out.
+ * @since_tizen 5.5
+ */
 #define GENERATE_ERROR_CASE(STRING, offset) case STRING: return #STRING;
 
+/**
+ * @brief Enumerations macro of UA framework error codes.
+ * @since_tizen 5.5
+ */
 typedef enum {
-       FOREACH_ERROR(GENERATE_ERROR_ENUM)
+       UAM_ERROR_NONE = TIZEN_ERROR_NONE, /**< Succsssful */
+       UAM_ERROR_INVALID_PARAMETER = TIZEN_ERROR_INVALID_PARAMETER, /**< Invalid parameter */
+       UAM_ERROR_PERMISSION_DENIED = TIZEN_ERROR_PERMISSION_DENIED, /**< Permission denied */
+       UAM_ERROR_TIMED_OUT = TIZEN_ERROR_TIMED_OUT, /**< Time out */
+       UAM_ERROR_NOW_IN_PROGRESS = TIZEN_ERROR_NOW_IN_PROGRESS, /**< Now in progress */
+       UAM_ERROR_NOT_SUPPORTED = TIZEN_ERROR_NOT_SUPPORTED, /**< Not supported */
+       UAM_ERROR_NOT_INITIALIZED = TIZEN_ERROR_UA | 0x01, /**< Not initiaized */
+       UAM_ERROR_NOT_IN_OPERATION = TIZEN_ERROR_UA | 0x02, /**< Not in progress */
+       UAM_ERROR_ALREADY_DONE = TIZEN_ERROR_UA | 0x03, /**< Already done */
+       UAM_ERROR_INTERNAL = TIZEN_ERROR_UA | 0x04, /**< Internal error */
+       UAM_ERROR_NOT_FOUND = TIZEN_ERROR_UA | 0x10, /**< Not found */
+       UAM_ERROR_ALREADY_REGISTERED = TIZEN_ERROR_UA | 0x11, /**< Already registered */
+       UAM_ERROR_DB_FAILED = TIZEN_ERROR_UA | 0x12, /**< DB operation failed */
+       UAM_ERROR_NOT_REGISTERED = TIZEN_ERROR_UA | 0x13, /**< Not registered */
 } uam_error_e;
 
+/**
+ * @brief Eevent data structure.
+ * @since_tizen 5.5
+ */
 typedef struct {
-       int result;
-       void *data;
-} uam_event_data_t;
+       int result; /**< Result code */
+       void *data; /**< Data pointer */
+} uam_event_data_s;
 
-typedef void (*uam_event_callback)(int event, uam_event_data_t *event_param, void *user_data);
+/**
+ * @brief Callback to be invoked when receiving events.
+ * @since_tizen 5.5
+ *
+ * @remarks The @a event_param should not be released.
+ * @remarks The @a event_param can be used only in the callback.
+ *
+ * @param[in] event Event type.
+ * @param[in] event_param The event data structure.
+ * @param[in] user_data The user data passed in _uam_init()
+ *
+ * @exception
+ * @pre
+ * @post
+ *
+ * @see _uam_init()
+ */
+typedef void (*uam_event_cb)(int event, uam_event_data_s *event_param, void *user_data);
 
-int _uam_init(uam_event_callback cb, void *user_data);
+/**
+ * @brief Initializes client library.
+ * @since_tizen 5.5
+ *
+ * @param[in] cb Callback handler
+ * @param[in] user_data The user data.
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @rerval #UAM_ERROR_ALREADY_REGISTERED Already registered
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
+int _uam_init(uam_event_cb cb, void *user_data);
 
+/**
+ * @brief De-initializes client library.
+ * @since_tizen 5.5
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @rerval #UAM_ERROR_NOT_REGISTERED Not registered
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
 int _uam_deinit(void);
 
+/**
+ * @brief Gets available sensor list.
+ * @since_tizen 5.5
+ *
+ * @param[out] bitmask Available sensor list
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
 int _uam_get_available_sensors(unsigned int *bitmask);
 
+/**
+ * @brief Gets a specific sensor availability.
+ * @since_tizen 5.5
+ *
+ * @param[in] sensor Sensor type
+ * @param[out] status Sensor state
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
 int _uam_is_sensor_ready(unsigned int sensor, gboolean* status);
 
+/**
+ * @brief Starts presence detection.
+ * @since_tizen 5.5
+ *
+ * @param[in] bitmask Bitmask to detect
+ * @param[in] service Service name
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
 int _uam_start_presence_detection(unsigned int bitmask, const char *service);
 
+/**
+ * @brief Stops presence detection.
+ * @since_tizen 5.5
+ *
+ * @param[in] bitmask Bitmask to detect
+ * @param[in] service Service name
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
 int _uam_stop_presence_detection(unsigned int bitmask, const char *service);
 
+/**
+ * @brief Starts absence detection.
+ * @since_tizen 5.5
+ *
+ * @param[in] bitmask Bitmask to detect
+ * @param[in] service Service name
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
 int _uam_start_absence_detection(unsigned int bitmask, const char *service);
 
+/**
+ * @brief Stops absence detection.
+ * @since_tizen 5.5
+ *
+ * @param[in] bitmask Bitmask to detect
+ * @param[in] service Service name
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
 int _uam_stop_absence_detection(unsigned int bitmask, const char *service);
 
+/**
+ * @brief Starts active devices searching.
+ * @since_tizen 5.5
+ *
+ * @param[in] bitmask Bitmask to detect
+ * @param[in] detection_period Detection period
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
 int _uam_start_search_active_devices(unsigned int bitmask, int detection_period);
 
+/**
+ * @brief Stops active devices searching.
+ * @since_tizen 5.5
+ *
+ * @param[in] bitmask Bitmask to detect
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
 int _uam_stop_search_active_devices(unsigned int bitmask);
 
+/**
+ * @brief Registers application id.
+ * @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 #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
 int _uam_register_app(const char *app_id, unsigned short uid);
 
+/**
+ * @brief Unregisters application id.
+ * @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 #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
 int _uam_deregister_app(const char *app_id, unsigned short uid);
 
+/**
+ * @brief Enumerations for presence state.
+ * @since_tizen 5.5
+ */
 typedef enum {
-       UAM_PRESENCE_STATE_INVALID = 0x00,
-       UAM_PRESENCE_STATE_PRESENT,
-       UAM_PRESENCE_STATE_ABSENT,
+       UAM_PRESENCE_STATE_INVALID = 0x00, /**< Invaild state */
+       UAM_PRESENCE_STATE_PRESENT, /**< Presence state */
+       UAM_PRESENCE_STATE_ABSENT, /**< Absence state */
 } uam_presence_state_e;
 
+/**
+ * @brief Enumerations for OS type.
+ * @since_tizen 5.5
+ */
 typedef enum {
-       UAM_OS_TYPE_UNDEFINED = 0x00,
-       UAM_OS_TYPE_TIZEN,
-       UAM_OS_TYPE_ANDROID,
-       UAM_OS_TYPE_IOS,
-       UAM_OS_TYPE_INVALID
+       UAM_OS_TYPE_UNDEFINED = 0x00, /**< Undefined */
+       UAM_OS_TYPE_TIZEN, /**< Tizen */
+       UAM_OS_TYPE_ANDROID, /**< Android */
+       UAM_OS_TYPE_IOS, /**< iOS */
+       UAM_OS_TYPE_INVALID /**< Invalid */
 } uam_os_type_e;
 
+/**
+ * @brief Enumerations for connectivity type.
+ * @since_tizen 5.5
+ */
 typedef enum {
-       UAM_TECH_TYPE_NONE = 0x00,
-       UAM_TECH_TYPE_BT = 0x01,
-       UAM_TECH_TYPE_BLE = 0x02,
-       UAM_TECH_TYPE_WIFI = 0x04,
-       UAM_TECH_TYPE_P2P = 0x08,
-       UAM_TECH_TYPE_MAX
+       UAM_TECH_TYPE_NONE = 0x00, /**< None */
+       UAM_TECH_TYPE_BT = 0x01, /**< BT */
+       UAM_TECH_TYPE_BLE = 0x02, /**< BLE */
+       UAM_TECH_TYPE_WIFI = 0x04, /**< Wi-Fi */
+       UAM_TECH_TYPE_P2P = 0x08, /**< Wi-Fi p2p */
+       UAM_TECH_TYPE_MAX /**< Max. connectivity type */
 } uam_tech_type_e;
 
+/**
+ * @brief Device info structure.
+ * @since_tizen 5.5
+ */
 typedef struct {
-       uam_os_type_e operating_system; /* Device's OS */
-       uam_tech_type_e type; /* Device's mac address type (BT/BLE/WIFI/P2p/...) */
-       char mac[UAM_MAC_ADDRESS_STRING_LEN]; /* Device's MAC ADDRESS */
-       char ipv4_addr[UAM_IP_ADDRESS_MAX_STRING_LEN];/* Device's IPv4 address optional */
-       char device_id[UAM_DEVICE_ID_MAX_STRING_LEN]; /* Device's uniquie ID */
-       long long int last_seen; /* Latest timestamp when device was discoverd */
-} uam_device_info_t;
-
-typedef struct {
-       char account[UAM_USER_ACCOUNT_MAX_STRING_LEN];
-       char name[UAM_USER_NAME_MAX_STRING_LEN];
-} uam_user_info_t;
-
+       uam_os_type_e operating_system; /**< Operating system */
+       uam_tech_type_e type; /**< Device's mac address type (BT/BLE/WIFI/P2p/...) */
+       char mac[UAM_MAC_ADDRESS_STRING_LEN]; /**< Device's MAC ADDRESS */
+       char ipv4_addr[UAM_IP_ADDRESS_MAX_STRING_LEN];/**< Device's IPv4 address optional */
+       char device_id[UAM_DEVICE_ID_MAX_STRING_LEN]; /**< Device's uniquie ID */
+       long long int last_seen; /**< Latest timestamp when device was discoverd */
+} uam_device_info_s;
+
+/**
+ * @brief User info structure.
+ * @since_tizen 5.5
+ */
 typedef struct {
-       unsigned int sensor_bitmask; /* Detecting sensor's bitmask */
-       char account[UAM_USER_ACCOUNT_MAX_STRING_LEN];
-       char service[UAM_SERVICE_MAX_STRING_LEN];
-} uam_detection_event_data_t;
+       char account[UAM_USER_ACCOUNT_MAX_STRING_LEN]; /**< User account */
+       char name[UAM_USER_NAME_MAX_STRING_LEN]; /**< User name */
+} uam_user_info_s;
 
+/**
+ * @brief Detection event structure.
+ * @since_tizen 5.5
+ */
 typedef struct {
-       char account[UAM_USER_ACCOUNT_MAX_STRING_LEN];
-       char name[UAM_USER_NAME_MAX_STRING_LEN];
-} uam_user_event_data_t;
-
+       unsigned int sensor_bitmask; /**< Detecting sensor's bitmask */
+       char account[UAM_USER_ACCOUNT_MAX_STRING_LEN]; /**< User account */
+       char service[UAM_SERVICE_MAX_STRING_LEN]; /**< Service name */
+} uam_detection_event_data_s;
+
+/**
+ * @brief User event structure.
+ * @since_tizen 5.5
+ */
 typedef struct {
-       int cycle;
-       int period;
-       int retries;
-} uam_detection_params_t;
+       char account[UAM_USER_ACCOUNT_MAX_STRING_LEN]; /**< User account */
+       char name[UAM_USER_NAME_MAX_STRING_LEN]; /**< User name */
+} uam_user_event_data_s;
 
+/**
+ * @brief Application info structure.
+ * @since_tizen 5.5
+ */
 typedef struct {
-       char *sender;
-       unsigned short uid;
-       char app_id[UAM_APP_ID_MAX_STRING_LEN];
-} uam_app_info_t;
-
+       char *sender; /**< Dbus sender */
+       unsigned short uid; /**< UID */
+       char app_id[UAM_APP_ID_MAX_STRING_LEN]; /**< Application id */
+} uam_app_info_s;
+
+/**
+ * @brief Gets registered user list.
+ * @since_tizen 5.5
+ *
+ * @remarks The @a user_list should be destroyed by using #g_free() and #g_ptr_array_free().
+ *
+ * @param[out] user_list User list array
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
 int _uam_get_registered_users(GPtrArray **user_list);
 
+/**
+ * @brief Checks registerd device.
+ * @since_tizen 5.5
+ *
+ * @param[in] dev_info Device info
+ * @param[out] is_registered Registered or not
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
 int _uam_is_device_registered(
-               uam_device_info_t *dev_info, gboolean *is_registered);
+               uam_device_info_s *dev_info, gboolean *is_registered);
 
-typedef void (*uam_event_callback)(int event, uam_event_data_t *event_param, void *user_data);
+/**
+ * @brief Callback to be called when receiving events.
+ * @since_tizen 5.5
+ *
+ * @remarks The @a event_param should not be released.
+ * @remarks The @a event_param can be used only in the callback.
+ *
+ * @param[in] event Event type
+ * @param[in] event_param Event data
+ * @param[in] user_data User data passed in _uam_init().
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
+typedef void (*uam_event_cb)(int event, uam_event_data_s *event_param, void *user_data);
 
-int _uam_init(uam_event_callback cb, void *user_data);
+/**
+ * @brief Intializes a client library of ua-manager.
+ * @since_tizen 5.5
+ *
+ * @param[in] cb Event callback
+ * @param[in] user_data User data passed in _uam_init().
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
+int _uam_init(uam_event_cb cb, void *user_data);
 
+/**
+ * @brief De-intializes a client library of ua-manager.
+ * @since_tizen 5.5
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
 int _uam_deinit(void);
 
+/**
+ * @brief Retrieves available sensor list.
+ * @since_tizen 5.5
+ *
+ * @param[in] bitmask Available sensor list
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
 int _uam_get_available_sensors(unsigned int *bitmask);
 
-int _uam_get_default_user(uam_user_info_t * uam_user);
+/**
+ * @brief Gets default user info.
+ * @since_tizen 5.5
+ *
+ * @param[in] uam_user User information
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
+int _uam_get_default_user(uam_user_info_s *uam_user);
 
-int _uam_add_user(uam_user_info_t * user);
+/**
+ * @brief Adds user info.
+ * @since_tizen 5.5
+ *
+ * @param[in] user User information.
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
+int _uam_add_user(uam_user_info_s *user);
 
+/**
+ * @brief Removes user info.
+ * @since_tizen 5.5
+ *
+ * @param[in] account User account.
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
 int _uam_remove_user(char *account);
 
-int _uam_request_get_user_by_account(char *account, uam_user_info_t * user);
+/**
+ * @brief Brings user information that meet the user account.
+ * @since_tizen 5.5
+ *
+ * @remarks The @a user should not be released.
+ * @remarks The @a user can be used only in the function.
+ *
+ * @param[in] account User account.
+ * @param[out] user User information.
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
+int _uam_request_get_user_by_account(char *account, uam_user_info_s *user);
 
-int _uam_request_get_user_by_deviceid(char *device_id, uam_user_info_t * user);
+/**
+ * @brief Brings user information that meet the device id.
+ * @since_tizen 5.5
+ *
+ * @remarks The @a user should not be released.
+ * @remarks The @a user can be used only in the function.
+ *
+ * @param[in] device_id Device id.
+ * @param[out] user User information.
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
+int _uam_request_get_user_by_deviceid(char *device_id, uam_user_info_s *user);
 
-int _uam_request_get_user_by_mac(char *mac, uam_user_info_t * user);
+/**
+ * @brief Brings user information that meet the MAC address.
+ * @since_tizen 5.5
+ *
+ * @remarks The @a user should not be released.
+ * @remarks The @a user can be used only in the function.
+ *
+ * @param[in] mac Mac address.
+ * @param[out] user User information.
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
+int _uam_request_get_user_by_mac(char *mac, uam_user_info_s *user);
 
-int _uam_request_add_device(char *account, uam_device_info_t *device);
+/**
+ * @brief Requests to add a device info to the user.
+ * @since_tizen 5.5
+ *
+ * @param[in] account User account.
+ * @param[in] device Device information.
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
+int _uam_request_add_device(char *account, uam_device_info_s *device);
 
-int _uam_request_remove_device(char *account, uam_device_info_t *device);
+/**
+ * @brief Requests to remove a device info to the user.
+ * @since_tizen 5.5
+ *
+ * @param[in] account User account.
+ * @param[in] device Device information.
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
+int _uam_request_remove_device(char *account, uam_device_info_s *device);
 
-int _uam_request_remove_device_by_deviceid(const char *device_id, uam_tech_type_e tech_type);
+/**
+ * @brief Deletes device information matching device id and sensor type.
+ * @since_tizen 5.5
+ *
+ * @param[in] device_id Device id.
+ * @param[in] tech_type Sensor type.
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
+int _uam_request_remove_device_by_deviceid(const char *device_id,
+       uam_tech_type_e tech_type);
 
+/**
+ * @brief Deletes device information matching device MAC.
+ * @since_tizen 5.5
+ *
+ * @param[in] mac MAC address.
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
 int _uam_request_remove_device_by_mac(const char *mac);
 
-int _uam_request_get_device_by_deviceid(const char *device_id, uam_tech_type_e tech_type, uam_device_info_t *device);
+/**
+ * @brief Retrieves device information matching device id.
+ * @since_tizen 5.5
+ *
+ * @remarks The @a device should not be released.
+ * @remarks The @a device can be used only in the function.
+ *
+ * @param[in] device_id Device id.
+ * @param[in] tech_type Sensor type.
+ * @param[out] device Device information.
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
+int _uam_request_get_device_by_deviceid(const char *device_id,
+       uam_tech_type_e tech_type, uam_device_info_s *device);
 
-int _uam_request_get_device_by_mac(const char *mac, uam_device_info_t *device);
+/**
+ * @brief Retrieves device information matching MAC address.
+ * @since_tizen 5.5
+ *
+ * @remarks The @a device should not be released.
+ * @remarks The @a device can be used only in the function.
+ *
+ * @param[in] mac MAC address.
+ * @param[out] device Device information.
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
+int _uam_request_get_device_by_mac(const char *mac, uam_device_info_s *device);
 
+/**
+ * @brief Gets registered devices list.
+ * @since_tizen 5.5
+ *
+ * @remarks The @a devices_list should be destroyed by using #g_free() and #g_ptr_array_free().
+ *
+ * @param[out] devices_list Device list array
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
 int _uam_request_get_devices(GPtrArray **devices_list);
 
+/**
+ * @brief Gets registered devices list per a user.
+ * @since_tizen 5.5
+ *
+ * @remarks The @a devices_list should be destroyed by using #g_free() and #g_ptr_array_free().
+ *
+ * @param[in] account User account.
+ * @param[out] devices_list Devices list
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
 int _uam_request_get_user_devices(char *account, GPtrArray **devices_list);
 
-int _uam_request_set_detection_threshold(unsigned int sensor_type, int presence_threshold, int absence_threshold);
+/**
+ * @brief Sets detection threshold.
+ * @since_tizen 5.5
+ *
+ * @param[in] sensor_type Sensor type.
+ * @param[in] presence_threshold Threshold value for presence.
+ * @param[in] absence_threshold Threshold value for absence.
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
+int _uam_request_set_detection_threshold(unsigned int sensor_type,
+       int presence_threshold, int absence_threshold);
 
+/**
+ * @brief Enables low-power mode.
+ * @since_tizen 5.5
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
 int _uam_enable_low_power_mode(void);
 
+/**
+ * @brief Disables low-power mode.
+ * @since_tizen 5.5
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
 int _uam_disable_low_power_mode(void);
 
+/**
+ * @brief Gets detction window size.
+ * @since_tizen 5.5
+ *
+ * @param[out] window Window size
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
 int _uam_get_detection_window(unsigned int *window);
 
+/**
+ * @brief Sets detction window.
+ * @since_tizen 5.5
+ *
+ * @param[in] window Window size
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
 int _uam_set_detection_window(unsigned int window);
 
+/**
+ * @brief Adds a user to the service.
+ * @since_tizen 5.5
+ *
+ * @param[in] service Service idt.
+ * @param[in] account User account.
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
 int _uam_service_add_user(const char *service, const char *account);
 
+/**
+ * @brief Removes a user from the service.
+ * @since_tizen 5.5
+ *
+ * @param[in] service Service idt.
+ * @param[in] account User account.
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
 int _uam_service_remove_user(const char *service, const char *account);
 
-int _uam_service_add_device(const char *service, char *device_id, uam_tech_type_e tech_type);
+/**
+ * @brief Adds a device to the service.
+ * @since_tizen 5.5
+ *
+ * @param[in] service Service idt.
+ * @param[in] device_id Device id.
+ * @param[in] tech_type Sensor type.
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
+int _uam_service_add_device(const char *service, char *device_id,
+       uam_tech_type_e tech_type);
 
-int _uam_service_remove_device(const char *service, char *device_id, uam_tech_type_e tech_type);
+/**
+ * @brief Removes a device from the service.
+ * @since_tizen 5.5
+ *
+ * @param[in] service Service idt.
+ * @param[in] device_id Device id.
+ * @param[in] tech_type Sensor type.
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
+int _uam_service_remove_device(const char *service, char *device_id,
+       uam_tech_type_e tech_type);
 
+/**
+ * @brief Sets detction cycle per eash service.
+ * @since_tizen 5.5
+ *
+ * @param[in] service Service id
+ * @param[in] cycle The cycle number of the service.
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
 int _uam_set_service_detection_cycle(const char *service, unsigned int cycle);
 
+/**
+ * @brief Gets detction cycle per eash service.
+ * @since_tizen 5.5
+ *
+ * @param[in] service Service id
+ * @param[out] cycle The cycle number of the service.
+ *
+ * @return 0 on success, otherwise a negative error value
+ * @retval #UAM_ERROR_NONE Successful
+ * @retval #UAM_ERROR_INVALID_PARAMETER Invalid parameters
+ * @retval #UAM_ERROR_INTERNAL Internal error
+ *
+ * @exception
+ * @pre
+ * @post
+ */
 int _uam_get_service_detection_cycle(const char *service, unsigned int *cycle);
 
 #ifdef __cplusplus
 }
 #endif
-#endif /* __UAM_API_H__ */
+#endif /* __TIZEN_UA_NETWORK_UA_API_H__ */
index 0adc57f..8935aca 100644 (file)
@@ -93,6 +93,8 @@ typedef enum {
 #define UAM_SIGNAL_DEVICE_FOUND "DeviceFound"
 #define UAM_SIGNAL_SCAN_COMPLETED "ScanCompleted"
 
+#define CASE_TO_STR(x) case x: return #x;
+
 #ifdef __cplusplus
 }
 #endif
index 5206e65..41f294d 100644 (file)
         <allow send_destination="net.uamd"/>
         <allow send_destination="net.uamd.enabler"/>
     </policy>
+    <policy group="users">
+        <allow send_destination="net.uamd"/>
+        <allow send_destination="net.uamd.enabler"/>
+    </policy>
     <policy context="default">
         <deny own="net.uamd"/>
         <deny own="net.uamd.enabler"/>
index 3876b10..146fcf6 100644 (file)
@@ -76,7 +76,7 @@ do { \
        do { \
                if (NULL == arg) { \
                        UAM_ERR("%s is NULL", #arg); \
-                       return UAM_ERROR_INVALID_PARAM; \
+                       return UAM_ERROR_INVALID_PARAMETER; \
                } \
        } while (0)
 
index 648e21d..7c061c1 100644 (file)
@@ -22,7 +22,7 @@
 extern "C" {
 #endif
 
-int _uam_register_event_handler(uam_event_callback event_cb, void *user_data);
+int _uam_register_event_handler(uam_event_cb event_cb, void *user_data);
 int _uam_unregister_event_handler(void);
 
 #ifdef __cplusplus
index 5d8f77b..27aba22 100644 (file)
@@ -36,7 +36,7 @@ int _uam_sync_request(
 int _uam_async_request(int req_func,
                GArray *in_param1, GArray *in_param2,
                GArray *in_param3, GArray *in_param4,
-               uam_event_callback callback, void *user_data);
+               uam_event_cb callback, void *user_data);
 
 #ifdef __cplusplus
 }
index b62a1c2..6611c96 100644 (file)
@@ -28,7 +28,7 @@ typedef struct {
 
 static uam_callback_info_t cb_info;
 
-UAM_EXPORT_API int _uam_init(uam_event_callback cb, void *user_data)
+UAM_EXPORT_API int _uam_init(uam_event_cb cb, void *user_data)
 {
        FUNC_ENTRY;
        int ret;
@@ -101,16 +101,16 @@ UAM_EXPORT_API int _uam_get_registered_users(GPtrArray **user_list)
                int i;
                int count;
 
-               count = (out_param->len)/sizeof(uam_user_info_t);
+               count = (out_param->len)/sizeof(uam_user_info_s);
                if (0 == count)
                        UAM_INFO("No registered users");
 
                for (i = 0; i < count; i++) {
-                       uam_user_info_t *user_info = NULL;
-                       uam_user_info_t *info;
+                       uam_user_info_s *user_info = NULL;
+                       uam_user_info_s *info;
 
-                       info = &g_array_index(out_param, uam_user_info_t, i);
-                       user_info = g_memdup(info, sizeof(uam_user_info_t));
+                       info = &g_array_index(out_param, uam_user_info_s, i);
+                       user_info = g_memdup(info, sizeof(uam_user_info_s));
                        if (user_info)
                                g_ptr_array_add(*user_list, (gpointer)user_info);
                }
@@ -122,7 +122,7 @@ UAM_EXPORT_API int _uam_get_registered_users(GPtrArray **user_list)
        return ret;
 }
 
-UAM_EXPORT_API int _uam_is_device_registered(uam_device_info_t *dev_info, gboolean *is_registered)
+UAM_EXPORT_API int _uam_is_device_registered(uam_device_info_s *dev_info, gboolean *is_registered)
 {
        FUNC_ENTRY;
        int ret;
@@ -132,7 +132,7 @@ UAM_EXPORT_API int _uam_is_device_registered(uam_device_info_t *dev_info, gboole
        UAM_INIT_PARAMS();
        UAM_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
 
-       g_array_append_vals(in_param1, dev_info, sizeof(uam_device_info_t));
+       g_array_append_vals(in_param1, dev_info, sizeof(uam_device_info_s));
        ret = _uam_sync_request(UAM_REQUEST_IS_DEVICE_ADDED,
                        in_param1, in_param2, in_param3, in_param4, &out_param);
        if (UAM_ERROR_NONE == ret)
@@ -144,7 +144,7 @@ UAM_EXPORT_API int _uam_is_device_registered(uam_device_info_t *dev_info, gboole
        return ret;
 }
 
-UAM_EXPORT_API int _uam_get_default_user(uam_user_info_t *user)
+UAM_EXPORT_API int _uam_get_default_user(uam_user_info_s *user)
 {
        FUNC_ENTRY;
        int ret;
@@ -159,10 +159,10 @@ UAM_EXPORT_API int _uam_get_default_user(uam_user_info_t *user)
 
        if (UAM_ERROR_NONE == ret) {
                if (out_param->len > 0) {
-                       uam_user_info_t *info;
+                       uam_user_info_s *info;
 
-                       info = &g_array_index(out_param, uam_user_info_t, 0);
-                       memcpy(user, info, sizeof(uam_user_info_t));
+                       info = &g_array_index(out_param, uam_user_info_s, 0);
+                       memcpy(user, info, sizeof(uam_user_info_s));
                } else {
                        UAM_WARN("out_param length is 0");
                }
@@ -174,7 +174,7 @@ UAM_EXPORT_API int _uam_get_default_user(uam_user_info_t *user)
        return ret;
 }
 
-UAM_EXPORT_API int _uam_add_user(uam_user_info_t *user)
+UAM_EXPORT_API int _uam_add_user(uam_user_info_s *user)
 {
        FUNC_ENTRY;
        int ret;
@@ -225,7 +225,7 @@ UAM_EXPORT_API int _uam_remove_user(char *account)
 }
 
 UAM_EXPORT_API int _uam_request_get_user_by_account(char *account,
-       uam_user_info_t *user)
+       uam_user_info_s *user)
 {
        FUNC_ENTRY;
        int ret;
@@ -244,10 +244,10 @@ UAM_EXPORT_API int _uam_request_get_user_by_account(char *account,
 
        if (UAM_ERROR_NONE == ret) {
                if (out_param->len > 0) {
-                       uam_user_info_t *info;
+                       uam_user_info_s *info;
 
-                       info = &g_array_index(out_param, uam_user_info_t, 0);
-                       memcpy(user, info, sizeof(uam_user_info_t));
+                       info = &g_array_index(out_param, uam_user_info_s, 0);
+                       memcpy(user, info, sizeof(uam_user_info_s));
                } else {
                        UAM_WARN("out_param length is 0");
                }
@@ -260,7 +260,7 @@ UAM_EXPORT_API int _uam_request_get_user_by_account(char *account,
 }
 
 UAM_EXPORT_API int _uam_request_get_user_by_deviceid(char *device_id,
-       uam_user_info_t *user)
+       uam_user_info_s *user)
 {
        FUNC_ENTRY;
        int ret;
@@ -279,10 +279,10 @@ UAM_EXPORT_API int _uam_request_get_user_by_deviceid(char *device_id,
 
        if (UAM_ERROR_NONE == ret) {
                if (out_param->len > 0) {
-                       uam_user_info_t * info;
+                       uam_user_info_s * info;
 
-                       info = &g_array_index(out_param, uam_user_info_t, 0);
-                       memcpy(user, info, sizeof(uam_user_info_t));
+                       info = &g_array_index(out_param, uam_user_info_s, 0);
+                       memcpy(user, info, sizeof(uam_user_info_s));
                } else {
                        UAM_WARN("out_param length is 0");
                }
@@ -295,7 +295,7 @@ UAM_EXPORT_API int _uam_request_get_user_by_deviceid(char *device_id,
 }
 
 UAM_EXPORT_API int _uam_request_get_user_by_mac(char *mac,
-       uam_user_info_t *user)
+       uam_user_info_s *user)
 {
        FUNC_ENTRY;
        int ret;
@@ -314,10 +314,10 @@ UAM_EXPORT_API int _uam_request_get_user_by_mac(char *mac,
 
        if (UAM_ERROR_NONE == ret) {
                if (out_param->len > 0) {
-                       uam_user_info_t * info;
+                       uam_user_info_s * info;
 
-                       info = &g_array_index(out_param, uam_user_info_t, 0);
-                       memcpy(user, info, sizeof(uam_user_info_t));
+                       info = &g_array_index(out_param, uam_user_info_s, 0);
+                       memcpy(user, info, sizeof(uam_user_info_s));
                } else {
                        UAM_WARN("out_param length is 0");
                }
@@ -330,7 +330,7 @@ UAM_EXPORT_API int _uam_request_get_user_by_mac(char *mac,
 }
 
 UAM_EXPORT_API int _uam_request_add_device(char *account,
-       uam_device_info_t *device)
+       uam_device_info_s *device)
 {
        FUNC_ENTRY;
        int ret;
@@ -344,7 +344,7 @@ UAM_EXPORT_API int _uam_request_add_device(char *account,
 
        g_strlcpy(str, account, UAM_USER_ACCOUNT_MAX_STRING_LEN);
        g_array_append_vals(in_param1, str, sizeof(str));
-       g_array_append_vals(in_param2, device, sizeof(uam_device_info_t));
+       g_array_append_vals(in_param2, device, sizeof(uam_device_info_s));
        ret = _uam_async_request(UAM_REQUEST_ADD_DEVICE, in_param1, in_param2,
                        in_param3, in_param4, cb_info.callback, cb_info.user_data);
 
@@ -355,7 +355,7 @@ UAM_EXPORT_API int _uam_request_add_device(char *account,
 }
 
 UAM_EXPORT_API int _uam_request_remove_device(char *account,
-       uam_device_info_t *device)
+       uam_device_info_s *device)
 {
        FUNC_ENTRY;
        int ret;
@@ -369,7 +369,7 @@ UAM_EXPORT_API int _uam_request_remove_device(char *account,
 
        g_strlcpy(str, account, UAM_USER_ACCOUNT_MAX_STRING_LEN);
        g_array_append_vals(in_param1, str, sizeof(str));
-       g_array_append_vals(in_param2, device, sizeof(uam_device_info_t));
+       g_array_append_vals(in_param2, device, sizeof(uam_device_info_s));
        ret = _uam_sync_request(UAM_REQUEST_DELETE_DEVICE,
                        in_param1, in_param2, in_param3, in_param4, &out_param);
 
@@ -426,7 +426,7 @@ UAM_EXPORT_API int _uam_request_remove_device_by_mac(const char *mac)
 }
 
 UAM_EXPORT_API int _uam_request_get_device_by_deviceid(const char *device_id,
-               uam_tech_type_e tech_type, uam_device_info_t *device)
+               uam_tech_type_e tech_type, uam_device_info_s *device)
 {
        FUNC_ENTRY;
        int ret;
@@ -446,10 +446,10 @@ UAM_EXPORT_API int _uam_request_get_device_by_deviceid(const char *device_id,
 
        if (UAM_ERROR_NONE == ret) {
                if (out_param->len > 0) {
-                       uam_device_info_t* info;
+                       uam_device_info_s* info;
 
-                       info = &g_array_index(out_param, uam_device_info_t, 0);
-                       memcpy(device, info, sizeof(uam_device_info_t));
+                       info = &g_array_index(out_param, uam_device_info_s, 0);
+                       memcpy(device, info, sizeof(uam_device_info_s));
                } else {
                        UAM_WARN("out_param length is 0");
                }
@@ -462,7 +462,7 @@ UAM_EXPORT_API int _uam_request_get_device_by_deviceid(const char *device_id,
 }
 
 UAM_EXPORT_API int _uam_request_get_device_by_mac(const char *mac,
-       uam_device_info_t *device)
+       uam_device_info_s *device)
 {
        FUNC_ENTRY;
        int ret;
@@ -481,10 +481,10 @@ UAM_EXPORT_API int _uam_request_get_device_by_mac(const char *mac,
 
        if (UAM_ERROR_NONE == ret) {
                if (out_param->len > 0) {
-                       uam_device_info_t* info;
+                       uam_device_info_s* info;
 
-                       info = &g_array_index(out_param, uam_device_info_t, 0);
-                       memcpy(device, info, sizeof(uam_device_info_t));
+                       info = &g_array_index(out_param, uam_device_info_s, 0);
+                       memcpy(device, info, sizeof(uam_device_info_s));
                } else {
                        UAM_WARN("out_param length is 0");
                }
@@ -512,16 +512,16 @@ UAM_EXPORT_API int _uam_request_get_devices(GPtrArray **devices_list)
                int i;
                int count;
 
-               count = (out_param->len)/sizeof(uam_device_info_t);
+               count = (out_param->len)/sizeof(uam_device_info_s);
                if (0 == count)
                        UAM_INFO("No registered device");
 
                for (i = 0; i < count; i++) {
-                       uam_device_info_t *device_info = NULL;
-                       uam_device_info_t *info;
+                       uam_device_info_s *device_info = NULL;
+                       uam_device_info_s *info;
 
-                       info = &g_array_index(out_param, uam_device_info_t, i);
-                       device_info = g_memdup(info, sizeof(uam_device_info_t));
+                       info = &g_array_index(out_param, uam_device_info_s, i);
+                       device_info = g_memdup(info, sizeof(uam_device_info_s));
                        if (device_info)
                                g_ptr_array_add(*devices_list, (gpointer)device_info);
                }
@@ -554,16 +554,16 @@ UAM_EXPORT_API int _uam_request_get_user_devices(char *account, GPtrArray **devi
                int i;
                int count;
 
-               count = (out_param->len)/sizeof(uam_device_info_t);
+               count = (out_param->len)/sizeof(uam_device_info_s);
                if (0 == count)
                        UAM_INFO("No registered device");
 
                for (i = 0; i < count; i++) {
-                       uam_device_info_t *device_info = NULL;
-                       uam_device_info_t *info;
+                       uam_device_info_s *device_info = NULL;
+                       uam_device_info_s *info;
 
-                       info = &g_array_index(out_param, uam_device_info_t, i);
-                       device_info = g_memdup(info, sizeof(uam_device_info_t));
+                       info = &g_array_index(out_param, uam_device_info_s, i);
+                       device_info = g_memdup(info, sizeof(uam_device_info_s));
                        if (device_info)
                                g_ptr_array_add(*devices_list, (gpointer)device_info);
                }
@@ -833,7 +833,7 @@ UAM_EXPORT_API int _uam_register_app(const char *app_id, unsigned short uid)
 {
        FUNC_ENTRY;
        int ret;
-       uam_app_info_t app_info;
+       uam_app_info_s app_info;
 
        UAM_INIT_PARAMS();
        UAM_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
@@ -841,7 +841,7 @@ UAM_EXPORT_API int _uam_register_app(const char *app_id, unsigned short uid)
        g_strlcpy(app_info.app_id, app_id, UAM_APP_ID_MAX_STRING_LEN);
        app_info.uid = uid;
 
-       g_array_append_vals(in_param1, &app_info, sizeof(uam_app_info_t));
+       g_array_append_vals(in_param1, &app_info, sizeof(uam_app_info_s));
        ret = _uam_sync_request(UAM_REQUEST_REGISTER_APP,
                        in_param1, in_param2, in_param3, in_param4, &out_param);
 
@@ -855,7 +855,7 @@ UAM_EXPORT_API int _uam_deregister_app(const char *app_id, unsigned short uid)
 {
        FUNC_ENTRY;
        int ret;
-       uam_app_info_t app_info;
+       uam_app_info_s app_info;
 
        UAM_INIT_PARAMS();
        UAM_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4, out_param);
@@ -863,7 +863,7 @@ UAM_EXPORT_API int _uam_deregister_app(const char *app_id, unsigned short uid)
        g_strlcpy(app_info.app_id, app_id, UAM_APP_ID_MAX_STRING_LEN);
        app_info.uid = uid;
 
-       g_array_append_vals(in_param1, &app_info, sizeof(uam_app_info_t));
+       g_array_append_vals(in_param1, &app_info, sizeof(uam_app_info_s));
        ret = _uam_sync_request(UAM_REQUEST_DEREGISTER_APP,
                        in_param1, in_param2, in_param3, in_param4, &out_param);
 
index 2cd1f30..a405942 100644 (file)
 
 #include "ua-common.h"
 
-const char *event_string[] = {
-       FOREACH_EVENT(GENERATE_EVENT_STRING)
-};
-
 const char *request_string[] = {
        FOREACH_REQUEST(GENERATE_REQUEST_STRING)
 };
@@ -95,13 +91,44 @@ const char *_uam_event_to_str(unsigned int event)
 {
        retv_if(UAM_EVENT_MAX <= event, NULL);
 
-       return event_string[event];
+       switch (event) {
+       CASE_TO_STR(UAM_EVENT_USER_ADDED)
+       CASE_TO_STR(UAM_EVENT_USER_REMOVED)
+       CASE_TO_STR(UAM_EVENT_DEVICE_ADDED)
+       CASE_TO_STR(UAM_EVENT_DEVICE_REMOVED)
+       CASE_TO_STR(UAM_EVENT_PRESENCE_DETECTED)
+       CASE_TO_STR(UAM_EVENT_USER_PRESENCE_DETECTED)
+       CASE_TO_STR(UAM_EVENT_ABSENCE_DETECTED)
+       CASE_TO_STR(UAM_EVENT_USER_ABSENCE_DETECTED)
+       CASE_TO_STR(UAM_EVENT_AMBIANT_MODE_ENABLED)
+       CASE_TO_STR(UAM_EVENT_AMBIANT_MODE_DISABLED)
+       CASE_TO_STR(UAM_EVENT_SENSOR_STATE_READY)
+       CASE_TO_STR(UAM_EVENT_SENSOR_STATE_NOT_READY)
+       CASE_TO_STR(UAM_EVENT_DETECTION_STARTED)
+       CASE_TO_STR(UAM_EVENT_DETECTION_STOPPED)
+       CASE_TO_STR(UAM_EVENT_DEVICE_FOUND)
+       CASE_TO_STR(UAM_EVENT_SCAN_COMPLETED)
+       default:
+               return "UNKNOWN ERROR";
+       }
 }
 
 const char *_uam_error_to_str(int error)
 {
        switch (error) {
-       FOREACH_ERROR(GENERATE_ERROR_CASE);
+       CASE_TO_STR(UAM_ERROR_NONE)
+       CASE_TO_STR(UAM_ERROR_INVALID_PARAMETER)
+       CASE_TO_STR(UAM_ERROR_PERMISSION_DENIED)
+       CASE_TO_STR(UAM_ERROR_TIMED_OUT)
+       CASE_TO_STR(UAM_ERROR_NOW_IN_PROGRESS)
+       CASE_TO_STR(UAM_ERROR_NOT_SUPPORTED)
+       CASE_TO_STR(UAM_ERROR_NOT_INITIALIZED)
+       CASE_TO_STR(UAM_ERROR_ALREADY_DONE)
+       CASE_TO_STR(UAM_ERROR_INTERNAL)
+       CASE_TO_STR(UAM_ERROR_NOT_FOUND)
+       CASE_TO_STR(UAM_ERROR_ALREADY_REGISTERED)
+       CASE_TO_STR(UAM_ERROR_DB_FAILED)
+       CASE_TO_STR(UAM_ERROR_NOT_REGISTERED)
        default:
                return "UNKNOWN ERROR";
        }
index e2db3a2..5b1214c 100644 (file)
@@ -32,7 +32,7 @@ static void __uam_send_event(int event, int result,
                void *data, void *callback, void *user_data)
 {
        FUNC_ENTRY;
-       uam_event_data_t event_data;
+       uam_event_data_s event_data;
 
        UAM_INFO("Event: %s [0x%4.4X], result= %s [0x%4.4X]",
                        _uam_event_to_str(event), event,
@@ -40,11 +40,11 @@ static void __uam_send_event(int event, int result,
 
        ret_if(NULL == callback);
 
-       memset(&event_data, 0x00, sizeof(uam_event_data_t));
+       memset(&event_data, 0x00, sizeof(uam_event_data_s));
        event_data.result = result;
        event_data.data = data;
 
-       ((uam_event_callback)callback)(event, &event_data, user_data);
+       ((uam_event_cb)callback)(event, &event_data, user_data);
 
        FUNC_EXIT;
 }
@@ -72,7 +72,7 @@ static void __uam_event_handler(GDBusConnection *connection,
                return;
 
        if (0 == strcasecmp(signal_name, UAM_SIGNAL_USER_PRESENCE_DETECTED)) {
-               uam_detection_event_data_t event_data;
+               uam_detection_event_data_s event_data;
                unsigned int sensor_bitmask;
                char *account = NULL;
                char *service = NULL;
@@ -89,7 +89,7 @@ static void __uam_event_handler(GDBusConnection *connection,
                __uam_send_event(event, result, &event_data,
                                event_info->cb, event_info->user_data);
        } else if (0 == strcasecmp(signal_name, UAM_SIGNAL_USER_ABSENCE_DETECTED)) {
-               uam_detection_event_data_t event_data;
+               uam_detection_event_data_s event_data;
                unsigned int sensor_bitmask;
                char *account = NULL;
                char *service = NULL;
@@ -141,11 +141,11 @@ static void __uam_event_handler(GDBusConnection *connection,
                __uam_send_event(event, result, &sensor,
                                event_info->cb, event_info->user_data);
        } else if (0 == strcasecmp(signal_name, UAM_SIGNAL_USER_ADDED)) {
-               uam_user_info_t user_info;
+               uam_user_info_s user_info;
                char *account = NULL;
                char *name = NULL;
 
-               memset(&user_info, 0, sizeof(uam_user_info_t));
+               memset(&user_info, 0, sizeof(uam_user_info_s));
                g_variant_get(parameters, "(i&s&s)", &result,
                                &account, &name);
 
@@ -158,11 +158,11 @@ static void __uam_event_handler(GDBusConnection *connection,
                __uam_send_event(event, result, &user_info,
                                event_info->cb, event_info->user_data);
        } else if (0 == strcasecmp(signal_name, UAM_SIGNAL_USER_REMOVED)) {
-               uam_user_info_t user_info;
+               uam_user_info_s user_info;
                char *account = NULL;
                char *name = NULL;
 
-               memset(&user_info, 0, sizeof(uam_user_info_t));
+               memset(&user_info, 0, sizeof(uam_user_info_s));
                g_variant_get(parameters, "(i&s&s)", &result,
                                &account, &name);
 
@@ -175,7 +175,7 @@ static void __uam_event_handler(GDBusConnection *connection,
                __uam_send_event(event, result, &user_info,
                                event_info->cb, event_info->user_data);
        } else if (0 == strcasecmp(signal_name, UAM_SIGNAL_DEVICE_ADDED)) {
-               uam_device_info_t dev_info;
+               uam_device_info_s dev_info;
                int os, type;
                char *mac = NULL;
                char *ipv4_addr = NULL;
@@ -197,7 +197,7 @@ static void __uam_event_handler(GDBusConnection *connection,
                __uam_send_event(event, result, &dev_info,
                                event_info->cb, event_info->user_data);
        } else if (0 == strcasecmp(signal_name, UAM_SIGNAL_DEVICE_REMOVED)) {
-               uam_device_info_t dev_info;
+               uam_device_info_s dev_info;
                int os, type;
                char *mac = NULL;
                char *ipv4_addr = NULL;
@@ -225,7 +225,7 @@ static void __uam_event_handler(GDBusConnection *connection,
                __uam_send_event(UAM_EVENT_DETECTION_STOPPED, result, NULL,
                                event_info->cb, event_info->user_data);
        } else if (0 == strcasecmp(signal_name, UAM_SIGNAL_DEVICE_FOUND)) {
-               uam_device_info_t dev_info;
+               uam_device_info_s dev_info;
                int os, type;
                char *mac = NULL;
                char *ipv4_addr = NULL;
@@ -258,7 +258,7 @@ static void __uam_event_handler(GDBusConnection *connection,
        FUNC_EXIT;
 }
 
-int _uam_register_event_handler(uam_event_callback event_cb, void *user_data)
+int _uam_register_event_handler(uam_event_cb event_cb, void *user_data)
 {
        FUNC_ENTRY;
        GDBusConnection *conn;
index dfe52da..287ea97 100644 (file)
@@ -92,7 +92,7 @@ static void __uam_get_event_info(int req_func, GArray *output,
                *event = UAM_EVENT_DEVICE_ADDED;
                ret_if(output == NULL);
                *param_data = &g_array_index(output,
-                               uam_device_info_t, 0);
+                               uam_device_info_s, 0);
                break;
        default:
                UAM_ERR("Unknown request function");
@@ -245,7 +245,7 @@ static void __uam_async_request_cb(
        FUNC_ENTRY;
        int event = -1;
        int result = UAM_ERROR_NONE;
-       uam_event_data_t event_data;
+       uam_event_data_s event_data;
        uam_req_info_t *req_info = user_data;
 
        GError *error = NULL;
@@ -253,7 +253,7 @@ static void __uam_async_request_cb(
        GVariant *param1;
        GArray *out_param = NULL;
 
-       memset(&event_data, 0x00, sizeof(uam_event_data_t));
+       memset(&event_data, 0x00, sizeof(uam_event_data_s));
 
        value = g_dbus_proxy_call_finish(G_DBUS_PROXY(object), res, &error);
        if (!value) {
@@ -266,7 +266,7 @@ static void __uam_async_request_cb(
 
                ret_if(req_info == NULL);
 
-               result = UAM_ERROR_TIMEOUT;
+               result = UAM_ERROR_TIMED_OUT;
        } else {
                g_variant_get(value, "(iv)", &result, &param1);
                g_variant_unref(value);
@@ -292,7 +292,7 @@ static void __uam_async_request_cb(
                __uam_get_event_info(req_info->req_func, out_param,
                                &event, &event_data.data);
 
-               ((uam_event_callback)req_info->cb)(
+               ((uam_event_cb)req_info->cb)(
                        event, &event_data, req_info->user_data);
        }
 
@@ -315,7 +315,7 @@ int _uam_async_request(
                GArray *in_param2,
                GArray *in_param3,
                GArray *in_param4,
-               uam_event_callback callback,
+               uam_event_cb callback,
                void *user_data
                )
 {
index b21e51f..f407bc9 100644 (file)
@@ -25,7 +25,7 @@ extern "C" {
 void _uam_cloud_update_registered_devices(void);
 
 void _uam_cloud_send_device_added(int status, const char *account,
-               const uam_device_info_t *dev_info);
+               const uam_device_info_s *dev_info);
 
 #ifdef __cplusplus
 }
index 21941b3..afc4879 100644 (file)
@@ -123,9 +123,9 @@ void _uam_remove_timer(guint id);
 
 const char* _uam_get_sensor_str(unsigned int ids);
 
-int _uam_register_app_info(char *sender, uam_app_info_t app_info);
+int _uam_register_app_info(char *sender, uam_app_info_s app_info);
 
-int _uam_deregister_app_info(char *sender, uam_app_info_t app_info);
+int _uam_deregister_app_info(char *sender, uam_app_info_s app_info);
 
 #ifdef __cplusplus
 }
index 277b2e4..7bbc339 100644 (file)
@@ -94,35 +94,35 @@ int _uam_core_add_user(const char *account, const char *name);
 
 int _uam_core_remove_user(const char *account);
 
-int _uam_core_add_device(const char *account, const uam_device_info_t *dev_info);
+int _uam_core_add_device(const char *account, const uam_device_info_s *dev_info);
 
-int _uam_core_remove_device(const char *account, const uam_device_info_t *dev_info);
+int _uam_core_remove_device(const char *account, const uam_device_info_s *dev_info);
 
 int _uam_core_remove_device_by_device_id(const char *device_id, int tech_type);
 
 int _uam_core_remove_device_by_mac(const char *mac);
 
-int _uam_core_get_default_user(uam_user_info_t *user_info);
+int _uam_core_get_default_user(uam_user_info_s *user_info);
 
-int _uam_core_get_users(int *count, uam_user_info_t **user_list);
+int _uam_core_get_users(int *count, uam_user_info_s **user_list);
 
-int _uam_core_get_user_by_account(const char *account, uam_user_info_t *user);
+int _uam_core_get_user_by_account(const char *account, uam_user_info_s *user);
 
 int _uam_core_get_devcie_by_device_id(
-               const char *device_id, int tech_type, uam_device_info_t *device);
+               const char *device_id, int tech_type, uam_device_info_s *device);
 
-int _uam_core_get_devcie_by_mac(const char *mac, uam_device_info_t *device);
+int _uam_core_get_devcie_by_mac(const char *mac, uam_device_info_s *device);
 
-int _uam_core_get_user_by_device_id(const char *device_id, uam_user_info_t *user);
+int _uam_core_get_user_by_device_id(const char *device_id, uam_user_info_s *user);
 
-int _uam_core_get_user_by_mac(const char *mac, uam_user_info_t *user);
+int _uam_core_get_user_by_mac(const char *mac, uam_user_info_s *user);
 
-int _uam_core_get_devices(int *count, uam_device_info_t **device_list);
+int _uam_core_get_devices(int *count, uam_device_info_s **device_list);
 
 int _uam_core_get_user_devices(const char *account,
-               int *count, uam_device_info_t **device_list);
+               int *count, uam_device_info_s **device_list);
 
-int _uam_core_is_device_added(uam_device_info_t *dev, gboolean *is_added);
+int _uam_core_is_device_added(uam_device_info_s *dev, gboolean *is_added);
 
 int _uam_core_get_available_sensors(unsigned int *sensor_bitmask);
 
@@ -152,13 +152,13 @@ void _uam_core_deinit(void);
 void _uam_core_handle_sensor_ready(unsigned int sensor, gboolean is_ready);
 
 void _uam_core_handle_device_added(int status,
-               int user_id, const uam_device_info_t *dev_info);
+               int user_id, const uam_device_info_s *dev_info);
 
 void _uam_core_handle_presence_detected(unsigned int sensor,
-               int user_id, uam_device_info_t *dev_info);
+               int user_id, uam_device_info_s *dev_info);
 
 void _uam_core_handle_absence_detected(unsigned int sensor,
-               int user_id, uam_device_info_t *dev_info);
+               int user_id, uam_device_info_s *dev_info);
 
 void _uam_core_cleanup_monitor(char *name);
 
@@ -174,7 +174,7 @@ int _uam_core_start_active_device_scan(char *sender, unsigned int sensors, int d
 
 int _uam_core_stop_active_device_scan(char *sender, unsigned int sensors);
 
-void _uam_core_handle_active_device(uam_active_scan_event_e event, unsigned int sensor, const uam_device_info_t *dev_info);
+void _uam_core_handle_active_device(uam_active_scan_event_e event, unsigned int sensor, const uam_device_info_s *dev_info);
 
 int _uam_core_service_add_user(const char *service_name, const char *account);
 
index fec78e3..0fb8fb3 100644 (file)
@@ -52,7 +52,7 @@ int _ua_db_insert_user_info(int* user_id, const char *name, const char *account)
 /* DEVICE QUERIES */
 typedef struct {
        int user_id;
-       uam_device_info_t dev_info;
+       uam_device_info_s dev_info;
        int presence_state;
        long long timestamp;
 } db_device_info_t;
@@ -72,7 +72,7 @@ int _ua_device_db_clear(void);
 int _ua_device_db_delete_device_info(const char *device_id, int tech_type, const char *address);
 
 /* insert */
-int _ua_device_db_insert_device_info(int user_id, const uam_device_info_t *dev_info,
+int _ua_device_db_insert_device_info(int user_id, const uam_device_info_s *dev_info,
                int presence_state, long long timestamp);
 
 /* update */
index 48b21df..cc2fcc3 100644 (file)
@@ -40,9 +40,9 @@ unsigned int _uam_pm_get_avaliable_sensors(void);
 
 gboolean _uam_pm_is_sensor_ready(unsigned int sensor_bitmask);
 
-int _uam_pm_register_device(unsigned short user_id, const uam_device_info_t *dev);
+int _uam_pm_register_device(unsigned short user_id, const uam_device_info_s *dev);
 
-int _uam_pm_unregister_device(unsigned short user_id, const uam_device_info_t *dev);
+int _uam_pm_unregister_device(unsigned short user_id, const uam_device_info_s *dev);
 
 int _uam_pm_start_detection(unsigned int detection_mode, unsigned int sensor_bitmask);
 
index 0755c31..fea2216 100644 (file)
@@ -67,7 +67,7 @@ static void ble_detection_state_changed_cb(int state)
 static void ble_device_detection_callback(uas_detection_type_e type, uas_device_info_t *device)
 {
        FUNC_ENTRY;
-       uam_device_info_t *dev_info;
+       uam_device_info_s *dev_info;
 
        ret_if(NULL == device);
 
@@ -89,7 +89,7 @@ static void ble_device_detection_callback(uas_detection_type_e type, uas_device_
 static void ble_device_added_callback(int status, uas_device_info_t *device)
 {
        FUNC_ENTRY;
-       uam_device_info_t *dev_info;
+       uam_device_info_s *dev_info;
 
        ret_if(NULL == device);
 
index b61a0f9..f38b793 100644 (file)
@@ -30,7 +30,7 @@ typedef struct {
 
 uam_plugin_info_t *cloud_plugin;
 
-static void __uap_to_uam_device_info(uam_device_info_t *dest,
+static void __uap_to_uam_device_info(uam_device_info_s *dest,
                const uap_device_info_t *src)
 {
        FUNC_ENTRY;
@@ -48,7 +48,7 @@ static void __uap_to_uam_device_info(uam_device_info_t *dest,
 }
 
 static void __uam_to_uap_device_info(uap_device_info_t *dest,
-               const uam_device_info_t *src)
+               const uam_device_info_s *src)
 {
        FUNC_ENTRY;
 
@@ -97,8 +97,8 @@ static int remove_user(const char *account)
 static int add_device(const char *account, uap_device_info_t *dev_info)
 {
        FUNC_ENTRY;
-       uam_device_info_t device;
-       uam_user_info_t user;
+       uam_device_info_s device;
+       uam_user_info_s user;
 
        if (NULL == account) {
                if (UAM_ERROR_NONE != _uam_core_get_default_user(&user)) {
@@ -111,7 +111,7 @@ static int add_device(const char *account, uap_device_info_t *dev_info)
 
        retv_if(NULL == dev_info, UAP_STATUS_INVALID_PARAMS);
 
-       memset(&device, 0x00, sizeof(uam_device_info_t));
+       memset(&device, 0x00, sizeof(uam_device_info_s));
        __uap_to_uam_device_info(&device, dev_info);
 
        if (UAM_ERROR_NONE != _uam_core_add_device(account, &device)) {
@@ -128,8 +128,8 @@ static int remove_device(const char *device_id, int type)
        FUNC_ENTRY;
 
        retv_if(NULL == device_id, UAP_STATUS_INVALID_PARAMS);
-       retv_if(UAP_TECH_TYPE_NONE >= type, UAM_ERROR_INVALID_PARAM);
-       retv_if(UAP_TECH_TYPE_P2P < type, UAM_ERROR_INVALID_PARAM);
+       retv_if(UAP_TECH_TYPE_NONE >= type, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(UAP_TECH_TYPE_P2P < type, UAM_ERROR_INVALID_PARAMETER);
 
        if (UAM_ERROR_NONE != _uam_core_remove_device_by_device_id(device_id, type)) {
                UAM_ERR("_uam_core_remove_user() failed");
@@ -159,7 +159,7 @@ void _uam_cloud_update_registered_devices(void)
 {
        FUNC_ENTRY;
        int indx;
-       uam_device_info_t *devices = NULL;
+       uam_device_info_s *devices = NULL;
        uap_device_info_t *dev_list = NULL;
        int num_devices = 0;
        uac_api_t *api;
@@ -190,7 +190,7 @@ void _uam_cloud_update_registered_devices(void)
 }
 
 void _uam_cloud_send_device_added(int status, const char *account,
-               const uam_device_info_t *dev_info)
+               const uam_device_info_s *dev_info)
 {
        FUNC_ENTRY;
        ret_if(NULL == cloud_plugin);
index 4aa28c9..d478b11 100644 (file)
@@ -101,9 +101,9 @@ static int __load_plugin(const char *path, const char *name, const char *symbol)
        void *handle;
        uas_module_t *module;
 
-       retv_if(NULL == path, UAM_ERROR_INVALID_PARAM);
-       retv_if(NULL == name, UAM_ERROR_INVALID_PARAM);
-       retv_if(NULL == symbol, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == path, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == name, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == symbol, UAM_ERROR_INVALID_PARAMETER);
 
        filename = g_build_filename(path, name, NULL);
        UAM_DBG("Loading [%s]", filename);
@@ -136,7 +136,7 @@ static int __load_sensor_plugins(void)
        const char *filename;
        int ret = UAM_ERROR_INTERNAL;
 
-       retv_if(0 == strlen(SENSOR_PLUGIN_DIR), UAM_ERROR_INVALID_PARAM);
+       retv_if(0 == strlen(SENSOR_PLUGIN_DIR), UAM_ERROR_INVALID_PARAMETER);
 
        UAM_DBG("Loading plugins from %s", SENSOR_PLUGIN_DIR);
 
@@ -385,17 +385,17 @@ gboolean _uam_pm_is_sensor_ready(unsigned int sensor_bitmask)
        return (UAS_STATE_READY == state ? TRUE : FALSE);
 }
 
-int _uam_pm_register_device(unsigned short user_id, const uam_device_info_t *dev)
+int _uam_pm_register_device(unsigned short user_id, const uam_device_info_s *dev)
 {
        FUNC_ENTRY;
        int id;
        uam_sensor_plugin_info_t *plugin;
        uas_device_info_t *device = NULL;
 
-       retv_if(NULL == dev, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == dev, UAM_ERROR_INVALID_PARAMETER);
 
        id = _pm_util_uam_tech_type_to_plugin_id(dev->type);
-       retv_if(UAS_PLUGIN_ID_MAX <= id, UAM_ERROR_INVALID_PARAM);
+       retv_if(UAS_PLUGIN_ID_MAX <= id, UAM_ERROR_INVALID_PARAMETER);
 
        plugin = plugins[id];
        retv_if(!plugin || !plugin->api, UAM_ERROR_NOT_SUPPORTED);
@@ -415,17 +415,17 @@ int _uam_pm_register_device(unsigned short user_id, const uam_device_info_t *dev
        return UAM_ERROR_NONE;
 }
 
-int _uam_pm_unregister_device(unsigned short user_id, const uam_device_info_t *dev)
+int _uam_pm_unregister_device(unsigned short user_id, const uam_device_info_s *dev)
 {
        FUNC_ENTRY;
        int id;
        uam_sensor_plugin_info_t *plugin;
        uas_device_info_t *device = NULL;
 
-       retv_if(NULL == dev, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == dev, UAM_ERROR_INVALID_PARAMETER);
 
        id = _pm_util_uam_tech_type_to_plugin_id(dev->type);
-       retv_if(UAS_PLUGIN_ID_MAX <= id, UAM_ERROR_INVALID_PARAM);
+       retv_if(UAS_PLUGIN_ID_MAX <= id, UAM_ERROR_INVALID_PARAMETER);
 
        plugin = plugins[id];
        retv_if(!plugin || !plugin->api, UAM_ERROR_NOT_SUPPORTED);
@@ -647,7 +647,7 @@ int _uam_pm_set_detection_threshold(unsigned int sensor,
        uam_sensor_plugin_info_t *plugin;
 
        id = _pm_util_sensor_bitmask_to_plugin_id(sensor);
-       retv_if(UAS_PLUGIN_ID_MAX <= id, UAM_ERROR_INVALID_PARAM);
+       retv_if(UAS_PLUGIN_ID_MAX <= id, UAM_ERROR_INVALID_PARAMETER);
 
        plugin = plugins[id];
        retv_if(!plugin || !plugin->api, UAM_ERROR_NOT_SUPPORTED);
index 3467ea6..e286587 100644 (file)
@@ -195,7 +195,7 @@ void _pm_util_uam_db_dev_to_uas_dev(unsigned int tech_type,
        FUNC_EXIT;
 }
 
-uas_device_info_t *_pm_util_uam_dev_info_to_uas_dev_info(const uam_device_info_t *dev)
+uas_device_info_t *_pm_util_uam_dev_info_to_uas_dev_info(const uam_device_info_s *dev)
 {
        FUNC_ENTRY;
        uas_device_info_t *device;
@@ -257,15 +257,15 @@ uas_device_info_t *_pm_util_uam_dev_info_to_uas_dev_info(const uam_device_info_t
        return device;
 }
 
-uam_device_info_t *_pm_util_uas_dev_info_to_uam_dev_info(const uas_device_info_t *dev)
+uam_device_info_s *_pm_util_uas_dev_info_to_uam_dev_info(const uas_device_info_t *dev)
 {
        FUNC_ENTRY;
-       uam_device_info_t *device;
+       uam_device_info_s *device;
        int i = 0;
 
        retv_if(NULL == dev, NULL);
 
-       device = g_new0(uam_device_info_t, 1);
+       device = g_new0(uam_device_info_s, 1);
        device->operating_system = dev->os;
 
        g_strlcpy(device->device_id, dev->device_id, UAM_DEVICE_ID_MAX_STRING_LEN);
index 7af480e..1af6fcf 100644 (file)
@@ -26,9 +26,9 @@
 extern "C" {
 #endif
 
-uas_device_info_t *_pm_util_uam_dev_info_to_uas_dev_info(const uam_device_info_t *dev);
+uas_device_info_t *_pm_util_uam_dev_info_to_uas_dev_info(const uam_device_info_s *dev);
 
-uam_device_info_t *_pm_util_uas_dev_info_to_uam_dev_info(const uas_device_info_t *dev);
+uam_device_info_s *_pm_util_uas_dev_info_to_uam_dev_info(const uas_device_info_t *dev);
 
 void _pm_util_uam_db_dev_to_uas_dev(unsigned int tech_type,
                uam_db_device_info_t *dev, uas_device_info_t **device);
index e65cac0..1855798 100644 (file)
@@ -104,9 +104,9 @@ static int __load_power_plugin(const char *path, const char *name, const char *s
        void *handle = NULL;
        uap_module_t *module = NULL;
 
-       retv_if(NULL == path, UAM_ERROR_INVALID_PARAM);
-       retv_if(NULL == name, UAM_ERROR_INVALID_PARAM);
-       retv_if(NULL == symbol, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == path, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == name, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == symbol, UAM_ERROR_INVALID_PARAMETER);
 
        filename = g_build_filename(path, name, NULL);
        UAM_DBG("Loading [%s]", filename);
@@ -128,7 +128,7 @@ static int __load_power_plugin(const char *path, const char *name, const char *s
        if (UAP_PLUGIN_ID_POWER != module->id) {
                dlclose(handle);
                handle = NULL;
-               return UAM_ERROR_INVALID_PARAM;
+               return UAM_ERROR_INVALID_PARAMETER;
        }
 
        retv_if(FALSE == __add_power_plugin(handle, module), UAM_ERROR_INTERNAL);
@@ -145,7 +145,7 @@ static int __load_power_plugins(void)
        const char *filename;
        int ret = UAM_ERROR_INTERNAL;
 
-       retv_if(0 == strlen(POWER_PLUGIN_DIR), UAM_ERROR_INVALID_PARAM);
+       retv_if(0 == strlen(POWER_PLUGIN_DIR), UAM_ERROR_INVALID_PARAMETER);
        UAM_DBG("Loading power plugin from %s", POWER_PLUGIN_DIR);
 
        dir = g_dir_open(POWER_PLUGIN_DIR, 0, NULL);
@@ -179,7 +179,7 @@ static int __init_power_plugin(void)
        uam_power_plugin_info_t *plugin = pwr_plugin;
        if (!plugin || !plugin->api) {
                UAM_WARN("Plugin is NULL");
-               return UAM_ERROR_INVALID_PARAM;
+               return UAM_ERROR_INVALID_PARAMETER;
        }
 
        status = plugin->api->init(&power_cbs);
index d48c82d..28029b3 100644 (file)
@@ -67,7 +67,7 @@ static void wifi_detection_state_changed_cb(int state)
 static void wifi_device_detection_callback(uas_detection_type_e type, uas_device_info_t *device)
 {
        FUNC_ENTRY;
-       uam_device_info_t *dev_info;
+       uam_device_info_s *dev_info;
 
        ret_if(NULL == device);
 
@@ -89,7 +89,7 @@ static void wifi_device_detection_callback(uas_detection_type_e type, uas_device
 static void wifi_device_added_callback(int status, uas_device_info_t *device)
 {
        FUNC_ENTRY;
-       uam_device_info_t *dev_info;
+       uam_device_info_s *dev_info;
 
        ret_if(NULL == device);
 
@@ -112,7 +112,7 @@ static void wifi_active_scan_callback(uas_active_scan_event_e event,
                const uas_device_info_t *device)
 {
        FUNC_ENTRY;
-       uam_device_info_t *dev_info = NULL;
+       uam_device_info_s *dev_info = NULL;
        uam_active_scan_event_e event_info;
 
        if (UAS_ACTIVE_DEVICE_FOUND == event) {
index 1954764..373de98 100644 (file)
 
 #include "ua-manager-common.h"
 
-const char *event_string[] = {
-       FOREACH_EVENT(GENERATE_EVENT_STRING)
-};
-
 const char *request_string[] = {
        FOREACH_REQUEST(GENERATE_REQUEST_STRING)
 };
@@ -96,13 +92,46 @@ const char *_uam_manager_event_to_str(unsigned int event)
 {
        retv_if(UAM_EVENT_MAX <= event, NULL);
 
-       return event_string[event];
+       switch (event) {
+       CASE_TO_STR(UAM_EVENT_USER_ADDED)
+       CASE_TO_STR(UAM_EVENT_USER_REMOVED)
+       CASE_TO_STR(UAM_EVENT_DEVICE_ADDED)
+       CASE_TO_STR(UAM_EVENT_DEVICE_REMOVED)
+       CASE_TO_STR(UAM_EVENT_PRESENCE_DETECTED)
+       CASE_TO_STR(UAM_EVENT_USER_PRESENCE_DETECTED)
+       CASE_TO_STR(UAM_EVENT_ABSENCE_DETECTED)
+       CASE_TO_STR(UAM_EVENT_USER_ABSENCE_DETECTED)
+       CASE_TO_STR(UAM_EVENT_AMBIANT_MODE_ENABLED)
+       CASE_TO_STR(UAM_EVENT_AMBIANT_MODE_DISABLED)
+       CASE_TO_STR(UAM_EVENT_SENSOR_STATE_READY)
+       CASE_TO_STR(UAM_EVENT_SENSOR_STATE_NOT_READY)
+       CASE_TO_STR(UAM_EVENT_DETECTION_STARTED)
+       CASE_TO_STR(UAM_EVENT_DETECTION_STOPPED)
+       CASE_TO_STR(UAM_EVENT_DEVICE_FOUND)
+       CASE_TO_STR(UAM_EVENT_SCAN_COMPLETED)
+       default:
+               return "UNKNOWN ERROR";
+       }
 }
 
 const char *_uam_manager_error_to_str(int error)
 {
        switch (error) {
-       FOREACH_ERROR(GENERATE_ERROR_CASE);
+       /* CHECK: List all enum values here */
+       CASE_TO_STR(UAM_ERROR_NONE)
+       CASE_TO_STR(UAM_ERROR_INVALID_PARAMETER)
+       CASE_TO_STR(UAM_ERROR_PERMISSION_DENIED)
+       CASE_TO_STR(UAM_ERROR_TIMED_OUT)
+       CASE_TO_STR(UAM_ERROR_NOW_IN_PROGRESS)
+       CASE_TO_STR(UAM_ERROR_NOT_SUPPORTED)
+       CASE_TO_STR(UAM_ERROR_NOT_INITIALIZED)
+       CASE_TO_STR(UAM_ERROR_NOT_IN_OPERATION)
+       CASE_TO_STR(UAM_ERROR_ALREADY_DONE)
+       CASE_TO_STR(UAM_ERROR_INTERNAL)
+       CASE_TO_STR(UAM_ERROR_NOT_FOUND)
+       CASE_TO_STR(UAM_ERROR_ALREADY_REGISTERED)
+       CASE_TO_STR(UAM_ERROR_DB_FAILED)
+       CASE_TO_STR(UAM_ERROR_NOT_REGISTERED)
        default:
                return "UNKNOWN ERROR";
        }
index 77e8010..85bdb06 100644 (file)
@@ -59,9 +59,9 @@ int _uam_read_detection_params(int *cycle, int *period, int *retries)
        json_object *jint;
        json_object *jvalue;
 
-       retv_if(NULL == cycle, UAM_ERROR_INVALID_PARAM);
-       retv_if(NULL == period, UAM_ERROR_INVALID_PARAM);
-       retv_if(NULL == retries, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == cycle, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == period, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == retries, UAM_ERROR_INVALID_PARAMETER);
 
        contents = __uam_get_file_content(UAM_CONFIG_FILE);
        retv_if(NULL == contents, UAM_ERROR_INTERNAL);
index d17cfa9..2e4e924 100644 (file)
@@ -136,7 +136,7 @@ static void __free_user_device(gpointer data)
        FUNC_EXIT;
 }
 
-static void __send_device_event(int event, const uam_device_info_t *dev_info)
+static void __send_device_event(int event, const uam_device_info_s *dev_info)
 {
        FUNC_ENTRY;
        GVariant *param;
@@ -230,7 +230,7 @@ static void __remove_user_device(gpointer data)
 {
        FUNC_ENTRY;
        uam_db_device_info_t *device = data;
-       uam_device_info_t dev_info;
+       uam_device_info_s dev_info;
        unsigned short user_id;
        GSList *l;
 
@@ -384,7 +384,7 @@ static uam_db_tech_info_t *__get_tech_info_by_mac(const char *mac)
 }
 
 static void __get_uam_db_dev_list_to_uam_dev_list(
-               GSList *db_dev_list, uam_device_info_t **device_list, int *count)
+               GSList *db_dev_list, uam_device_info_s **device_list, int *count)
 {
        FUNC_ENTRY;
        GSList *l;
@@ -409,7 +409,7 @@ static void __get_uam_db_dev_list_to_uam_dev_list(
                }
        }
 
-       *device_list = g_new0(uam_device_info_t, *count);
+       *device_list = g_new0(uam_device_info_s, *count);
 
        /* Copy devices */
        for (l = db_dev_list; NULL != l; l = g_slist_next(l)) {
@@ -463,14 +463,14 @@ static void __get_uam_db_dev_list_to_uam_dev_list(
        FUNC_EXIT;
 }
 
-static int __copy_tech_info_to_device_info(uam_db_tech_info_t *tech, uam_device_info_t *device)
+static int __copy_tech_info_to_device_info(uam_db_tech_info_t *tech, uam_device_info_s *device)
 {
        FUNC_ENTRY;
        GSList *l;
 
-       retv_if(NULL == tech, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == tech, UAM_ERROR_INVALID_PARAMETER);
 
-       memset(device, 0x00, sizeof(uam_device_info_t));
+       memset(device, 0x00, sizeof(uam_device_info_s));
        for (l = tech->addresses; NULL != l; l = g_slist_next(l)) {
                uam_db_address_info_t *addr = l->data;
 
@@ -593,7 +593,7 @@ static GSList *__convert_db_svc_list_to_uam_svc_list(GSList *db_svc_list)
 }
 
 static void __uam_core_add_dev_to_list(
-               uam_db_user_info_t *user, const uam_device_info_t *dev_info,
+               uam_db_user_info_t *user, const uam_device_info_s *dev_info,
                int presence_state, long long timestamp, GSList *svc_list)
 {
        FUNC_ENTRY;
@@ -772,7 +772,7 @@ int _uam_core_remove_user(const char *account)
        return UAM_ERROR_NONE;
 }
 
-int _uam_core_add_device(const char *account, const uam_device_info_t *dev_info)
+int _uam_core_add_device(const char *account, const uam_device_info_s *dev_info)
 {
        FUNC_ENTRY;
        int ret;
@@ -780,11 +780,11 @@ int _uam_core_add_device(const char *account, const uam_device_info_t *dev_info)
        uam_db_device_info_t *device;
        uam_db_user_info_t *user;
 
-       retv_if(NULL == account, UAM_ERROR_INVALID_PARAM);
-       retv_if(NULL == dev_info, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == account, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == dev_info, UAM_ERROR_INVALID_PARAMETER);
 
        l = g_slist_find_custom(users, account, __compare_user_account);
-       retv_if(NULL == l, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == l, UAM_ERROR_INVALID_PARAMETER);
        user = l->data;
 
        l = g_slist_find_custom(devices, dev_info->device_id, __compare_device_id);
@@ -806,14 +806,14 @@ int _uam_core_add_device(const char *account, const uam_device_info_t *dev_info)
        return UAM_ERROR_NONE;
 }
 
-int _uam_core_is_device_added(uam_device_info_t *dev, gboolean *is_added)
+int _uam_core_is_device_added(uam_device_info_s *dev, gboolean *is_added)
 {
        FUNC_ENTRY;
        uam_db_device_info_t *device;
        GSList *l;
 
-       retv_if(NULL == dev, UAM_ERROR_INVALID_PARAM);
-       retv_if(NULL == is_added, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == dev, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == is_added, UAM_ERROR_INVALID_PARAMETER);
 
        *is_added = FALSE;
        l = g_slist_find_custom(devices, dev->device_id, __compare_device_id);
@@ -858,7 +858,7 @@ done:
        return UAM_ERROR_NONE;
 }
 
-int _uam_core_remove_device(const char *account, const uam_device_info_t *dev_info)
+int _uam_core_remove_device(const char *account, const uam_device_info_s *dev_info)
 {
        FUNC_ENTRY;
        int ret;
@@ -867,25 +867,25 @@ int _uam_core_remove_device(const char *account, const uam_device_info_t *dev_in
        uam_db_device_info_t *device;
        uam_db_user_info_t *user;
 
-       retv_if(NULL == account, UAM_ERROR_INVALID_PARAM);
-       retv_if(NULL == dev_info, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == account, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == dev_info, UAM_ERROR_INVALID_PARAMETER);
 
        /* Retrieve user from list */
        l = g_slist_find_custom(users, account, __compare_user_account);
-       retv_if(NULL == l, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == l, UAM_ERROR_INVALID_PARAMETER);
        user = l->data;
 
        /* Retrieve device from list */
        l = g_slist_find_custom(devices, dev_info->device_id, __compare_device_id);
-       retv_if(NULL == l, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == l, UAM_ERROR_INVALID_PARAMETER);
        device = l->data;
-       retv_if(user != device->user, UAM_ERROR_INVALID_PARAM);
-       retv_if(!(device->supported_techs & dev_info->type), UAM_ERROR_INVALID_PARAM);
+       retv_if(user != device->user, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(!(device->supported_techs & dev_info->type), UAM_ERROR_INVALID_PARAMETER);
 
        /* Retrieve tech info from list */
        l = g_slist_find_custom(device->tech_list,
                        &(dev_info->type), __compare_tech_type);
-       retv_if(NULL == l, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == l, UAM_ERROR_INVALID_PARAMETER);
        tech = l->data;
 
        ret = _uam_pm_unregister_device(user->user_id, dev_info);
@@ -935,13 +935,13 @@ int _uam_core_remove_device_by_device_id(const char *device_id, int tech_type)
        FUNC_ENTRY;
        int ret;
        GSList *l;
-       uam_device_info_t dev_info;
+       uam_device_info_s dev_info;
        uam_db_tech_info_t *tech;
        uam_db_device_info_t *device;
 
-       retv_if(NULL == device_id, UAM_ERROR_INVALID_PARAM);
-       retv_if(UAM_TECH_TYPE_NONE >= tech_type, UAM_ERROR_INVALID_PARAM);
-       retv_if(UAM_TECH_TYPE_P2P < tech_type, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == device_id, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(UAM_TECH_TYPE_NONE >= tech_type, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(UAM_TECH_TYPE_P2P < tech_type, UAM_ERROR_INVALID_PARAMETER);
 
        /* Retrieve device from list */
        l = g_slist_find_custom(devices, device_id, __compare_device_id);
@@ -1006,10 +1006,10 @@ int _uam_core_remove_device_by_mac(const char *mac)
        FUNC_ENTRY;
        uam_db_tech_info_t *tech;
        uam_db_device_info_t *device;
-       uam_device_info_t dev_info;
+       uam_device_info_s dev_info;
        int ret;
 
-       retv_if(NULL == mac, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == mac, UAM_ERROR_INVALID_PARAMETER);
 
        tech = __get_tech_info_by_mac(mac);
        retv_if(NULL == tech, UAM_ERROR_NOT_FOUND);
@@ -1062,14 +1062,14 @@ int _uam_core_remove_device_by_mac(const char *mac)
        return UAM_ERROR_NONE;
 }
 
-int _uam_core_get_default_user(uam_user_info_t *user_info)
+int _uam_core_get_default_user(uam_user_info_s *user_info)
 {
        FUNC_ENTRY;
        int ret;
        GSList *l;
        uam_db_user_info_t *user;
 
-       retv_if(NULL == user_info, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == user_info, UAM_ERROR_INVALID_PARAMETER);
 
        ret = _uam_core_add_user(USER_ACCOUNT_DEFAULT, USER_NAME_DEFAULT);
        if ((UAM_ERROR_NONE != ret) && (UAM_ERROR_ALREADY_REGISTERED != ret)) {
@@ -1081,7 +1081,7 @@ int _uam_core_get_default_user(uam_user_info_t *user_info)
        retv_if(NULL == l, UAM_ERROR_INTERNAL);
        user = l->data;
 
-       memset(user_info, 0x00, sizeof(uam_user_info_t));
+       memset(user_info, 0x00, sizeof(uam_user_info_s));
        g_strlcpy(user_info->account, user->account, UAM_USER_ACCOUNT_MAX_STRING_LEN);
        g_strlcpy(user_info->name, user->name, UAM_USER_NAME_MAX_STRING_LEN);
 
@@ -1089,14 +1089,14 @@ int _uam_core_get_default_user(uam_user_info_t *user_info)
        return UAM_ERROR_NONE;
 }
 
-int _uam_core_get_users(int *count, uam_user_info_t **user_list)
+int _uam_core_get_users(int *count, uam_user_info_s **user_list)
 {
        FUNC_ENTRY;
        guint size;
        GSList *l;
 
        size = g_slist_length(users);
-       *user_list = g_new0(uam_user_info_t, size);
+       *user_list = g_new0(uam_user_info_s, size);
        *count = 0;
 
        /* fetch users list from DB */
@@ -1120,13 +1120,13 @@ int _uam_core_get_users(int *count, uam_user_info_t **user_list)
        return UAM_ERROR_NONE;
 }
 
-int _uam_core_get_user_by_account(const char *account, uam_user_info_t *user)
+int _uam_core_get_user_by_account(const char *account, uam_user_info_s *user)
 {
        FUNC_ENTRY;
        uam_db_user_info_t *db_info;
        GSList *l;
 
-       retv_if(NULL == account, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == account, UAM_ERROR_INVALID_PARAMETER);
 
        l = g_slist_find_custom(users, account, __compare_user_account);
        retv_if(NULL == l, UAM_ERROR_NOT_FOUND);
@@ -1142,23 +1142,23 @@ int _uam_core_get_user_by_account(const char *account, uam_user_info_t *user)
 }
 
 int _uam_core_get_devcie_by_device_id(
-               const char *device_id, int tech_type, uam_device_info_t *device)
+               const char *device_id, int tech_type, uam_device_info_s *device)
 {
        FUNC_ENTRY;
        uam_db_device_info_t *db_info;
        GSList *l;
        GSList *l1;
 
-       retv_if(NULL == device_id, UAM_ERROR_INVALID_PARAM);
-       retv_if(UAM_TECH_TYPE_NONE >= tech_type, UAM_ERROR_INVALID_PARAM);
-       retv_if(UAM_TECH_TYPE_P2P < tech_type, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == device_id, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(UAM_TECH_TYPE_NONE >= tech_type, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(UAM_TECH_TYPE_P2P < tech_type, UAM_ERROR_INVALID_PARAMETER);
 
        l = g_slist_find_custom(devices, device_id, __compare_device_id);
        retv_if(NULL == l, UAM_ERROR_NOT_FOUND);
        db_info = l->data;
        retv_if(!(tech_type & db_info->supported_techs), UAM_ERROR_NOT_FOUND);
 
-       memset(device, 0x00, sizeof(uam_device_info_t));
+       memset(device, 0x00, sizeof(uam_device_info_s));
 
        for (l1 = db_info->tech_list; NULL != l1; l1 = g_slist_next(l1)) {
                uam_db_tech_info_t *tech = l1->data;
@@ -1203,13 +1203,13 @@ int _uam_core_get_devcie_by_device_id(
        return UAM_ERROR_NONE;
 }
 
-int _uam_core_get_devcie_by_mac(const char *mac, uam_device_info_t *device)
+int _uam_core_get_devcie_by_mac(const char *mac, uam_device_info_s *device)
 {
        FUNC_ENTRY;
        int ret;
        uam_db_tech_info_t *tech;
 
-       retv_if(NULL == mac, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == mac, UAM_ERROR_INVALID_PARAMETER);
 
        tech = __get_tech_info_by_mac(mac);
        retv_if(NULL == tech, UAM_ERROR_NOT_FOUND);
@@ -1224,13 +1224,13 @@ int _uam_core_get_devcie_by_mac(const char *mac, uam_device_info_t *device)
        return UAM_ERROR_NONE;
 }
 
-int _uam_core_get_user_by_device_id(const char *device_id, uam_user_info_t *user)
+int _uam_core_get_user_by_device_id(const char *device_id, uam_user_info_s *user)
 {
        FUNC_ENTRY;
        uam_db_device_info_t *dev;
        GSList *l;
 
-       retv_if(NULL == device_id, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == device_id, UAM_ERROR_INVALID_PARAMETER);
 
        l = g_slist_find_custom(devices, device_id, __compare_device_id);
        retv_if(NULL == l, UAM_ERROR_NOT_FOUND);
@@ -1244,12 +1244,12 @@ int _uam_core_get_user_by_device_id(const char *device_id, uam_user_info_t *user
        return UAM_ERROR_NONE;
 }
 
-int _uam_core_get_user_by_mac(const char *mac, uam_user_info_t *user)
+int _uam_core_get_user_by_mac(const char *mac, uam_user_info_s *user)
 {
        FUNC_ENTRY;
        uam_db_tech_info_t *tech;
 
-       retv_if(NULL == mac, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == mac, UAM_ERROR_INVALID_PARAMETER);
 
        tech = __get_tech_info_by_mac(mac);
        retv_if(NULL == tech, UAM_ERROR_NOT_FOUND);
@@ -1262,7 +1262,7 @@ int _uam_core_get_user_by_mac(const char *mac, uam_user_info_t *user)
        return UAM_ERROR_NONE;
 }
 
-int _uam_core_get_devices(int *count, uam_device_info_t **device_list)
+int _uam_core_get_devices(int *count, uam_device_info_s **device_list)
 {
        FUNC_ENTRY;
 
@@ -1273,14 +1273,14 @@ int _uam_core_get_devices(int *count, uam_device_info_t **device_list)
 }
 
 int _uam_core_get_user_devices(const char *account,
-               int *count, uam_device_info_t **device_list)
+               int *count, uam_device_info_s **device_list)
 {
        FUNC_ENTRY;
        uam_db_user_info_t *user;
        GSList *l;
 
        l = g_slist_find_custom(users, account, __compare_user_account);
-       retv_if(NULL == l, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == l, UAM_ERROR_INVALID_PARAMETER);
        user = l->data;
 
        __get_uam_db_dev_list_to_uam_dev_list(user->devices, device_list, count);
@@ -1318,13 +1318,13 @@ int _uam_core_service_add_user(const char *svc_name, const char *account)
        uam_db_user_info_t *user;
        uam_db_service_info_t *service;
 
-       retv_if(NULL == account, UAM_ERROR_INVALID_PARAM);
-       retv_if(NULL == svc_name, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == account, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == svc_name, UAM_ERROR_INVALID_PARAMETER);
        retv_if(0 == g_strcmp0(svc_name, UAM_SERVICE_DEFAULT), UAM_ERROR_PERMISSION_DENIED);
 
        /* Retrieve user from list */
        l = g_slist_find_custom(users, account, __compare_user_account);
-       retv_if(NULL == l, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == l, UAM_ERROR_INVALID_PARAMETER);
        user = l->data;
 
        /* Retrieve service from list */
@@ -1377,18 +1377,18 @@ int _uam_core_service_remove_user(const char *svc_name, const char *account)
        GSList *l;
        uam_db_user_info_t *user;
 
-       retv_if(NULL == account, UAM_ERROR_INVALID_PARAM);
-       retv_if(NULL == svc_name, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == account, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == svc_name, UAM_ERROR_INVALID_PARAMETER);
        retv_if(0 == g_strcmp0(svc_name, UAM_SERVICE_DEFAULT), UAM_ERROR_PERMISSION_DENIED);
 
        /* Retrieve user from list */
        l = g_slist_find_custom(users, account, __compare_user_account);
-       retv_if(NULL == l, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == l, UAM_ERROR_INVALID_PARAMETER);
        user = l->data;
 
        /* Retrieve service from list */
        l = g_slist_find_custom(services, svc_name, __compare_svc_name);
-       retv_if(NULL == l, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == l, UAM_ERROR_INVALID_PARAMETER);
 
        for (l = user->devices; NULL != l; l = g_slist_next(l)) {
                uam_db_device_info_t *device = l->data;
@@ -1476,14 +1476,14 @@ int _uam_core_service_add_device(const char *svc_name, const char *device_id, in
        uam_db_tech_info_t *tech_info;
        uam_db_service_info_t *service;
 
-       retv_if(NULL == svc_name, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == svc_name, UAM_ERROR_INVALID_PARAMETER);
        retv_if(0 == g_strcmp0(svc_name, UAM_SERVICE_DEFAULT), UAM_ERROR_PERMISSION_DENIED);
-       retv_if(NULL == device_id, UAM_ERROR_INVALID_PARAM);
-       retv_if(UAM_TECH_TYPE_NONE >= tech_type, UAM_ERROR_INVALID_PARAM);
-       retv_if(UAM_TECH_TYPE_MAX <= tech_type, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == device_id, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(UAM_TECH_TYPE_NONE >= tech_type, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(UAM_TECH_TYPE_MAX <= tech_type, UAM_ERROR_INVALID_PARAMETER);
 
        tech_info = __uam_core_get_dev_tech_info(device_id, tech_type);
-       retv_if(NULL == tech_info, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == tech_info, UAM_ERROR_INVALID_PARAMETER);
 
        l = g_slist_find_custom(tech_info->svc_list, svc_name, __compare_svc_name);
        retv_if(NULL != l, UAM_ERROR_ALREADY_REGISTERED);
@@ -1517,18 +1517,18 @@ int _uam_core_service_remove_device(const char *svc_name, const char *device_id,
        char *mac;
        uam_db_tech_info_t *tech_info;
 
-       retv_if(NULL == svc_name, UAM_ERROR_INVALID_PARAM);
-       retv_if(NULL == device_id, UAM_ERROR_INVALID_PARAM);
-       retv_if(UAM_TECH_TYPE_NONE >= tech_type, UAM_ERROR_INVALID_PARAM);
-       retv_if(UAM_TECH_TYPE_MAX <= tech_type, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == svc_name, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == device_id, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(UAM_TECH_TYPE_NONE >= tech_type, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(UAM_TECH_TYPE_MAX <= tech_type, UAM_ERROR_INVALID_PARAMETER);
        retv_if(0 == g_strcmp0(svc_name, UAM_SERVICE_DEFAULT), UAM_ERROR_PERMISSION_DENIED);
 
        /* Retrieve service from list */
        l = g_slist_find_custom(services, svc_name, __compare_svc_name);
-       retv_if(NULL == l, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == l, UAM_ERROR_INVALID_PARAMETER);
 
        tech_info = __uam_core_get_dev_tech_info(device_id, tech_type);
-       retv_if(NULL == tech_info, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == tech_info, UAM_ERROR_INVALID_PARAMETER);
 
        l = g_slist_find_custom(tech_info->svc_list, svc_name, __compare_svc_name);
        retv_if(NULL == l, UAM_ERROR_NOT_REGISTERED);
@@ -1552,12 +1552,12 @@ int _uam_core_set_service_detection_cycle(const char *svc_name, unsigned int new
        uam_db_service_info_t *service;
        unsigned int elapsed_time;
 
-       retv_if(NULL == svc_name, UAM_ERROR_INVALID_PARAM);
-       retv_if(UAM_DETECTION_CYCLE_MIN > new_cycle, UAM_ERROR_INVALID_PARAM);
-       retv_if(0 != (new_cycle % UAM_DETECTION_CYCLE_MIN), UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == svc_name, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(UAM_DETECTION_CYCLE_MIN > new_cycle, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(0 != (new_cycle % UAM_DETECTION_CYCLE_MIN), UAM_ERROR_INVALID_PARAMETER);
 
        l = g_slist_find_custom(services, svc_name, __compare_svc_name);
-       retv_if(NULL == l, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == l, UAM_ERROR_INVALID_PARAMETER);
        service = l->data;
 
        elapsed_time = service->cycle - service->remaining_time;
@@ -1581,11 +1581,11 @@ int _uam_core_get_service_detection_cycle(const char *svc_name, unsigned int *cy
        GSList *l;
        uam_db_service_info_t *service;
 
-       retv_if(NULL == svc_name, UAM_ERROR_INVALID_PARAM);
-       retv_if(NULL == cycle, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == svc_name, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == cycle, UAM_ERROR_INVALID_PARAMETER);
 
        l = g_slist_find_custom(services, svc_name, __compare_svc_name);
-       retv_if(NULL == l, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == l, UAM_ERROR_INVALID_PARAMETER);
        service = l->data;
        *cycle = service->cycle;
 
@@ -1676,11 +1676,11 @@ static int __uam_core_start_detection(int detection_type,
        gboolean is_monitor_added = TRUE;
        GSList *l;
 
-       retv_if(NULL == sender, UAM_ERROR_INVALID_PARAM);
-       retv_if(NULL == svc_name, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == sender, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == svc_name, UAM_ERROR_INVALID_PARAMETER);
 
        l = g_slist_find_custom(services, svc_name, __compare_svc_name);
-       retv_if(NULL == l, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == l, UAM_ERROR_INVALID_PARAMETER);
        service = l->data;
 
        monitor = __uam_find_monitor(monitors, sender, svc_name, detection_type);
@@ -1722,8 +1722,8 @@ static int __uam_core_stop_detection(int detection_type,
        uam_monitor_info_t *monitor;
        uam_db_service_info_t *service;
 
-       retv_if(NULL == sender, UAM_ERROR_INVALID_PARAM);
-       retv_if(NULL == svc_name, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == sender, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == svc_name, UAM_ERROR_INVALID_PARAMETER);
 
        monitor = __uam_find_monitor(monitors, sender, svc_name, detection_type);
        retv_if(NULL == monitor, UAM_ERROR_NOT_IN_OPERATION);
@@ -1841,7 +1841,7 @@ int _uam_core_get_detection_window(unsigned int *window)
 {
        FUNC_ENTRY;
 
-       retv_if(NULL == window, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == window, UAM_ERROR_INVALID_PARAMETER);
 
        *window = detection_window;
 
@@ -1853,9 +1853,9 @@ int _uam_core_set_detection_window(unsigned int window)
 {
        FUNC_ENTRY;
 
-       retv_if(0 >= window, UAM_ERROR_INVALID_PARAM);
-       retv_if(UAM_DETECTION_WINDOW_MAX < window, UAM_ERROR_INVALID_PARAM);
-       retv_if(0 != (window % UAM_DETECTION_WINDOW_STEP), UAM_ERROR_INVALID_PARAM);
+       retv_if(0 >= window, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(UAM_DETECTION_WINDOW_MAX < window, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(0 != (window % UAM_DETECTION_WINDOW_STEP), UAM_ERROR_INVALID_PARAMETER);
 
        if (UAM_ERROR_NONE != _uam_pm_set_detection_window(window)) {
                UAM_ERR("_uam_pm_set_detection_window(%d) failed", window);
@@ -2017,7 +2017,7 @@ void _uam_core_handle_sensor_ready(unsigned int sensor, gboolean is_ready)
 }
 
 void _uam_core_handle_device_added(int status,
-               int user_id, const uam_device_info_t *dev_info)
+               int user_id, const uam_device_info_s *dev_info)
 {
        FUNC_ENTRY;
        GSList *l;
@@ -2027,7 +2027,7 @@ void _uam_core_handle_device_added(int status,
        l = _uam_manager_get_request_list();
        for (; NULL != l; l = g_slist_next(l)) {
                uam_request_context_t *info = l->data;
-               uam_device_info_t *dev;
+               uam_device_info_s *dev;
                GArray *out_param;
 
                if (!info || (UAM_REQUEST_ADD_DEVICE != info->function))
@@ -2049,7 +2049,7 @@ void _uam_core_handle_device_added(int status,
                }
 
                out_param = g_array_new(FALSE, FALSE, sizeof(gchar));
-               g_array_append_vals(out_param, dev_info, sizeof(uam_device_info_t));
+               g_array_append_vals(out_param, dev_info, sizeof(uam_device_info_s));
                _uam_manager_method_return(info->context, out_param, status);
                g_free(info->data);
                _uam_manager_remove_req_ctxt_from_list(info);
@@ -2179,7 +2179,7 @@ void __send_user_presence_event(uam_db_tech_info_t *tech, unsigned int sensor)
 }
 
 void _uam_core_handle_presence_detected(unsigned int sensor,
-               int user_id, uam_device_info_t *dev_info)
+               int user_id, uam_device_info_s *dev_info)
 {
        FUNC_ENTRY;
        uam_db_user_info_t *user;
@@ -2366,7 +2366,7 @@ static void __send_user_absence_event(uam_tech_type_e type, unsigned int sensor)
 }
 
 void _uam_core_handle_absence_detected(unsigned int sensor,
-               int user_id, uam_device_info_t *dev_info)
+               int user_id, uam_device_info_s *dev_info)
 {
        FUNC_ENTRY;
        uam_db_user_info_t *user;
@@ -2578,8 +2578,8 @@ int _uam_core_start_active_device_scan(char *sender, unsigned int sensors, int d
        int ret;
        uam_scanner_info_t *scanner;
 
-       retv_if(NULL == sender, UAM_ERROR_INVALID_PARAM);
-       retv_if(0 == sensors, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == sender, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(0 == sensors, UAM_ERROR_INVALID_PARAMETER);
 
        scanner = __uam_find_scanner(sender);
        retv_if(NULL != scanner, UAM_ERROR_NOW_IN_PROGRESS);
@@ -2610,8 +2610,8 @@ int _uam_core_stop_active_device_scan(char *sender, unsigned int sensors)
        uam_scanner_info_t *scanner;
        GSList *l;
 
-       retv_if(NULL == sender, UAM_ERROR_INVALID_PARAM);
-       retv_if(0 == sensors, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == sender, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(0 == sensors, UAM_ERROR_INVALID_PARAMETER);
 
        scanner = __uam_find_scanner(sender);
        retv_if(NULL == scanner, UAM_ERROR_NOT_IN_OPERATION);
@@ -2654,7 +2654,7 @@ int _uam_core_stop_active_device_scan(char *sender, unsigned int sensors)
 }
 
 void _uam_core_handle_active_device(uam_active_scan_event_e event,
-               unsigned int sensor, const uam_device_info_t *dev_info)
+               unsigned int sensor, const uam_device_info_s *dev_info)
 {
        FUNC_ENTRY;
        GSList *l;
index 52a6581..c78db5d 100644 (file)
@@ -431,9 +431,9 @@ int _ua_device_db_update_device_ip_address(char *device_id, int tech_type, char
        int error_code = UAM_ERROR_NONE;
        sqlite3_stmt *stmt = update_ip_address;
 
-       retv_if(NULL == device_id, UAM_ERROR_INVALID_PARAM);
-       retv_if(NULL == address, UAM_ERROR_INVALID_PARAM);
-       retv_if(NULL == ip_address, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == device_id, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == address, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == ip_address, UAM_ERROR_INVALID_PARAMETER);
 
        DB_ACTION(sqlite3_bind_text(stmt, 1, ip_address, -1, SQLITE_TRANSIENT));
        DB_ACTION(sqlite3_bind_text(stmt, 2, device_id, -1, SQLITE_TRANSIENT));
@@ -461,8 +461,8 @@ int _ua_device_db_update_device_presence(char *device_id, int tech_type, char *a
        int error_code = UAM_ERROR_NONE;
        sqlite3_stmt *stmt = update_presence;
 
-       retv_if(NULL == device_id, UAM_ERROR_INVALID_PARAM);
-       retv_if(NULL == address, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == device_id, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == address, UAM_ERROR_INVALID_PARAMETER);
 
        DB_ACTION(sqlite3_bind_int(stmt, 1, presence_state));
        DB_ACTION(sqlite3_bind_text(stmt, 2, device_id, -1, SQLITE_TRANSIENT));
@@ -490,8 +490,8 @@ int _ua_device_db_update_device_timestamp(char *device_id, int tech_type, char *
        int error_code = UAM_ERROR_NONE;
        sqlite3_stmt *stmt = update_timestamp;
 
-       retv_if(NULL == device_id, UAM_ERROR_INVALID_PARAM);
-       retv_if(NULL == address, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == device_id, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == address, UAM_ERROR_INVALID_PARAMETER);
 
        DB_ACTION(sqlite3_bind_int64(stmt, 1, timestamp));
        DB_ACTION(sqlite3_bind_text(stmt, 2, device_id, -1, SQLITE_TRANSIENT));
@@ -513,14 +513,14 @@ handle_error:
        return error_code;
 }
 
-int _ua_device_db_insert_device_info(int user_id, const uam_device_info_t *dev_info,
+int _ua_device_db_insert_device_info(int user_id, const uam_device_info_s *dev_info,
                int presence_state, long long timestamp)
 {
        FUNC_ENTRY;
        int error_code = UAM_ERROR_NONE;
        sqlite3_stmt *stmt = insert_device_info;
 
-       retv_if(NULL == dev_info, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == dev_info, UAM_ERROR_INVALID_PARAMETER);
 
        UAM_INFO("%s-%d-%s-%s-%lld-%d-%d-%d", dev_info->device_id,
                        dev_info->type, dev_info->mac, dev_info->ipv4_addr,
@@ -584,7 +584,7 @@ int _ua_device_db_get_device(char *device_id, int tech_type, char *address,
        int error_code = UAM_ERROR_NONE;
        sqlite3_stmt *stmt = select_device;
 
-       retv_if(NULL == info, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == info, UAM_ERROR_INVALID_PARAMETER);
 
        UAM_INFO("UserId: %s", device_id);
 
@@ -626,8 +626,8 @@ int _uam_db_get_device_number(const char *device_id, int tech_type, const char *
        int error_code = UAM_ERROR_NONE;
        sqlite3_stmt *stmt = select_device_number;
 
-       retv_if(NULL == device_id, UAM_ERROR_INVALID_PARAM);
-       retv_if(NULL == address, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == device_id, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(NULL == address, UAM_ERROR_INVALID_PARAMETER);
 
        UAM_INFO("UserId: %s", device_id);
 
index 3408437..a7bd8d1 100644 (file)
@@ -23,7 +23,7 @@
 #include <aul_svc.h>
 #include <bundle_internal.h>
 
-GSList *apps; /* List of apps to launch - uam_app_info_t*/
+GSList *apps; /* List of apps to launch - uam_app_info_s*/
 
 #define UA_EVENT "UA_EVENT"
 
@@ -52,7 +52,7 @@ const char* __uam_event_str(int event)
        }
 }
 
-static void __uam_app_launcher(uam_app_info_t *app_info, int event)
+static void __uam_app_launcher(uam_app_info_s *app_info, int event)
 {
        FUNC_ENTRY;
        int r = 0;
@@ -90,7 +90,7 @@ static void __uam_resume_app(const char *dest, int event)
        UAM_INFO("dest: [%s] ", dest);
        if (NULL == dest) {
                for (l = apps; NULL != l; l = g_slist_next(l)) {
-                       uam_app_info_t *app_info = l->data;
+                       uam_app_info_s *app_info = l->data;
                        if (NULL == app_info)
                                continue;
 
@@ -100,7 +100,7 @@ static void __uam_resume_app(const char *dest, int event)
                }
        } else {
                for (l = apps; NULL != l; l = g_slist_next(l)) {
-                       uam_app_info_t *app_info = l->data;
+                       uam_app_info_s *app_info = l->data;
                        if (NULL == app_info)
                                continue;
 
@@ -197,7 +197,7 @@ int _uam_manager_send_event(
        return UAM_ERROR_NONE;
 }
 
-static uam_app_info_t *__uam_find_app(const char *name)
+static uam_app_info_s *__uam_find_app(const char *name)
 {
 //     FUNC_ENTRY;
        GSList *l;
@@ -205,7 +205,7 @@ static uam_app_info_t *__uam_find_app(const char *name)
        retv_if(NULL == name, NULL);
 
        for (l = apps; NULL != l; l = g_slist_next(l)) {
-               uam_app_info_t *app_info = l->data;
+               uam_app_info_s *app_info = l->data;
 
                if (!app_info || !app_info->sender)
                        continue;
@@ -220,12 +220,12 @@ static uam_app_info_t *__uam_find_app(const char *name)
        return NULL;
 }
 
-int _uam_register_app_info(char *sender, uam_app_info_t app_info)
+int _uam_register_app_info(char *sender, uam_app_info_s app_info)
 {
        FUNC_ENTRY;
 
        int ret;
-       uam_app_info_t *app;
+       uam_app_info_s *app;
 
        app = __uam_find_app(sender);
 
@@ -236,7 +236,7 @@ int _uam_register_app_info(char *sender, uam_app_info_t app_info)
                return ret;
        }
 
-       app = g_malloc0(sizeof(uam_app_info_t));
+       app = g_malloc0(sizeof(uam_app_info_s));
        app->sender = g_strdup(sender);
        g_strlcpy(app->app_id, app_info.app_id, UAM_APP_ID_MAX_STRING_LEN);
        app->uid = app_info.uid;
@@ -248,12 +248,12 @@ int _uam_register_app_info(char *sender, uam_app_info_t app_info)
        return ret;
 }
 
-int _uam_deregister_app_info(char *sender, uam_app_info_t app_info)
+int _uam_deregister_app_info(char *sender, uam_app_info_s app_info)
 {
        FUNC_ENTRY;
 
        int ret;
-       uam_app_info_t *app;
+       uam_app_info_s *app;
 
        app = __uam_find_app(sender);
 
index 5197516..db987da 100644 (file)
@@ -116,11 +116,11 @@ static int __uam_manager_sync_request_handler(
                break;
        }
        case UAM_REQUEST_GET_DEFAULT_USER: {
-               uam_user_info_t user;
+               uam_user_info_s user;
 
                result = _uam_core_get_default_user(&user);
                g_array_append_vals(*out_param1,
-                               &user, sizeof(uam_user_info_t));
+                               &user, sizeof(uam_user_info_s));
                break;
        }
        case UAM_REQUEST_ADD_USER: {
@@ -145,7 +145,7 @@ static int __uam_manager_sync_request_handler(
        }
        case UAM_REQUEST_GET_USER_BY_ACCOUNT: {
                const char *account;
-               uam_user_info_t user;
+               uam_user_info_s user;
 
                account = (char *)g_variant_get_data(in_param1);
                UAM_DBG("Account: [%s]", account);
@@ -153,12 +153,12 @@ static int __uam_manager_sync_request_handler(
                result = _uam_core_get_user_by_account(account, &user);
                if (UAM_ERROR_NONE == result)
                        g_array_append_vals(*out_param1,
-                                       &user, sizeof(uam_user_info_t));
+                                       &user, sizeof(uam_user_info_s));
                break;
        }
        case UAM_REQUEST_GET_USER_BY_DEVICE_ID: {
                const char *device_id;
-               uam_user_info_t user;
+               uam_user_info_s user;
 
                device_id = (char *)g_variant_get_data(in_param1);
                UAM_DBG("device_id: [%s]", device_id);
@@ -166,12 +166,12 @@ static int __uam_manager_sync_request_handler(
                result = _uam_core_get_user_by_device_id(device_id, &user);
                if (UAM_ERROR_NONE == result)
                        g_array_append_vals(*out_param1,
-                                       &user, sizeof(uam_user_info_t));
+                                       &user, sizeof(uam_user_info_s));
                break;
        }
        case UAM_REQUEST_GET_USER_BY_MAC: {
                const char *mac;
-               uam_user_info_t user;
+               uam_user_info_s user;
 
                mac = (char *)g_variant_get_data(in_param1);
                UAM_DBG("MAC: [%s]", mac);
@@ -179,12 +179,12 @@ static int __uam_manager_sync_request_handler(
                result = _uam_core_get_user_by_mac(mac, &user);
                if (UAM_ERROR_NONE == result)
                        g_array_append_vals(*out_param1,
-                                       &user, sizeof(uam_user_info_t));
+                                       &user, sizeof(uam_user_info_s));
                break;
        }
        case UAM_REQUEST_GET_USERS: {
                int count = 0;
-               uam_user_info_t *users = NULL;
+               uam_user_info_s *users = NULL;
 
                result = _uam_core_get_users(&count, &users);
                if (UAM_ERROR_NONE == result) {
@@ -192,7 +192,7 @@ static int __uam_manager_sync_request_handler(
 
                        for (indx = 0; indx < count; indx++)
                                g_array_append_vals(*out_param1,
-                                               &(users[indx]), sizeof(uam_user_info_t));
+                                               &(users[indx]), sizeof(uam_user_info_s));
 
                        g_free(users);
                }
@@ -200,10 +200,10 @@ static int __uam_manager_sync_request_handler(
        }
        case UAM_REQUEST_IS_DEVICE_ADDED: {
                gboolean is_added = FALSE;
-               uam_device_info_t dev_info;
+               uam_device_info_s dev_info;
 
                __uam_manager_copy_params(in_param1,
-                               &dev_info, sizeof(uam_device_info_t));
+                               &dev_info, sizeof(uam_device_info_s));
                UAM_DBG("DeviceId: [%s], Type: %d, MAC: [%s]",
                                dev_info.device_id, dev_info.type, dev_info.mac);
 
@@ -214,11 +214,11 @@ static int __uam_manager_sync_request_handler(
        }
        case UAM_REQUEST_DELETE_DEVICE: {
                const char *account;
-               uam_device_info_t dev_info;
+               uam_device_info_s dev_info;
 
                account = (char *)g_variant_get_data(in_param1);
                __uam_manager_copy_params(in_param2,
-                               &dev_info, sizeof(uam_device_info_t));
+                               &dev_info, sizeof(uam_device_info_s));
                UAM_DBG("Account: [%s], Type: %d, MAC: [%s]",
                                account, dev_info.type, dev_info.mac);
 
@@ -248,7 +248,7 @@ static int __uam_manager_sync_request_handler(
        case UAM_REQUEST_GET_DEVICE_BY_DEVICE_ID: {
                const char *device_id;
                int tech_type;
-               uam_device_info_t device;
+               uam_device_info_s device;
 
                device_id = (char *)g_variant_get_data(in_param1);
                __uam_manager_copy_params(in_param2, &tech_type, sizeof(int));
@@ -257,12 +257,12 @@ static int __uam_manager_sync_request_handler(
                result = _uam_core_get_devcie_by_device_id(device_id, tech_type, &device);
                if (UAM_ERROR_NONE == result)
                        g_array_append_vals(*out_param1,
-                                       &device, sizeof(uam_device_info_t));
+                                       &device, sizeof(uam_device_info_s));
                break;
        }
        case UAM_REQUEST_GET_DEVICE_BY_MAC: {
                const char *mac;
-               uam_device_info_t device;
+               uam_device_info_s device;
 
                mac = (char *)g_variant_get_data(in_param1);
                UAM_DBG("mac: [%s]", mac);
@@ -270,12 +270,12 @@ static int __uam_manager_sync_request_handler(
                result = _uam_core_get_devcie_by_mac(mac, &device);
                if (UAM_ERROR_NONE == result)
                        g_array_append_vals(*out_param1,
-                                       &device, sizeof(uam_device_info_t));
+                                       &device, sizeof(uam_device_info_s));
                break;
        }
        case UAM_REQUEST_GET_DEVICES: {
                int count = 0;
-               uam_device_info_t *devices = NULL;
+               uam_device_info_s *devices = NULL;
 
                result = _uam_core_get_devices(&count, &devices);
                if (UAM_ERROR_NONE == result) {
@@ -283,7 +283,7 @@ static int __uam_manager_sync_request_handler(
 
                        for (indx = 0; indx < count; indx++)
                                g_array_append_vals(*out_param1,
-                                               &(devices[indx]), sizeof(uam_device_info_t));
+                                               &(devices[indx]), sizeof(uam_device_info_s));
 
                        g_free(devices);
                }
@@ -292,7 +292,7 @@ static int __uam_manager_sync_request_handler(
        case UAM_REQUEST_GET_USER_DEVICES: {
                const char *account;
                int count = 0;
-               uam_device_info_t *devices = NULL;
+               uam_device_info_s *devices = NULL;
 
                account = (char *)g_variant_get_data(in_param1);
                UAM_DBG("Account: [%s]", account);
@@ -303,7 +303,7 @@ static int __uam_manager_sync_request_handler(
 
                        for (indx = 0; indx < count; indx++)
                                g_array_append_vals(*out_param1,
-                                               &(devices[indx]), sizeof(uam_device_info_t));
+                                               &(devices[indx]), sizeof(uam_device_info_s));
 
                        g_free(devices);
                }
@@ -401,19 +401,19 @@ static int __uam_manager_sync_request_handler(
                break;
        }
        case UAM_REQUEST_REGISTER_APP: {
-               uam_app_info_t app_info;
+               uam_app_info_s app_info;
 
                __uam_manager_copy_params(in_param1,
-                               &app_info, sizeof(uam_app_info_t));
+                               &app_info, sizeof(uam_app_info_s));
 
                result = _uam_register_app_info(sender, app_info);
                break;
        }
        case UAM_REQUEST_DEREGISTER_APP: {
-               uam_app_info_t app_info;
+               uam_app_info_s app_info;
 
                __uam_manager_copy_params(in_param1,
-                               &app_info, sizeof(uam_app_info_t));
+                               &app_info, sizeof(uam_app_info_s));
 
                result = _uam_deregister_app_info(sender, app_info);
                break;
@@ -579,7 +579,7 @@ static int __uam_manager_async_request_handler(
        switch (function) {
        case UAM_REQUEST_ADD_DEVICE: {
                const char *account;
-               uam_device_info_t dev_info;
+               uam_device_info_s dev_info;
 
                if (__uam_manager_is_request_pending(UAM_REQUEST_ADD_DEVICE)) {
                        UAM_ERR("Another request is already in progress");
@@ -589,7 +589,7 @@ static int __uam_manager_async_request_handler(
 
                account = (char *)g_variant_get_data(in_param1);
                __uam_manager_copy_params(in_param2,
-                               &dev_info, sizeof(uam_device_info_t));
+                               &dev_info, sizeof(uam_device_info_s));
                UAM_DBG("Account: [%s], Type: %d, MAC: [%s] IP: [%s], ID: [%s]",
                                account, dev_info.type, dev_info.mac,
                                dev_info.ipv4_addr, dev_info.device_id);
@@ -598,7 +598,7 @@ static int __uam_manager_async_request_handler(
                if (UAM_ERROR_NONE == result) {
                        __uam_manager_save_request_context(
                                        context, result, sender, function,
-                                       g_memdup(&dev_info, sizeof(uam_device_info_t)));
+                                       g_memdup(&dev_info, sizeof(uam_device_info_s)));
                }
                break;
        }
index 01bc833..64982db 100644 (file)
@@ -408,7 +408,7 @@ int _uam_db_insert_service_info(int *service_number, const char *service_name, i
        int error_code = UAM_ERROR_NONE;
        sqlite3_stmt *stmt = insert_service_info;
 
-       retv_if(NULL == service_name, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == service_name, UAM_ERROR_INVALID_PARAMETER);
 
        UAM_INFO("%s-%d", service_name, cycle);
 
@@ -481,7 +481,7 @@ int _uam_db_update_service_cycle(const char *service_name, int cycle)
        int error_code = UAM_ERROR_NONE;
        sqlite3_stmt *stmt = update_cycle;
 
-       retv_if(NULL == service_name, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == service_name, UAM_ERROR_INVALID_PARAMETER);
 
        DB_ACTION(sqlite3_bind_int64(stmt, 1, cycle));
        DB_ACTION(sqlite3_bind_text(stmt, 2, service_name, -1, SQLITE_TRANSIENT));
@@ -508,8 +508,8 @@ int _uam_db_get_service_info(const char *service_name, db_service_info_t *info)
        sqlite3_stmt *stmt = select_service;
        int rc;
 
-       retv_if(!service_name, UAM_ERROR_INVALID_PARAM);
-       retv_if(!info, UAM_ERROR_INVALID_PARAM);
+       retv_if(!service_name, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(!info, UAM_ERROR_INVALID_PARAMETER);
 
        UAM_INFO("Service Name: %s", service_name);
 
index 19a72cc..fc1ab32 100644 (file)
@@ -421,7 +421,7 @@ int _ua_db_insert_user_info(int *user_id, const char *name, const char *account)
        int error_code = UAM_ERROR_NONE;
        sqlite3_stmt *stmt = insert_user_info;
 
-       retv_if(NULL == account, UAM_ERROR_INVALID_PARAM);
+       retv_if(NULL == account, UAM_ERROR_INVALID_PARAMETER);
 
        UAM_INFO("%s-%s", name, account);
 
@@ -453,7 +453,7 @@ int _ua_db_delete_by_user_id(int user_id)
        int error_code = UAM_ERROR_NONE;
        sqlite3_stmt *stmt = delete_user_info;
 
-       retv_if(0 > user_id, UAM_ERROR_INVALID_PARAM);
+       retv_if(0 > user_id, UAM_ERROR_INVALID_PARAMETER);
 
        UAM_INFO("UserId: %d", user_id);
 
@@ -478,8 +478,8 @@ int _ua_db_get_user(int user_id, db_user_info_t *info)
        int error_code = UAM_ERROR_NONE;
        sqlite3_stmt *stmt = select_user_data;
 
-       retv_if(0 > user_id, UAM_ERROR_INVALID_PARAM);
-       retv_if(!info, UAM_ERROR_INVALID_PARAM);
+       retv_if(0 > user_id, UAM_ERROR_INVALID_PARAMETER);
+       retv_if(!info, UAM_ERROR_INVALID_PARAMETER);
 
        UAM_INFO("UserId: %d", user_id);