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 */
93
94 /**
95 * Get port settings
96 *
97 * @return Port settings
98 */
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 */
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 */
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__
DeviceInterfaceType
Serial device interface type.
@ DEV_IFTYPE_DCE
DCE (Data Communications Equipment) device.
@ DEV_IFTYPE_DTE
DTE (Data Terminal Equipment) device.
Settings getSettings()
Get port settings.
Device getParent()
Get the parent device of this port.
FlowControl
Flow control type.
@ FLOW_CTRL_HARDWARE
Hardware flow control.
@ FLOW_CTRL_SOFTWARE
Software flow control.
@ FLOW_CTRL_NONE
No flow control.
@ PARITY_NONE
No parity (implies 8 data bits)
@ PARITY_ODD
Odd parity (implies 7 data bits)
@ PARITY_EVEN
Even parity (implies 7 data bits)
Emulation
Terminal emulation type.
Encoding
Character encoding.
int setSettings(in Settings settings)
Set new port settings.
DeviceInterfaceType getDetectedInterfaceType()
Get automatically detected interface type.
Basic IDL definitions.
Definition Event.idl:10
Radm Model.
Definition AccessPort.idl:8
Common base for all events.
Definition Event.idl:13
DeviceInterfaceType newIfType
Detected interface type after change.
DeviceInterfaceType oldIfType
Detected interface type before change.
int delay
Delay after sending the command (in s)
Event: The port settings have changed.
Settings newSettings
Port settings after change.
Settings oldSettings
Port settings before change.
int stopBits
Number of stop bits (1 or 2)
EscapeKeyModifier escKeyModifier
Key modifier for going from terminal to command mode.
vector< ExitCommandItem > exitCommand
Sequence of commands to send when a client disconnects.
string escChar
Character for going from terminal to command mode (at most 1 character)
boolean alwaysActive
Whether data should be read and buffered even if no client is currently connected.
DeviceInterfaceType devIfType
Interface type override.
Encoding encoding
Character encoding.
FlowControl flowCtrl
Flow control mode.
boolean multiWriteMode
Whether multiple port accessors can write to the same port simultaneously.
Emulation emulation
Terminal emulation setting.
int txCharDelayMs
Delay after each transmitted character (in ms)
int txLineDelayMs
Delay after each transmitted line (in ms)
int sshDpaPort
SSH port for directly accessing this serial port (in case SSH-DPA is enabled)
int breakDurationMs
Duration of transmitted break conditions (in ms)