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