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_1_0_1 {
/** 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_4_0_3 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_4_0_3> 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_1_0_1::SensorData::sensor
Sensor_4_0_3 sensor
Reference to the sensor object.
Definition: AlertedSensorManager.idl:41
sensors::AlertedSensorManager_1_0_1::UNAVAILABLE
Sensor is unavailable.
Definition: AlertedSensorManager.idl:19
sensors::AlertedSensorManager_1_0_1::SensorData
Data about a monitored sensor.
Definition: AlertedSensorManager.idl:40
sensors::AlertedSensorManager_1_0_1::SensorCounts::total
int total
Total number of monitored sensors.
Definition: AlertedSensorManager.idl:27
sensors::AlertedSensorManager_1_0_1::CRITICAL
Sensor is in critical state.
Definition: AlertedSensorManager.idl:21
idl
Basic IDL definitions.
Definition: Event.idl:10
sensors::AlertedSensorManager_1_0_1::SensorCounts::warned
int warned
Number of warned sensors.
Definition: AlertedSensorManager.idl:30
sensors::AlertedSensorManager_1_0_1::removedSensors
vector< Sensor_4_0_3 > removedSensors
Removed sensors.
Definition: AlertedSensorManager.idl:69
sensors::AlertedSensorManager_1_0_1::SensorCounts
Statistics about monitored sensors.
Definition: AlertedSensorManager.idl:26
sensors::AlertedSensorManager_1_0_1::NORMAL
Sensor is not alerted.
Definition: AlertedSensorManager.idl:20
sensors::Sensor_4_0_3
Sensor interface
Definition: Sensor.idl:15
sensors::AlertedSensorManager_1_0_1::SensorCounts::unavailable
int unavailable
Number of unavailable sensors.
Definition: AlertedSensorManager.idl:28
sensors::AlertedSensorManager_1_0_1::AlertState
AlertState
Sensor alert state.
Definition: AlertedSensorManager.idl:18
sensors
Sensors Model.
Definition: AccumulatingNumericSensor.idl:13
sensors::AlertedSensorManager_1_0_1::changedSensors
vector< SensorData > changedSensors
Changed or added sensors.
Definition: AlertedSensorManager.idl:68
sensors::AlertedSensorManager_1_0_1::SensorData::alertState
AlertState alertState
Current alert state of the sensor.
Definition: AlertedSensorManager.idl:43
sensors::AlertedSensorManager_1_0_1::SensorCounts::critical
int critical
Number of critical sensors.
Definition: AlertedSensorManager.idl:29
sensors::AlertedSensorManager_1_0_1
A global instance keeping track of sensors in alerted state.
Definition: AlertedSensorManager.idl:15
sensors::AlertedSensorManager_1_0_1::SensorData::parent
Object parent
Reference to the sensor&#39;s parent object.
Definition: AlertedSensorManager.idl:42