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_3 extends sensors.Sensor_4_0_3 {
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
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  */
121  MetaData getMetaData();
122 
123  /**
124  * Retrieve Numeric Thresholds.
125  *
126  * @return sensor thresholds
127  */
128  NumThresholds getThresholds();
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  */
143  Reading getReading();
144 
145  };
146 
147 }
148 
149 #endif /* !__LHXMODEL_SENSOR_IDL__ */
double numThresholdMax
Largest possible Numeric Reading Threshold Value.
Definition: LhxSensor.idl:53
Sensor&#39;s self describing data.
Definition: LhxSensor.idl:20
LHX Sensor Interface.
Definition: LhxSensor.idl:17
double lowerWarning
Lower warning threshold value.
Definition: LhxSensor.idl:71
boolean lowerWarningIsEnabled
Lower warning threshold enabled.
Definition: LhxSensor.idl:70
double numThresholdMin
Smallest possible Numeric Reading Threshold Value.
Definition: LhxSensor.idl:48
string id
Descriptive ID of sensor containing label.
Definition: LhxSensor.idl:63
int numDecDigits
Number of significant decimal digits.
Definition: LhxSensor.idl:33
double numRangeMin
Smallest possible Numeric Reading Value.
Definition: LhxSensor.idl:38
boolean lowerCriticalIsEnabled
Lower critical threshold enabled.
Definition: LhxSensor.idl:68
sensors::Sensor_4_0_3 TypeSpec type
Sensor type, reading type and unit.
Definition: LhxSensor.idl:24
LHX Model.
Definition: Lhx.idl:14
Basic IDL definitions.
Definition: Event.idl:10
double upperCritical
Upper critical threshold value.
Definition: LhxSensor.idl:75
Sensor reading.
Definition: LhxSensor.idl:89
boolean isValid
numeric value is valid or NAN
Definition: LhxSensor.idl:93
int state
discrete reading or state
Definition: LhxSensor.idl:91
time timestamp
Time of sample.
Definition: LhxSensor.idl:90
double hysteresis
Deassertion hysteresis.
Definition: LhxSensor.idl:76
Sensor interface
Definition: Sensor.idl:15
Numerical sensor thresholds.
Definition: LhxSensor.idl:67
Reading newReading
Reading after change.
Definition: LhxSensor.idl:105
Sensors Model.
Definition: AccumulatingNumericSensor.idl:13
double value
numeric reading value
Definition: LhxSensor.idl:92
NumThresholds newThresholds
Thresholds after change.
Definition: LhxSensor.idl:99
Complete sensor type specification.
Definition: Sensor.idl:160
double lowerCritical
Lower critical threshold value.
Definition: LhxSensor.idl:69
double numRangeMax
Largest possible Numeric Reading Value.
Definition: LhxSensor.idl:43
boolean upperWarningIsEnabled
Upper warning threshold enabled.
Definition: LhxSensor.idl:72
string label
The sensor label.
Definition: LhxSensor.idl:58
double upperWarning
Upper warning threshold value.
Definition: LhxSensor.idl:73
boolean upperCriticalIsEnabled
Upper critical threshold enabled.
Definition: LhxSensor.idl:74