Raritan / Server Technology Xerus™ PDU JSON-RPC API
StateSensor.idl
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /*
3  * Copyright 2009 Raritan Inc. All rights reserved.
4  */
5 
6 #ifndef __SENSORMODEL_STATESENSOR_IDL__
7 #define __SENSORMODEL_STATESENSOR_IDL__
8 
9 #include <Event.idl>
10 #include <Sensor.idl>
11 
12 /** Sensors Model */
13 module sensors {
14 
15  /**
16  * Sensor with discrete readings
17  *
18  * Sensor states are represented as a numerical field in the State
19  * structure. The interpretation of this value depends on the sensor
20  * type which can be queried with the getTypeSpec() method.
21  *
22  * Mappings for typical sensor types are:
23  *
24  * | Sensor Type | States |
25  * |---------------------|-----------------------|
26  * | CONTACT_CLOSURE | normal(0), alarmed(1) |
27  * | ON_OFF_SENSOR | off(0), on(1) |
28  * | TRIP_SENSOR | open(0), close(1) |
29  * | VIBRATION | normal(0), alarmed(1) |
30  * | WATER_LEAK | normal(0), alarmed(1) |
31  * | SMOKE_DETECTOR | normal(0), alarmed(1) |
32  * | FAULT_STATE | OK(0), fault(1) |
33  * | OCCUPANCY | normal(0), alarmed(1) |
34  * | TAMPER | normal(0), alarmed(1) |
35  * | DOOR_LOCKSTATE | open(0), close(1) |
36  * | DOORHANDLE_LOCK | open(0), close(1) |
37  * | DOORHANDLE_SWITCH | open(0), close(1) |
38  *
39  * For some special sensors there are constants defining the possible
40  * state values, for instance in PowerQualitySensor.idl or
41  * ResidualCurrentStateSensor.idl.
42  */
43  interface StateSensor extends Sensor {
44 
45  /** Sensor state */
46  structure State {
47  time timestamp; ///< UNIX timestamp (UTC) of last sample
48  boolean available; ///< \c true if the sensor is available
49  int value; ///< Discrete sensor value; intrepretation depends on the type of sensor
50  };
51 
52  valueobject StateChangedEvent extends idl.Event {
53  State oldState;
54  State newState;
55  };
56 
57  /**
58  * Get the sensor state.
59  *
60  * @return Sensor state
61  */
63 
64  };
65 
66 }
67 
68 #endif
Sensor interface
Definition: Sensor.idl:15
Sensor with discrete readings.
Definition: StateSensor.idl:43
State getState()
Get the sensor state.
Basic IDL definitions.
Definition: Event.idl:10
Sensors Model.
Definition: AccumulatingNumericSensor.idl:13
Sensor state.
Definition: StateSensor.idl:46
time timestamp
UNIX timestamp (UTC) of last sample.
Definition: StateSensor.idl:47
int value
Discrete sensor value; intrepretation depends on the type of sensor.
Definition: StateSensor.idl:49
boolean available
true if the sensor is available
Definition: StateSensor.idl:48