summaryrefslogtreecommitdiff
path: root/test/uat-init.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/uat-init.c')
-rw-r--r--test/uat-init.c36
1 files changed, 14 insertions, 22 deletions
diff --git a/test/uat-init.c b/test/uat-init.c
index 183b3ee..12d1ee0 100644
--- a/test/uat-init.c
+++ b/test/uat-init.c
@@ -39,45 +39,37 @@ static char g_uid[MENU_DATA_SIZE + 1] = {0,}; /**< User id */
static char cycle_time[MENU_DATA_SIZE + 1] = {0,};
static char window[MENU_DATA_SIZE + 1] = {0,};
-static void __absence_detected_all_cb(int result, ua_monitor_h monitor,
+static void __user_absence_detected_cb(int result, ua_monitor_h monitor,
ua_user_h user_handle, void *user_data)
{
- int ret = UA_ERROR_NONE;
char *account = NULL;
char *pbuf = uat_get_time();
- msgp("[%s]", pbuf);
+ msg("\n[%s]", pbuf);
free(pbuf);
- msgp("ABSENCE ALL detectd [%s]", uat_get_error_str(result));
+ ua_user_get_account(user_handle, &account);
+ msgp("[%s] ABSENCE detected [%s]", account, uat_get_error_str(result));
- if (user_handle) {
- ret = ua_user_get_account(user_handle, &account);
- if (UA_ERROR_NONE == ret) {
- msgp("User account info %s", account);
- free(account);
- }
+ if (account) {
+ free(account);
}
}
-static void __presence_detected_all_cb(int result, ua_monitor_h monitor,
+static void __user_presence_detected_cb(int result, ua_monitor_h monitor,
ua_user_h user_handle, void *user_data)
{
- int ret = UA_ERROR_NONE;
char *account = NULL;
char *pbuf = uat_get_time();
- msgp("[%s]", pbuf);
+ msg("\n[%s]", pbuf);
free(pbuf);
- msgb("PRESENCE ALL detectd [%s]", uat_get_error_str(result));
+ ua_user_get_account(user_handle, &account);
+ msgb("[%s] PRESENCE detected [%s]", account, uat_get_error_str(result));
- if (user_handle) {
- ret = ua_user_get_account(user_handle, &account);
- if (UA_ERROR_NONE == ret) {
- msgb("User account info %s", account);
- free(account);
- }
+ if (account) {
+ free(account);
}
}
@@ -147,7 +139,7 @@ static int run_ua_monitor_set_user_absence_detected_cb(
msg("ua_monitor_set_absence_detected_cb");
ret = ua_monitor_set_user_absence_detected_cb(g_ua_mon_h,
- __absence_detected_all_cb, g_ua_mon_h);
+ __user_absence_detected_cb, g_ua_mon_h);
msg(" - ua_monitor_set_absence_detected_cb() ret: [0x%X] [%s]",
ret, uat_get_error_str(ret));
@@ -163,7 +155,7 @@ static int run_ua_monitor_set_user_presence_detected_cb(
msg("ua_monitor_set_presence_detected_cb");
ret = ua_monitor_set_user_presence_detected_cb(g_ua_mon_h,
- __presence_detected_all_cb, g_ua_mon_h);
+ __user_presence_detected_cb, g_ua_mon_h);
msg(" - ua_monitor_set_presence_detected_cb() ret: [0x%X] [%s]",
ret, uat_get_error_str(ret));