Loading...
Searching...
No Matches
Controller.idl
/* SPDX-License-Identifier: BSD-3-Clause */
/*
* Copyright 2010 Raritan Inc. All rights reserved.
*/
#ifndef __PDUMODEL_CONTROLLER_IDL__
#define __PDUMODEL_CONTROLLER_IDL__
#include <Event.idl>
/**
* PDU Model
*/
module pdumodel {
/** Sub controller statistics */
structure CtrlStatistic {
int mainCSumErrCnt; ///< Main controller CRC error counter
int subCSumErrCnt; ///< Sub controller CRC error counter
int timeoutCnt; ///< Main controller timeout counter
int resetCnt; ///< Controller reset counter
int emResetCnt; ///< Energy meter reset counter
};
/** Sub controller interface */
interface Controller {
constant int ERR_NOT_SUPPORTED = 1; ///< Operation not supported
/** Communication status */
enumeration Status {
OK, ///< Communication with controller is known to be working
COMMUNICATION_UNSTABLE, ///< Controller can be communicated with sporadically
COMMUNICATION_FAILURE, ///< Controller can't be communicated with
UNKNOWN, ///< Communication status is unknown, e.g. after startup
INCOMPATIBLE, ///< The characteristics of the controller don't meet the expectations
FIRMWARE_UPDATE ///< A controller firmware update is in progress
};
/** Sub controller type */
enumeration Type {
OUTLET_CTRL, ///< %Outlet controller
INLET_CTRL, ///< %Inlet controller
METER_CTRL ///< %General metering controller
};
/** Sub controller metadata */
structure MetaData {
Type type; ///< %Controller type
string address; ///< Sub controller address
int magic; ///< Magic code
boolean versionAvailable; ///< \c true if version information and serial number is available
int fwAppVersion; ///< Firmware application version; 0 if unavailable
int fwBootVersion; ///< Firmware bootloader version; 0 if unavailable
int hwVersion; ///< Hardware version; 0 if unavailable
string serial; ///< Serial number; empty if unavailable
boolean haveResetCnt; ///< \c true if controller reset counter is available
boolean haveEmResetCnt; ///< \c true if energy meter reset counter is available
boolean isOptional; ///< \c true if this controller is optional (temporary absence may be expected)
};
/** Event: Controller communication status has changed */
valueobject StatusChangedEvent extends idl.Event {
Status oldStatus; ///< Status before change
Status newStatus; ///< Status after change
};
/** Event: Controller metadata has changed */
valueobject MetaDataChangedEvent extends idl.Event {
MetaData oldMetaData; ///< Metadata before change
MetaData newMetaData; ///< Metadata after change
};
/**
* Retrieve the current status of communication with controller
*
* @return communication status
*/
Status getCommunicationStatus();
/**
* Retrieve statistics
*
* @return statistics of %Controller
*/
CtrlStatistic getStatistics();
/**
* Retrieve the sub controller metadata.
*
* @return %Controller metadata
*/
MetaData getMetaData();
/**
* Reset this sub controller.
*
* Note: Depending on the hardware setup of the specific device, calling
* this method may also cause other sub controllers to be reset.
* @return 0 on success
* ERR_NOT_SUPPORTED if the hardware setup doesn't allow resetting the controller
*/
int reset();
};
}
#endif
pdumodel::Controller
Sub controller interface.
Definition Controller.idl:26
pdumodel::Controller::Type
Type
Sub controller type.
Definition Controller.idl:40
pdumodel::Controller::METER_CTRL
@ METER_CTRL
General metering controller
Definition Controller.idl:43
pdumodel::Controller::INLET_CTRL
@ INLET_CTRL
Inlet controller
Definition Controller.idl:42
pdumodel::Controller::OUTLET_CTRL
@ OUTLET_CTRL
Outlet controller
Definition Controller.idl:41
pdumodel::Controller::ERR_NOT_SUPPORTED
constant int ERR_NOT_SUPPORTED
Operation not supported.
Definition Controller.idl:27
pdumodel::Controller::getStatistics
CtrlStatistic getStatistics()
Retrieve statistics.
pdumodel::Controller::getMetaData
MetaData getMetaData()
Retrieve the sub controller metadata.
pdumodel::Controller::reset
int reset()
Reset this sub controller.
pdumodel::Controller::getCommunicationStatus
Status getCommunicationStatus()
Retrieve the current status of communication with controller.
pdumodel::Controller::Status
Status
Communication status.
Definition Controller.idl:30
pdumodel::Controller::COMMUNICATION_FAILURE
@ COMMUNICATION_FAILURE
Controller can't be communicated with.
Definition Controller.idl:33
pdumodel::Controller::FIRMWARE_UPDATE
@ FIRMWARE_UPDATE
A controller firmware update is in progress.
Definition Controller.idl:36
pdumodel::Controller::INCOMPATIBLE
@ INCOMPATIBLE
The characteristics of the controller don't meet the expectations.
Definition Controller.idl:35
pdumodel::Controller::OK
@ OK
Communication with controller is known to be working.
Definition Controller.idl:31
pdumodel::Controller::COMMUNICATION_UNSTABLE
@ COMMUNICATION_UNSTABLE
Controller can be communicated with sporadically.
Definition Controller.idl:32
pdumodel::Controller::UNKNOWN
@ UNKNOWN
Communication status is unknown, e.g. after startup.
Definition Controller.idl:34
idl
Basic IDL definitions.
Definition Event.idl:10
pdumodel
PDU Model.
Definition Circuit.idl:16
serial
Serial Ports.
Definition AnalogModem.idl:12
idl::Event
Common base for all events.
Definition Event.idl:13
pdumodel::Controller::MetaDataChangedEvent
Event: Controller metadata has changed.
Definition Controller.idl:68
pdumodel::Controller::MetaDataChangedEvent::oldMetaData
MetaData oldMetaData
Metadata before change.
Definition Controller.idl:69
pdumodel::Controller::MetaDataChangedEvent::newMetaData
MetaData newMetaData
Metadata after change.
Definition Controller.idl:70
pdumodel::Controller::MetaData
Sub controller metadata.
Definition Controller.idl:47
pdumodel::Controller::MetaData::isOptional
boolean isOptional
true if this controller is optional (temporary absence may be expected)
Definition Controller.idl:58
pdumodel::Controller::MetaData::hwVersion
int hwVersion
Hardware version; 0 if unavailable.
Definition Controller.idl:54
pdumodel::Controller::MetaData::magic
int magic
Magic code.
Definition Controller.idl:50
pdumodel::Controller::MetaData::address
string address
Sub controller address.
Definition Controller.idl:49
pdumodel::Controller::MetaData::fwBootVersion
int fwBootVersion
Firmware bootloader version; 0 if unavailable.
Definition Controller.idl:53
pdumodel::Controller::MetaData::haveResetCnt
boolean haveResetCnt
true if controller reset counter is available
Definition Controller.idl:56
pdumodel::Controller::MetaData::haveEmResetCnt
boolean haveEmResetCnt
true if energy meter reset counter is available
Definition Controller.idl:57
pdumodel::Controller::MetaData::fwAppVersion
int fwAppVersion
Firmware application version; 0 if unavailable.
Definition Controller.idl:52
pdumodel::Controller::MetaData::type
Type type
Controller type
Definition Controller.idl:48
pdumodel::Controller::MetaData::versionAvailable
boolean versionAvailable
true if version information and serial number is available
Definition Controller.idl:51
pdumodel::Controller::StatusChangedEvent
Event: Controller communication status has changed.
Definition Controller.idl:62
pdumodel::Controller::StatusChangedEvent::oldStatus
Status oldStatus
Status before change.
Definition Controller.idl:63
pdumodel::Controller::StatusChangedEvent::newStatus
Status newStatus
Status after change.
Definition Controller.idl:64
pdumodel::CtrlStatistic
Sub controller statistics.
Definition Controller.idl:17
pdumodel::CtrlStatistic::resetCnt
int resetCnt
Controller reset counter.
Definition Controller.idl:21
pdumodel::CtrlStatistic::subCSumErrCnt
int subCSumErrCnt
Sub controller CRC error counter.
Definition Controller.idl:19
pdumodel::CtrlStatistic::timeoutCnt
int timeoutCnt
Main controller timeout counter.
Definition Controller.idl:20
pdumodel::CtrlStatistic::mainCSumErrCnt
int mainCSumErrCnt
Main controller CRC error counter.
Definition Controller.idl:18
pdumodel::CtrlStatistic::emResetCnt
int emResetCnt
Energy meter reset counter.
Definition Controller.idl:22