Name: ua-manager
Summary: User awareness manager
-Version: 0.12.1
+Version: 0.12.2
Release: 1
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
&accuracy, &count, &values[0], &values[1],
&values[2], &values[3]);
- __uam_copy_sensor_data(&sensor_info, 0, sensor_bitmask, timestamp,
- accuracy, count, values);
+ __uam_copy_sensor_data(&sensor_info, UAM_PRESENCE_STATE_PRESENT, sensor_bitmask,
+ timestamp, accuracy, count, values);
event = UAM_EVENT_PRESENCE_DETECTED;
&accuracy, &count, &values[0], &values[1],
&values[2], &values[3]);
- __uam_copy_sensor_data(&sensor_info, 0, sensor_bitmask, timestamp,
- accuracy, count, values);
+ __uam_copy_sensor_data(&sensor_info, UAM_PRESENCE_STATE_ABSENT,
+ sensor_bitmask, timestamp, accuracy, count, values);
event = UAM_EVENT_ABSENCE_DETECTED;
int status, accuracy, count;
double values[UAM_SENSOR_MAX_VALUES];
- g_variant_get(parameters, "(uutiidddd)", &status, &sensor_bitmask, ×tamp,
+ g_variant_get(parameters, "(uutiidddd)", &sensor_bitmask, &status, ×tamp,
&accuracy, &count, &values[0], &values[1],&values[2], &values[3]);
+ UAM_DBG("%d %d %llu %d %d", sensor_bitmask, status, timestamp, accuracy, count);
+
__uam_copy_sensor_data(&sensor_info, status, sensor_bitmask, timestamp,
accuracy, count, values);
int _uam_core_add_ibeacon_adv(unsigned int adv_len, const char *iadv);
-void _uam_core_handle_status_changed(unsigned int sensor,
- unsigned int type, void *info);
+void _uam_core_handle_status_changed(unsigned int sensor, void *info);
#ifdef __cplusplus
}
info = sensor_info;
motion_info = _pm_util_uas_sensor_info_to_uam_sensor_info(info);
- _uam_core_handle_status_changed(UAM_SENSOR_BITMASK_MOTION, type, motion_info);
+ _uam_core_handle_status_changed(UAM_SENSOR_BITMASK_MOTION, motion_info);
g_free(motion_info);
sensor_info = g_new0(uam_sensor_info_s, 1);
retv_if(NULL == sensor_info, NULL);
+ sensor_info->status = info->status;
sensor_info->timestamp = info->timestamp;
sensor_info->accuracy = info->accuracy;
sensor_info->count = info->count;
if (UAM_DETECT_PRESENCE != mon->mode)
continue;
- user->timestamp = (unsigned long long) time(NULL);
+ user->timestamp = (unsigned long long)time(NULL);
UAM_INFO("sensor [%d]", sensor);
_uam_manager_send_event(mon->name,
UAM_EVENT_USER_PRESENCE_DETECTED,
if (!user)
continue;
- user->timestamp = (unsigned long long) time(NULL);
+ user->timestamp = (unsigned long long)time(NULL);
_uam_manager_send_event(mon->name,
UAM_EVENT_USER_ABSENCE_DETECTED,
g_variant_new("(usst)", sensor,
return UAM_ERROR_NONE;
}
-void _uam_core_handle_status_changed(unsigned int sensor, unsigned int type,
- void *info)
+void _uam_core_handle_status_changed(unsigned int sensor, void *info)
{
FUNC_ENTRY;
ret_if(NULL == info);
- sensor_info->status = type;
+ UAM_DBG("%d %d %llu %d %d", sensor, sensor_info->status, sensor_info->timestamp,
+ sensor_info->accuracy, sensor_info->count);
- UAM_INFO("sensor: 0x%8.8X, detection_type: %d", sensor, type);
+ UAM_INFO("sensor: 0x%8.8X %s", sensor, sensor_info->status == UAS_ABSENCE ?
+ "UAM_EVENT_ABSENCE_DETECTED" : "UAM_EVENT_PRESENCE_DETECTED");
- if (UAS_ABSENCE == type) {
- _uam_manager_send_event(NULL, UAM_EVENT_SENSOR_STATUS_CHANGED,
- g_variant_new("(uutiidddd)", type, sensor, 0, 0, 0, 0, 0, 0, 0));
- UAM_DBG("Sent UAM_EVENT_ABSENCE_DETECTED for 0x%8.8X", sensor);
- } else {
- _uam_manager_send_event(NULL, UAM_EVENT_SENSOR_STATUS_CHANGED,
- g_variant_new("(uutiidddd)", type, sensor, sensor_info->timestamp,
- sensor_info->accuracy, sensor_info->count, sensor_info->values[0],
- sensor_info->values[1], sensor_info->values[2], sensor_info->values[3]));
- }
+ _uam_manager_send_event(NULL, UAM_EVENT_SENSOR_STATUS_CHANGED,
+ g_variant_new("(uutiidddd)", sensor, sensor_info->status, sensor_info->timestamp,
+ sensor_info->accuracy, sensor_info->count, sensor_info->values[0],
+ sensor_info->values[1], sensor_info->values[2], sensor_info->values[3]));
FUNC_EXIT;
}
/* Sensor information structure */
typedef struct {
- unsigned long long timestamp;
- int accuracy;
- int count;
- double *values;
+ unsigned int status; /**< Sensor status */
+ unsigned long long timestamp; /**< Timestamp */
+ int accuracy; /**< Accuracy */
+ int count; /**< How many sensor data are there */
+ double *values; /**< Sensor data */
} uas_sensor_info_t;
/* Active scan event types */