Loading...
Searching...
No Matches
AlertedSensorManager.idl
/* SPDX-License-Identifier: BSD-3-Clause */
/*
* Copyright 2018 Raritan Inc. All rights reserved.
*/
#ifndef __ALERTED_SENSOR_MANAGER_IDL__
#define __ALERTED_SENSOR_MANAGER_IDL__
#include <Sensor.idl>
/** Sensors model */
module sensors {
/** A global instance keeping track of sensors in alerted state */
interface AlertedSensorManager {
/** Sensor alert state */
enumeration AlertState {
UNAVAILABLE, ///< Sensor is unavailable
NORMAL, ///< Sensor is not alerted
CRITICAL, ///< Sensor is in critical state
WARNED ///< Sensor is in warned state
};
/** Statistics about monitored sensors */
structure SensorCounts {
int total; ///< Total number of monitored sensors
int unavailable; ///< Number of unavailable sensors
int critical; ///< Number of critical sensors
int warned; ///< Number of warned sensors
};
/**
* Data about a monitored sensor.
*
* All entries include a reference to the sensor's parent object (e.g.
* an inlet or a peripheral device slot), allowing a client to identify
* an unknown alerted sensor with just a few RPC calls.
*/
structure SensorData {
Sensor sensor; ///< Reference to the sensor object
Object parent; ///< Reference to the sensor's parent object
AlertState alertState; ///< Current alert state of the sensor
};
/**
* Event: A change in the list of monitored sensors occurred.
*
* This event is fired when sensors are added to or removed from the
* list of monitored sensors. It is not fired when a monitored sensor's
* alert state changes.
*/
valueobject MonitoredSensorsChangedEvent extends idl.Event {
SensorCounts counts; ///< Sensor statistics after the change
};
/**
* Event: One or more sensors' alert states have changed.
*
* This event is fired whenever the result of getAlertedSensors()
* changes, i.e. in the following cases:
* - An existing sensor's alert state changes
* - A newly added sensor is alerted
* - A sensor that was alerted is removed
*/
valueobject AlertedSensorsChangedEvent extends idl.Event {
SensorCounts counts; ///< Sensor statistics after the change
vector<SensorData> changedSensors; ///< Changed or added sensors
vector<Sensor> removedSensors; ///< Removed sensors
};
/**
* Retrieve the current sensor counts.
*
* @return Current sensor counts
*/
SensorCounts getSensorCounts();
/**
* Retrieve a list of all monitored sensors.
*
* @return List of monitored sensors including alert state
*/
vector<SensorData> getAllSensors();
/**
* Retrieve a list of currently alerted sensors.
*
* @return List of alerted sensors
*/
vector<SensorData> getAlertedSensors();
};
}
#endif
sensors::AlertedSensorManager
A global instance keeping track of sensors in alerted state.
Definition AlertedSensorManager.idl:15
sensors::AlertedSensorManager::getSensorCounts
SensorCounts getSensorCounts()
Retrieve the current sensor counts.
sensors::AlertedSensorManager::getAlertedSensors
vector< SensorData > getAlertedSensors()
Retrieve a list of currently alerted sensors.
sensors::AlertedSensorManager::AlertState
AlertState
Sensor alert state.
Definition AlertedSensorManager.idl:18
sensors::AlertedSensorManager::NORMAL
@ NORMAL
Sensor is not alerted.
Definition AlertedSensorManager.idl:20
sensors::AlertedSensorManager::CRITICAL
@ CRITICAL
Sensor is in critical state.
Definition AlertedSensorManager.idl:21
sensors::AlertedSensorManager::UNAVAILABLE
@ UNAVAILABLE
Sensor is unavailable.
Definition AlertedSensorManager.idl:19
sensors::AlertedSensorManager::getAllSensors
vector< SensorData > getAllSensors()
Retrieve a list of all monitored sensors.
sensors::Sensor
Sensor interface
Definition Sensor.idl:15
idl
Basic IDL definitions.
Definition Event.idl:10
sensors
Sensors Model.
Definition AccumulatingNumericSensor.idl:13
idl::Event
Common base for all events.
Definition Event.idl:13
sensors::AlertedSensorManager::AlertedSensorsChangedEvent
Event: One or more sensors' alert states have changed.
Definition AlertedSensorManager.idl:66
sensors::AlertedSensorManager::AlertedSensorsChangedEvent::counts
SensorCounts counts
Sensor statistics after the change.
Definition AlertedSensorManager.idl:67
sensors::AlertedSensorManager::AlertedSensorsChangedEvent::removedSensors
vector< Sensor > removedSensors
Removed sensors.
Definition AlertedSensorManager.idl:69
sensors::AlertedSensorManager::AlertedSensorsChangedEvent::changedSensors
vector< SensorData > changedSensors
Changed or added sensors.
Definition AlertedSensorManager.idl:68
sensors::AlertedSensorManager::MonitoredSensorsChangedEvent
Event: A change in the list of monitored sensors occurred.
Definition AlertedSensorManager.idl:53
sensors::AlertedSensorManager::MonitoredSensorsChangedEvent::counts
SensorCounts counts
Sensor statistics after the change.
Definition AlertedSensorManager.idl:54
sensors::AlertedSensorManager::SensorCounts
Statistics about monitored sensors.
Definition AlertedSensorManager.idl:26
sensors::AlertedSensorManager::SensorCounts::critical
int critical
Number of critical sensors.
Definition AlertedSensorManager.idl:29
sensors::AlertedSensorManager::SensorCounts::unavailable
int unavailable
Number of unavailable sensors.
Definition AlertedSensorManager.idl:28
sensors::AlertedSensorManager::SensorCounts::total
int total
Total number of monitored sensors.
Definition AlertedSensorManager.idl:27
sensors::AlertedSensorManager::SensorCounts::warned
int warned
Number of warned sensors.
Definition AlertedSensorManager.idl:30
sensors::AlertedSensorManager::SensorData
Data about a monitored sensor.
Definition AlertedSensorManager.idl:40
sensors::AlertedSensorManager::SensorData::alertState
AlertState alertState
Current alert state of the sensor.
Definition AlertedSensorManager.idl:43
sensors::AlertedSensorManager::SensorData::parent
Object parent
Reference to the sensor's parent object.
Definition AlertedSensorManager.idl:42
sensors::AlertedSensorManager::SensorData::sensor
Sensor sensor
Reference to the sensor object.
Definition AlertedSensorManager.idl:41