Raritan / Server Technology Xerus™ PDU JSON-RPC API: PeripheralDeviceSlot.idl Source File

Raritan / Server Technology Xerus™ PDU JSON-RPC API

PeripheralDeviceSlot.idl
1 /* SPDX-License-Identifier: BSD-3-Clause */
2 /*
3 * Copyright 2012 Raritan Inc. All rights reserved.
4 */
5
6 #ifndef __PERIPHERAL_DEVICE_SLOT_IDL__
7 #define __PERIPHERAL_DEVICE_SLOT_IDL__
8
9 #include <Sensor.idl>
10 #include <UserEvent.idl>
11
12 /** Peripheral Devices */
13 module peripheral {
14
15 /** peripheral device port types */
16 [unknown_fallback("UNSPECIFIED")]
17 enumeration PortType {
18 ONBOARD, ///< a built in, inaccessible port
19 DEV_PORT, ///< a sensor port on the device
20 ONEWIRE_HUB_PORT, ///< a port on a Hub
21 ONEWIRE_CHAIN_POS, ///< a chain position
22 REMOTE_HUB_PORT, ///< a RS485 remote hub port
23 WIRELESS_BRIDGE, ///< a wireless bridge, e.g. usb dongle
24 WIRELESS_DEVICE, ///< a wireless device
25 UNSPECIFIED, ///< device type is unknown
26 GATEWAY_SENSOR ///< a gateway sensor
27 };
28
29 /** peripheral device position element, list forms position */
30 structure PosElement {
31 PortType portType; ///< type of the element
32 string port; ///< value of the element, a label
33 };
34
35 /** peripheral device identification */
36 structure DeviceID {
37 string serial; ///< Serial number
38 sensors.Sensor.TypeSpec type; ///< device's type spec
39 boolean isActuator; ///< true if device is an actuator
40 int channel; ///< Channel number
41 };
42
43 /** peripheral device position based address */
44 structure Address {
45 vector<PosElement> position; ///< Position within 1-wire topo
46 sensors.Sensor.TypeSpec type; ///< device's type spec
47 boolean isActuator; ///< true if device is an actuator
48 int channel; ///< Channel number
49 };
50
51 /**
52 * A peripheral device is the collection of
53 * - device identification
54 * - device position
55 * - a flag indicating actuator type
56 * - device reference
57 */
58 valueobject Device {
59 DeviceID deviceID; ///< device identification
60 vector<PosElement> position; ///< Position within 1-wire topo
61 string packageClass; ///< physical package identifier
62 sensors.Sensor device; ///< device reference
63 };
64
65 /** Peripheral Device Slot */
66 interface DeviceSlot {
67
68 constant int ERR_INVALID_PARAMS = 1; ///< Invalid parameters
69 constant int ERR_NOT_SUPPORTED = 2; ///< Operation not supported
70
71 constant int CHANNEL_INVALID = -1;///< Device has no channels
72
73 /** user writeable location */
74 structure Location {
75 string x; ///< X coordinate
76 string y; ///< Y coordinate
77 string z; ///< Z coordinate (semantics depends on ZCoordMode)
78 };
79
80 /** user configurable slot attributes */
81 structure Settings {
82 string name; ///< User-defined name
83 string description; ///< User-defined description
84 Location location; ///< user-defined device location
85 boolean useDefaultThresholds; ///< use default thresholds
86 map<string, string> properties; ///< sensor specific settings
87 };
88
89 /** Event: The device attached to this slot has changed */
90 valueobject DeviceChangedEvent extends idl.Event {
91 Device oldDevice; ///< Device before change
92 Device newDevice; ///< Device after change
93 };
94
95 /** Event: The slot settings have been changed */
96 valueobject SettingsChangedEvent extends event.UserEvent {
97 Settings oldSettings; ///< Settings before change
98 Settings newSettings; ///< Settings after change
99 };
100
101 /**
102 * Returns the actual device reference.
103 * The reference becomes invalid due to assign/unassign method
104 * call. This conditions is also flagged by EVT_KEY_DEVICE_CHANGED
105 * event
106 */
107 Device getDevice();
108
109 /**
110 * Associate this slot with a given (old or detected new) peripheral device.
111 *
112 * @param devid peripheral device identification
113 *
114 * @return 0 if OK
115 * @return ERR_INVALID_PARAMS if devid is unknown or invalid
116 */
117 int assign(in DeviceID devid);
118
119 /**
120 * Associate this slot with an addressable (new) peripheral device.
121 *
122 * @param address peripheral device address
123 *
124 * @return 0 if OK
125 * @return ERR_INVALID_PARAMS if address is invalid
126 */
127 int assignAddress(in string packageClass, in Address address);
128
129 /**
130 * Break the association for this slot.
131 * @return 0 if OK
132 * @return ERR_NOT_SUPPORTED if operation is not supported
133 * this is the case for sensors with
134 * complete position information
135 */
136 int unassign();
137
138 /**
139 * Retrieve the user-defined settings.
140 *
141 * @return Slot settings
142 */
143 Settings getSettings();
144
145 /**
146 * Change the slot settings.
147 *
148 * @param settings New slot settings
149 *
150 * @return 0 if OK
151 * @return ERR_INVALID_PARAMS if any parameters are invalid
152 */
153 int setSettings(in Settings settings);
154
155 };
156
157 }
158
159 #endif /* !__PERIPHERAL_DEVICE_SLOT_IDL__ */
peripheral::DeviceSlot
Peripheral Device Slot.
Definition: PeripheralDeviceSlot.idl:66
peripheral::DeviceSlot::assignAddress
int assignAddress(in string packageClass, in Address address)
Associate this slot with an addressable (new) peripheral device.
peripheral::DeviceSlot::getDevice
Device getDevice()
Returns the actual device reference.
peripheral::DeviceSlot::getSettings
Settings getSettings()
Retrieve the user-defined settings.
peripheral::DeviceSlot::assign
int assign(in DeviceID devid)
Associate this slot with a given (old or detected new) peripheral device.
peripheral::DeviceSlot::unassign
int unassign()
Break the association for this slot.
peripheral::DeviceSlot::setSettings
int setSettings(in Settings settings)
Change the slot settings.
sensors::Sensor
Sensor interface
Definition: Sensor.idl:15
idl
Basic IDL definitions.
Definition: Event.idl:10
peripheral
Peripheral Devices.
Definition: GatewaySensorManager.idl:17
peripheral::PortType
PortType
peripheral device port types
Definition: PeripheralDeviceSlot.idl:17
peripheral::REMOTE_HUB_PORT
@ REMOTE_HUB_PORT
a RS485 remote hub port
Definition: PeripheralDeviceSlot.idl:22
peripheral::WIRELESS_BRIDGE
@ WIRELESS_BRIDGE
a wireless bridge, e.g. usb dongle
Definition: PeripheralDeviceSlot.idl:23
peripheral::WIRELESS_DEVICE
@ WIRELESS_DEVICE
a wireless device
Definition: PeripheralDeviceSlot.idl:24
peripheral::UNSPECIFIED
@ UNSPECIFIED
device type is unknown
Definition: PeripheralDeviceSlot.idl:25
peripheral::ONBOARD
@ ONBOARD
a built in, inaccessible port
Definition: PeripheralDeviceSlot.idl:18
peripheral::ONEWIRE_HUB_PORT
@ ONEWIRE_HUB_PORT
a port on a Hub
Definition: PeripheralDeviceSlot.idl:20
peripheral::ONEWIRE_CHAIN_POS
@ ONEWIRE_CHAIN_POS
a chain position
Definition: PeripheralDeviceSlot.idl:21
peripheral::GATEWAY_SENSOR
@ GATEWAY_SENSOR
a gateway sensor
Definition: PeripheralDeviceSlot.idl:26
peripheral::DEV_PORT
@ DEV_PORT
a sensor port on the device
Definition: PeripheralDeviceSlot.idl:19
sensors
Sensors Model.
Definition: AccumulatingNumericSensor.idl:13
idl::Event
Common base for all events.
Definition: Event.idl:13
peripheral::Address
peripheral device position based address
Definition: PeripheralDeviceSlot.idl:44
peripheral::Address::type
sensors::Sensor TypeSpec type
device's type spec
Definition: PeripheralDeviceSlot.idl:46
peripheral::Address::isActuator
boolean isActuator
true if device is an actuator
Definition: PeripheralDeviceSlot.idl:47
peripheral::Address::channel
int channel
Channel number.
Definition: PeripheralDeviceSlot.idl:48
peripheral::Address::position
vector< PosElement > position
Position within 1-wire topo.
Definition: PeripheralDeviceSlot.idl:45
peripheral::DeviceID
peripheral device identification
Definition: PeripheralDeviceSlot.idl:36
peripheral::DeviceID::isActuator
boolean isActuator
true if device is an actuator
Definition: PeripheralDeviceSlot.idl:39
peripheral::DeviceID::serial
string serial
Serial number.
Definition: PeripheralDeviceSlot.idl:37
peripheral::DeviceID::channel
int channel
Channel number.
Definition: PeripheralDeviceSlot.idl:40
peripheral::DeviceID::type
sensors::Sensor TypeSpec type
device's type spec
Definition: PeripheralDeviceSlot.idl:38
peripheral::DeviceSlot::DeviceChangedEvent
Event: The device attached to this slot has changed.
Definition: PeripheralDeviceSlot.idl:90
peripheral::DeviceSlot::DeviceChangedEvent::oldDevice
Device oldDevice
Device before change.
Definition: PeripheralDeviceSlot.idl:91
peripheral::DeviceSlot::DeviceChangedEvent::newDevice
Device newDevice
Device after change.
Definition: PeripheralDeviceSlot.idl:92
peripheral::DeviceSlot::Location
user writeable location
Definition: PeripheralDeviceSlot.idl:74
peripheral::DeviceSlot::Location::x
string x
X coordinate.
Definition: PeripheralDeviceSlot.idl:75
peripheral::DeviceSlot::Location::y
string y
Y coordinate.
Definition: PeripheralDeviceSlot.idl:76
peripheral::DeviceSlot::Location::z
string z
Z coordinate (semantics depends on ZCoordMode)
Definition: PeripheralDeviceSlot.idl:77
peripheral::DeviceSlot::SettingsChangedEvent
Event: The slot settings have been changed.
Definition: PeripheralDeviceSlot.idl:96
peripheral::DeviceSlot::SettingsChangedEvent::oldSettings
Settings oldSettings
Settings before change.
Definition: PeripheralDeviceSlot.idl:97
peripheral::DeviceSlot::SettingsChangedEvent::newSettings
Settings newSettings
Settings after change.
Definition: PeripheralDeviceSlot.idl:98
peripheral::DeviceSlot::Settings
user configurable slot attributes
Definition: PeripheralDeviceSlot.idl:81
peripheral::DeviceSlot::Settings::properties
map< string, string > properties
sensor specific settings
Definition: PeripheralDeviceSlot.idl:86
peripheral::DeviceSlot::Settings::name
string name
User-defined name.
Definition: PeripheralDeviceSlot.idl:82
peripheral::DeviceSlot::Settings::useDefaultThresholds
boolean useDefaultThresholds
use default thresholds
Definition: PeripheralDeviceSlot.idl:85
peripheral::DeviceSlot::Settings::location
Location location
user-defined device location
Definition: PeripheralDeviceSlot.idl:84
peripheral::DeviceSlot::Settings::description
string description
User-defined description.
Definition: PeripheralDeviceSlot.idl:83
peripheral::Device
A peripheral device is the collection of.
Definition: PeripheralDeviceSlot.idl:58
peripheral::Device::device
sensors::Sensor device
device reference
Definition: PeripheralDeviceSlot.idl:62
peripheral::Device::packageClass
string packageClass
physical package identifier
Definition: PeripheralDeviceSlot.idl:61
peripheral::Device::position
vector< PosElement > position
Position within 1-wire topo.
Definition: PeripheralDeviceSlot.idl:60
peripheral::Device::deviceID
DeviceID deviceID
device identification
Definition: PeripheralDeviceSlot.idl:59
peripheral::PosElement
peripheral device position element, list forms position
Definition: PeripheralDeviceSlot.idl:30
peripheral::PosElement::portType
PortType portType
type of the element
Definition: PeripheralDeviceSlot.idl:31
peripheral::PosElement::port
string port
value of the element, a label
Definition: PeripheralDeviceSlot.idl:32
sensors::Sensor::TypeSpec
Complete sensor type specification.
Definition: Sensor.idl:169