static uam_monitor_info_t *__uam_find_monitor(
const char *name, uam_pm_detection_mode_e mode)
{
- FUNC_ENTRY;
+// FUNC_ENTRY;
GSList *l;
retv_if(NULL == name, NULL);
}
}
- FUNC_EXIT;
+// FUNC_EXIT;
return NULL;
}
monitor->mode = detection_type;
}
+ UAM_DBG("Name: %s, Mode: %d", monitor->name, monitor->mode);
+
/* Find sensors which are already monitoring */
active_sensors = __uam_get_active_sensors(detection_type);
UAM_DBG("sensors: 0x%8.8X, active_sensors: 0x%8.8X", sensors, active_sensors);
user = l->data;
l = g_slist_find_custom(user->devices,
- dev_info->device_id, __compare_user_id);
+ dev_info->device_id, __compare_device_id);
if (NULL == l) {
UAM_ERR("Valid user_id [%d] but Invalid device_id [%s]",
user_id, dev_info->device_id);
FUNC_EXIT;
}
+
+void _uam_core_cleanup_monitor(char *name)
+{
+ if (__uam_find_monitor(name, UAM_DETECT_PRESENCE))
+ __uam_core_stop_detection(UAM_DETECT_PRESENCE, name, UAM_SENSOR_ALL);
+
+ if (__uam_find_monitor(name, UAM_DETECT_ABSENCE))
+ __uam_core_stop_detection(UAM_DETECT_ABSENCE, name, UAM_SENSOR_ALL);
+}