Raritan PX2/PX3 JSON-RPC API

Sensor.idl
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /*
3 * Copyright 2009 Raritan Inc. All rights reserved.
4 */
5
6 #ifndef __TFW_SENSOR_IDL__
7 #define __TFW_SENSOR_IDL__
8
9 #include <Event.idl>
10
11 /** Sensors Model */
12 module sensors {
13
14 /** %Sensor interface */
15 interface Sensor_4_0_3 {
16
17 constant int ERR_NOT_SUPPORTED = 1; ///< The operation is not supported
18
19 /** %Sensor reading type */
20 constant int NUMERIC = 0; //< %Sensor has numeric readings
21 constant int DISCRETE_ON_OFF = 1; //< %Sensor has two discrete readings: 0 (off) and 1 (on), see OnOffState
22 constant int DISCRETE_MULTI = 2; //< %Sensor has multiple discrete readings
23
24 /** Sensor states for DISCRETE_ON_OFF sensors */
25 enumeration OnOffState {
26 OFF, ///< off
27 ON ///< on
28 };
29
30 enumeration OpenClosedState {
31 OPEN, ///< open
32 CLOSED ///< closed
33 };
34
35 enumeration NormalAlarmedState {
36 NORMAL, ///< normal (not alarmed)
37 ALARMED ///< alarmed
38 };
39
40 enumeration OkFaultState {
41 OK, ///< OK
42 FAULT ///< fault
43 };
44
45 /** %Sensor type */
46 constant int UNSPECIFIED = 0; //< Unspecified
47
48 constant int VOLTAGE = 1; //< Voltage
49 constant int CURRENT = 2; //< Current
50 constant int UNBALANCE_CURRENT = 3; //< Current unbalance
51 constant int POWER = 4; //< Power
52 constant int POWER_FACTOR = 5; //< Power factor
53 constant int ENERGY = 6; //< Energy
54 constant int FREQUENCY = 7; //< Frequency
55 constant int TEMPERATURE = 8; //< Temperature
56 constant int HUMIDITY = 9; //< Relative humidity
57 constant int AIR_FLOW = 10; //< Air flow
58 constant int AIR_PRESSURE = 11; //< Air pressure
59 constant int CONTACT_CLOSURE = 12; //< Contact Closure [uses %NormalAlarmedState mapping]
60 constant int ON_OFF_SENSOR = 13; //< Switch state [uses %OnOffState mapping]
61 constant int TRIP_SENSOR = 14; //< Circuit breaker tripped [uses %OpenClosedState mapping]
62 constant int VIBRATION = 15; //< Vibration [uses %NormalAlarmedState mapping]
63 constant int WATER_LEAK = 16; //< Water leak [uses %NormalAlarmedState mapping]
64 constant int SMOKE_DETECTOR = 17; //< Smoke detector [uses %NormalAlarmedState mapping]
65
66 constant int TOTAL_HARMONIC_DISTORTION = 18; //< Total harmonic distortion
67
68 constant int MASS = 19; //< Mass
69 constant int ELECTRICAL_RESISTANCE = 20; //< Electrical resistance
70 constant int FLUX = 21; //< Flux (mass per time, e.g. water flow)
71
72 constant int LUMINOUS_INTENSITY = 22; //< Luminous intensity
73 constant int ACCELERATION = 23; //< Acceleration
74 constant int MAGNETIC_FLUX_DENSITY = 24; //< Magnetic flux density
75 constant int ELECTRIC_FIELD_STRENGTH = 25; //< Electric field strength
76 constant int MAGNETIC_FIELD_STRENGTH = 26; //< Magnetic field strength [uses %NormelAlarmedState mapping if of %DISCRETE_ON_OFF type]
77 constant int ANGLE = 27; //< Angle (e.g. phase angle)
78
79 constant int SELECTION = 28; //< Selected index (one of n)
80 constant int FAULT_STATE = 29; //< Fault state [uses %NormalAlarmedState mapping if of %DISCRETE_ON_OFF type]
81 constant int POWER_QUALITY = 30; //< Power quality
82 constant int ROTATIONAL_SPEED = 31; //< Rotational speed (e.g. fan speed)
83
84 constant int LUMINOUS_ENERGY = 32; //< Luminous energy
85 constant int LUMINOUS_FLUX = 33; //< Luminous flux
86 constant int ILLUMINANCE = 34; //< Illuminance used for light incident on a surface
87 constant int LUMINOUS_EMITTANCE = 35; //< Luminous emittance used for light emitted from a surface
88
89 constant int MOTION = 36; //< Motion detection
90 constant int OCCUPANCY = 37; //< Occupancy detection [uses %NormalAlarmedState mapping]
91 constant int TAMPER = 38; //< Tamper detection [uses %NormalAlarmedState mapping]
92 constant int DRY_CONTACT = 39; //< Dry contact (actuator) [uses %OnOffState mapping]
93 constant int POWERED_DRY_CONTACT = 40; //< Powered dry contact (actuator) [uses %OnOffState mapping]
94
95 constant int ABSOLUTE_HUMIDITY = 41; //< Absolute humidity
96 constant int DOOR_STATE = 42; //< Door state [uses %OpenClosedState mapping]
97 constant int DOOR_LOCK_STATE = 43; //< Door lock state [uses %OpenClosedState mapping]
98 constant int DOOR_HANDLE_LOCK = 44; //< Door handle switch [uses %OpenClosedState mapping]
99
100 constant int CREST_FACTOR = 45; //< Crest factor
101
102 /** %Sensor unit */
103 constant int NONE = 0; //< No unit
104 constant int VOLT = 1; //< Volts
105 constant int AMPERE = 2; //< Amperes
106 constant int WATT = 3; //< Watts
107 constant int VOLT_AMP = 4; //< Voltamperes
108 constant int WATT_HOUR = 5; //< Watthours
109 constant int VOLT_AMP_HOUR = 6; //< Voltamperehours
110 constant int DEGREE_CELSIUS = 7; //< Degrees Celsius
111 constant int HZ = 8; //< Hertz
112 constant int PERCENT = 9; //< Percent
113 constant int METER_PER_SEC = 10; //< Meters per second
114 constant int PASCAL = 11; //< Pascal
115 constant int G = 12; //< G-force
116 constant int RPM = 13; //< Revolutions per minute
117 constant int METER = 14; //< Meters
118 constant int HOUR = 15; //< Hours
119 constant int MINUTE = 16; //< Minutes
120 constant int SECOND = 17; //< Seconds
121
122 constant int VOLT_AMP_REACTIVE = 18; //< Voltamperesreactive (var)
123 constant int VOLT_AMP_REACTIVE_HOUR = 19; //< Voltamperesreactivehours (varh)
124
125 constant int GRAM = 20; //< Gram (g)
126 constant int OHM = 21; //< Ohm (omega, R)
127 constant int LITERS_PER_HOUR = 22; //< Liters per hour (l/h)
128
129 constant int CANDELA = 23; //< Candela (cd)
130 constant int METER_PER_SQARE_SEC = 24; //< Meter per square second (m/s^2)
131 constant int TESLA = 25; //< Tesla (T)
132 constant int VOLT_PER_METER = 26; //< Volt per meter (V/m)
133 constant int VOLT_PER_AMPERE = 27; //< Volt per ampere (V/A)
134 constant int DEGREE = 28; //< Degree (angle)
135
136 constant int DEGREE_FAHRENHEIT = 29; //< Degrees Fahrenheit (deg F)
137 constant int KELVIN = 30; //< Kelvin (deg K)
138 constant int JOULE = 31; //< Joules (J)
139 constant int COULOMB = 32; //< Coulombs (C)
140 constant int NIT = 33; //< Nits (cd/m^2)
141 constant int LUMEN = 34; //< Lumen (lm)
142 constant int LUMEN_SECOND = 35; //< Lumen second (lh s)
143 constant int LUX = 36; //< Lux (lx)
144 constant int PSI = 37; //< Pounds per square inch (psi)
145 constant int NEWTON = 38; //< Newtons (N, J/m)
146 constant int FOOT = 39; //< Feet (ft)
147 constant int FOOT_PER_SEC = 40; //< Feet per second (ft/s)
148 constant int CUBIC_METER = 41; //< Cubic meters (m^3)
149 constant int RADIANT = 42; //< Radiants (rad)
150 constant int STERADIANT = 43; //< Steradiants (sr)
151 constant int HENRY = 44; //< Henries (H, Vs/A, Ohm s)
152 constant int FARAD = 45; //< Farads (f)
153 constant int MOL = 46; //< Moles (mol)
154 constant int BECQUEREL = 47; //< Becquerels (Bq)
155 constant int GRAY = 48; //< Grays (Gy, J/kg)
156 constant int SIEVERT = 49; //< Sieverts (Sv = J/kg)
157 constant int G_PER_CUBIC_METER = 50; //< Gram per cubic meter (g/m^3)
158
159 /** Complete sensor type specification */
160 structure TypeSpec {
161 int readingtype; ///< %Sensor reading type
162 int type; ///< %Sensor type
163 int unit; ///< %Sensor unit
164 };
165
166 /** Event: The type specification of the sensor changed */
167 valueobject TypeSpecChangedEvent extends idl.Event {
168 TypeSpec oldTypeSpec; ///< Type specification before change
169 TypeSpec newTypeSpec; ///< Type specification after change
170 };
171
172 /**
173 * Retrieve the sensor type specification.
174 *
175 * @return Type specification
176 */
177 TypeSpec getTypeSpec();
178
179 /**
180 * Set sensor type and unit
181 *
182 * @param type the sensor type to set
183 * @param unit the sensor unit to set
184 *
185 * @return ERR_NOT_SUPPORTED or 0
186 */
187 int setType(in int type, in int unit);
188
189 };
190
191 }
192
193 #endif
sensors::Sensor_4_0_3::OkFaultState
OkFaultState
Definition: Sensor.idl:40
sensors::Sensor_4_0_3::OpenClosedState
OpenClosedState
Definition: Sensor.idl:30
sensors::Sensor_4_0_3::OFF
off
Definition: Sensor.idl:26
sensors::Sensor_4_0_3::NORMAL
normal (not alarmed)
Definition: Sensor.idl:36
idl
Basic IDL definitions.
Definition: Event.idl:10
sensors::Sensor_4_0_3::TypeSpec::unit
int unit
Sensor unit
Definition: Sensor.idl:163
sensors::Sensor_4_0_3::NormalAlarmedState
NormalAlarmedState
Definition: Sensor.idl:35
sensors::Sensor_4_0_3
Sensor interface
Definition: Sensor.idl:15
sensors::Sensor_4_0_3::newTypeSpec
TypeSpec newTypeSpec
Type specification after change.
Definition: Sensor.idl:169
sensors
Sensors Model.
Definition: AccumulatingNumericSensor.idl:13
sensors::Sensor_4_0_3::OnOffState
OnOffState
Sensor states for DISCRETE_ON_OFF sensors.
Definition: Sensor.idl:25
sensors::Sensor_4_0_3::TypeSpec::readingtype
int readingtype
Sensor reading type
Definition: Sensor.idl:161
sensors::Sensor_4_0_3::TypeSpec
Complete sensor type specification.
Definition: Sensor.idl:160
sensors::Sensor_4_0_3::OPEN
open
Definition: Sensor.idl:31
sensors::Sensor_4_0_3::TypeSpec::type
int type
Sensor type
Definition: Sensor.idl:162
sensors::Sensor_4_0_3::OK
OK.
Definition: Sensor.idl:41