Raritan / Server Technology Xerus™ PDU JSON-RPC API: Port.idl Source File

Raritan / Server Technology Xerus™ PDU JSON-RPC API

Port.idl
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /*
3 * Copyright 2011 Raritan Inc. All rights reserved.
4 */
5
6 #ifndef __PORTSMODEL_PORT_IDL__
7 #define __PORTSMODEL_PORT_IDL__
8
9 #include <Event.idl>
10 #include <PortFuse.idl>
11
12 /**
13 * Ports
14 */
15 module portsmodel {
16
17 /** Port interface */
18 interface Port {
19
20 /** Error codes */
21 constant int NO_ERROR = 0; ///< operation successful, no error
22 constant int ERR_INVALID_PARAM = 1; ///< invalid parameter for an operation
23 constant int ERR_DEVICE_BUSY = 2; ///< operation fails because connected device is busy
24
25 /** Port detection type */
26 enumeration DetectionType {
27 AUTO, ///< auto detection of connected devices
28 PINNED, ///< port is pinned to a specific device type
29 DISABLED ///< port is disabled and will not detect any device connected
30 };
31
32 /** Port detection mode */
33 structure DetectionMode {
34 DetectionType type; ///< detection type: auto or pinned
35 string pinnedDeviceType; ///< contains specific device type in pinned mode, not used for auto
36 };
37
38 /** Port properties */
39 structure Properties {
40 string name; ///< user defineable name - NOT USED RIGHT NOW!
41 string label; ///< label on device
42 DetectionMode mode; ///< detection mode
43 string detectedDeviceType; ///< detected device type or empty if nothing connected
44 string detectedDeviceName; ///< detected device name or empty if nothing connected
45 };
46
47 /** Event: The port properties have changed */
48 valueobject PropertiesChangedEvent extends idl.Event {
49 Properties oldProperties; ///< Properties before change
50 Properties newProperties; ///< Properties after change
51 };
52
53 /** Event: The device connected to the port has changed */
54 valueobject DeviceChangedEvent extends idl.Event {
55 Object oldDevice; ///< Connected device before change
56 Object newDevice; ///< Connected device after change
57 };
58
59 /**
60 * Get the current properties of the port
61 *
62 * @return Properties of the Port
63 */
64 Properties getProperties();
65
66 /**
67 * NOT USED RIGHT NOW!
68 *
69 * Set the port name
70 *
71 * @param name new port name
72 */
73 void setName(in string name);
74
75 /**
76 * Set the detection mode for the port
77 *
78 * @param mode new detection mode
79 * @return NO_ERROR on success
80 * @return ERR_INVALID_PARAM invalid parameter
81 * @return ERR_DEVICE_BUSY device busy (e.g. Asset Strip Firmware Update)
82 */
83 int setDetectionMode(in DetectionMode mode);
84
85 /**
86 * Get all detectable devices of this port
87 *
88 * @return List of all registered detectable Devices
89 */
90 vector<string> getDetectableDevices();
91
92 /**
93 * Get the connected device of the port
94 *
95 * @return Device connected to Port
96 */
97 Object getDevice();
98
99 /**
100 * Get device type specific configuration interface.
101 *
102 * @param deviceType Device type to get configuration interface for
103 *
104 * @return Device configuration interface
105 */
106 Object getDeviceConfig(in string deviceType);
107
108 /**
109 * Get the fuse for this port
110 *
111 * @return A fuse instance, if available
112 */
113 PortFuse getFuse();
114 };
115 }
116
117 #endif /* __PORTSMODEL_PORT_IDL__ */
portsmodel::PortFuse
Interface describing a controllable fuse for a device port.
Definition: PortFuse.idl:17
portsmodel::Port
Port interface.
Definition: Port.idl:18
portsmodel::Port::getDeviceConfig
Object getDeviceConfig(in string deviceType)
Get device type specific configuration interface.
portsmodel::Port::DetectionType
DetectionType
Port detection type.
Definition: Port.idl:26
portsmodel::Port::PINNED
@ PINNED
port is pinned to a specific device type
Definition: Port.idl:28
portsmodel::Port::AUTO
@ AUTO
auto detection of connected devices
Definition: Port.idl:27
portsmodel::Port::getDetectableDevices
vector< string > getDetectableDevices()
Get all detectable devices of this port.
portsmodel::Port::getDevice
Object getDevice()
Get the connected device of the port.
portsmodel::Port::setName
void setName(in string name)
NOT USED RIGHT NOW!
portsmodel::Port::setDetectionMode
int setDetectionMode(in DetectionMode mode)
Set the detection mode for the port.
portsmodel::Port::getProperties
Properties getProperties()
Get the current properties of the port.
portsmodel::Port::getFuse
PortFuse getFuse()
Get the fuse for this port.
idl
Basic IDL definitions.
Definition: Event.idl:10
portsmodel
Ports.
Definition: Port.idl:15
idl::Event
Common base for all events.
Definition: Event.idl:13
portsmodel::Port::DetectionMode
Port detection mode.
Definition: Port.idl:33
portsmodel::Port::DetectionMode::pinnedDeviceType
string pinnedDeviceType
contains specific device type in pinned mode, not used for auto
Definition: Port.idl:35
portsmodel::Port::DetectionMode::type
DetectionType type
detection type: auto or pinned
Definition: Port.idl:34
portsmodel::Port::DeviceChangedEvent
Event: The device connected to the port has changed.
Definition: Port.idl:54
portsmodel::Port::DeviceChangedEvent::oldDevice
Object oldDevice
Connected device before change.
Definition: Port.idl:55
portsmodel::Port::DeviceChangedEvent::newDevice
Object newDevice
Connected device after change.
Definition: Port.idl:56
portsmodel::Port::PropertiesChangedEvent
Event: The port properties have changed.
Definition: Port.idl:48
portsmodel::Port::PropertiesChangedEvent::newProperties
Properties newProperties
Properties after change.
Definition: Port.idl:50
portsmodel::Port::PropertiesChangedEvent::oldProperties
Properties oldProperties
Properties before change.
Definition: Port.idl:49
portsmodel::Port::Properties
Port properties.
Definition: Port.idl:39
portsmodel::Port::Properties::mode
DetectionMode mode
detection mode
Definition: Port.idl:42
portsmodel::Port::Properties::label
string label
label on device
Definition: Port.idl:41
portsmodel::Port::Properties::detectedDeviceType
string detectedDeviceType
detected device type or empty if nothing connected
Definition: Port.idl:43
portsmodel::Port::Properties::name
string name
user defineable name - NOT USED RIGHT NOW!
Definition: Port.idl:40
portsmodel::Port::Properties::detectedDeviceName
string detectedDeviceName
detected device name or empty if nothing connected
Definition: Port.idl:44