Raritan PX2/PX3 JSON-RPC API
PeripheralDeviceManager.idl
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /*
3  * Copyright 2012 Raritan Inc. All rights reserved.
4  */
5 
6 #ifndef __PERIPHERAL_DEVICE_MANAGER_IDL__
7 #define __PERIPHERAL_DEVICE_MANAGER_IDL__
8 
9 #include <PeripheralDeviceSlot.idl>
10 #include <PeripheralDevicePackage.idl>
11 #include <PortFuse.idl>
12 #include <NumericSensor.idl>
13 #include <Sensor.idl>
14 #include <UserEvent.idl>
15 
16 /** Peripheral Devices */
17 module peripheral {
18 
19  /** Peripheral Device Manager */
20  interface DeviceManager_3_0_2 {
21 
22  constant int ERR_INVALID_PARAMS = 1; ///< Invalid parameters
23 
24  /** Z Coordinate Mode identifier */
25  enumeration ZCoordMode {
26  RACKUNITS, ///< Z coordinate of slot settings is in rack units
27  FREEFORM ///< Z coordinate of slot settings is free form text
28  };
29 
30  /** peripheral DeviceManager's s settings */
31  structure Settings {
32  ZCoordMode zCoordMode; ///< Z coordinate semantics
33  boolean autoManageNewDevices; ///< Automatically manage newly detected devices
34  float deviceAltitude; ///< Altitude of device in meters
35  int presenceDetectionTimeout; ///< Timeout for presence detection (sec)
36  map<string, sensors.NumericSensor_4_0_3.Thresholds> defaultThresholdsMap; ///< Default thresholds by peripheral device type
37  int maxActivePoweredDryContacts; ///< The maximum number of concurrently active powered dry contacts
38  };
39 
40  /** Peripheral DeviceManager's metadata */
41  structure MetaData {
42  int oneWirePortCount; ///< Number of 1-wire ports
43  int onboardDeviceCount; ///< Number of onboard peripheral devices
44  };
45 
46  /** Peripheral device type info */
47  structure DeviceTypeInfo {
48  sensors.Sensor_4_0_3.TypeSpec type; ///< Device (sensor) type
49  boolean isActuator; ///< Is actuator or not
50  string identifier; ///< Device type identifier
51  string name; ///< Device type display name
52  sensors.NumericSensor_4_0_3.Range defaultRange; ///< Default sensor range (numeric sensors only)
53  int defaultDecDigits; ///< Default sensor precision (numeric sensors only)
54  };
55 
56  /** Firmware update status */
57  structure FirmwareUpdateState {
58  boolean active; ///< \c true if any peripheral device is currently updated
59  int remaining; ///< Number of peripheral devices that are still pending to be updated
60  };
61 
62  /** Event: Peripheral device manager's settings have been changed */
63  valueobject SettingsChangedEvent extends event.UserEvent {
64  Settings oldSettings; ///< Settings before change
65  Settings newSettings; ///< Settings after change
66  };
67 
68  /** Event: A peripheral device was added or removed */
69  valueobject DeviceEvent_2_0_0 extends idl.Event {
70  vector<Device_3_0_2> devices; ///< Affected devices
71  vector<Device_3_0_2> allDevices; ///< New list of discovered devices after change
72  };
73 
74  /** Event: A peripheral device was added */
75  valueobject DeviceAddedEvent_2_0_0 extends DeviceEvent_2_0_0 { };
76 
77  /** Event: A peripheral device was removed */
78  valueobject DeviceRemovedEvent_2_0_0 extends DeviceEvent_2_0_0 { };
79 
80  /** Event: An unknown device was attached */
81  valueobject UnknownDeviceAttachedEvent extends idl.Event {
82  string romCode; ///< Device ROM code
83  vector<PosElement> position; ///< Device position in the chain
84  };
85 
86  /** Enumeration: State of device firmware update */
88  UPDATE_STARTED, ///< Update is running
89  UPDATE_SUCCESSFUL, ///< Update has finished successfully
90  UPDATE_FAILED ///< Update has failed
91  };
92 
93  /** Event: Firmware update on a device was started or has finished */
94  valueobject DeviceFirmwareUpdateStateChangedEvent extends idl.Event {
95  string oldVersion; ///< Firmware version before update
96  string newVersion; ///< Firmware version to be updated to
97  string serial; ///< Serial number of device
98  DeviceFirmwareUpdateState state; ///< Update state
99  };
100 
101  /** Event: Firmware update state has changed
102  * This event will be sent to enclose one of more {@link DeviceFirmwareUpdateStateChangedEvent}.
103  * That is, it will be sent before a series of firmware updates is started and after the
104  * firmware update series has ended. */
105  valueobject FirmwareUpdateStateChangedEvent extends idl.Event {
106  FirmwareUpdateState newState; ///< New update state
107  };
108 
109  /** Event: A peripheral device package was added or removed */
110  valueobject PackageEvent_2_0_0 extends idl.Event {
111  vector<PackageInfo_2_0_1> packageInfos; ///< Information about affected packages
112  vector<PackageInfo_2_0_1> allPackages; ///< New list of discovered packages after change
113  };
114 
115  /** Event: A peripheral device package was added */
116  valueobject PackageAddedEvent_2_0_0 extends PackageEvent_2_0_0 { };
117  /** Event: A peripheral device package was removed */
118  valueobject PackageRemovedEvent_2_0_0 extends PackageEvent_2_0_0 { };
119 
120  /** Peripheral device statistics */
121  structure Statistics {
122  int cSumErrCnt; ///< CRC / checksum error counter
123  };
124 
125  /**
126  * Get the list of peripheral device slots.
127  *
128  * @return List of peripheral device slots
129  */
130  vector<DeviceSlot_2_0_3> getDeviceSlots();
131 
132  /**
133  * Get a DeviceSlot by its index
134  *
135  * @param idx index of the slot to get
136  * @return the requested slot
137  */
138  DeviceSlot_2_0_3 getDeviceSlot(in int idx);
139 
140  /**
141  * Get the list of currently attached peripheral devices
142  *
143  * @return List of all discovered peripheral devices
144  */
145  vector<Device_3_0_2> getDiscoveredDevices();
146 
147  /**
148  * Get the list of currently attached peripheral device packages
149  *
150  * @return List of all discovered peripheral device packages
151  */
152  vector<PackageInfo_2_0_1> getDiscoveredPackageInfos();
153 
154  /**
155  * Retrieve the peripheral DeviceManager's settings.
156  *
157  * @return peripheral DeviceManager's settings
158  */
159  Settings getSettings();
160 
161  /**
162  * Change the peripheral DeviceManager's settings.
163  *
164  * @param settings New peripheral DeviceManager's settings
165  *
166  * @return 0 if OK
167  * @return ERR_INVALID_PARAMS if any parameters are invalid
168  */
169  int setSettings(in Settings settings);
170 
171  /**
172  * Retreive the Peripheral DeviceManager's metadata.
173  *
174  * @return Peripheral DeviceManager's metadata
175  */
176  MetaData getMetaData();
177 
178  /**
179  * Get the list of all peripheral device type infos
180  *
181  * @return List of all peripheral device type infos
182  */
183  vector<DeviceTypeInfo> getDeviceTypeInfos();
184 
185  /**
186  * Return the state of device firmware updates running
187  * on devices connected to this device manager
188  *
189  * @return Firmware update state
190  */
191  FirmwareUpdateState getFirmwareUpdateState();
192 
193  /**
194  * Retrieve statistics
195  *
196  * @return peripheral device statistics
197  */
198  Statistics getStatistics();
199 
200  /**
201  * Get the list of currently attached peripheral device packages
202  *
203  * @return List of all discovered peripheral device packages
204  */
205  vector<Package_1_0_1> getDiscoveredPackages();
206 
207  /**
208  * Get the fuse for the sensor port
209  *
210  * @return A fuse instance, if available
211  */
212  portsmodel.PortFuse getPortFuse();
213  };
214 }
215 
216 #endif /* !__PERIPHERAL_DEVICE_MANAGER_IDL__ */
Update is running.
Definition: PeripheralDeviceManager.idl:88
int onboardDeviceCount
Number of onboard peripheral devices.
Definition: PeripheralDeviceManager.idl:43
Settings newSettings
Settings after change.
Definition: PeripheralDeviceManager.idl:65
Range of possible sensor readings.
Definition: NumericSensor.idl:24
Update has finished successfully.
Definition: PeripheralDeviceManager.idl:89
int presenceDetectionTimeout
Timeout for presence detection (sec)
Definition: PeripheralDeviceManager.idl:35
string newVersion
Firmware version to be updated to.
Definition: PeripheralDeviceManager.idl:96
string name
Device type display name.
Definition: PeripheralDeviceManager.idl:51
ZCoordMode zCoordMode
Z coordinate semantics.
Definition: PeripheralDeviceManager.idl:32
Firmware update status.
Definition: PeripheralDeviceManager.idl:57
DeviceFirmwareUpdateState
Enumeration: State of device firmware update.
Definition: PeripheralDeviceManager.idl:87
Peripheral Devices.
Definition: PeripheralDeviceManager.idl:17
boolean active
true if any peripheral device is currently updated
Definition: PeripheralDeviceManager.idl:58
Peripheral device statistics.
Definition: PeripheralDeviceManager.idl:121
Peripheral DeviceManager&#39;s metadata.
Definition: PeripheralDeviceManager.idl:41
ZCoordMode
Z Coordinate Mode identifier.
Definition: PeripheralDeviceManager.idl:25
sensors::NumericSensor_4_0_3 Range defaultRange
Default sensor range (numeric sensors only)
Definition: PeripheralDeviceManager.idl:52
string identifier
Device type identifier.
Definition: PeripheralDeviceManager.idl:50
Basic IDL definitions.
Definition: Event.idl:10
int oneWirePortCount
Number of 1-wire ports.
Definition: PeripheralDeviceManager.idl:42
vector< PackageInfo_2_0_1 > allPackages
New list of discovered packages after change.
Definition: PeripheralDeviceManager.idl:112
vector< Device_3_0_2 > allDevices
New list of discovered devices after change.
Definition: PeripheralDeviceManager.idl:71
sensors::Sensor_4_0_3 TypeSpec type
Device (sensor) type.
Definition: PeripheralDeviceManager.idl:48
int cSumErrCnt
CRC / checksum error counter.
Definition: PeripheralDeviceManager.idl:122
DeviceFirmwareUpdateState state
Update state.
Definition: PeripheralDeviceManager.idl:98
boolean isActuator
Is actuator or not.
Definition: PeripheralDeviceManager.idl:49
Numeric sensor thresholds.
Definition: NumericSensor.idl:111
Sensor interface
Definition: Sensor.idl:15
Ports.
Definition: Port.idl:15
Peripheral Device Slot.
Definition: PeripheralDeviceSlot.idl:60
Z coordinate of slot settings is in rack units.
Definition: PeripheralDeviceManager.idl:26
int defaultDecDigits
Default sensor precision (numeric sensors only)
Definition: PeripheralDeviceManager.idl:53
Sensors Model.
Definition: AccumulatingNumericSensor.idl:13
vector< PosElement > position
Device position in the chain.
Definition: PeripheralDeviceManager.idl:83
Complete sensor type specification.
Definition: Sensor.idl:160
Interface describing a controllable fuse for a device port.
Definition: PortFuse.idl:17
Peripheral device type info.
Definition: PeripheralDeviceManager.idl:47
boolean autoManageNewDevices
Automatically manage newly detected devices.
Definition: PeripheralDeviceManager.idl:33
A sensor with numeric readings.
Definition: NumericSensor.idl:17
int maxActivePoweredDryContacts
The maximum number of concurrently active powered dry contacts.
Definition: PeripheralDeviceManager.idl:37
peripheral DeviceManager&#39;s s settings
Definition: PeripheralDeviceManager.idl:31
float deviceAltitude
Altitude of device in meters.
Definition: PeripheralDeviceManager.idl:34
string serial
Serial number of device.
Definition: PeripheralDeviceManager.idl:97
map< string, sensors::NumericSensor_4_0_3.Thresholds > defaultThresholdsMap
Default thresholds by peripheral device type.
Definition: PeripheralDeviceManager.idl:36
int remaining
Number of peripheral devices that are still pending to be updated.
Definition: PeripheralDeviceManager.idl:59
Peripheral Device Manager.
Definition: PeripheralDeviceManager.idl:20