Raritan PX2/PX3 JSON-RPC API
LhxSensor.idl
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /*
3  * Copyright 2011 Raritan Inc. All rights reserved.
4  */
5 
6 #ifndef __LHXMODEL_SENSOR_IDL__
7 #define __LHXMODEL_SENSOR_IDL__
8 
9 #include <Event.idl>
10 #include <Sensor.idl>
11 #include <UserEvent.idl>
12 
13 /** LHX Model */
14 module lhxmodel {
15 
16  /** LHX Sensor Interface */
17  interface Sensor_4_0_4 extends sensors.Sensor_4_0_4 {
18 
19  /** Sensor's self describing data */
20  structure MetaData {
21  /**
22  * Sensor type, reading type and unit
23  */
25 
26  /**
27  * Number of significant decimal digits.
28  *
29  * Indicates how many digits should be displayed
30  * to the right of the decimal point. I.e. double
31  * values must be rounded with this precision.
32  */
34 
35  /**
36  * Smallest possible Numeric Reading Value
37  */
38  double numRangeMin;
39 
40  /**
41  * Largest possible Numeric Reading Value
42  */
43  double numRangeMax;
44 
45  /**
46  * Smallest possible Numeric Reading Threshold Value
47  */
49 
50  /**
51  * Largest possible Numeric Reading Threshold Value
52  */
54 
55  /**
56  * The sensor label.
57  */
58  string label;
59 
60  /**
61  * Descriptive ID of sensor containing label.
62  */
63  string id;
64  };
65 
66  /** Numerical sensor thresholds */
67  structure NumThresholds {
68  boolean lowerCriticalIsEnabled; ///< Lower critical threshold enabled
69  double lowerCritical; ///< Lower critical threshold value
70  boolean lowerWarningIsEnabled; ///< Lower warning threshold enabled
71  double lowerWarning; ///< Lower warning threshold value
72  boolean upperWarningIsEnabled; ///< Upper warning threshold enabled
73  double upperWarning; ///< Upper warning threshold value
74  boolean upperCriticalIsEnabled; ///< Upper critical threshold enabled
75  double upperCritical; ///< Upper critical threshold value
76  double hysteresis; ///< Deassertion hysteresis
77  };
78 
79  constant int STATE_NOT_AVAILABLE = -1; ///< Communication to sensor lost
80  constant int STATE_CLOSED = 0; ///< Closed
81  constant int STATE_OPEN = 1; ///< Open
82  constant int STATE_NUM_NORMAL = 0; ///< Numerical sensor in normal range
83  constant int STATE_NUM_ABOVE_UPPER_CRITICAL = 1; ///< Above upper critical threshold
84  constant int STATE_NUM_ABOVE_UPPER_WARNING = 2; ///< Above upper warning threshold
85  constant int STATE_NUM_BELOW_LOWER_WARNING = 3; ///< Below lower warning threshold
86  constant int STATE_NUM_BELOW_LOWER_CRITICAL = 4; ///< Below lower critical threshold
87 
88  /** Sensor reading */
89  structure Reading {
90  time timestamp; ///< Time of sample (UNIX timestamp, UTC)
91  int state; ///< discrete reading or state
92  double value; ///< numeric reading value
93  boolean isValid; ///< numeric value is valid or NAN
94  };
95 
96  /** Event: Sensor thresholds have been changed */
97  valueobject ThresholdsChangedEvent extends event.UserEvent {
98  NumThresholds oldThresholds; ///< Thresholds before change
99  NumThresholds newThresholds; ///< Thresholds after change
100  };
101 
102  /** Event: Sensor state has changed */
103  valueobject StateChangedEvent extends idl.Event {
104  Reading oldReading; ///< Reading before change
105  Reading newReading; ///< Reading after change
106  };
107 
108  /** Event: Sensor numeric reading has changed */
109  valueobject ReadingChangedEvent extends idl.Event {
110  Reading newReading; ///< New reading
111  };
112 
113  constant int ERR_INVALID_PARAM = 1; ///< Invalid parameters
114  constant int ERR_NOT_SUPPORTED = 2; ///< Not supported
115 
116  /**
117  * Retrieve the LHX metadata.
118  *
119  * @return metadata
120  */
122 
123  /**
124  * Retrieve Numeric Thresholds.
125  *
126  * @return sensor thresholds
127  */
129 
130  /**
131  * Set Numeric Thresholds.
132  *
133  * @return 0 if OK
134  * @return ERR_INVALID_PARAM if any parameters are invalid
135  */
136  int setThresholds(in NumThresholds thresholds);
137 
138  /**
139  * Retrieve sensors reading
140  *
141  * @return reading
142  */
144 
145  };
146 
147 }
148 
149 #endif /* !__LHXMODEL_SENSOR_IDL__ */
lhxmodel::Sensor_4_0_4::getMetaData
MetaData getMetaData()
Retrieve the LHX metadata.
lhxmodel::Sensor_4_0_4::MetaData::type
sensors::Sensor_4_0_4 TypeSpec type
Sensor type, reading type and unit.
Definition: LhxSensor.idl:24
lhxmodel::Sensor_4_0_4::getThresholds
NumThresholds getThresholds()
Retrieve Numeric Thresholds.
sensors
Sensors Model.
Definition: AccumulatingNumericSensor.idl:13
lhxmodel::Sensor_4_0_4::MetaData::numThresholdMin
double numThresholdMin
Smallest possible Numeric Reading Threshold Value.
Definition: LhxSensor.idl:48
lhxmodel::Sensor_4_0_4::newReading
Reading newReading
Reading after change.
Definition: LhxSensor.idl:105
lhxmodel::Sensor_4_0_4::NumThresholds::upperWarningIsEnabled
boolean upperWarningIsEnabled
Upper warning threshold enabled.
Definition: LhxSensor.idl:72
lhxmodel::Sensor_4_0_4::setThresholds
int setThresholds(in NumThresholds thresholds)
Set Numeric Thresholds.
sensors::Sensor_4_0_4::TypeSpec
Complete sensor type specification.
Definition: Sensor.idl:163
lhxmodel::Sensor_4_0_4::MetaData
Sensor's self describing data.
Definition: LhxSensor.idl:20
lhxmodel::Sensor_4_0_4::Reading::state
int state
discrete reading or state
Definition: LhxSensor.idl:91
lhxmodel::Sensor_4_0_4::NumThresholds::lowerCritical
double lowerCritical
Lower critical threshold value.
Definition: LhxSensor.idl:69
lhxmodel::Sensor_4_0_4::getReading
Reading getReading()
Retrieve sensors reading.
lhxmodel::Sensor_4_0_4::NumThresholds::upperCritical
double upperCritical
Upper critical threshold value.
Definition: LhxSensor.idl:75
idl
Basic IDL definitions.
Definition: Event.idl:10
lhxmodel::Sensor_4_0_4::NumThresholds::lowerWarning
double lowerWarning
Lower warning threshold value.
Definition: LhxSensor.idl:71
lhxmodel::Sensor_4_0_4::Reading::value
double value
numeric reading value
Definition: LhxSensor.idl:92
lhxmodel::Sensor_4_0_4::NumThresholds::upperCriticalIsEnabled
boolean upperCriticalIsEnabled
Upper critical threshold enabled.
Definition: LhxSensor.idl:74
lhxmodel::Sensor_4_0_4::MetaData::numRangeMin
double numRangeMin
Smallest possible Numeric Reading Value.
Definition: LhxSensor.idl:38
lhxmodel::Sensor_4_0_4::MetaData::numRangeMax
double numRangeMax
Largest possible Numeric Reading Value.
Definition: LhxSensor.idl:43
lhxmodel::Sensor_4_0_4::NumThresholds::lowerWarningIsEnabled
boolean lowerWarningIsEnabled
Lower warning threshold enabled.
Definition: LhxSensor.idl:70
sensors::Sensor_4_0_4
Sensor interface
Definition: Sensor.idl:15
lhxmodel::Sensor_4_0_4::Reading
Sensor reading.
Definition: LhxSensor.idl:89
lhxmodel::Sensor_4_0_4::Reading::timestamp
time timestamp
Time of sample (UNIX timestamp, UTC)
Definition: LhxSensor.idl:90
lhxmodel::Sensor_4_0_4::MetaData::label
string label
The sensor label.
Definition: LhxSensor.idl:58
lhxmodel::Sensor_4_0_4::MetaData::numThresholdMax
double numThresholdMax
Largest possible Numeric Reading Threshold Value.
Definition: LhxSensor.idl:53
lhxmodel::Sensor_4_0_4::NumThresholds
Numerical sensor thresholds.
Definition: LhxSensor.idl:67
lhxmodel::Sensor_4_0_4::NumThresholds::upperWarning
double upperWarning
Upper warning threshold value.
Definition: LhxSensor.idl:73
lhxmodel::Sensor_4_0_4::Reading::isValid
boolean isValid
numeric value is valid or NAN
Definition: LhxSensor.idl:93
lhxmodel::Sensor_4_0_4::newThresholds
NumThresholds newThresholds
Thresholds after change.
Definition: LhxSensor.idl:99
lhxmodel::Sensor_4_0_4::NumThresholds::lowerCriticalIsEnabled
boolean lowerCriticalIsEnabled
Lower critical threshold enabled.
Definition: LhxSensor.idl:68
lhxmodel::Sensor_4_0_4::NumThresholds::hysteresis
double hysteresis
Deassertion hysteresis.
Definition: LhxSensor.idl:76
lhxmodel::Sensor_4_0_4::MetaData::numDecDigits
int numDecDigits
Number of significant decimal digits.
Definition: LhxSensor.idl:33
lhxmodel
LHX Model.
Definition: Lhx.idl:14
lhxmodel::Sensor_4_0_4
LHX Sensor Interface.
Definition: LhxSensor.idl:17
lhxmodel::Sensor_4_0_4::MetaData::id
string id
Descriptive ID of sensor containing label.
Definition: LhxSensor.idl:63