FUNC_EXIT;
}
+static void light_detection_status_changed_cb(uas_detection_type_e type,
+ void *sensor_info)
+{
+ FUNC_ENTRY;
+
+ uas_sensor_info_t *info = NULL;
+ uam_sensor_info_s *light_info = NULL;
+
+ UAM_DBG("Light: %s", type == UAS_PRESENCE ? "PRESENCE" : "ABSENCE");
+
+ if (sensor_info)
+ info = sensor_info;
+ light_info = _pm_util_uas_sensor_info_to_uam_sensor_info(info);
+
+ _uam_core_handle_status_changed(UAM_SENSOR_BITMASK_LIGHT, light_info);
+
+ g_free(light_info);
+
+ FUNC_EXIT;
+}
+
void light_detection_callback(uas_detection_type_e type, void *sensor_info)
{
FUNC_ENTRY;
uas_callbacks_t light_cbs = {
.state_changed_cb = light_state_changed_callback,
.detection_state_cb = light_detection_state_changed_cb,
- .detection_status_cb = NULL,
+ .detection_status_cb = light_detection_status_changed_cb,
.detected_cb = light_detection_callback,
.device_detected_cb = NULL,
.device_added_cb = NULL,
ret_if(NULL == info);
- 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 %s", sensor, sensor_info->status == UAS_ABSENCE ?
"UAM_EVENT_ABSENCE_DETECTED" : "UAM_EVENT_PRESENCE_DETECTED");
+ UAM_DBG("%llu %d %d", sensor_info->timestamp,
+ sensor_info->accuracy, sensor_info->count);
_uam_manager_send_event(NULL, UAM_EVENT_SENSOR_STATUS_CHANGED,
g_variant_new("(uutiidddd)", sensor, sensor_info->status, sensor_info->timestamp,