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