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

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 */
89 Properties getProperties();
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 */
108 int setDetectionMode(in DetectionMode mode);
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 */
138 PortFuse getFuse();
139 };
140}
141
142#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:19
portsmodel::Port::getDeviceConfig
Object getDeviceConfig(in string deviceType)
Get device type specific configuration interface.
portsmodel::Port::DetectionType
DetectionType
Port detection type.
Definition Port.idl:27
portsmodel::Port::PINNED
@ PINNED
port is pinned to a specific device type
Definition Port.idl:29
portsmodel::Port::AUTO
@ AUTO
auto detection of connected devices
Definition Port.idl:28
portsmodel::Port::DeviceTypeId
DeviceTypeId
devices types that may be connected to port
Definition Port.idl:35
portsmodel::Port::UNSPECIFIED
@ UNSPECIFIED
not specified, means "not detected" in Properties::detectedDeviceTypeId
Definition Port.idl:36
portsmodel::Port::SENSOR_HUB
@ SENSOR_HUB
sensor hub
Definition Port.idl:38
portsmodel::Port::BEEPER
@ BEEPER
external beeper
Definition Port.idl:39
portsmodel::Port::OTHER
@ OTHER
other types, not listet below
Definition Port.idl:37
portsmodel::Port::ASSET_STRIP
@ ASSET_STRIP
asset strip
Definition Port.idl:40
portsmodel::Port::POWER_CIM
@ POWER_CIM
power cim
Definition Port.idl:41
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::getDetectableDevices
vector< string > getDetectableDevices()
Get all detectable devices of this 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
peripheral
Peripheral Devices.
Definition GatewaySensorManager.idl:17
portsmodel
Ports.
Definition Port.idl:16
idl::Event
Common base for all events.
Definition Event.idl:13
peripheral::PosElement
peripheral device position element, list forms position
Definition PosElement.idl:31
portsmodel::Port::DetectionMode
Port detection mode.
Definition Port.idl:51
portsmodel::Port::DetectionMode::pinnedDeviceType
string pinnedDeviceType
contains specific device type in pinned mode, not used for auto
Definition Port.idl:53
portsmodel::Port::DetectionMode::type
DetectionType type
detection type: auto or pinned
Definition Port.idl:52
portsmodel::Port::DeviceChangedEvent
Event: The device connected to the port has changed.
Definition Port.idl:79
portsmodel::Port::DeviceChangedEvent::oldDevice
Object oldDevice
Connected device before change.
Definition Port.idl:80
portsmodel::Port::DeviceChangedEvent::newDevice
Object newDevice
Connected device after change.
Definition Port.idl:81
portsmodel::Port::DeviceTypeWithId
Definition Port.idl:45
portsmodel::Port::DeviceTypeWithId::type
string type
device type string
Definition Port.idl:47
portsmodel::Port::DeviceTypeWithId::id
DeviceTypeId id
device type ID
Definition Port.idl:46
portsmodel::Port::PropertiesChangedEvent
Event: The port properties have changed.
Definition Port.idl:73
portsmodel::Port::PropertiesChangedEvent::newProperties
Properties newProperties
Properties after change.
Definition Port.idl:75
portsmodel::Port::PropertiesChangedEvent::oldProperties
Properties oldProperties
Properties before change.
Definition Port.idl:74
portsmodel::Port::Properties
Port properties.
Definition Port.idl:57
portsmodel::Port::Properties::topoId
string topoId
short id depending on position, e.g. 'REMOTE-HUB-1' or 'USB-2-1-4'
Definition Port.idl:66
portsmodel::Port::Properties::mode
DetectionMode mode
detection mode
Definition Port.idl:60
portsmodel::Port::Properties::detectedDeviceTypeId
DeviceTypeId detectedDeviceTypeId
detected device type ID or UNSPECIFIED if nothing connected
Definition Port.idl:64
portsmodel::Port::Properties::serialId
string serialId
serial number of device, e.g. for USB Dongle, maybe empty
Definition Port.idl:67
portsmodel::Port::Properties::portType
peripheral::PortType portType
machine-readable port type information
Definition Port.idl:68
portsmodel::Port::Properties::position
vector< peripheral::PosElement > position
full machine-readable position information
Definition Port.idl:69
portsmodel::Port::Properties::label
string label
label on device
Definition Port.idl:59
portsmodel::Port::Properties::detectedDeviceType
string detectedDeviceType
detected device type or empty if nothing connected
Definition Port.idl:61
portsmodel::Port::Properties::name
string name
user defineable name - NOT USED RIGHT NOW!
Definition Port.idl:58
portsmodel::Port::Properties::detectableDeviceTypes
vector< DeviceTypeWithId > detectableDeviceTypes
all detectable devices of this port as ID-string pairs
Definition Port.idl:65
portsmodel::Port::Properties::pinnedDeviceTypeId
DeviceTypeId pinnedDeviceTypeId
contains specific device type ID in pinned mode, or UNSPECIFIED if not pinned
Definition Port.idl:63
portsmodel::Port::Properties::detectedDeviceName
string detectedDeviceName
detected device name or empty if nothing connected
Definition Port.idl:62