Legrand / 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  */
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  */
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  */
114  };
115 }
116 
117 #endif /* __PORTSMODEL_PORT_IDL__ */
Interface describing a controllable fuse for a device port.
Definition: PortFuse.idl:17
Port interface.
Definition: Port.idl:18
Object getDeviceConfig(in string deviceType)
Get device type specific configuration interface.
DetectionType
Port detection type.
Definition: Port.idl:26
@ PINNED
port is pinned to a specific device type
Definition: Port.idl:28
@ AUTO
auto detection of connected devices
Definition: Port.idl:27
vector< string > getDetectableDevices()
Get all detectable devices of this port.
Object getDevice()
Get the connected device of the port.
void setName(in string name)
NOT USED RIGHT NOW!
int setDetectionMode(in DetectionMode mode)
Set the detection mode for the port.
Properties getProperties()
Get the current properties of the port.
PortFuse getFuse()
Get the fuse for this port.
Basic IDL definitions.
Definition: Event.idl:10
Ports.
Definition: Port.idl:15
Common base for all events.
Definition: Event.idl:13
Port detection mode.
Definition: Port.idl:33
string pinnedDeviceType
contains specific device type in pinned mode, not used for auto
Definition: Port.idl:35
DetectionType type
detection type: auto or pinned
Definition: Port.idl:34
Event: The device connected to the port has changed.
Definition: Port.idl:54
Object oldDevice
Connected device before change.
Definition: Port.idl:55
Object newDevice
Connected device after change.
Definition: Port.idl:56
Event: The port properties have changed.
Definition: Port.idl:48
Properties newProperties
Properties after change.
Definition: Port.idl:50
Properties oldProperties
Properties before change.
Definition: Port.idl:49
Port properties.
Definition: Port.idl:39
DetectionMode mode
detection mode
Definition: Port.idl:42
string label
label on device
Definition: Port.idl:41
string detectedDeviceType
detected device type or empty if nothing connected
Definition: Port.idl:43
string name
user defineable name - NOT USED RIGHT NOW!
Definition: Port.idl:40
string detectedDeviceName
detected device name or empty if nothing connected
Definition: Port.idl:44