Legrand / Raritan / Server Technology Xerus™ JSON-RPC API
Loading...
Searching...
No Matches
Controller.idl
1/* SPDX-License-Identifier: BSD-3-Clause */
2/*
3 * Copyright 2010 Raritan Inc. All rights reserved.
4 */
5
6#ifndef __PDUMODEL_CONTROLLER_IDL__
7#define __PDUMODEL_CONTROLLER_IDL__
8
9#include <Event.idl>
10
11/**
12 * PDU Model
13 */
14module pdumodel {
15
16 /** Sub controller statistics */
17 structure CtrlStatistic {
18 int mainCSumErrCnt; ///< Main controller CRC error counter
19 int subCSumErrCnt; ///< Sub controller CRC error counter
20 int timeoutCnt; ///< Main controller timeout counter
21 int resetCnt; ///< Controller reset counter
22 int emResetCnt; ///< Energy meter reset counter
23 };
24
25 /** Sub controller interface */
26 interface Controller {
27 constant int ERR_NOT_SUPPORTED = 1; ///< Operation not supported
28
29 /** Communication status */
30 enumeration Status {
31 OK, ///< Communication with controller is known to be working
32 COMMUNICATION_UNSTABLE, ///< Controller can be communicated with sporadically
33 COMMUNICATION_FAILURE, ///< Controller can't be communicated with
34 UNKNOWN, ///< Communication status is unknown, e.g. after startup
35 INCOMPATIBLE, ///< The characteristics of the controller don't meet the expectations
36 FIRMWARE_UPDATE ///< A controller firmware update is in progress
37 };
38
39 /** Sub controller type */
40 enumeration Type {
41 OUTLET_CTRL, ///< %Outlet controller
42 INLET_CTRL, ///< %Inlet controller
43 METER_CTRL ///< %General metering controller
44 };
45
46 /** Sub controller metadata */
47 structure MetaData {
48 Type type; ///< %Controller type
49 string address; ///< Sub controller address
50 int magic; ///< Magic code
51 boolean versionAvailable; ///< \c true if version information and serial number is available
52 int fwAppVersion; ///< Firmware application version; 0 if unavailable
53 int fwBootVersion; ///< Firmware bootloader version; 0 if unavailable
54 int hwVersion; ///< Hardware version; 0 if unavailable
55 string serial; ///< Serial number; empty if unavailable
56 boolean haveResetCnt; ///< \c true if controller reset counter is available
57 boolean haveEmResetCnt; ///< \c true if energy meter reset counter is available
58 boolean isOptional; ///< \c true if this controller is optional (temporary absence may be expected)
59 };
60
61 /** Event: Controller communication status has changed */
62 valueobject StatusChangedEvent extends idl.Event {
63 Status oldStatus; ///< Status before change
64 Status newStatus; ///< Status after change
65 };
66
67 /** Event: Controller metadata has changed */
68 valueobject MetaDataChangedEvent extends idl.Event {
69 MetaData oldMetaData; ///< Metadata before change
70 MetaData newMetaData; ///< Metadata after change
71 };
72
73 /**
74 * Retrieve the current status of communication with controller
75 *
76 * @return communication status
77 */
79
80 /**
81 * Retrieve statistics
82 *
83 * @return statistics of %Controller
84 */
86
87 /**
88 * Retrieve the sub controller metadata.
89 *
90 * @return %Controller metadata
91 */
93
94 /**
95 * Reset this sub controller.
96 *
97 * Note: Depending on the hardware setup of the specific device, calling
98 * this method may also cause other sub controllers to be reset.
99
100 * @return 0 on success
101 * ERR_NOT_SUPPORTED if the hardware setup doesn't allow resetting the controller
102 */
103 int reset();
104 };
105
106}
107
108#endif
Sub controller interface.
Definition: Controller.idl:26
Type
Sub controller type.
Definition: Controller.idl:40
@ INLET_CTRL
Inlet controller
Definition: Controller.idl:42
@ OUTLET_CTRL
Outlet controller
Definition: Controller.idl:41
CtrlStatistic getStatistics()
Retrieve statistics.
MetaData getMetaData()
Retrieve the sub controller metadata.
int reset()
Reset this sub controller.
Status getCommunicationStatus()
Retrieve the current status of communication with controller.
Status
Communication status.
Definition: Controller.idl:30
@ COMMUNICATION_FAILURE
Controller can't be communicated with.
Definition: Controller.idl:33
@ INCOMPATIBLE
The characteristics of the controller don't meet the expectations.
Definition: Controller.idl:35
@ OK
Communication with controller is known to be working.
Definition: Controller.idl:31
@ COMMUNICATION_UNSTABLE
Controller can be communicated with sporadically.
Definition: Controller.idl:32
@ UNKNOWN
Communication status is unknown, e.g. after startup.
Definition: Controller.idl:34
Basic IDL definitions.
Definition: Event.idl:10
PDU Model.
Definition: Ade.idl:12
Common base for all events.
Definition: Event.idl:13
Event: Controller metadata has changed.
Definition: Controller.idl:68
MetaData oldMetaData
Metadata before change.
Definition: Controller.idl:69
MetaData newMetaData
Metadata after change.
Definition: Controller.idl:70
Sub controller metadata.
Definition: Controller.idl:47
boolean isOptional
true if this controller is optional (temporary absence may be expected)
Definition: Controller.idl:58
string serial
Serial number; empty if unavailable.
Definition: Controller.idl:55
int hwVersion
Hardware version; 0 if unavailable.
Definition: Controller.idl:54
string address
Sub controller address.
Definition: Controller.idl:49
int fwBootVersion
Firmware bootloader version; 0 if unavailable.
Definition: Controller.idl:53
boolean haveResetCnt
true if controller reset counter is available
Definition: Controller.idl:56
boolean haveEmResetCnt
true if energy meter reset counter is available
Definition: Controller.idl:57
int fwAppVersion
Firmware application version; 0 if unavailable.
Definition: Controller.idl:52
Type type
Controller type
Definition: Controller.idl:48
boolean versionAvailable
true if version information and serial number is available
Definition: Controller.idl:51
Event: Controller communication status has changed.
Definition: Controller.idl:62
Status oldStatus
Status before change.
Definition: Controller.idl:63
Status newStatus
Status after change.
Definition: Controller.idl:64
Sub controller statistics.
Definition: Controller.idl:17
int resetCnt
Controller reset counter.
Definition: Controller.idl:21
int subCSumErrCnt
Sub controller CRC error counter.
Definition: Controller.idl:19
int timeoutCnt
Main controller timeout counter.
Definition: Controller.idl:20
int mainCSumErrCnt
Main controller CRC error counter.
Definition: Controller.idl:18
int emResetCnt
Energy meter reset counter.
Definition: Controller.idl:22