summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsaerome kim <saerome.kim@samsung.com>2019-04-16 19:52:40 +0900
committersaerome.kim <saerome.kim@samsung.com>2019-04-16 20:52:54 +0900
commit75e5b2fc0b3032ad7216d51d76bfc0327092431e (patch)
treed92e8b84b96410d5a4d617e2b529e96e08775c84
parent76e0075f2e499a787b9f6de2c6510051d42ee852 (diff)
downloaduser-awareness-75e5b2fc0b3032ad7216d51d76bfc0327092431e.tar.gz
user-awareness-75e5b2fc0b3032ad7216d51d76bfc0327092431e.tar.bz2
user-awareness-75e5b2fc0b3032ad7216d51d76bfc0327092431e.zip
Change-Id: I3e6bdd1e67de3249d74c2dd6afacbf25c56f02d4 Signed-off-by: saerome kim <saerome.kim@samsung.com>
-rw-r--r--include/user-awareness-internal.h9
-rw-r--r--include/user-awareness-private.h113
-rw-r--r--include/user-awareness-util.h22
-rw-r--r--include/user-awareness.h6
-rw-r--r--src/user-awareness-event-handler.c12
-rw-r--r--src/user-awareness-monitors.c52
-rw-r--r--src/user-awareness-users.c198
7 files changed, 214 insertions, 198 deletions
diff --git a/include/user-awareness-internal.h b/include/user-awareness-internal.h
index efabf2c..9596909 100644
--- a/include/user-awareness-internal.h
+++ b/include/user-awareness-internal.h
@@ -46,11 +46,8 @@ extern "C" {
* @retval #UA_ERROR_NONE Successful
* @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter
*/
-int ua_monitor_set_brightness_threshold(
- ua_monitor_h handle,
- int presence_threshold,
- int absence_threshold
- );
+int ua_monitor_set_brightness_threshold(ua_monitor_h handle,
+ int presence_threshold, int absence_threshold);
/**
* @internal
@@ -60,7 +57,6 @@ int ua_monitor_set_brightness_threshold(
*
* @return 0 on success, otherwise a negative error value
* @retval #UA_ERROR_NONE Successful
- * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter
*/
int ua_enable_low_power_mode(void);
@@ -72,7 +68,6 @@ int ua_enable_low_power_mode(void);
*
* @return 0 on success, otherwise a negative error value
* @retval #UA_ERROR_NONE Successful
- * @retval #UA_ERROR_INVALID_PARAMETER Invalid parameter
*/
int ua_disable_low_power_mode(void);
diff --git a/include/user-awareness-private.h b/include/user-awareness-private.h
index e7faff4..d853b14 100644
--- a/include/user-awareness-private.h
+++ b/include/user-awareness-private.h
@@ -83,82 +83,82 @@ extern "C" {
#define UA_ALL_SENSOR_PRESENCE_DETECTION_WAIT_TIME 65
typedef struct {
- const void *callback;
- void *user_data;
+ const void *callback; /**< Callback function pointer */
+ void *user_data; /**< User data */
} ua_callback_t;
typedef struct {
- unsigned int sensor_bitmask;
- unsigned int presence_detected_bitmask;
- unsigned int absence_detected_bitmask;
- ua_detection_mode_e presence_mode;
- ua_detection_mode_e absence_mode;
- gboolean presence_detection_started;
- gboolean absence_detection_started;
- unsigned int presence_detection_timer;
- unsigned int absence_detection_timer;
- ua_callback_t sensor_state_cb;
- ua_callback_t absence_all_users_cb;
- ua_presence_user_detected_cb presence_cb;
- ua_absence_user_detected_cb absence_cb;
- void *user_data;
- } ua_monitor_t;
+ unsigned int sensor_bitmask; /**< Bit-mask for sensors which be supported */
+ unsigned int presence_detected_bitmask; /**< Detetected presence bitmask */
+ unsigned int absence_detected_bitmask; /**< Detected Absence bitmask */
+ ua_detection_mode_e presence_mode; /**< Presence mode */
+ ua_detection_mode_e absence_mode; /**< Absence mode */
+ gboolean presence_detection_started; /**< Is presence detection started */
+ gboolean absence_detection_started; /**< Is absence detection started */
+ unsigned int presence_detection_timer; /**< Presence detection timer */
+ unsigned int absence_detection_timer; /**< Absence detection timer */
+ ua_callback_t sensor_state_cb; /**< Callback to let apps know sensors added or not */
+ ua_callback_t absence_all_users_cb; /**< Callback to let apps know noboty in here */
+ ua_presence_user_detected_cb presence_cb; /**< User presence detection callback */
+ ua_absence_user_detected_cb absence_cb; /**< User absence detection callback */
+ void *user_data; /**< User data */
+ } ua_monitor_s;
typedef struct {
- ua_monitor_t *monitor;
- ua_sensor_e type;
- unsigned short absence_period;
- unsigned int absence_timer;
- unsigned int detection_timer;
- } ua_sensors_t;
+ ua_monitor_s *monitor; /**< Monitor handle */
+ ua_sensor_e type; /**< Bitmask to express the supported sensors */
+ unsigned short absence_period; /**< Absence period */
+ unsigned int absence_timer; /**< Absence timer */
+ unsigned int detection_timer; /**< Detection timer */
+ } ua_sensors_s;
typedef struct {
- ua_user_h user_handle;
- ua_presence_state_e state;
- unsigned int sensor_bitmask;
- char* account;
- char* name;
- gboolean isadded;
- gboolean default_user;
- gboolean create_by_app;
- } ua_user_info_t;
+ ua_user_h user_handle; /**< User handle */
+ ua_presence_state_e state; /**< Presence state */
+ unsigned int sensor_bitmask; /**< Detected user devices bitmask */
+ char* account; /**< Account */
+ char* name; /**< User name */
+ gboolean isadded; /**< Is the user addition completed? */
+ gboolean default_user; /**< Is it a default user? */
+ gboolean create_by_app; /**< Did app add this user information? */
+ } ua_user_info_s;
typedef enum {
- UA_PRESENCE_DETECTION = 0x00,
- UA_ABSENCE_DETECTION
+ UA_PRESENCE_DETECTION = 0x00, /**< Presence detcection */
+ UA_ABSENCE_DETECTION /**< Absence detection */
} ua_detection_type_e;
typedef struct {
- ua_user_h user;
- ua_device_h handle;
- char *mac;
- char *bssid;
- char *ipv4;
- char *ipv6;
- char *mobile_id;
- ua_mac_type_e type;
- bool pairing_required;
- ua_presence_state_e state;
- ua_os_type_e os;
- gboolean isadded;
- gboolean create_by_app;
- } ua_dev_info_t;
+ ua_user_h user; /**< User handle */
+ ua_device_h handle; /**< Device handle */
+ char *mac; /**< MAC address */
+ char *bssid; /**< BSSID */
+ char *ipv4; /**< IPv4 address */
+ char *ipv6; /**< IPv6 address */
+ char *mobile_id; /**< Mobile id (e.g. BT MAC or UUID) */
+ ua_mac_type_e type; /**< Connectivity technology type using this MAC address */
+ bool pairing_required; /**< Does it need pairing? */
+ ua_presence_state_e state; /**< Presence state */
+ ua_os_type_e os; /**< OS type */
+ gboolean isadded; /**< Is the device addition completed? */
+ gboolean create_by_app; /**< Did app add this device information? */
+ } ua_dev_info_s;
void _ua_monitor_handle_user_presence_detected(
- unsigned int bitmask, ua_user_info_t *user_info);
+ unsigned int bitmask, ua_user_info_s *user_info);
void _ua_monitor_handle_sensor_state(unsigned int bitmask, gboolean ready);
void _ua_monitor_handle_user_absence_detected(
- unsigned int bitmask, ua_user_info_t *user_info);
+ unsigned int bitmask, ua_user_info_s *user_info);
- void _ua_free_ua_user_info_t(ua_user_info_t *user);
+ void _ua_free_ua_user_info_t(ua_user_info_s *user);
int _ua_mark_user_info_state_db(char* account, int state, unsigned sensor_bitmask);
bool _ua_check_all_users_absence_any(unsigned int bitmask);
- int _ua_user_add_info_to_list(ua_user_info_t* ua_info);
+ int _ua_user_add_info_to_list(ua_user_info_s* ua_info);
int _ua_user_add_info_to_list_from_uapi_data(uam_user_info_t* uam_info);
@@ -168,10 +168,7 @@ extern "C" {
void _ua_handle_device_removed(int result, uam_device_info_t *uam_info);
- typedef bool (*_ua_intr_registered_user_cb)(
- ua_user_h user_handle,
- void *user_data
- );
+ typedef bool (*_ua_intr_registered_user_cb)(ua_user_h user_handle, void *user_data);
int _ua_intr_foreach_registered_users(
_ua_intr_registered_user_cb foreach_cb,
@@ -181,13 +178,13 @@ extern "C" {
ua_registered_user_cb foreach_cb,
void *user_data);
- int _ua_intr_get_default_user();
+ int _ua_intr_get_default_user(void);
ua_user_h _ua_get_user_handle_by_account(char* account);
int _ua_is_device_exist(char* mobile_id, char* mac, ua_mac_type_e type, gboolean* is_exist);
- GSList *_ua_user_get_users();
+ GSList *_ua_user_get_users(void);
#ifdef __cplusplus
}
#endif
diff --git a/include/user-awareness-util.h b/include/user-awareness-util.h
index 6bc8ff8..2690ccd 100644
--- a/include/user-awareness-util.h
+++ b/include/user-awareness-util.h
@@ -24,8 +24,30 @@
extern "C" {
#endif
+/**
+ * @ingroup CAPI_NETWORK_UA_MODULE
+ * @internal
+ * @brief Converts the error code of ua-manager to the error code of user-awareness.
+ * @since_tizen 5.5
+ *
+ * @param[in] ua_error Error code to be converted.
+ *
+ * @return Error value
+ */
int _ua_get_error_code(int ua_error);
+/**
+ * @ingroup CAPI_NETWORK_UA_MODULE
+ * @internal
+ * @brief Converts the error code to a string.
+ * @since_tizen 5.5
+ *
+ * @remarks The returned value can be used until return call function is valid.
+ *
+ * @param[in] err Error code to be converted.
+ *
+ * @return Error string
+ */
const char *_ua_get_error_string(ua_error_code_e err);
#ifdef __cplusplus
diff --git a/include/user-awareness.h b/include/user-awareness.h
index f32cdda..bcfa57d 100644
--- a/include/user-awareness.h
+++ b/include/user-awareness.h
@@ -806,16 +806,18 @@ int ua_user_get_name(
*/
typedef void (*ua_user_device_added_cb)(
int result,
- ua_device_h dev,
+ ua_device_h dev_handle,
void *user_data);
/**
* @ingroup CAPI_NETWORK_UA_MODULE
- * @brief Async API to add device for a user.
+ * @brief Adds device for a user.
* @since_tizen 5.5
*
* @param[in] user_handle The user handle.
* @param[in] device_handle The device handle.
+ * @param[in] callback Callback to be invoked after adding the user done.
+ * @param[in] user_data The user data to be passed when callback is called.
*
* @return 0 on success, otherwise a negative error value
* @retval #UA_ERROR_NONE Successful
diff --git a/src/user-awareness-event-handler.c b/src/user-awareness-event-handler.c
index d06725a..aa728b7 100644
--- a/src/user-awareness-event-handler.c
+++ b/src/user-awareness-event-handler.c
@@ -34,7 +34,7 @@ static void __ua_event_handler(int event, uam_event_data_t *event_param, void *u
switch (event) {
case UAM_EVENT_USER_PRESENCE_DETECTED: {
uam_detection_event_data_t *event_data = NULL;
- ua_user_info_t* user_info;
+ ua_user_info_s* user_info;
ua_user_h user_handle = NULL;
event_data = event_param->data;
@@ -43,7 +43,7 @@ static void __ua_event_handler(int event, uam_event_data_t *event_param, void *u
user_handle = _ua_get_user_handle_by_account(event_data->account);
if (user_handle) {
- user_info = (ua_user_info_t*) user_handle;
+ user_info = (ua_user_info_s*) user_handle;
_ua_mark_user_info_state_db(user_info->account,
UA_PRESENCE_STATE_ACTIVATE, event_data->sensor_bitmask);
@@ -55,7 +55,7 @@ static void __ua_event_handler(int event, uam_event_data_t *event_param, void *u
}
case UAM_EVENT_USER_ABSENCE_DETECTED: {
uam_detection_event_data_t *event_data = NULL;
- ua_user_info_t* user_info;
+ ua_user_info_s* user_info;
ua_user_h user_handle = NULL;
event_data = event_param->data;
@@ -64,7 +64,7 @@ static void __ua_event_handler(int event, uam_event_data_t *event_param, void *u
user_handle = _ua_get_user_handle_by_account(event_data->account);
if (user_handle) {
- user_info = (ua_user_info_t*) user_handle;
+ user_info = (ua_user_info_s*) user_handle;
_ua_mark_user_info_state_db(user_info->account,
UA_PRESENCE_STATE_INACTIVATE, event_data->sensor_bitmask);
@@ -161,10 +161,10 @@ static bool __foreach_intr_registered_user_info(
ua_user_h handle, void *user_data)
{
int ret;
- ua_user_info_t* user_info;
+ ua_user_info_s* user_info;
retv_if(NULL == handle, false);
- user_info = (ua_user_info_t*)handle;
+ user_info = (ua_user_info_s*)handle;
/* Initial state need to be set ACTIVATE to handle absence case */
ret = _ua_user_add_info_to_list(user_info);
diff --git a/src/user-awareness-monitors.c b/src/user-awareness-monitors.c
index be87274..88fcae2 100644
--- a/src/user-awareness-monitors.c
+++ b/src/user-awareness-monitors.c
@@ -135,11 +135,11 @@ int ua_monitor_create(ua_monitor_h *handle)
{
FUNC_ENTRY;
- ua_monitor_t *monitor = NULL;
+ ua_monitor_s *monitor = NULL;
UA_VALIDATE_INPUT_PARAMETER(handle);
- monitor = g_malloc0(sizeof(ua_monitor_t));
+ monitor = g_malloc0(sizeof(ua_monitor_s));
if (!monitor) {
UA_ERR("g_malloc0 failed");
return UA_ERROR_OUT_OF_MEMORY;
@@ -154,7 +154,7 @@ int ua_monitor_create(ua_monitor_h *handle)
return UA_ERROR_NONE;
}
-static void __ua_free_ua_monitor_t(ua_monitor_t *monitor)
+static void __ua_free_ua_monitor_t(ua_monitor_s *monitor)
{
FUNC_ENTRY;
@@ -178,7 +178,7 @@ static void __ua_free_ua_monitor_t(ua_monitor_t *monitor)
int ua_monitor_destroy(ua_monitor_h handle)
{
FUNC_ENTRY;
- ua_monitor_t *monitor = (ua_monitor_t *)handle;
+ ua_monitor_s *monitor = (ua_monitor_s *)handle;
UA_VALIDATE_INPUT_PARAMETER(handle);
UA_VALIDATE_HANDLE(handle, ua_monitor_list);
@@ -196,7 +196,7 @@ int ua_monitor_set_sensor_state_cb(ua_monitor_h handle,
ua_monitor_sensor_state_changed_cb callback, void *user_data)
{
FUNC_ENTRY;
- ua_monitor_t *monitor = (ua_monitor_t *)handle;
+ ua_monitor_s *monitor = (ua_monitor_s *)handle;
UA_VALIDATE_INPUT_PARAMETER(callback);
UA_VALIDATE_INPUT_PARAMETER(handle);
@@ -212,7 +212,7 @@ int ua_monitor_set_sensor_state_cb(ua_monitor_h handle,
int ua_monitor_unset_sensor_state_cb(ua_monitor_h handle)
{
FUNC_ENTRY;
- ua_monitor_t *monitor = (ua_monitor_t *)handle;
+ ua_monitor_s *monitor = (ua_monitor_s *)handle;
UA_VALIDATE_INPUT_PARAMETER(handle);
UA_VALIDATE_HANDLE(handle, ua_monitor_list);
@@ -228,7 +228,7 @@ int ua_monitor_set_absence_detected_cb(ua_monitor_h handle,
ua_absence_detected_cb callback, void *user_data)
{
FUNC_ENTRY;
- ua_monitor_t *monitor = (ua_monitor_t *)handle;
+ ua_monitor_s *monitor = (ua_monitor_s *)handle;
UA_VALIDATE_INPUT_PARAMETER(callback);
UA_VALIDATE_INPUT_PARAMETER(handle);
@@ -244,7 +244,7 @@ int ua_monitor_set_absence_detected_cb(ua_monitor_h handle,
int ua_monitor_unset_absence_detected_cb(ua_monitor_h handle)
{
FUNC_ENTRY;
- ua_monitor_t *monitor = (ua_monitor_t *)handle;
+ ua_monitor_s *monitor = (ua_monitor_s *)handle;
UA_VALIDATE_INPUT_PARAMETER(handle);
UA_VALIDATE_HANDLE(handle, ua_monitor_list);
@@ -261,7 +261,7 @@ int ua_monitor_add_sensor(
ua_sensor_e sensor_type)
{
FUNC_ENTRY;
- ua_monitor_t *monitor = (ua_monitor_t *)handle;
+ ua_monitor_s *monitor = (ua_monitor_s *)handle;
unsigned int bitmask;
unsigned int available_sensors = 0;
@@ -291,7 +291,7 @@ int ua_monitor_remove_sensor(
ua_sensor_e sensor_type)
{
FUNC_ENTRY;
- ua_monitor_t *monitor = (ua_monitor_t *)handle;
+ ua_monitor_s *monitor = (ua_monitor_s *)handle;
unsigned int bitmask;
UA_VALIDATE_INPUT_PARAMETER(handle);
@@ -444,7 +444,7 @@ int ua_monitor_start_presence_detection(
{
FUNC_ENTRY;
int ret;
- ua_monitor_t *monitor = (ua_monitor_t *)handle;
+ ua_monitor_s *monitor = (ua_monitor_s *)handle;
ua_detection_type_e detect = UA_PRESENCE_DETECTION;
UA_VALIDATE_INPUT_PARAMETER(handle);
@@ -480,7 +480,7 @@ int ua_monitor_start_absence_detection(
{
FUNC_ENTRY;
int ret;
- ua_monitor_t *monitor = (ua_monitor_t *)handle;
+ ua_monitor_s *monitor = (ua_monitor_s *)handle;
ua_detection_type_e detect = UA_ABSENCE_DETECTION;
UA_VALIDATE_INPUT_PARAMETER(handle);
@@ -639,7 +639,7 @@ int ua_monitor_stop_presence_detection(ua_monitor_h handle)
{
FUNC_ENTRY;
int ret;
- ua_monitor_t *monitor = (ua_monitor_t *)handle;
+ ua_monitor_s *monitor = (ua_monitor_s *)handle;
ua_detection_type_e detect = UA_PRESENCE_DETECTION;
UA_VALIDATE_INPUT_PARAMETER(handle);
@@ -667,7 +667,7 @@ int ua_monitor_stop_absence_detection(ua_monitor_h handle)
{
FUNC_ENTRY;
int ret;
- ua_monitor_t *monitor = (ua_monitor_t *)handle;
+ ua_monitor_s *monitor = (ua_monitor_s *)handle;
ua_detection_type_e detect = UA_ABSENCE_DETECTION;
UA_VALIDATE_INPUT_PARAMETER(handle);
@@ -694,7 +694,7 @@ int ua_monitor_stop_absence_detection(ua_monitor_h handle)
static gboolean __ua_reset_presence_detected_history(gpointer data)
{
FUNC_ENTRY;
- ua_monitor_t *monitor = data;
+ ua_monitor_s *monitor = data;
if (0 < monitor->presence_detected_bitmask)
monitor->presence_detected_bitmask = 0;
@@ -703,7 +703,7 @@ static gboolean __ua_reset_presence_detected_history(gpointer data)
return FALSE;
}
-static void __ua_sensor_send_presence_detected(ua_monitor_t *monitor, unsigned int bitmask, ua_user_info_t *user_info)
+static void __ua_sensor_send_presence_detected(ua_monitor_s *monitor, unsigned int bitmask, ua_user_info_s *user_info)
{
FUNC_ENTRY;
ua_sensor_e sensor_type;
@@ -775,7 +775,7 @@ static gboolean __ua_absence_detection_timeout(gpointer data)
user_list = _ua_user_get_users();
for (l = ua_monitor_list; NULL != l; l = g_slist_next(l)) {
- ua_monitor_t *monitor = l->data;
+ ua_monitor_s *monitor = l->data;
if (!monitor)
continue;
@@ -802,7 +802,7 @@ static gboolean __ua_absence_detection_timeout(gpointer data)
continue;
for (l1 = user_list; NULL != l1; l1 = g_slist_next(l1)) {
- ua_user_info_t *user_info = l1->data;
+ ua_user_info_s *user_info = l1->data;
UA_INFO("Scanning user list...");
if (!user_info || (monitor->sensor_bitmask & user_info->sensor_bitmask))
@@ -818,7 +818,7 @@ static gboolean __ua_absence_detection_timeout(gpointer data)
return FALSE;
}
-static void __ua_sensor_send_absence_detected(ua_monitor_t *monitor, unsigned int bitmask, ua_user_info_t *user_info)
+static void __ua_sensor_send_absence_detected(ua_monitor_s *monitor, unsigned int bitmask, ua_user_info_s *user_info)
{
FUNC_ENTRY;
ua_sensor_e sensor_type;
@@ -866,13 +866,13 @@ static void __ua_sensor_send_absence_detected(ua_monitor_t *monitor, unsigned in
FUNC_EXIT;
}
-void _ua_monitor_handle_user_presence_detected(unsigned int bitmask, ua_user_info_t *user_info)
+void _ua_monitor_handle_user_presence_detected(unsigned int bitmask, ua_user_info_s *user_info)
{
FUNC_ENTRY;
GSList *l;
for (l = ua_monitor_list; l; l = g_slist_next(l)) {
- ua_monitor_t *monitor = l->data;
+ ua_monitor_s *monitor = l->data;
if (!monitor || !monitor->presence_detection_started)
continue;
@@ -891,13 +891,13 @@ void _ua_monitor_handle_user_presence_detected(unsigned int bitmask, ua_user_inf
FUNC_EXIT;
}
-void _ua_monitor_handle_user_absence_detected(unsigned int bitmask, ua_user_info_t *user_info)
+void _ua_monitor_handle_user_absence_detected(unsigned int bitmask, ua_user_info_s *user_info)
{
FUNC_ENTRY;
GSList *l;
for (l = ua_monitor_list; l; l = g_slist_next(l)) {
- ua_monitor_t *monitor = l->data;
+ ua_monitor_s *monitor = l->data;
if (!monitor || !monitor->absence_detection_started)
continue;
@@ -912,7 +912,7 @@ void _ua_monitor_handle_user_absence_detected(unsigned int bitmask, ua_user_info
FUNC_EXIT;
}
-static void __ua_remove_sensor(ua_monitor_t *monitor, ua_sensor_e sensor_type)
+static void __ua_remove_sensor(ua_monitor_s *monitor, ua_sensor_e sensor_type)
{
FUNC_ENTRY;
int ret;
@@ -1001,7 +1001,7 @@ void _ua_monitor_handle_sensor_state(unsigned int bitmask, gboolean ready)
sensor_type = __ua_sensor_bitmask_to_type(bitmask);
for (l = ua_monitor_list; l; l = g_slist_next(l)) {
- ua_monitor_t *monitor = l->data;
+ ua_monitor_s *monitor = l->data;
if (!monitor)
continue;
@@ -1021,7 +1021,7 @@ int ua_monitor_set_brightness_threshold(ua_monitor_h handle, int presence_thresh
{
FUNC_ENTRY;
int ret;
- ua_monitor_t *monitor = (ua_monitor_t *)handle;
+ ua_monitor_s *monitor = (ua_monitor_s *)handle;
UA_VALIDATE_INPUT_PARAMETER(handle);
UA_VALIDATE_HANDLE(handle, ua_monitor_list);
diff --git a/src/user-awareness-users.c b/src/user-awareness-users.c
index aebe115..d05562c 100644
--- a/src/user-awareness-users.c
+++ b/src/user-awareness-users.c
@@ -69,7 +69,7 @@ static uam_tech_type_e __to_uam_tech_type(ua_mac_type_e type)
void _ua_free_ua_device_info_t(gpointer data)
{
FUNC_ENTRY;
- ua_dev_info_t *device = data;
+ ua_dev_info_s *device = data;
ret_if(NULL == device);
@@ -93,7 +93,7 @@ void _ua_free_ua_device_info_t(gpointer data)
FUNC_EXIT;
}
-void _ua_free_ua_user_info_t(ua_user_info_t *user)
+void _ua_free_ua_user_info_t(ua_user_info_s *user)
{
FUNC_ENTRY;
@@ -114,11 +114,11 @@ int _ua_mark_user_info_state_db(char* account, int state, unsigned sensor_bitmas
{
FUNC_ENTRY;
GSList *l;
- ua_user_info_t *u;
+ ua_user_info_s *u;
UA_VALIDATE_INPUT_PARAMETER(account);
for (l = ua_users_list; l; l = g_slist_next(l)) {
- u = (ua_user_info_t *)l->data;
+ u = (ua_user_info_s *)l->data;
if (!g_strcmp0(account, u->account)) {
UA_INFO("User found [%s]", u->account);
@@ -144,10 +144,10 @@ bool _ua_check_all_users_absence_any(unsigned int bitmask)
{
FUNC_ENTRY;
GSList *l;
- ua_user_info_t *u;
+ ua_user_info_s *u;
for (l = ua_users_list; l; l = g_slist_next(l)) {
- u = (ua_user_info_t *)l->data;
+ u = (ua_user_info_s *)l->data;
if (u->sensor_bitmask & bitmask) {
UA_INFO("User found [%s]", u->account);
@@ -158,15 +158,15 @@ bool _ua_check_all_users_absence_any(unsigned int bitmask)
return true;
}
-static ua_user_info_t *__ua_get_user_from_list(const char *account)
+static ua_user_info_s *__ua_get_user_from_list(const char *account)
{
GSList *l;
- ua_user_info_t *user_info;
+ ua_user_info_s *user_info;
retv_if(NULL == account, NULL);
for (l = ua_users_list; l; l = g_slist_next(l)) {
- user_info = (ua_user_info_t *)l->data;
+ user_info = (ua_user_info_s *)l->data;
if (!g_strcmp0(account, user_info->account))
return user_info;
@@ -175,14 +175,14 @@ static ua_user_info_t *__ua_get_user_from_list(const char *account)
return NULL;
}
-static ua_dev_info_t *__ua_get_device_from_list(
+static ua_dev_info_s *__ua_get_device_from_list(
const char* mobile_id, const char* mac, ua_mac_type_e type)
{
GSList *l;
- ua_dev_info_t *dev;
+ ua_dev_info_s *dev;
for (l = ua_devices_list; NULL != l; l = g_slist_next(l)) {
- dev = (ua_dev_info_t *)l->data;
+ dev = (ua_dev_info_s *)l->data;
if (type != dev->type)
continue;
@@ -205,11 +205,11 @@ int _ua_is_device_exist(char* mobile_id, char* mac, ua_mac_type_e type, gboolean
{
GSList *l;
UA_VALIDATE_INPUT_PARAMETER(is_exist);
- ua_dev_info_t *dev;
+ ua_dev_info_s *dev;
*is_exist = false;
for (l = ua_devices_list; l; l = g_slist_next(l)) {
- dev = (ua_dev_info_t *)l->data;
+ dev = (ua_dev_info_s *)l->data;
if ((int)type == (int)dev->type) {
if (mobile_id && !g_strcmp0(mobile_id, dev->mobile_id)) {
@@ -230,13 +230,13 @@ int _ua_is_device_exist(char* mobile_id, char* mac, ua_mac_type_e type, gboolean
int _ua_user_add_info_to_list_from_uapi_data(uam_user_info_t* uam_info)
{
FUNC_ENTRY;
- ua_user_info_t* user_info;
+ ua_user_info_s* user_info;
UA_VALIDATE_INPUT_PARAMETER(uam_info);
if (NULL != __ua_get_user_from_list(uam_info->account))
return UA_ERROR_ALREADY_DONE;
- user_info = g_malloc0(sizeof(ua_user_info_t));
+ user_info = g_malloc0(sizeof(ua_user_info_s));
if (!user_info) {
UA_ERR("g_malloc0 failed");
@@ -274,16 +274,16 @@ int _ua_user_add_info_to_list_from_uapi_data(uam_user_info_t* uam_info)
FUNC_EXIT;
}
-int _ua_user_add_info_to_list(ua_user_info_t* ua_info)
+int _ua_user_add_info_to_list(ua_user_info_s* ua_info)
{
FUNC_ENTRY;
- ua_user_info_t* user_info;
+ ua_user_info_s* user_info;
UA_VALIDATE_INPUT_PARAMETER(ua_info);
if (NULL != __ua_get_user_from_list(ua_info->account))
return UA_ERROR_ALREADY_DONE;
- user_info = g_malloc0(sizeof(ua_user_info_t));
+ user_info = g_malloc0(sizeof(ua_user_info_s));
if (!user_info) {
UA_ERR("g_malloc0 failed");
@@ -326,20 +326,20 @@ int _ua_remove_user_info_from_list(char* account)
FUNC_ENTRY;
GSList *l;
GSList *m;
- ua_user_info_t *u;
- ua_dev_info_t *dev;
+ ua_user_info_s *u;
+ ua_dev_info_s *dev;
UA_VALIDATE_INPUT_PARAMETER(account);
for (l = ua_users_list; l; l = g_slist_next(l)) {
- u = (ua_user_info_t *)l->data;
+ u = (ua_user_info_s *)l->data;
if (!g_strcmp0(account, u->account)) {
if (u->create_by_app == false) {
UA_INFO("User found [%s]", u->account);
for (m = ua_devices_list; m; m = g_slist_next(l)) {
- dev = (ua_dev_info_t *)m->data;
+ dev = (ua_dev_info_s *)m->data;
if (u == dev->user) {
dev->user = NULL;
break;
@@ -360,10 +360,10 @@ int _ua_remove_user_info_from_list(char* account)
FUNC_EXIT;
}
-static ua_dev_info_t* __ua_add_device_info_to_list(uam_device_info_t *uam_info)
+static ua_dev_info_s* __ua_add_device_info_to_list(uam_device_info_t *uam_info)
{
FUNC_ENTRY;
- ua_dev_info_t *dev;
+ ua_dev_info_s *dev;
retv_if(NULL == uam_info, NULL);
dev = __ua_get_device_from_list(uam_info->device_id,
@@ -385,7 +385,7 @@ static ua_dev_info_t* __ua_add_device_info_to_list(uam_device_info_t *uam_info)
return dev;
}
- dev = g_malloc0(sizeof(ua_dev_info_t));
+ dev = g_malloc0(sizeof(ua_dev_info_s));
if (!dev) {
UA_ERR("g_malloc0 failed");
return NULL;
@@ -430,7 +430,7 @@ static ua_dev_info_t* __ua_add_device_info_to_list(uam_device_info_t *uam_info)
void _ua_handle_device_added(int result, uam_device_info_t *uam_info)
{
FUNC_ENTRY;
- ua_dev_info_t *dev;
+ ua_dev_info_s *dev;
result = _ua_get_error_code(result);
if (UA_ERROR_NONE != result) {
@@ -461,13 +461,13 @@ static void __ua_remove_device_info_from_list(uam_device_info_t *uam_info)
{
FUNC_ENTRY;
GSList *l;
- ua_dev_info_t *u;
+ ua_dev_info_s *u;
ua_mac_type_e type;
ret_if(NULL == uam_info);
type = __to_ua_mac_type(uam_info->type);
for (l = ua_devices_list; l; l = g_slist_next(l)) {
- u = (ua_dev_info_t *)l->data;
+ u = (ua_dev_info_s *)l->data;
if (type != u->type)
continue;
@@ -505,7 +505,7 @@ ua_user_h _ua_get_user_handle_by_account(char* account)
{
FUNC_ENTRY;
GSList *l;
- ua_user_info_t *u;
+ ua_user_info_s *u;
if (account == NULL) {
UA_INFO("Account is NULL");
@@ -513,7 +513,7 @@ ua_user_h _ua_get_user_handle_by_account(char* account)
}
for (l = ua_users_list; l; l = g_slist_next(l)) {
- u = (ua_user_info_t *)l->data;
+ u = (ua_user_info_s *)l->data;
if (!g_strcmp0(account, u->account)) {
UA_INFO("User found [%s]", u->account);
@@ -528,11 +528,11 @@ ua_user_h _ua_get_user_handle_by_account(char* account)
int ua_user_create(ua_user_h *user_handle)
{
FUNC_ENTRY;
- ua_user_info_t *user = NULL;
+ ua_user_info_s *user = NULL;
UA_VALIDATE_INPUT_PARAMETER(user_handle);
- user = g_malloc0(sizeof(ua_user_info_t));
+ user = g_malloc0(sizeof(ua_user_info_s));
if (!user) {
UA_ERR("g_malloc0 failed");
return UA_ERROR_OUT_OF_MEMORY;
@@ -555,7 +555,7 @@ int ua_user_add(ua_user_h user_handle)
{
FUNC_ENTRY;
int ret;
- ua_user_info_t *user = (ua_user_info_t *)user_handle;
+ ua_user_info_s *user = (ua_user_info_s *)user_handle;
uam_user_info_t uam_user;
UA_VALIDATE_INPUT_PARAMETER(user_handle);
@@ -585,7 +585,7 @@ int ua_user_remove(ua_user_h user_handle)
{
FUNC_ENTRY;
int ret;
- ua_user_info_t *user = (ua_user_info_t *)user_handle;
+ ua_user_info_s *user = (ua_user_info_s *)user_handle;
char account[UAM_USER_ACCOUNT_MAX_STRING_LEN];
UA_VALIDATE_INPUT_PARAMETER(user_handle);
@@ -614,13 +614,13 @@ int ua_user_get_default_user(ua_user_h* user_handle)
FUNC_ENTRY;
int ret;
uam_user_info_t uam_user;
- ua_user_info_t *user = NULL;
+ ua_user_info_s *user = NULL;
GSList *l;
UA_VALIDATE_INPUT_PARAMETER(user_handle);
for (l = ua_users_list; l; l = g_slist_next(l)) {
- user = (ua_user_info_t *)l->data;
+ user = (ua_user_info_s *)l->data;
if (user->default_user == true) {
UA_INFO("User found [%s]", user->account);
@@ -638,7 +638,7 @@ int ua_user_get_default_user(ua_user_h* user_handle)
return ret;
}
- user = g_malloc0(sizeof(ua_user_info_t));
+ user = g_malloc0(sizeof(ua_user_info_s));
if (!user) {
UA_ERR("Failed to allocated memory");
return UA_ERROR_OUT_OF_MEMORY;
@@ -661,7 +661,7 @@ int ua_user_get_default_user(ua_user_h* user_handle)
int ua_user_set_account(ua_user_h user_handle, const char* account)
{
FUNC_ENTRY;
- ua_user_info_t *user = (ua_user_info_t *)user_handle;
+ ua_user_info_s *user = (ua_user_info_s *)user_handle;
UA_VALIDATE_INPUT_PARAMETER(user_handle);
UA_VALIDATE_INPUT_PARAMETER(account);
@@ -682,7 +682,7 @@ int ua_user_get_account(
char** account)
{
FUNC_ENTRY;
- ua_user_info_t *user = (ua_user_info_t *)user_handle;
+ ua_user_info_s *user = (ua_user_info_s *)user_handle;
UA_VALIDATE_INPUT_PARAMETER(user_handle);
UA_VALIDATE_HANDLE(user_handle, ua_users_list);
@@ -704,7 +704,7 @@ int ua_user_get_name(
char** name)
{
FUNC_ENTRY;
- ua_user_info_t *user = (ua_user_info_t *)user_handle;
+ ua_user_info_s *user = (ua_user_info_s *)user_handle;
UA_VALIDATE_INPUT_PARAMETER(user_handle);
UA_VALIDATE_HANDLE(user_handle, ua_users_list);
@@ -728,7 +728,7 @@ int ua_user_set_name(
const char* name)
{
FUNC_ENTRY;
- ua_user_info_t *user = (ua_user_info_t *)handle;
+ ua_user_info_s *user = (ua_user_info_s *)handle;
UA_VALIDATE_INPUT_PARAMETER(handle);
UA_VALIDATE_INPUT_PARAMETER(name);
@@ -748,8 +748,8 @@ int ua_user_set_name(
int ua_user_destroy(ua_user_h user_handle)
{
FUNC_ENTRY;
- ua_user_info_t *user = (ua_user_info_t *)user_handle;
- ua_dev_info_t* dev;
+ ua_user_info_s *user = (ua_user_info_s *)user_handle;
+ ua_dev_info_s* dev;
GSList *l;
UA_VALIDATE_INPUT_PARAMETER(user_handle);
@@ -764,7 +764,7 @@ int ua_user_destroy(ua_user_h user_handle)
}
for (l = ua_devices_list; l; l = g_slist_next(l)) {
- dev = (ua_dev_info_t *)l->data;
+ dev = (ua_dev_info_s *)l->data;
if (dev->user == user_handle) {
UA_INFO("User found in device handle");
@@ -782,11 +782,11 @@ int ua_user_destroy(ua_user_h user_handle)
int ua_device_create(ua_device_h *device_handle)
{
FUNC_ENTRY;
- ua_dev_info_t *device = NULL;
+ ua_dev_info_s *device = NULL;
UA_VALIDATE_INPUT_PARAMETER(device_handle);
- device = g_malloc0(sizeof(ua_dev_info_t));
+ device = g_malloc0(sizeof(ua_dev_info_s));
if (!device) {
UA_ERR("g_malloc0 failed");
return UA_ERROR_OUT_OF_MEMORY;
@@ -817,7 +817,7 @@ int ua_device_create(ua_device_h *device_handle)
int ua_device_destroy(ua_device_h device_handle)
{
FUNC_ENTRY;
- ua_dev_info_t *device = (ua_dev_info_t *)device_handle;
+ ua_dev_info_s *device = (ua_dev_info_s *)device_handle;
UA_VALIDATE_INPUT_PARAMETER(device_handle);
UA_VALIDATE_HANDLE(device_handle, ua_devices_list);
@@ -833,7 +833,7 @@ int ua_device_set_mac_type(ua_device_h handle, ua_mac_type_e mac_type)
{
FUNC_ENTRY;
- ua_dev_info_t *device = (ua_dev_info_t *)handle;
+ ua_dev_info_s *device = (ua_dev_info_s *)handle;
UA_VALIDATE_INPUT_PARAMETER(handle);
retv_if(UA_MAC_TYPE_NONE >= mac_type, UA_ERROR_INVALID_PARAMETER);
@@ -849,7 +849,7 @@ int ua_device_get_mac_type(ua_device_h handle, ua_mac_type_e *mac_type)
{
FUNC_ENTRY;
- ua_dev_info_t *device = (ua_dev_info_t *)handle;
+ ua_dev_info_s *device = (ua_dev_info_s *)handle;
UA_VALIDATE_INPUT_PARAMETER(handle);
UA_VALIDATE_INPUT_PARAMETER(mac_type);
@@ -867,7 +867,7 @@ int ua_device_set_mac_address(
FUNC_ENTRY;
int ret;
gboolean status = false;
- ua_dev_info_t *device = (ua_dev_info_t *)handle;
+ ua_dev_info_s *device = (ua_dev_info_s *)handle;
UA_VALIDATE_INPUT_PARAMETER(handle);
UA_VALIDATE_INPUT_PARAMETER(mac_address);
@@ -900,7 +900,7 @@ int ua_device_set_os_info(
ua_os_type_e os)
{
FUNC_ENTRY;
- ua_dev_info_t *device = (ua_dev_info_t *)handle;
+ ua_dev_info_s *device = (ua_dev_info_s *)handle;
UA_VALIDATE_INPUT_PARAMETER(handle);
UA_VALIDATE_HANDLE(handle, ua_devices_list);
@@ -923,7 +923,7 @@ int ua_device_set_mobile_id(
const char* mobile_id)
{
FUNC_ENTRY;
- ua_dev_info_t *device = (ua_dev_info_t *)handle;
+ ua_dev_info_s *device = (ua_dev_info_s *)handle;
int ret;
gboolean status = false;
@@ -954,7 +954,7 @@ int ua_device_set_wifi_bssid(
const char* bssid)
{
FUNC_ENTRY;
- ua_dev_info_t *device = (ua_dev_info_t *)handle;
+ ua_dev_info_s *device = (ua_dev_info_s *)handle;
UA_VALIDATE_INPUT_PARAMETER(handle);
UA_VALIDATE_INPUT_PARAMETER(bssid);
@@ -975,7 +975,7 @@ int ua_device_set_wifi_ipv4_address(
const char* ipv4_address)
{
FUNC_ENTRY;
- ua_dev_info_t *device = (ua_dev_info_t *)handle;
+ ua_dev_info_s *device = (ua_dev_info_s *)handle;
UA_VALIDATE_INPUT_PARAMETER(handle);
UA_VALIDATE_INPUT_PARAMETER(ipv4_address);
@@ -996,7 +996,7 @@ int ua_device_get_mac_address(
char** mac_address)
{
FUNC_ENTRY;
- ua_dev_info_t *device = (ua_dev_info_t *)device_handle;
+ ua_dev_info_s *device = (ua_dev_info_s *)device_handle;
UA_VALIDATE_INPUT_PARAMETER(device_handle);
UA_VALIDATE_HANDLE(device_handle, ua_devices_list);
@@ -1025,7 +1025,7 @@ int ua_device_get_os_info(
)
{
FUNC_ENTRY;
- ua_dev_info_t *device = (ua_dev_info_t *)device_handle;
+ ua_dev_info_s *device = (ua_dev_info_s *)device_handle;
UA_VALIDATE_INPUT_PARAMETER(device_handle);
UA_VALIDATE_HANDLE(device_handle, ua_devices_list);
@@ -1041,7 +1041,7 @@ int ua_device_get_mobile_id(
char** mobile_id)
{
FUNC_ENTRY;
- ua_dev_info_t *device = (ua_dev_info_t *)device_handle;
+ ua_dev_info_s *device = (ua_dev_info_s *)device_handle;
UA_VALIDATE_INPUT_PARAMETER(device_handle);
UA_VALIDATE_HANDLE(device_handle, ua_devices_list);
@@ -1069,7 +1069,7 @@ int ua_device_get_wifi_bssid(
char** bssid)
{
FUNC_ENTRY;
- ua_dev_info_t *device = (ua_dev_info_t *)device_handle;
+ ua_dev_info_s *device = (ua_dev_info_s *)device_handle;
UA_VALIDATE_INPUT_PARAMETER(device_handle);
UA_VALIDATE_HANDLE(device_handle, ua_devices_list);
@@ -1097,7 +1097,7 @@ int ua_device_get_wifi_ipv4_address(
char** ipv4_address)
{
FUNC_ENTRY;
- ua_dev_info_t *device = (ua_dev_info_t *)device_handle;
+ ua_dev_info_s *device = (ua_dev_info_s *)device_handle;
UA_VALIDATE_INPUT_PARAMETER(device_handle);
UA_VALIDATE_HANDLE(device_handle, ua_devices_list);
@@ -1127,14 +1127,14 @@ int ua_device_get_handle_by_mac_address(
FUNC_ENTRY;
GSList *l;
int ret;
- ua_dev_info_t *dev;
+ ua_dev_info_s *dev;
uam_device_info_t uam_dev;
UA_VALIDATE_INPUT_PARAMETER(mac);
UA_VALIDATE_INPUT_PARAMETER(device_handle);
for (l = ua_devices_list; l; l = g_slist_next(l)) {
- dev = (ua_dev_info_t *)l->data;
+ dev = (ua_dev_info_s *)l->data;
if (!g_strcmp0(mac, dev->mac)) {
UA_INFO("MAC found [%s]", dev->mac);
@@ -1151,7 +1151,7 @@ int ua_device_get_handle_by_mac_address(
return ret;
}
- dev = g_malloc0(sizeof(ua_dev_info_t));
+ dev = g_malloc0(sizeof(ua_dev_info_s));
if (!dev) {
UA_ERR("g_malloc0 failed");
return UA_ERROR_OUT_OF_MEMORY;
@@ -1210,7 +1210,7 @@ int ua_device_get_handle_by_mobile_id(
FUNC_ENTRY;
GSList *l;
int ret;
- ua_dev_info_t *dev;
+ ua_dev_info_s *dev;
uam_device_info_t uam_dev;
uam_tech_type_e type;
@@ -1220,7 +1220,7 @@ int ua_device_get_handle_by_mobile_id(
retv_if((UA_MAC_TYPE_INVALID <= mac_type), UA_ERROR_INVALID_PARAMETER);
for (l = ua_devices_list; l; l = g_slist_next(l)) {
- dev = (ua_dev_info_t *)l->data;
+ dev = (ua_dev_info_s *)l->data;
if ((mac_type == dev->type) && !g_strcmp0(mobile_id, dev->mobile_id)) {
UA_INFO("Mobile ID found [%s]", dev->mobile_id);
@@ -1238,7 +1238,7 @@ int ua_device_get_handle_by_mobile_id(
return ret;
}
- dev = g_malloc0(sizeof(ua_dev_info_t));
+ dev = g_malloc0(sizeof(ua_dev_info_s));
if (!dev) {
UA_ERR("g_malloc0 failed");
return UA_ERROR_OUT_OF_MEMORY;
@@ -1295,12 +1295,12 @@ int ua_user_foreach_registered_users(
{
FUNC_ENTRY;
GSList *l;
- ua_user_info_t *u;
+ ua_user_info_s *u;
UA_VALIDATE_INPUT_PARAMETER(foreach_cb);
for (l = ua_users_list; l; l = g_slist_next(l)) {
- u = (ua_user_info_t *)l->data;
+ u = (ua_user_info_s *)l->data;
if (!foreach_cb(u->user_handle, user_data))
break;
@@ -1336,8 +1336,8 @@ int _ua_foreach_registered_users(
for (i = 0; i < user_list->len; i++) {
ptr = g_ptr_array_index(user_list, i);
if (ptr) {
- ua_user_info_t* user_info;
- user_info = g_malloc0(sizeof(ua_user_info_t));
+ ua_user_info_s* user_info;
+ user_info = g_malloc0(sizeof(ua_user_info_s));
if (!user_info) {
UA_ERR("g_malloc0 failed");
@@ -1392,9 +1392,9 @@ int ua_device_clone(ua_device_h *cloned,
{
FUNC_ENTRY;
int ret;
- ua_dev_info_t *device;
+ ua_dev_info_s *device;
uam_user_info_t uam_user;
- ua_dev_info_t *org_device = (ua_dev_info_t *)origin;
+ ua_dev_info_s *org_device = (ua_dev_info_s *)origin;
UA_VALIDATE_INPUT_PARAMETER(cloned);
UA_VALIDATE_INPUT_PARAMETER(origin);
@@ -1408,7 +1408,7 @@ int ua_device_clone(ua_device_h *cloned,
return UA_ERROR_NONE;
}
- device = g_malloc0(sizeof(ua_dev_info_t));
+ device = g_malloc0(sizeof(ua_dev_info_s));
if (!device) {
UA_ERR("g_malloc0 failed");
return UA_ERROR_OUT_OF_MEMORY;
@@ -1449,11 +1449,11 @@ int ua_device_clone(ua_device_h *cloned,
return ret;
} else {
GSList *l;
- ua_user_info_t *user_info;
+ ua_user_info_s *user_info;
int found = 0;
for (l = ua_users_list; l; l = g_slist_next(l)) {
- user_info = (ua_user_info_t *)l->data;
+ user_info = (ua_user_info_s *)l->data;
if (!g_strcmp0(uam_user.account, user_info->account)) {
UA_INFO("User found [%s]", user_info->account);
@@ -1489,8 +1489,8 @@ int ua_user_add_device(ua_user_h user_handle, ua_device_h device_handle,
int ret;
ua_user_h handle = NULL;
ua_user_h temp_handle = NULL;
- ua_dev_info_t *device = (ua_dev_info_t *) device_handle;
- ua_user_info_t* user = NULL;
+ ua_dev_info_s *device = (ua_dev_info_s *) device_handle;
+ ua_user_info_s* user = NULL;
uam_device_info_t uam_device;
UA_VALIDATE_INPUT_PARAMETER(device_handle);
@@ -1513,7 +1513,7 @@ int ua_user_add_device(ua_user_h user_handle, ua_device_h device_handle,
device->user = user_handle;
}
- user = (ua_user_info_t *)device->user;
+ user = (ua_user_info_s *)device->user;
memset(&uam_device, 0, sizeof(uam_device_info_t));
uam_device.operating_system = device->os;
@@ -1546,8 +1546,8 @@ int ua_user_remove_device(ua_user_h user_handle, ua_device_h device_handle)
FUNC_ENTRY;
int ret;
ua_user_h handle = NULL;
- ua_dev_info_t *device = (ua_dev_info_t *) device_handle;
- ua_user_info_t* user = NULL;
+ ua_dev_info_s *device = (ua_dev_info_s *) device_handle;
+ ua_user_info_s* user = NULL;
uam_device_info_t uam_device;
UA_VALIDATE_INPUT_PARAMETER(device_handle);
@@ -1563,11 +1563,11 @@ int ua_user_remove_device(ua_user_h user_handle, ua_device_h device_handle)
return ret;
}
- user = (ua_user_info_t *)handle;
+ user = (ua_user_info_s *)handle;
} else {
UA_VALIDATE_HANDLE(user_handle, ua_users_list);
retv_if((device->user != user_handle), UA_ERROR_INVALID_PARAMETER);
- user = (ua_user_info_t *)user_handle;
+ user = (ua_user_info_s *)user_handle;
}
memset(&uam_device, 0, sizeof(uam_device_info_t));
@@ -1601,13 +1601,13 @@ int ua_device_remove_by_address(const char* mac)
FUNC_ENTRY;
int ret;
GSList *l;
- ua_dev_info_t *device = NULL;
+ ua_dev_info_s *device = NULL;
int found = 0;
UA_VALIDATE_INPUT_PARAMETER(mac);
for (l = ua_devices_list; l; l = g_slist_next(l)) {
- device = (ua_dev_info_t *)l->data;
+ device = (ua_dev_info_s *)l->data;
if (!g_strcmp0(mac, device->mac)) {
UA_INFO("MAC found [%s]", device->mac);
@@ -1638,7 +1638,7 @@ int ua_device_remove_by_mobile_id(const char* mobile_id, ua_mac_type_e mac_type)
FUNC_ENTRY;
int ret;
GSList *l;
- ua_dev_info_t *device = NULL;
+ ua_dev_info_s *device = NULL;
int found = 0;
UA_VALIDATE_INPUT_PARAMETER(mobile_id);
@@ -1646,7 +1646,7 @@ int ua_device_remove_by_mobile_id(const char* mobile_id, ua_mac_type_e mac_type)
retv_if((UA_MAC_TYPE_INVALID <= mac_type), UA_ERROR_INVALID_PARAMETER);
for (l = ua_devices_list; l; l = g_slist_next(l)) {
- device = (ua_dev_info_t *)l->data;
+ device = (ua_dev_info_s *)l->data;
if (!g_strcmp0(mobile_id, device->mobile_id)) {
UA_INFO("Mobile ID [%s]", device->mobile_id);
@@ -1699,8 +1699,8 @@ int ua_foreach_all_registered_dev_info(
for (i = 0; i < devices_list->len; i++) {
ptr = g_ptr_array_index(devices_list, i);
if (ptr) {
- ua_dev_info_t* device_info;
- device_info = g_malloc0(sizeof(ua_dev_info_t));
+ ua_dev_info_s* device_info;
+ device_info = g_malloc0(sizeof(ua_dev_info_s));
if (!device_info) {
UA_ERR("g_malloc0 failed");
ret = UA_ERROR_OUT_OF_MEMORY;
@@ -1745,7 +1745,7 @@ int ua_foreach_all_registered_dev_info(
}
for (l = ua_devices_db_list; l; l = g_slist_next(l)) {
- ua_dev_info_t *u = l->data;
+ ua_dev_info_s *u = l->data;
if (NULL == u)
continue;
@@ -1773,7 +1773,7 @@ int ua_foreach_registered_dev_info_by_user(
FUNC_ENTRY;
int i;
int ret;
- ua_user_info_t *user = (ua_user_info_t *)user_handle;
+ ua_user_info_s *user = (ua_user_info_s *)user_handle;
GPtrArray *devices_list = NULL;
uam_device_info_t *ptr;
GSList *l;
@@ -1796,8 +1796,8 @@ int ua_foreach_registered_dev_info_by_user(
for (i = 0; i < devices_list->len; i++) {
ptr = g_ptr_array_index(devices_list, i);
if (ptr) {
- ua_dev_info_t* device_info;
- device_info = g_malloc0(sizeof(ua_dev_info_t));
+ ua_dev_info_s* device_info;
+ device_info = g_malloc0(sizeof(ua_dev_info_s));
if (!device_info) {
UA_ERR("g_malloc0 failed");
ret = UA_ERROR_OUT_OF_MEMORY;
@@ -1843,7 +1843,7 @@ int ua_foreach_registered_dev_info_by_user(
}
for (l = ua_devices_db_list; l; l = g_slist_next(l)) {
- ua_dev_info_t *u = l->data;
+ ua_dev_info_s *u = l->data;
if (NULL == u)
continue;
@@ -1869,7 +1869,7 @@ int ua_device_get_pairing_required(
{
FUNC_ENTRY;
int ret;
- ua_dev_info_t *device = (ua_dev_info_t *)handle;
+ ua_dev_info_s *device = (ua_dev_info_s *)handle;
gboolean is_registered = FALSE;
uam_device_info_t uam_device;
@@ -1919,12 +1919,12 @@ int _ua_intr_foreach_registered_users(
return ret;
}
-int _ua_intr_get_default_user()
+int _ua_intr_get_default_user(void)
{
FUNC_ENTRY;
int ret;
uam_user_info_t uam_user;
- ua_user_info_t *user = NULL;
+ ua_user_info_s *user = NULL;
GSList *l;
ret = _ua_get_error_code(_uam_get_default_user(&uam_user));
@@ -1935,7 +1935,7 @@ int _ua_intr_get_default_user()
}
for (l = ua_users_list; l; l = g_slist_next(l)) {
- user = (ua_user_info_t *)l->data;
+ user = (ua_user_info_s *)l->data;
if (!g_strcmp0(uam_user.account, user->account)) {
UA_INFO("User found [%s]", user->account);
@@ -1945,7 +1945,7 @@ int _ua_intr_get_default_user()
}
}
- user = g_malloc0(sizeof(ua_user_info_t));
+ user = g_malloc0(sizeof(ua_user_info_s));
if (!user) {
UA_ERR("Failed to allocate memory");
return UA_ERROR_OUT_OF_MEMORY;
@@ -1963,7 +1963,7 @@ int _ua_intr_get_default_user()
return UA_ERROR_NONE;
}
-GSList *_ua_user_get_users()
+GSList *_ua_user_get_users(void)
{
FUNC_ENTRY;
FUNC_EXIT;