Legrand / Raritan / Server Technology Xerus™ JSON-RPC API
Loading...
Searching...
No Matches
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#include <PosElement.idl>
12
13/**
14 * Ports
15 */
16module portsmodel {
17
18 /** Port interface */
19 interface Port {
20
21 /** Error codes */
22 constant int NO_ERROR = 0; ///< operation successful, no error
23 constant int ERR_INVALID_PARAM = 1; ///< invalid parameter for an operation
24 constant int ERR_DEVICE_BUSY = 2; ///< operation fails because connected device is busy
25
26 /** Port detection type */
27 enumeration DetectionType {
28 AUTO, ///< auto detection of connected devices
29 PINNED, ///< port is pinned to a specific device type
30 DISABLED ///< port is disabled and will not detect any device connected
31 };
32
33 /** devices types that may be connected to port */
34 [unknown_fallback("OTHER")]
35 enumeration DeviceTypeId {
36 UNSPECIFIED, ///< not specified, means "not detected" in Properties.detectedDeviceTypeId
37 OTHER, ///< other types, not listet below
38 SENSOR_HUB, ///< sensor hub
39 BEEPER, ///< external beeper
40 ASSET_STRIP, ///< asset strip
41 POWER_CIM, ///< power cim
42 GATEWAY_SENSOR ///< modbus RTU gateway sensor
43 };
44
45 structure DeviceTypeWithId {
46 DeviceTypeId id; ///< device type ID
47 string type; ///< device type string
48 };
49
50 /** Port detection mode */
51 structure DetectionMode {
52 DetectionType type; ///< detection type: auto or pinned
53 string pinnedDeviceType; ///< contains specific device type in pinned mode, not used for auto
54 };
55
56 /** Port properties */
57 structure Properties {
58 string name; ///< user defineable name - NOT USED RIGHT NOW!
59 string label; ///< label on device
60 DetectionMode mode; ///< detection mode
61 string detectedDeviceType; ///< detected device type or empty if nothing connected
62 string detectedDeviceName; ///< detected device name or empty if nothing connected
63 DeviceTypeId pinnedDeviceTypeId; ///< contains specific device type ID in pinned mode, or UNSPECIFIED if not pinned
64 DeviceTypeId detectedDeviceTypeId; ///< detected device type ID or UNSPECIFIED if nothing connected
65 vector<DeviceTypeWithId> detectableDeviceTypes; ///< all detectable devices of this port as ID-string pairs
66 string topoId; ///< short id depending on position, e.g. 'REMOTE-HUB-1' or 'USB-2-1-4'
67 string serialId; ///< serial number of device, e.g. for USB Dongle, maybe empty
68 peripheral.PortType portType; ///< machine-readable port type information
69 vector<peripheral.PosElement> position; ///< full machine-readable position information
70 };
71
72 /** Event: The port properties have changed */
73 valueobject PropertiesChangedEvent extends idl.Event {
74 Properties oldProperties; ///< Properties before change
75 Properties newProperties; ///< Properties after change
76 };
77
78 /** Event: The device connected to the port has changed */
79 valueobject DeviceChangedEvent extends idl.Event {
80 Object oldDevice; ///< Connected device before change
81 Object newDevice; ///< Connected device after change
82 };
83
84 /**
85 * Get the current properties of the port
86 *
87 * @return Properties of the Port
88 */
90
91 /**
92 * NOT USED RIGHT NOW!
93 *
94 * Set the port name
95 *
96 * @param name new port name
97 */
98 void setName(in string name);
99
100 /**
101 * Set the detection mode for the port
102 *
103 * @param mode new detection mode
104 * @return NO_ERROR on success
105 * @return ERR_INVALID_PARAM invalid parameter
106 * @return ERR_DEVICE_BUSY device busy (e.g. Asset Strip Firmware Update)
107 */
109
110 /**
111 * Get all detectable devices of this port
112 *
113 * @return List of all registered detectable Devices as strings
114 */
115 vector<string> getDetectableDevices();
116
117 /**
118 * Get the connected device of the port
119 *
120 * @return Device connected to Port
121 */
122 Object getDevice();
123
124 /**
125 * Get device type specific configuration interface.
126 *
127 * @param deviceType Device type to get configuration interface for
128 *
129 * @return Device configuration interface
130 */
131 Object getDeviceConfig(in string deviceType);
132
133 /**
134 * Get the fuse for this port
135 *
136 * @return A fuse instance, if available
137 */
139 };
140}
141
142#endif /* __PORTSMODEL_PORT_IDL__ */
Interface describing a controllable fuse for a device port.
Definition: PortFuse.idl:17
Port interface.
Definition: Port.idl:19
Object getDeviceConfig(in string deviceType)
Get device type specific configuration interface.
DetectionType
Port detection type.
Definition: Port.idl:27
@ PINNED
port is pinned to a specific device type
Definition: Port.idl:29
@ AUTO
auto detection of connected devices
Definition: Port.idl:28
DeviceTypeId
devices types that may be connected to port
Definition: Port.idl:35
@ UNSPECIFIED
not specified, means "not detected" in Properties::detectedDeviceTypeId
Definition: Port.idl:36
@ SENSOR_HUB
sensor hub
Definition: Port.idl:38
@ BEEPER
external beeper
Definition: Port.idl:39
@ OTHER
other types, not listet below
Definition: Port.idl:37
@ ASSET_STRIP
asset strip
Definition: Port.idl:40
@ POWER_CIM
power cim
Definition: Port.idl:41
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.
vector< string > getDetectableDevices()
Get all detectable devices of this 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
Peripheral Devices.
Ports.
Definition: Port.idl:16
Common base for all events.
Definition: Event.idl:13
peripheral device position element, list forms position
Definition: PosElement.idl:31
Port detection mode.
Definition: Port.idl:51
string pinnedDeviceType
contains specific device type in pinned mode, not used for auto
Definition: Port.idl:53
DetectionType type
detection type: auto or pinned
Definition: Port.idl:52
Event: The device connected to the port has changed.
Definition: Port.idl:79
Object oldDevice
Connected device before change.
Definition: Port.idl:80
Object newDevice
Connected device after change.
Definition: Port.idl:81
string type
device type string
Definition: Port.idl:47
DeviceTypeId id
device type ID
Definition: Port.idl:46
Event: The port properties have changed.
Definition: Port.idl:73
Properties newProperties
Properties after change.
Definition: Port.idl:75
Properties oldProperties
Properties before change.
Definition: Port.idl:74
Port properties.
Definition: Port.idl:57
string topoId
short id depending on position, e.g. 'REMOTE-HUB-1' or 'USB-2-1-4'
Definition: Port.idl:66
DetectionMode mode
detection mode
Definition: Port.idl:60
DeviceTypeId detectedDeviceTypeId
detected device type ID or UNSPECIFIED if nothing connected
Definition: Port.idl:64
string serialId
serial number of device, e.g. for USB Dongle, maybe empty
Definition: Port.idl:67
peripheral::PortType portType
machine-readable port type information
Definition: Port.idl:68
vector< peripheral::PosElement > position
full machine-readable position information
Definition: Port.idl:69
string label
label on device
Definition: Port.idl:59
string detectedDeviceType
detected device type or empty if nothing connected
Definition: Port.idl:61
string name
user defineable name - NOT USED RIGHT NOW!
Definition: Port.idl:58
vector< DeviceTypeWithId > detectableDeviceTypes
all detectable devices of this port as ID-string pairs
Definition: Port.idl:65
DeviceTypeId pinnedDeviceTypeId
contains specific device type ID in pinned mode, or UNSPECIFIED if not pinned
Definition: Port.idl:63
string detectedDeviceName
detected device name or empty if nothing connected
Definition: Port.idl:62