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