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 */
88 Device getDevice();
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 */
124 Settings getSettings();
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::DeviceSlot
Peripheral Device Slot.
Definition PeripheralDeviceSlot.idl:47
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
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:25
peripheral::Address::type
sensors::Sensor TypeSpec type
device's type spec
Definition PeripheralDeviceSlot.idl:27
peripheral::Address::isActuator
boolean isActuator
true if device is an actuator
Definition PeripheralDeviceSlot.idl:28
peripheral::Address::channel
int channel
Channel number.
Definition PeripheralDeviceSlot.idl:29
peripheral::Address::position
vector< PosElement > position
Position within 1-wire topo.
Definition PeripheralDeviceSlot.idl:26
peripheral::DeviceID
peripheral device identification
Definition PeripheralDeviceSlot.idl:17
peripheral::DeviceID::isActuator
boolean isActuator
true if device is an actuator
Definition PeripheralDeviceSlot.idl:20
peripheral::DeviceID::serial
string serial
Serial number.
Definition PeripheralDeviceSlot.idl:18
peripheral::DeviceID::channel
int channel
Channel number.
Definition PeripheralDeviceSlot.idl:21
peripheral::DeviceID::type
sensors::Sensor TypeSpec type
device's type spec
Definition PeripheralDeviceSlot.idl:19
peripheral::DeviceSlot::DeviceChangedEvent
Event: The device attached to this slot has changed.
Definition PeripheralDeviceSlot.idl:71
peripheral::DeviceSlot::DeviceChangedEvent::oldDevice
Device oldDevice
Device before change.
Definition PeripheralDeviceSlot.idl:72
peripheral::DeviceSlot::DeviceChangedEvent::newDevice
Device newDevice
Device after change.
Definition PeripheralDeviceSlot.idl:73
peripheral::DeviceSlot::Location
user writeable location
Definition PeripheralDeviceSlot.idl:55
peripheral::DeviceSlot::Location::x
string x
X coordinate.
Definition PeripheralDeviceSlot.idl:56
peripheral::DeviceSlot::Location::y
string y
Y coordinate.
Definition PeripheralDeviceSlot.idl:57
peripheral::DeviceSlot::Location::z
string z
Z coordinate (semantics depends on ZCoordMode)
Definition PeripheralDeviceSlot.idl:58
peripheral::DeviceSlot::SettingsChangedEvent
Event: The slot settings have been changed.
Definition PeripheralDeviceSlot.idl:77
peripheral::DeviceSlot::SettingsChangedEvent::oldSettings
Settings oldSettings
Settings before change.
Definition PeripheralDeviceSlot.idl:78
peripheral::DeviceSlot::SettingsChangedEvent::newSettings
Settings newSettings
Settings after change.
Definition PeripheralDeviceSlot.idl:79
peripheral::DeviceSlot::Settings
user configurable slot attributes
Definition PeripheralDeviceSlot.idl:62
peripheral::DeviceSlot::Settings::properties
map< string, string > properties
sensor specific settings
Definition PeripheralDeviceSlot.idl:67
peripheral::DeviceSlot::Settings::name
string name
User-defined name.
Definition PeripheralDeviceSlot.idl:63
peripheral::DeviceSlot::Settings::useDefaultThresholds
boolean useDefaultThresholds
use default thresholds
Definition PeripheralDeviceSlot.idl:66
peripheral::DeviceSlot::Settings::location
Location location
user-defined device location
Definition PeripheralDeviceSlot.idl:65
peripheral::DeviceSlot::Settings::description
string description
User-defined description.
Definition PeripheralDeviceSlot.idl:64
peripheral::Device
A peripheral device is the collection of.
Definition PeripheralDeviceSlot.idl:39
peripheral::Device::device
sensors::Sensor device
device reference
Definition PeripheralDeviceSlot.idl:43
peripheral::Device::packageClass
string packageClass
physical package identifier
Definition PeripheralDeviceSlot.idl:42
peripheral::Device::position
vector< PosElement > position
Position within 1-wire topo.
Definition PeripheralDeviceSlot.idl:41
peripheral::Device::deviceID
DeviceID deviceID
device identification
Definition PeripheralDeviceSlot.idl:40
sensors::Sensor::TypeSpec
Complete sensor type specification.
Definition Sensor.idl:177