Raritan / Server Technology Xerus™ PDU JSON-RPC API
Classes | Public Types | Public Member Functions | Public Attributes | List of all members
peripheral::GatewaySensorManager Interface Reference

Gateway Sensor Configuration Interface. More...

import"GatewaySensorManager.idl";

Classes

struct  ConfigurationChangedEvent
 Event: The gateway sensor feature configuration has changed. More...
 
struct  ConfigurationPackage
 
struct  DeviceFeedback
 
struct  Feedback
 
struct  FeedbackChangedEvent
 Event: The configuration usage feedback has changed. More...
 
struct  FeedbackObject
 Feedback from gateway sensor configuration usage. More...
 
struct  InterpretationRule
 InterpretationRule defines a rule that is applied to a reading, resulting in an Interpretation. More...
 
struct  InterpretationRuleCatchAll
 
struct  InterpretationRuleIEEE754INF
 InterpretationRuleIEEE* are applied after value is wapped, masked and interpreted as float / double. More...
 
struct  InterpretationRuleIEEE754NAN
 
struct  InterpretationRuleInvertable
 
struct  InterpretationRuleModbusException
 InterpretationRuleModbusException is applied to modbus read exceptions. More...
 
struct  InterpretationRuleModbusSpecificError
 InterpretationRuleModbusSpecificError is applied to specific errors from libmodbus. More...
 
struct  InterpretationRuleModbusSystemError
 InterpretationRuleModbusSystemError is applied to standard system errors returned from libmodbus. More...
 
struct  InterpretationRuleRangeRAW
 InterpretationRuleRangeRAW is applied after swap, but before masking (because it has it's own mask) More...
 
struct  InterpretationRuleRAW
 InterpretationRuleRAW is applied after swap, but before masking (because it has it's own mask) More...
 
struct  ModbusSensor
 
struct  ModbusValueEncoding16
 
struct  ModbusValueEncoding32
 
struct  ModbusValueEncoding64
 
struct  ModbusValueEncoding8
 
struct  ModbusValueEncodingBit
 
struct  NumericSensorClass
 Sensor class that stores numeric sensor properties. More...
 
struct  NumericValueEncoding
 
struct  RemoteDevice
 Specification of a remote device that provides access to sensors. More...
 
struct  RemoteModbusDevice
 
struct  RemoteModbusRTUDevice
 
struct  RemoteModbusTCPDevice
 
struct  Sensor
 Specification of a Sensor. More...
 
struct  SensorClass
 Specification of sensor class that stores sensor properties. More...
 
struct  SensorFeedback
 
struct  StateSensorClass
 Sensor class that stores state sensor properties. More...
 
struct  SwitchSensorClass
 Sensor class that switch properties. More...
 
struct  ValueEncoding
 

Public Types

enum  EncodingType { BOOL , INT , UINT , IEEE754 }
 Specification of value encoding. More...
 
enum  Interpretation {
  DEFAULT , REJECT_DEVICE , REJECT_SENSOR , IGNORE ,
  UNAVAILABLE , NUMERIC_INVALID , STATE_ON , STATE_OFF
}
 Here you define how certain read values are to be interpreted. More...
 
enum  ModbusEndianness { MODBUS_BIG_ENDIAN , MODBUS_LITTLE_ENDIAN }
 

Public Member Functions

map< string, ConfigurationPackagegetConfiguration ()
 Get all defined gateway sensors and required objects from config. More...
 
int setConfiguration (in map< string, ConfigurationPackage > cfg)
 Replace defined gateway sensor and/or other configuration objects in config. More...
 
vector< FeedbackgetFeedback ()
 Get feedback from gateway sensor configuration usage. More...
 

Public Attributes

constant int MODBUS_VENDOR_NAME = 0
 
constant int MODBUS_PRODUCT_CODE = 1
 
constant int MODBUS_REVISION = 2
 
constant int MODBUS_VENDOR_URL = 3
 
constant int MODBUS_PRODUCT_NAME = 5
 
constant int MODBUS_MODEL_NAME = 6
 
constant int MODBUS_APP_NAME = 7
 
constant int ERR_CONFIG_INCONSISTENT = 1
 
constant int ERR_CONFIG_STORAGE_FAILED = 2
 

Detailed Description

Gateway Sensor Configuration Interface.

Member Enumeration Documentation

◆ EncodingType

Specification of value encoding.

Before an instance of Sensor can be created, an instance of ValueEncoding must be present. The Sensor locates the corresponding ValueEncoding using the sensor class id encodingId.

Enumerator
BOOL 

boolean

INT 

signed integer of a size specified in ValueEncoding

UINT 

unsigned integer of a size specified in ValueEncoding

IEEE754 

IEEE 754 floating point of a size specified in ValueEncoding.

◆ Interpretation

Here you define how certain read values are to be interpreted.

The rules leading to *_IGNORE and *_UNAVAILABLE are applied to numeric values and states.

IGNORE can be time-limited using ignoreTimeout, see InterpretationRule. After the time has expired, the value is set to unavailable.

NUMERIC_INVALID only affects NumericSensors. As DEFAULT for numeric sensors (if no rule is matched, or if DEFAULT is matched) the value is converted to a floating point number according to type specification.

STATE_ON and STATE_OFF affect only StateSensors. If no such rule is specified, the state becomes true if the read value is integral and not 0. If STATE_ON or STATE_OFF are present in the rules, then the state is set to true or false only if a STATE_* rule matches. Otherwise (DEFAULT) the state becomes unavailable.

REJECT_SENSOR means: do not accept this reading in any way. The sensor is treated as non-existent.

REJECT_DEVICE means: do not accept this reading in any way. Instead, this is a clear indication that the device is defective, or it is a wrong device. All sensors that belong to this device are treated as non-existent. REJECT_DEVICE can be used in this way to detect devices. The sensor defined for this purpose does not have to be imported as gateway sensor (see Sensor::classId = "").

DEFAULT on failed receives modbus exceptions REJECT_SENSOR. DEFAULT on modbus read errors (e.g. timeouts) is REJECT_DEVICE.

Enumerator
DEFAULT 

use default decoding

REJECT_DEVICE 

device is treated as non-existent

REJECT_SENSOR 

sensor is treated as non-existent

IGNORE 

ignore (use previous value)

UNAVAILABLE 

set value to unavailable

NUMERIC_INVALID 

set numeric value to invalid

STATE_ON 

set state to ON

STATE_OFF 

set state to OFF

◆ ModbusEndianness

Enumerator
MODBUS_BIG_ENDIAN 

use big endian modbus word order (default is big endian)

MODBUS_LITTLE_ENDIAN 

use little endian modbus word order

Member Function Documentation

◆ getConfiguration()

map<string, ConfigurationPackage> peripheral::GatewaySensorManager::getConfiguration ( )

Get all defined gateway sensors and required objects from config.

Read all Sensor Classes, Remote Devices, Value Encodings and Sensors at once to ensure that the overall configuration is consistent

Returns
all defined gateway sensor feature configuration objects

◆ getFeedback()

vector<Feedback> peripheral::GatewaySensorManager::getFeedback ( )

Get feedback from gateway sensor configuration usage.

Returns
Result: the full feedback

◆ setConfiguration()

int peripheral::GatewaySensorManager::setConfiguration ( in map< string, ConfigurationPackage cfg)

Replace defined gateway sensor and/or other configuration objects in config.

Write all Sensor Classes, Remote Devices, Value Encodings and Sensors at once to ensure that the overall configuration is consistent at every moment.

The uniqueness of all IDs and the availability of all referenced elements are checked before the configuration is applied. Otherwise setConfiguration() returns with an error.

Parameters
cfgall defined gateway sensor feature configuration objects
Returns
0 if OK
ERR_CONFIG_INCONSISTENT if consistency check has failed (e.g. non-unique identifiers)
ERR_CONFIG_STORAGE_FAILED if configuration cannot be stored

The documentation for this interface was generated from the following file: