Legrand / Raritan / Server Technology Xerus™ JSON-RPC API
Loading...
Searching...
No Matches
Classes | Public Member Functions | Public Attributes | List of all members
sensors::Logger Interface Reference

Sensor logger interface. More...

Classes

struct  Info
 Sensor logger info. More...
 
struct  InfoChangedEvent
 Event: Sensor logger info has changed. More...
 
struct  LoggedSensorsChangedEvent
 Event: Set of logged sensors has been changed. More...
 
struct  LogRow
 One full log row. More...
 
struct  Record
 Sensor log record. More...
 
struct  SensorSet
 Set of logged sensors. More...
 
struct  Settings
 Sensor logger settings. More...
 
struct  SettingsChangedEvent
 Event: Sensor logger settings have been changed. More...
 
struct  TimedRecord
 Sensor log record with timestamp. More...
 

Public Member Functions

Info getInfo ()
 Retrieve the sensor logger info. More...
 
Settings getSettings ()
 Retrieve the sensor logger settings. More...
 
int setSettings (in Settings settings)
 Change the sensor logger settings. More...
 
int getTimeStamps (out vector< time > timestamps, in int recid, in int count)
 Retrieve a set of log record timestamps. More...
 
int getSensorRecords (out vector< Record > recs, in sensors::Sensor sensor, in int recid, in int count)
 Retrieve log records for a given sensor. More...
 
int getPeripheralDeviceRecords (out vector< Record > recs, in peripheral::DeviceSlot slot, in int recid, in int count)
 Retrieve log records for an peripheral device slot. More...
 
int getSensorTimedRecords (out vector< TimedRecord > recs, in sensors::Sensor sensor, in int recid, in int count)
 Retrieve log records with timestamps for a given sensor. More...
 
int getPeripheralDeviceTimedRecords (out vector< TimedRecord > recs, in peripheral::DeviceSlot slot, in int recid, in int count)
 Retrieve log records with timestamps for an peripheral device slot. More...
 
SensorSet getLoggedSensors ()
 Retrieve the set of logged sensors. More...
 
int setLoggedSensors (in SensorSet sensors)
 Change the set of logged sensors. More...
 
int enableSensors (in SensorSet sensors)
 Enable logging for one or more sensors or peripheral device slots. More...
 
int disableSensors (in SensorSet sensors)
 Disable logging for one or more sensors or peripheral device slots. More...
 
boolean isSensorEnabled (in sensors::Sensor sensor)
 Check if logging is enabled for a given sensor. More...
 
boolean isSlotEnabled (in peripheral::DeviceSlot slot)
 Check if logging is enabled for a given peripheral device slot. More...
 
void enableAllSensors ()
 Enable logging for all PDU sensors.
 
void disableAllSensors ()
 Disable logging for all PDU sensors.
 
time getSensorSetTimestamp ()
 Get the time of the last sensor set modification. More...
 
int getLogRow (out LogRow row, in int recid)
 Get one full log row. More...
 

Public Attributes

constant int STATE_UNAVAILABLE = 0
 Sensor state in log record. More...
 
constant int STATE_OPEN = 1
 Circuit breaker open. More...
 
constant int STATE_CLOSE = 2
 Circuit breaker closed. More...
 
constant int STATE_BELOW_LOWER_CRITICAL = 3
 Numeric sensor below lower critical threshold. More...
 
constant int STATE_BELOW_LOWER_WARNING = 4
 Numeric sensor below lower warning threshold. More...
 
constant int STATE_NORMAL = 5
 Numeric sensor in normal range; normal operation. More...
 
constant int STATE_ABOVE_UPPER_WARNING = 6
 Numeric sensor above upper warning threshold. More...
 
constant int STATE_ABOVE_UPPER_CRITICAL = 7
 Numeric sensor above upper critical threshold. More...
 
constant int STATE_ON = 8
 Power state on. More...
 
constant int STATE_OFF = 9
 Power state off. More...
 
constant int STATE_ALARMED = 10
 Alarmed. More...
 
constant int STATE_OK = 11
 OK. More...
 
constant int STATE_MARGINAL = 12
 Marginal. More...
 
constant int STATE_FAIL = 13
 Fail. More...
 
constant int STATE_YES = 14
 Yes. More...
 
constant int STATE_NO = 15
 No. More...
 
constant int STATE_STANDBY = 16
 Standby operation. More...
 
constant int STATE_ONE = 17
 First source active. More...
 
constant int STATE_TWO = 18
 Second source active. More...
 
constant int STATE_IN_SYNC = 19
 Phases are in sync. More...
 
constant int STATE_OUT_OF_SYNC = 20
 Phases are out of sync. More...
 
constant int STATE_FAULT = 21
 Fault. More...
 
constant int STATE_SELF_TEST = 22
 Sensor is currently testing itself. More...
 
constant int STATE_I1_OPEN_FAULT = 23
 Inlet 1 switch open fault. More...
 
constant int STATE_I1_SHORT_FAULT = 24
 Inlet 1 switch short fault. More...
 
constant int STATE_I2_OPEN_FAULT = 25
 Inlet 2 switch open fault. More...
 
constant int STATE_I2_SHORT_FAULT = 26
 Inlet 2 switch short fault. More...
 
constant int STATE_WARNING = 27
 Warning. More...
 
constant int STATE_CRITICAL = 28
 Critical. More...
 
constant int STATE_NON_REDUNDANT = 29
 Non-redundant operation. More...
 
constant int STATE_INACTIVE = 30
 Bypass inactive. More...
 
constant int STATE_I1_SELECTED = 31
 Inlet 1 selected. More...
 
constant int STATE_I2_SELECTED = 32
 Inlet 2 selected. More...
 
constant int STATE_I1_SELECTED_AND_ACTIVE = 33
 Inlet 1 selected and active. More...
 
constant int STATE_I2_SELECTED_AND_ACTIVE = 34
 Inlet 2 selected and active. More...
 

Detailed Description

Sensor logger interface.

The sensor log stores a fixed number of log records for each enabled sensor. Log records hold the minimum, maximum and average reading of all samples within the period as well as the most critical state.

Record IDs start at 1 and grow continuously without wrap-around. To avoid race conditions it is allowed to request records that are no longer available, i.e. have rotated out of the log. Unavailable records come back empty (available = false, timestamp = 0). It is not OK to read past newestRecId.

Log record periods are synchronized with the system time, so all devices with the same log settings and proper time configuration move to a new record simultaneously.

Definition at line 31 of file SensorLogger.idl.

Member Function Documentation

◆ disableSensors()

int sensors::Logger::disableSensors ( in SensorSet  sensors)

Disable logging for one or more sensors or peripheral device slots.

Sensors in the list that are not logged are ignored. Logged sensors not in the list remain enabled.

Parameters
sensorsSensors and slots to be disabled
Returns
0 if OK
1 if any sensor in the list is unknown

◆ enableSensors()

int sensors::Logger::enableSensors ( in SensorSet  sensors)

Enable logging for one or more sensors or peripheral device slots.

Sensors in the list that are already logged are ignored. Logged sensors not in the list remain enabled.

Parameters
sensorsSensors and slots to be logged
Returns
0 if OK
1 if any sensor in the list is unknown

◆ getInfo()

Info sensors::Logger::getInfo ( )

Retrieve the sensor logger info.

Returns
Sensor logger info

◆ getLoggedSensors()

SensorSet sensors::Logger::getLoggedSensors ( )

Retrieve the set of logged sensors.

Returns
Set of logged sensors

◆ getLogRow()

int sensors::Logger::getLogRow ( out LogRow  row,
in int  recid 
)

Get one full log row.

Parameters
rowResult: Log row
recidRecord id
Returns
0 if OK
1 if the record id is invalid

◆ getPeripheralDeviceRecords()

int sensors::Logger::getPeripheralDeviceRecords ( out vector< Record recs,
in peripheral::DeviceSlot  slot,
in int  recid,
in int  count 
)

Retrieve log records for an peripheral device slot.

Parameters
recsResult: Sensor log records
slotPeripheral device slot reference
recidFirst record id
countNumber of records
Returns
0 if OK
1 if any record id is invalid

◆ getPeripheralDeviceTimedRecords()

int sensors::Logger::getPeripheralDeviceTimedRecords ( out vector< TimedRecord recs,
in peripheral::DeviceSlot  slot,
in int  recid,
in int  count 
)

Retrieve log records with timestamps for an peripheral device slot.

Parameters
recsResult: Sensor log records
slotPeripheral device slot reference
recidFirst record id
countNumber of records
Returns
0 if OK
1 if any record id is invalid

◆ getSensorRecords()

int sensors::Logger::getSensorRecords ( out vector< Record recs,
in sensors::Sensor  sensor,
in int  recid,
in int  count 
)

Retrieve log records for a given sensor.

Parameters
recsResult: Sensor log records
sensorSensor reference
recidFirst record id
countNumber of records
Returns
0 if OK
1 if any record id is invalid

◆ getSensorSetTimestamp()

time sensors::Logger::getSensorSetTimestamp ( )

Get the time of the last sensor set modification.

This can be used by clients which keep a cached copy of the sensor set to determine whether that copy is still up-to-date.

Returns
Sensor set time stamp (UNIX timestamp, UTC)

◆ getSensorTimedRecords()

int sensors::Logger::getSensorTimedRecords ( out vector< TimedRecord recs,
in sensors::Sensor  sensor,
in int  recid,
in int  count 
)

Retrieve log records with timestamps for a given sensor.

Parameters
recsResult: Sensor log records
sensorSensor reference
recidFirst record id
countNumber of records
Returns
0 if OK
1 if any record id is invalid

◆ getSettings()

Settings sensors::Logger::getSettings ( )

Retrieve the sensor logger settings.

Returns
Sensor logger settings

◆ getTimeStamps()

int sensors::Logger::getTimeStamps ( out vector< time >  timestamps,
in int  recid,
in int  count 
)

Retrieve a set of log record timestamps.

Parameters
timestampsResult: Log record timestamps
recidFirst record id
countNumber of records
Returns
0 if OK
1 if any record id is invalid

◆ isSensorEnabled()

boolean sensors::Logger::isSensorEnabled ( in sensors::Sensor  sensor)

Check if logging is enabled for a given sensor.

Parameters
sensorSensor to be checked
Returns
true if sensor is logged, false otherwise

◆ isSlotEnabled()

boolean sensors::Logger::isSlotEnabled ( in peripheral::DeviceSlot  slot)

Check if logging is enabled for a given peripheral device slot.

Parameters
sensorPeripheral device slot to be checked
Returns
true if slot is logged, false otherwise

◆ setLoggedSensors()

int sensors::Logger::setLoggedSensors ( in SensorSet  sensors)

Change the set of logged sensors.

Parameters
sensorsNew set of sensors
Returns
0 if OK
1 if any sensor in the list is unknown

◆ setSettings()

int sensors::Logger::setSettings ( in Settings  settings)

Change the sensor logger settings.

Parameters
settingsNew settings
Returns
0 if OK
1 if any parameters are invalid

Member Data Documentation

◆ STATE_ABOVE_UPPER_CRITICAL

constant int sensors::Logger::STATE_ABOVE_UPPER_CRITICAL = 7

Numeric sensor above upper critical threshold.

Definition at line 110 of file SensorLogger.idl.

◆ STATE_ABOVE_UPPER_WARNING

constant int sensors::Logger::STATE_ABOVE_UPPER_WARNING = 6

Numeric sensor above upper warning threshold.

Definition at line 109 of file SensorLogger.idl.

◆ STATE_ALARMED

constant int sensors::Logger::STATE_ALARMED = 10

Alarmed.

Definition at line 113 of file SensorLogger.idl.

◆ STATE_BELOW_LOWER_CRITICAL

constant int sensors::Logger::STATE_BELOW_LOWER_CRITICAL = 3

Numeric sensor below lower critical threshold.

Definition at line 106 of file SensorLogger.idl.

◆ STATE_BELOW_LOWER_WARNING

constant int sensors::Logger::STATE_BELOW_LOWER_WARNING = 4

Numeric sensor below lower warning threshold.

Definition at line 107 of file SensorLogger.idl.

◆ STATE_CLOSE

constant int sensors::Logger::STATE_CLOSE = 2

Circuit breaker closed.

Definition at line 105 of file SensorLogger.idl.

◆ STATE_CRITICAL

constant int sensors::Logger::STATE_CRITICAL = 28

Critical.

Definition at line 131 of file SensorLogger.idl.

◆ STATE_FAIL

constant int sensors::Logger::STATE_FAIL = 13

Fail.

Definition at line 116 of file SensorLogger.idl.

◆ STATE_FAULT

constant int sensors::Logger::STATE_FAULT = 21

Fault.

Definition at line 124 of file SensorLogger.idl.

◆ STATE_I1_OPEN_FAULT

constant int sensors::Logger::STATE_I1_OPEN_FAULT = 23

Inlet 1 switch open fault.

Definition at line 126 of file SensorLogger.idl.

◆ STATE_I1_SELECTED

constant int sensors::Logger::STATE_I1_SELECTED = 31

Inlet 1 selected.

Definition at line 134 of file SensorLogger.idl.

◆ STATE_I1_SELECTED_AND_ACTIVE

constant int sensors::Logger::STATE_I1_SELECTED_AND_ACTIVE = 33

Inlet 1 selected and active.

Definition at line 136 of file SensorLogger.idl.

◆ STATE_I1_SHORT_FAULT

constant int sensors::Logger::STATE_I1_SHORT_FAULT = 24

Inlet 1 switch short fault.

Definition at line 127 of file SensorLogger.idl.

◆ STATE_I2_OPEN_FAULT

constant int sensors::Logger::STATE_I2_OPEN_FAULT = 25

Inlet 2 switch open fault.

Definition at line 128 of file SensorLogger.idl.

◆ STATE_I2_SELECTED

constant int sensors::Logger::STATE_I2_SELECTED = 32

Inlet 2 selected.

Definition at line 135 of file SensorLogger.idl.

◆ STATE_I2_SELECTED_AND_ACTIVE

constant int sensors::Logger::STATE_I2_SELECTED_AND_ACTIVE = 34

Inlet 2 selected and active.

Definition at line 137 of file SensorLogger.idl.

◆ STATE_I2_SHORT_FAULT

constant int sensors::Logger::STATE_I2_SHORT_FAULT = 26

Inlet 2 switch short fault.

Definition at line 129 of file SensorLogger.idl.

◆ STATE_IN_SYNC

constant int sensors::Logger::STATE_IN_SYNC = 19

Phases are in sync.

Definition at line 122 of file SensorLogger.idl.

◆ STATE_INACTIVE

constant int sensors::Logger::STATE_INACTIVE = 30

Bypass inactive.

Definition at line 133 of file SensorLogger.idl.

◆ STATE_MARGINAL

constant int sensors::Logger::STATE_MARGINAL = 12

Marginal.

Definition at line 115 of file SensorLogger.idl.

◆ STATE_NO

constant int sensors::Logger::STATE_NO = 15

No.

Definition at line 118 of file SensorLogger.idl.

◆ STATE_NON_REDUNDANT

constant int sensors::Logger::STATE_NON_REDUNDANT = 29

Non-redundant operation.

Definition at line 132 of file SensorLogger.idl.

◆ STATE_NORMAL

constant int sensors::Logger::STATE_NORMAL = 5

Numeric sensor in normal range; normal operation.

Definition at line 108 of file SensorLogger.idl.

◆ STATE_OFF

constant int sensors::Logger::STATE_OFF = 9

Power state off.

Definition at line 112 of file SensorLogger.idl.

◆ STATE_OK

constant int sensors::Logger::STATE_OK = 11

OK.

Definition at line 114 of file SensorLogger.idl.

◆ STATE_ON

constant int sensors::Logger::STATE_ON = 8

Power state on.

Definition at line 111 of file SensorLogger.idl.

◆ STATE_ONE

constant int sensors::Logger::STATE_ONE = 17

First source active.

Definition at line 120 of file SensorLogger.idl.

◆ STATE_OPEN

constant int sensors::Logger::STATE_OPEN = 1

Circuit breaker open.

Definition at line 104 of file SensorLogger.idl.

◆ STATE_OUT_OF_SYNC

constant int sensors::Logger::STATE_OUT_OF_SYNC = 20

Phases are out of sync.

Definition at line 123 of file SensorLogger.idl.

◆ STATE_SELF_TEST

constant int sensors::Logger::STATE_SELF_TEST = 22

Sensor is currently testing itself.

Definition at line 125 of file SensorLogger.idl.

◆ STATE_STANDBY

constant int sensors::Logger::STATE_STANDBY = 16

Standby operation.

Definition at line 119 of file SensorLogger.idl.

◆ STATE_TWO

constant int sensors::Logger::STATE_TWO = 18

Second source active.

Definition at line 121 of file SensorLogger.idl.

◆ STATE_UNAVAILABLE

constant int sensors::Logger::STATE_UNAVAILABLE = 0

Sensor state in log record.

Unavailable

Definition at line 103 of file SensorLogger.idl.

◆ STATE_WARNING

constant int sensors::Logger::STATE_WARNING = 27

Warning.

Definition at line 130 of file SensorLogger.idl.

◆ STATE_YES

constant int sensors::Logger::STATE_YES = 14

Yes.

Definition at line 117 of file SensorLogger.idl.


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