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