Legrand / Raritan Xerus™ JSON-RPC API for Remote Access Devices like KX4-101, KX3G2

Loading...
Searching...
No Matches
SerialAccessPort.idl
1#ifndef __RADM_SERIAL_ACCESS_PORT_IDL__
2#define __RADM_SERIAL_ACCESS_PORT_IDL__
3
4#include <Event.idl>
5#include <UserEvent.idl>
6#include <AccessPort.idl>
7
8module radm {
9
10 interface SerialAccessPort extends AccessPort {
11
12 /** Serial device interface type */
13 enumeration DeviceInterfaceType {
14 DEV_IFTYPE_AUTO, ///< auto detect
15 DEV_IFTYPE_DTE, ///< DTE (Data Terminal Equipment) device
16 DEV_IFTYPE_DCE ///< DCE (Data Communications Equipment) device
17 };
18
19 /** Terminal emulation type */
20 enumeration Emulation {
21 VT100,
22 VT220,
23 VT320,
24 ANSI
25 };
26
27 /** Character encoding */
28 enumeration Encoding {
29 DEFAULT,
30 US_ASCII,
31 ISO_8859_1,
32 ISO_8859_15,
33 UTF_8,
34 SHIFT_JIS,
35 EUC_JP,
36 EUC_CN,
37 EUC_KR,
38 EIGHTBIT_ASCII
39 };
40
41 /** Flow control type */
42 enumeration FlowControl {
43 FLOW_CTRL_NONE, ///< No flow control
44 FLOW_CTRL_HARDWARE, ///< Hardware flow control
45 FLOW_CTRL_SOFTWARE ///< Software flow control
46 };
47
48 /** Parity mode */
49 enumeration Parity {
50 PARITY_NONE, ///< No parity (implies 8 data bits)
51 PARITY_ODD, ///< Odd parity (implies 7 data bits)
52 PARITY_EVEN ///< Even parity (implies 7 data bits)
53 };
54
55 enumeration EscapeKeyModifier {
56 NO_MODIFIER,
57 CONTROL
58 };
59
60 structure ExitCommandItem {
61 string command; ///< Command to send
62 int delay; ///< Delay after sending the command (in s)
63 };
64
65 structure Settings {
66 string name; ///< Port name
67 Emulation emulation; ///< Terminal emulation setting
68 Encoding encoding; ///< Character encoding
69 DeviceInterfaceType devIfType; ///< Interface type override
70 int baudRate; ///< Baud rate
71 Parity parity; ///< Parity mode
72 FlowControl flowCtrl; ///< Flow control mode
73 int stopBits; ///< Number of stop bits (1 or 2)
74 int txCharDelayMs; ///< Delay after each transmitted character (in ms)
75 int txLineDelayMs; ///< Delay after each transmitted line (in ms)
76 int breakDurationMs; ///< Duration of transmitted break conditions (in ms)
77 boolean multiWriteMode; ///< Whether multiple port accessors can write to the same port simultaneously
78 boolean alwaysActive; ///< Whether data should be read and buffered even if no client is currently connected
79 string escChar; ///< Character for going from terminal to command mode (at most 1 character)
80 EscapeKeyModifier escKeyModifier; ///< Key modifier for going from terminal to command mode
81 vector<ExitCommandItem> exitCommand; ///< Sequence of commands to send when a client disconnects
82 int sshDpaPort; ///< SSH port for directly accessing this serial port (in case SSH-DPA is enabled)
83 };
84
85 /**
86 * Get the parent device of this port
87 *
88 * Note: In practice, an instance of {@link DsamDevice} will be returned.
89 *
90 * @return Parent device
91 */
92 Device getParent();
93
94 /**
95 * Get port settings
96 *
97 * @return Port settings
98 */
99 Settings getSettings();
100
101 /**
102 * Set new port settings
103 *
104 * @param settings New settings
105 *
106 * @return 0 on success
107 * @return 1 if any setting value is invalid
108 */
109 int setSettings(in Settings settings);
110
111 /**
112 * Get automatically detected interface type
113 *
114 * @return Detected interface type
115 */
116 DeviceInterfaceType getDetectedInterfaceType();
117
118 /** Event: The port settings have changed */
119 valueobject SettingsChangedEvent extends event.UserEvent {
120 Settings oldSettings; ///< Port settings before change
121 Settings newSettings; ///< Port settings after change
122 };
123
124 /** Event: The detected type has changed */
125 valueobject DetectedInterfaceTypeChangedEvent extends idl.Event {
126 DeviceInterfaceType oldIfType; ///< Detected interface type before change
127 DeviceInterfaceType newIfType; ///< Detected interface type after change
128 };
129 };
130}
131
132#endif //__RADM_SERIAL_ACCESS_PORT_IDL__
radm::AccessPort
Definition AccessPort.idl:10
radm::Device
Definition Device.idl:7
radm::SerialAccessPort
Definition SerialAccessPort.idl:10
radm::SerialAccessPort::DeviceInterfaceType
DeviceInterfaceType
Serial device interface type.
Definition SerialAccessPort.idl:13
radm::SerialAccessPort::DEV_IFTYPE_DCE
@ DEV_IFTYPE_DCE
DCE (Data Communications Equipment) device.
Definition SerialAccessPort.idl:16
radm::SerialAccessPort::DEV_IFTYPE_DTE
@ DEV_IFTYPE_DTE
DTE (Data Terminal Equipment) device.
Definition SerialAccessPort.idl:15
radm::SerialAccessPort::DEV_IFTYPE_AUTO
@ DEV_IFTYPE_AUTO
auto detect
Definition SerialAccessPort.idl:14
radm::SerialAccessPort::getSettings
Settings getSettings()
Get port settings.
radm::SerialAccessPort::getParent
Device getParent()
Get the parent device of this port.
radm::SerialAccessPort::FlowControl
FlowControl
Flow control type.
Definition SerialAccessPort.idl:42
radm::SerialAccessPort::FLOW_CTRL_HARDWARE
@ FLOW_CTRL_HARDWARE
Hardware flow control.
Definition SerialAccessPort.idl:44
radm::SerialAccessPort::FLOW_CTRL_SOFTWARE
@ FLOW_CTRL_SOFTWARE
Software flow control.
Definition SerialAccessPort.idl:45
radm::SerialAccessPort::FLOW_CTRL_NONE
@ FLOW_CTRL_NONE
No flow control.
Definition SerialAccessPort.idl:43
radm::SerialAccessPort::Parity
Parity
Parity mode.
Definition SerialAccessPort.idl:49
radm::SerialAccessPort::PARITY_NONE
@ PARITY_NONE
No parity (implies 8 data bits)
Definition SerialAccessPort.idl:50
radm::SerialAccessPort::PARITY_ODD
@ PARITY_ODD
Odd parity (implies 7 data bits)
Definition SerialAccessPort.idl:51
radm::SerialAccessPort::PARITY_EVEN
@ PARITY_EVEN
Even parity (implies 7 data bits)
Definition SerialAccessPort.idl:52
radm::SerialAccessPort::Emulation
Emulation
Terminal emulation type.
Definition SerialAccessPort.idl:20
radm::SerialAccessPort::Encoding
Encoding
Character encoding.
Definition SerialAccessPort.idl:28
radm::SerialAccessPort::setSettings
int setSettings(in Settings settings)
Set new port settings.
radm::SerialAccessPort::getDetectedInterfaceType
DeviceInterfaceType getDetectedInterfaceType()
Get automatically detected interface type.
idl
Basic IDL definitions.
Definition Event.idl:10
radm
Radm Model.
Definition AccessPort.idl:8
idl::Event
Common base for all events.
Definition Event.idl:13
radm::SerialAccessPort::DetectedInterfaceTypeChangedEvent
Event: The detected type has changed.
Definition SerialAccessPort.idl:125
radm::SerialAccessPort::DetectedInterfaceTypeChangedEvent::newIfType
DeviceInterfaceType newIfType
Detected interface type after change.
Definition SerialAccessPort.idl:127
radm::SerialAccessPort::DetectedInterfaceTypeChangedEvent::oldIfType
DeviceInterfaceType oldIfType
Detected interface type before change.
Definition SerialAccessPort.idl:126
radm::SerialAccessPort::ExitCommandItem
Definition SerialAccessPort.idl:60
radm::SerialAccessPort::ExitCommandItem::command
string command
Command to send.
Definition SerialAccessPort.idl:61
radm::SerialAccessPort::ExitCommandItem::delay
int delay
Delay after sending the command (in s)
Definition SerialAccessPort.idl:62
radm::SerialAccessPort::SettingsChangedEvent
Event: The port settings have changed.
Definition SerialAccessPort.idl:119
radm::SerialAccessPort::SettingsChangedEvent::newSettings
Settings newSettings
Port settings after change.
Definition SerialAccessPort.idl:121
radm::SerialAccessPort::SettingsChangedEvent::oldSettings
Settings oldSettings
Port settings before change.
Definition SerialAccessPort.idl:120
radm::SerialAccessPort::Settings
Definition SerialAccessPort.idl:65
radm::SerialAccessPort::Settings::stopBits
int stopBits
Number of stop bits (1 or 2)
Definition SerialAccessPort.idl:73
radm::SerialAccessPort::Settings::escKeyModifier
EscapeKeyModifier escKeyModifier
Key modifier for going from terminal to command mode.
Definition SerialAccessPort.idl:80
radm::SerialAccessPort::Settings::exitCommand
vector< ExitCommandItem > exitCommand
Sequence of commands to send when a client disconnects.
Definition SerialAccessPort.idl:81
radm::SerialAccessPort::Settings::escChar
string escChar
Character for going from terminal to command mode (at most 1 character)
Definition SerialAccessPort.idl:79
radm::SerialAccessPort::Settings::alwaysActive
boolean alwaysActive
Whether data should be read and buffered even if no client is currently connected.
Definition SerialAccessPort.idl:78
radm::SerialAccessPort::Settings::devIfType
DeviceInterfaceType devIfType
Interface type override.
Definition SerialAccessPort.idl:69
radm::SerialAccessPort::Settings::encoding
Encoding encoding
Character encoding.
Definition SerialAccessPort.idl:68
radm::SerialAccessPort::Settings::flowCtrl
FlowControl flowCtrl
Flow control mode.
Definition SerialAccessPort.idl:72
radm::SerialAccessPort::Settings::multiWriteMode
boolean multiWriteMode
Whether multiple port accessors can write to the same port simultaneously.
Definition SerialAccessPort.idl:77
radm::SerialAccessPort::Settings::emulation
Emulation emulation
Terminal emulation setting.
Definition SerialAccessPort.idl:67
radm::SerialAccessPort::Settings::name
string name
Port name.
Definition SerialAccessPort.idl:66
radm::SerialAccessPort::Settings::txCharDelayMs
int txCharDelayMs
Delay after each transmitted character (in ms)
Definition SerialAccessPort.idl:74
radm::SerialAccessPort::Settings::txLineDelayMs
int txLineDelayMs
Delay after each transmitted line (in ms)
Definition SerialAccessPort.idl:75
radm::SerialAccessPort::Settings::baudRate
int baudRate
Baud rate.
Definition SerialAccessPort.idl:70
radm::SerialAccessPort::Settings::sshDpaPort
int sshDpaPort
SSH port for directly accessing this serial port (in case SSH-DPA is enabled)
Definition SerialAccessPort.idl:82
radm::SerialAccessPort::Settings::breakDurationMs
int breakDurationMs
Duration of transmitted break conditions (in ms)
Definition SerialAccessPort.idl:76
radm::SerialAccessPort::Settings::parity
Parity parity
Parity mode.
Definition SerialAccessPort.idl:71