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