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 */
24 sensors.Sensor_4_0_3.TypeSpec type;
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 */
33 int numDecDigits;
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 */
48 double numThresholdMin;
49
50 /**
51 * Largest possible Numeric Reading Threshold Value
52 */
53 double numThresholdMax;
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__ */
lhxmodel::Sensor_4_0_3::MetaData::numThresholdMax
double numThresholdMax
Largest possible Numeric Reading Threshold Value.
Definition: LhxSensor.idl:53
lhxmodel::Sensor_4_0_3::MetaData
Sensor&#39;s self describing data.
Definition: LhxSensor.idl:20
lhxmodel::Sensor_4_0_3
LHX Sensor Interface.
Definition: LhxSensor.idl:17
lhxmodel::Sensor_4_0_3::NumThresholds::lowerWarning
double lowerWarning
Lower warning threshold value.
Definition: LhxSensor.idl:71
lhxmodel::Sensor_4_0_3::NumThresholds::lowerWarningIsEnabled
boolean lowerWarningIsEnabled
Lower warning threshold enabled.
Definition: LhxSensor.idl:70
lhxmodel::Sensor_4_0_3::MetaData::numThresholdMin
double numThresholdMin
Smallest possible Numeric Reading Threshold Value.
Definition: LhxSensor.idl:48
lhxmodel::Sensor_4_0_3::MetaData::id
string id
Descriptive ID of sensor containing label.
Definition: LhxSensor.idl:63
lhxmodel::Sensor_4_0_3::MetaData::numDecDigits
int numDecDigits
Number of significant decimal digits.
Definition: LhxSensor.idl:33
lhxmodel::Sensor_4_0_3::MetaData::numRangeMin
double numRangeMin
Smallest possible Numeric Reading Value.
Definition: LhxSensor.idl:38
lhxmodel::Sensor_4_0_3::NumThresholds::lowerCriticalIsEnabled
boolean lowerCriticalIsEnabled
Lower critical threshold enabled.
Definition: LhxSensor.idl:68
lhxmodel::Sensor_4_0_3::MetaData::type
sensors::Sensor_4_0_3 TypeSpec type
Sensor type, reading type and unit.
Definition: LhxSensor.idl:24
lhxmodel
LHX Model.
Definition: Lhx.idl:14
idl
Basic IDL definitions.
Definition: Event.idl:10
lhxmodel::Sensor_4_0_3::NumThresholds::upperCritical
double upperCritical
Upper critical threshold value.
Definition: LhxSensor.idl:75
lhxmodel::Sensor_4_0_3::Reading
Sensor reading.
Definition: LhxSensor.idl:89
lhxmodel::Sensor_4_0_3::Reading::isValid
boolean isValid
numeric value is valid or NAN
Definition: LhxSensor.idl:93
lhxmodel::Sensor_4_0_3::Reading::state
int state
discrete reading or state
Definition: LhxSensor.idl:91
lhxmodel::Sensor_4_0_3::Reading::timestamp
time timestamp
Time of sample.
Definition: LhxSensor.idl:90
lhxmodel::Sensor_4_0_3::NumThresholds::hysteresis
double hysteresis
Deassertion hysteresis.
Definition: LhxSensor.idl:76
sensors::Sensor_4_0_3
Sensor interface
Definition: Sensor.idl:15
lhxmodel::Sensor_4_0_3::NumThresholds
Numerical sensor thresholds.
Definition: LhxSensor.idl:67
lhxmodel::Sensor_4_0_3::newReading
Reading newReading
Reading after change.
Definition: LhxSensor.idl:105
sensors
Sensors Model.
Definition: AccumulatingNumericSensor.idl:13
lhxmodel::Sensor_4_0_3::Reading::value
double value
numeric reading value
Definition: LhxSensor.idl:92
lhxmodel::Sensor_4_0_3::newThresholds
NumThresholds newThresholds
Thresholds after change.
Definition: LhxSensor.idl:99
sensors::Sensor_4_0_3::TypeSpec
Complete sensor type specification.
Definition: Sensor.idl:160
lhxmodel::Sensor_4_0_3::NumThresholds::lowerCritical
double lowerCritical
Lower critical threshold value.
Definition: LhxSensor.idl:69
lhxmodel::Sensor_4_0_3::MetaData::numRangeMax
double numRangeMax
Largest possible Numeric Reading Value.
Definition: LhxSensor.idl:43
lhxmodel::Sensor_4_0_3::NumThresholds::upperWarningIsEnabled
boolean upperWarningIsEnabled
Upper warning threshold enabled.
Definition: LhxSensor.idl:72
lhxmodel::Sensor_4_0_3::MetaData::label
string label
The sensor label.
Definition: LhxSensor.idl:58
lhxmodel::Sensor_4_0_3::NumThresholds::upperWarning
double upperWarning
Upper warning threshold value.
Definition: LhxSensor.idl:73
lhxmodel::Sensor_4_0_3::NumThresholds::upperCriticalIsEnabled
boolean upperCriticalIsEnabled
Upper critical threshold enabled.
Definition: LhxSensor.idl:74