StateSensor.idl
/* SPDX-License-Identifier: BSD-3-Clause */
/*
* Copyright 2009 Raritan Inc. All rights reserved.
*/
#ifndef __SENSORMODEL_STATESENSOR_IDL__
#define __SENSORMODEL_STATESENSOR_IDL__
#include <Event.idl>
#include <Sensor.idl>
/** Sensors Model */
module sensors {
/**
* Sensor with discrete readings
*
* Sensor states are represented as a numerical field in the State
* structure. The interpretation of this value depends on the sensor
* type which can be queried with the getTypeSpec() method.
*
* Mappings for typical sensor types are:
*
* | Sensor Type | States |
* |---------------------|-----------------------|
* | CONTACT_CLOSURE | normal(0), alarmed(1) |
* | ON_OFF_SENSOR | off(0), on(1) |
* | TRIP_SENSOR | open(0), close(1) |
* | VIBRATION | normal(0), alarmed(1) |
* | WATER_LEAK | normal(0), alarmed(1) |
* | SMOKE_DETECTOR | normal(0), alarmed(1) |
* | FAULT_STATE | OK(0), fault(1) |
* | OCCUPANCY | normal(0), alarmed(1) |
* | TAMPER | normal(0), alarmed(1) |
* | DOOR_LOCKSTATE | open(0), close(1) |
* | DOORHANDLE_LOCK | open(0), close(1) |
* | DOORHANDLE_SWITCH | open(0), close(1) |
*
* For some special sensors there are constants defining the possible
* state values, for instance in PowerQualitySensor.idl or
* ResidualCurrentStateSensor.idl.
*/
interface StateSensor_4_0_3 extends Sensor_4_0_3 {
/** Sensor state */
structure State {
time timestamp; ///< Timestamp of last sample
boolean available; ///< \c true if the sensor is available
int value; ///< Discrete sensor value; intrepretation depends on the type of sensor
};
valueobject StateChangedEvent extends idl.Event {
State oldState;
State newState;
};
/**
* Get the sensor state.
*
* @return Sensor state
*/
State getState();
};
}
#endif
sensors::StateSensor_4_0_3::State
Sensor state.
Definition: StateSensor.idl:46
idl
Basic IDL definitions.
Definition: Event.idl:10
sensors::StateSensor_4_0_3::State::timestamp
time timestamp
Timestamp of last sample.
Definition: StateSensor.idl:47
sensors::Sensor_4_0_3
Sensor interface
Definition: Sensor.idl:15
sensors
Sensors Model.
Definition: AccumulatingNumericSensor.idl:13
sensors::StateSensor_4_0_3
Sensor with discrete readings.
Definition: StateSensor.idl:43
sensors::StateSensor_4_0_3::State::available
boolean available
true if the sensor is available
Definition: StateSensor.idl:48
sensors::StateSensor_4_0_3::State::value
int value
Discrete sensor value; intrepretation depends on the type of sensor.
Definition: StateSensor.idl:49