Loading...
Searching...
No Matches
NumericSensor.idl
/* SPDX-License-Identifier: BSD-3-Clause */
/*
* Copyright 2009 Raritan Inc. All rights reserved.
*/
#ifndef __SENSORMODEL_NUMERICSENSOR_IDL__
#define __SENSORMODEL_NUMERICSENSOR_IDL__
#include <Event.idl>
#include <Sensor.idl>
#include <UserEvent.idl>
/** Sensors Model */
module sensors {
/** A sensor with numeric readings */
interface NumericSensor extends Sensor {
constant int THRESHOLD_OUT_OF_RANGE = 1; ///< The threshold exceedes the sensor range
constant int THRESHOLD_INVALID = 2; ///< The threshold constraints are not met
constant int THRESHOLD_NOT_SUPPORTED = 3; ///< The sensor does not support setting this threshold
/** Range of possible sensor readings */
structure Range {
double lower; ///< Minimum reading
double upper; ///< Maximum reading
};
/**
* Threshold capabilities
*/
structure ThresholdCapabilities {
boolean hasUpperCritical; ///< Sensor has upper critical threshold
boolean hasUpperWarning; ///< Sensor has upper warning threshold
boolean hasLowerWarning; ///< Sensor has lower warning threshold
boolean hasLowerCritical; ///< Sensor has lower critical threshold
};
/** Numeric sensor metadata */
structure MetaData {
/**
* Sensor type, reading type and unit
*/
Sensor.TypeSpec type;
/**
* Number of significant decimal digits.
*
* Indicates how many digits should be displayed
* to the right of the decimal point. I.e. double
* values must be rounded with this precision.
*/
int decdigits;
/**
* Sensor accuracy in percent.
*
* How close in percent measurement is to actual value.
* This value has an implicit precision of 2, i.e. the double
* value must be rounded for 2 decimal digits before use.
* For example a reading of 10.0 and an accuracy of 0.2
* means the actual reading value is 10.0 +/- 0.2%.
*
* A value of 0 means unused.
*/
float accuracy;
/**
* Sensor resolution.
*
* Minimum difference between any two measured values.
* Must be rounded with decimal digits.
*/
float resolution;
/**
* Sensor tolerance.
*
* Tolerance is given in +/- counts of the reading value.
* It indicates a constant magnitude possible error in the
* quantization of an analog input to the sensor.
* Rounded with decimal digits + 1.
*
* A value of 0 means unused.
*/
float tolerance;
/**
* Sensor noise threshold.
*
* Threshold under which sensor measurements will be ignored.
* Sensor measurements below that value will be reported at
* the lower bound of the sensor range.
*/
float noiseThreshold;
/**
* Range of possible sensor readings.
*
* Range values are rounded with with decimal digits.
*/
Range range;
/**
* Threshold capabilities
*/
ThresholdCapabilities thresholdCaps;
};
/** Numeric sensor thresholds */
structure Thresholds {
boolean upperCriticalActive; ///< \c true if the upper critical threshold is enabled
double upperCritical; ///< Upper critical threshold
boolean upperWarningActive; ///< \c true if the upper warning threshold is enabled
double upperWarning; ///< Upper warning threshold
boolean lowerWarningActive; ///< \c true if the lower warning threshold is enabled
double lowerWarning; ///< Lower warning threshold
boolean lowerCriticalActive; ///< \c true if the lower critical threshold is enabled
double lowerCritical; ///< Lower critical threshold
int assertionTimeout; ///< Assertion timeout in samples
float deassertionHysteresis; ///< Deassertion hysteresis
};
/** Numeric sensor reading */
structure Reading {
/** Numeric sensor status
*
* The status is determined on the basis of rounded values. The
* rounding is done according to MetaData::decdigits. This ensures
* that status and value will match when displayed simultaneously,
* if the value is also displayed rounded.
*/
structure Status {
boolean aboveUpperCritical; ///< Reading is above upper critical threshold
boolean aboveUpperWarning; ///< Reading is above upper warning threshold
boolean belowLowerWarning; ///< Reading is below lower warning threshold
boolean belowLowerCritical; ///< Reading is below lower critical threshold
};
time timestamp; ///< UNIX timestamp (UTC) of last sample
boolean available; ///< \c true if the sensor is available
Status status; ///< Numeric sensor status
boolean valid; ///< \c true if the sensor reading is valid
double value; ///< Numeric sensor reading, not rounded
};
/** Numeric sensor minimum / maximum values */
structure MinMax {
double minReading; ///< the minimum value since observedSince, not rounded
time minReadingTimestamp; ///< UNIX timestamp (UTC) when the minimum value has occurred
double maxReading; ///< the maximum value since observedSince, not rounded
time maxReadingTimestamp; ///< UNIX timestamp (UTC) when the maximum value has occurred
boolean valid; ///< \c true if min and max are valid
time observedSince; ///< UNIX timestamp (UTC) of last reset of min / max
};
/** Event: Numeric sensor reading has changed
*
* The event is sent when the Reading::value has changed enough to affect
* a digit to be displayed according to MetaData::decdigits, or if one of
* Reading::available, Reading::status or Reading::valid has changed.
*/
valueobject ReadingChangedEvent extends idl.Event {
Reading newReading; ///< New numeric sensor reading
};
/** Event: Sensor state has changed */
valueobject StateChangedEvent extends idl.Event {
Reading oldReading; ///< Reading before state change
Reading newReading; ///< Reading after state change
};
/** Event: Sensor metadata has changed */
valueobject MetaDataChangedEvent extends idl.Event {
MetaData oldMetaData; ///< Metadata before change
MetaData newMetaData; ///< Metadata after change
};
/** Event: Sensor default thresholds have changed */
valueobject DefaultThresholdsChangedEvent extends event.UserEvent {
Thresholds oldDefaultThresholds; ///< Default thresholds set before change
Thresholds newDefaultThresholds; ///< Default thresholds set after change
};
/** Event: Sensor thresholds have changed */
valueobject ThresholdsChangedEvent extends event.UserEvent {
Thresholds oldThresholds; ///< Threshold set before change
Thresholds newThresholds; ///< Threshold set after change
};
/** Event: Sensor min or max value has changed
*
* The event is sent when MinMax::minReading or MinMax::maxReading have
* changed enough to affect a digit to be displayed according to MetaData::decdigits,
* or if MinMax::valid has changed.
*/
valueobject MinMaxChangedEvent extends idl.Event {
MinMax newMinMax; ///< Minimum / maximum of sensor value
};
/** Event: Min / Max value has been reset */
valueobject MinMaxResetEvent extends event.UserEvent {
MinMax oldMinMax; ///< Min / max before reset
MinMax newMinMax; ///< Min / max after reset, incl. new observedSince timestamp
};
/**
* Retrieve the sensor metadata.
*
* @return Sensor metadata
*/
MetaData getMetaData();
/**
* Retrieve the sensor default thresholds.
*
* @return Set of default thresholds
*/
Thresholds getDefaultThresholds();
/**
* Retrieve the thresholds.
*
* Note: In case of peripheral devices these thresholds may be overridden
* by the device slot configuration.
*
* @return Set of configured thresholds
*/
Thresholds getThresholds();
/**
* Change the thresholds.
*
* Note: In case of peripheral devices these thresholds may be overridden
* by the device slot configuration.
*
* @param thresh New set of thresholds
*
* @return 0 if OK
* @return THRESHOLD_OUT_OF_RANGE if any threshold is out of range
* @return THRESHOLD_INVALID if thresholds don't meet the requirements
* @return THRESHOLD_NOT_SUPPORTED if threshold is not supported
*/
int setThresholds(in Thresholds thresh);
/**
* Get the sensor reading.
*
* @return Sensor reading, not rounded
*/
Reading getReading();
/**
* Get the min / max of sensor value.
*
* @return Sensor min / max values
*/
MinMax getMinMax();
/**
* Reset min / max of sensor value.
*
*/
void resetMinMax();
};
}
#endif
sensors::NumericSensor
A sensor with numeric readings.
Definition NumericSensor.idl:17
sensors::NumericSensor::resetMinMax
void resetMinMax()
Reset min / max of sensor value.
sensors::NumericSensor::THRESHOLD_INVALID
constant int THRESHOLD_INVALID
The threshold constraints are not met.
Definition NumericSensor.idl:20
sensors::NumericSensor::getReading
Reading getReading()
Get the sensor reading.
sensors::NumericSensor::getThresholds
Thresholds getThresholds()
Retrieve the thresholds.
sensors::NumericSensor::getDefaultThresholds
Thresholds getDefaultThresholds()
Retrieve the sensor default thresholds.
sensors::NumericSensor::getMinMax
MinMax getMinMax()
Get the min / max of sensor value.
sensors::NumericSensor::THRESHOLD_NOT_SUPPORTED
constant int THRESHOLD_NOT_SUPPORTED
The sensor does not support setting this threshold.
Definition NumericSensor.idl:21
sensors::NumericSensor::getMetaData
MetaData getMetaData()
Retrieve the sensor metadata.
sensors::NumericSensor::setThresholds
int setThresholds(in Thresholds thresh)
Change the thresholds.
sensors::NumericSensor::THRESHOLD_OUT_OF_RANGE
constant int THRESHOLD_OUT_OF_RANGE
The threshold exceedes the sensor range.
Definition NumericSensor.idl:19
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::NumericSensor::DefaultThresholdsChangedEvent
Event: Sensor default thresholds have changed.
Definition NumericSensor.idl:179
sensors::NumericSensor::DefaultThresholdsChangedEvent::oldDefaultThresholds
Thresholds oldDefaultThresholds
Default thresholds set before change.
Definition NumericSensor.idl:180
sensors::NumericSensor::DefaultThresholdsChangedEvent::newDefaultThresholds
Thresholds newDefaultThresholds
Default thresholds set after change.
Definition NumericSensor.idl:181
sensors::NumericSensor::MetaDataChangedEvent
Event: Sensor metadata has changed.
Definition NumericSensor.idl:173
sensors::NumericSensor::MetaDataChangedEvent::oldMetaData
MetaData oldMetaData
Metadata before change.
Definition NumericSensor.idl:174
sensors::NumericSensor::MetaDataChangedEvent::newMetaData
MetaData newMetaData
Metadata after change.
Definition NumericSensor.idl:175
sensors::NumericSensor::MetaData
Numeric sensor metadata.
Definition NumericSensor.idl:40
sensors::NumericSensor::MetaData::type
Sensor::TypeSpec type
Sensor type, reading type and unit.
Definition NumericSensor.idl:44
sensors::NumericSensor::MetaData::resolution
float resolution
Sensor resolution.
Definition NumericSensor.idl:74
sensors::NumericSensor::MetaData::noiseThreshold
float noiseThreshold
Sensor noise threshold.
Definition NumericSensor.idl:95
sensors::NumericSensor::MetaData::tolerance
float tolerance
Sensor tolerance.
Definition NumericSensor.idl:86
sensors::NumericSensor::MetaData::accuracy
float accuracy
Sensor accuracy in percent.
Definition NumericSensor.idl:66
sensors::NumericSensor::MetaData::range
Range range
Range of possible sensor readings.
Definition NumericSensor.idl:102
sensors::NumericSensor::MetaData::decdigits
int decdigits
Number of significant decimal digits.
Definition NumericSensor.idl:53
sensors::NumericSensor::MetaData::thresholdCaps
ThresholdCapabilities thresholdCaps
Threshold capabilities.
Definition NumericSensor.idl:107
sensors::NumericSensor::MinMaxChangedEvent
Event: Sensor min or max value has changed.
Definition NumericSensor.idl:196
sensors::NumericSensor::MinMaxChangedEvent::newMinMax
MinMax newMinMax
Minimum / maximum of sensor value.
Definition NumericSensor.idl:197
sensors::NumericSensor::MinMaxResetEvent
Event: Min / Max value has been reset.
Definition NumericSensor.idl:201
sensors::NumericSensor::MinMaxResetEvent::oldMinMax
MinMax oldMinMax
Min / max before reset.
Definition NumericSensor.idl:202
sensors::NumericSensor::MinMaxResetEvent::newMinMax
MinMax newMinMax
Min / max after reset, incl. new observedSince timestamp.
Definition NumericSensor.idl:203
sensors::NumericSensor::MinMax
Numeric sensor minimum / maximum values.
Definition NumericSensor.idl:147
sensors::NumericSensor::MinMax::maxReadingTimestamp
time maxReadingTimestamp
UNIX timestamp (UTC) when the maximum value has occurred.
Definition NumericSensor.idl:151
sensors::NumericSensor::MinMax::minReading
double minReading
the minimum value since observedSince, not rounded
Definition NumericSensor.idl:148
sensors::NumericSensor::MinMax::valid
boolean valid
true if min and max are valid
Definition NumericSensor.idl:152
sensors::NumericSensor::MinMax::minReadingTimestamp
time minReadingTimestamp
UNIX timestamp (UTC) when the minimum value has occurred.
Definition NumericSensor.idl:149
sensors::NumericSensor::MinMax::observedSince
time observedSince
UNIX timestamp (UTC) of last reset of min / max.
Definition NumericSensor.idl:153
sensors::NumericSensor::MinMax::maxReading
double maxReading
the maximum value since observedSince, not rounded
Definition NumericSensor.idl:150
sensors::NumericSensor::Range
Range of possible sensor readings.
Definition NumericSensor.idl:24
sensors::NumericSensor::Range::upper
double upper
Maximum reading.
Definition NumericSensor.idl:26
sensors::NumericSensor::Range::lower
double lower
Minimum reading.
Definition NumericSensor.idl:25
sensors::NumericSensor::ReadingChangedEvent
Event: Numeric sensor reading has changed.
Definition NumericSensor.idl:162
sensors::NumericSensor::ReadingChangedEvent::newReading
Reading newReading
New numeric sensor reading.
Definition NumericSensor.idl:163
sensors::NumericSensor::Reading::Status
Numeric sensor status.
Definition NumericSensor.idl:133
sensors::NumericSensor::Reading::Status::aboveUpperCritical
boolean aboveUpperCritical
Reading is above upper critical threshold.
Definition NumericSensor.idl:134
sensors::NumericSensor::Reading::Status::belowLowerWarning
boolean belowLowerWarning
Reading is below lower warning threshold.
Definition NumericSensor.idl:136
sensors::NumericSensor::Reading::Status::belowLowerCritical
boolean belowLowerCritical
Reading is below lower critical threshold.
Definition NumericSensor.idl:137
sensors::NumericSensor::Reading::Status::aboveUpperWarning
boolean aboveUpperWarning
Reading is above upper warning threshold.
Definition NumericSensor.idl:135
sensors::NumericSensor::Reading
Numeric sensor reading.
Definition NumericSensor.idl:125
sensors::NumericSensor::Reading::status
Status status
Numeric sensor status.
Definition NumericSensor.idl:141
sensors::NumericSensor::Reading::available
boolean available
true if the sensor is available
Definition NumericSensor.idl:140
sensors::NumericSensor::Reading::value
double value
Numeric sensor reading, not rounded.
Definition NumericSensor.idl:143
sensors::NumericSensor::Reading::valid
boolean valid
true if the sensor reading is valid
Definition NumericSensor.idl:142
sensors::NumericSensor::Reading::timestamp
time timestamp
UNIX timestamp (UTC) of last sample.
Definition NumericSensor.idl:139
sensors::NumericSensor::StateChangedEvent
Event: Sensor state has changed.
Definition NumericSensor.idl:167
sensors::NumericSensor::StateChangedEvent::oldReading
Reading oldReading
Reading before state change.
Definition NumericSensor.idl:168
sensors::NumericSensor::StateChangedEvent::newReading
Reading newReading
Reading after state change.
Definition NumericSensor.idl:169
sensors::NumericSensor::ThresholdCapabilities
Threshold capabilities.
Definition NumericSensor.idl:32
sensors::NumericSensor::ThresholdCapabilities::hasUpperCritical
boolean hasUpperCritical
Sensor has upper critical threshold.
Definition NumericSensor.idl:33
sensors::NumericSensor::ThresholdCapabilities::hasLowerWarning
boolean hasLowerWarning
Sensor has lower warning threshold.
Definition NumericSensor.idl:35
sensors::NumericSensor::ThresholdCapabilities::hasUpperWarning
boolean hasUpperWarning
Sensor has upper warning threshold.
Definition NumericSensor.idl:34
sensors::NumericSensor::ThresholdCapabilities::hasLowerCritical
boolean hasLowerCritical
Sensor has lower critical threshold.
Definition NumericSensor.idl:36
sensors::NumericSensor::ThresholdsChangedEvent
Event: Sensor thresholds have changed.
Definition NumericSensor.idl:185
sensors::NumericSensor::ThresholdsChangedEvent::newThresholds
Thresholds newThresholds
Threshold set after change.
Definition NumericSensor.idl:187
sensors::NumericSensor::ThresholdsChangedEvent::oldThresholds
Thresholds oldThresholds
Threshold set before change.
Definition NumericSensor.idl:186
sensors::NumericSensor::Thresholds
Numeric sensor thresholds.
Definition NumericSensor.idl:111
sensors::NumericSensor::Thresholds::upperWarningActive
boolean upperWarningActive
true if the upper warning threshold is enabled
Definition NumericSensor.idl:114
sensors::NumericSensor::Thresholds::upperWarning
double upperWarning
Upper warning threshold.
Definition NumericSensor.idl:115
sensors::NumericSensor::Thresholds::assertionTimeout
int assertionTimeout
Assertion timeout in samples.
Definition NumericSensor.idl:120
sensors::NumericSensor::Thresholds::lowerWarningActive
boolean lowerWarningActive
true if the lower warning threshold is enabled
Definition NumericSensor.idl:116
sensors::NumericSensor::Thresholds::upperCritical
double upperCritical
Upper critical threshold.
Definition NumericSensor.idl:113
sensors::NumericSensor::Thresholds::lowerCriticalActive
boolean lowerCriticalActive
true if the lower critical threshold is enabled
Definition NumericSensor.idl:118
sensors::NumericSensor::Thresholds::lowerWarning
double lowerWarning
Lower warning threshold.
Definition NumericSensor.idl:117
sensors::NumericSensor::Thresholds::deassertionHysteresis
float deassertionHysteresis
Deassertion hysteresis.
Definition NumericSensor.idl:121
sensors::NumericSensor::Thresholds::lowerCritical
double lowerCritical
Lower critical threshold.
Definition NumericSensor.idl:119
sensors::NumericSensor::Thresholds::upperCriticalActive
boolean upperCriticalActive
true if the upper critical threshold is enabled
Definition NumericSensor.idl:112
sensors::Sensor::TypeSpec
Complete sensor type specification.
Definition Sensor.idl:177