PeripheralDeviceSlot.idl
/* SPDX-License-Identifier: BSD-3-Clause */
/*
* Copyright 2012 Raritan Inc. All rights reserved.
*/
#ifndef __PERIPHERAL_DEVICE_SLOT_IDL__
#define __PERIPHERAL_DEVICE_SLOT_IDL__
#include <Sensor.idl>
#include <UserEvent.idl>
/** Peripheral Devices */
module peripheral {
/** peripheral device port types */
enumeration PortType {
ONEWIRE_ONBOARD, ///< a built in, inaccessible port
ONEWIRE_DEV_PORT, ///< a 1-wire port on the device
ONEWIRE_HUB_PORT, ///< a port on a Hub
ONEWIRE_CHAIN_POS ///< a chain position
};
/** peripheral device position element, list forms position */
structure PosElement {
PortType portType; ///< type of the element
string port; ///< value of the element, a label
};
/** peripheral device identification */
structure DeviceID_4_0_0 {
string serial; ///< Serial number
sensors.Sensor_4_0_3.TypeSpec type; ///< device's type spec
boolean isActuator; ///< true if device is an actuator
int channel; ///< Channel number
};
/** peripheral device position based address */
structure Address_4_0_0 {
vector<PosElement> position; ///< Position within 1-wire topo
sensors.Sensor_4_0_3.TypeSpec type; ///< device's type spec
boolean isActuator; ///< true if device is an actuator
int channel; ///< Channel number
};
/**
* A peripheral device is the collection of
* - device identification
* - device position
* - a flag indicating actuator type
* - device reference
*/
valueobject Device_3_0_2 {
DeviceID_4_0_0 deviceID; ///< device identification
vector<PosElement> position; ///< Position within 1-wire topo
string packageClass; ///< physical package identifier
sensors.Sensor_4_0_3 device; ///< device reference
};
/** Peripheral Device Slot */
interface DeviceSlot_2_0_3 {
constant int ERR_INVALID_PARAMS = 1; ///< Invalid parameters
constant int ERR_NOT_SUPPORTED = 2; ///< Operation not supported
constant int CHANNEL_INVALID = -1;///< Device has no channels
/** user writeable location */
structure Location {
string x; ///< X coordinate
string y; ///< Y coordinate
string z; ///< Z coordinate (semantics depends on ZCoordMode)
};
/** user configurable slot attributes */
structure Settings {
string name; ///< User-defined name
string description; ///< User-defined description
Location location; ///< user-defined device location
boolean useDefaultThresholds; ///< use default thresholds
map<string, string> properties; ///< sensor specific settings
};
/** Event: The device attached to this slot has changed */
valueobject DeviceChangedEvent extends idl.Event {
Device_3_0_2 oldDevice; ///< Device before change
Device_3_0_2 newDevice; ///< Device after change
};
/** Event: The slot settings have been changed */
valueobject SettingsChangedEvent extends event.UserEvent {
Settings oldSettings; ///< Settings before change
Settings newSettings; ///< Settings after change
};
/**
* Returns the actual device reference.
* The reference becomes invalid due to assign/unassign method
* call. This conditions is also flagged by EVT_KEY_DEVICE_CHANGED
* event
*/
Device_3_0_2 getDevice();
/**
* Associate this slot with a given (old or detected new) peripheral device.
*
* @param devid peripheral device identification
*
* @return 0 if OK
* @return ERR_INVALID_PARAMS if devid is unknown or invalid
*/
int assign(in DeviceID_4_0_0 devid);
/**
* Associate this slot with an addressable (new) peripheral device.
*
* @param address peripheral device address
*
* @return 0 if OK
* @return ERR_INVALID_PARAMS if address is invalid
*/
int assignAddress(in string packageClass, in Address_4_0_0 address);
/**
* Break the association for this slot.
* @return 0 if OK
* @return ERR_NOT_SUPPORTED if operation is not supported
* this is the case for sensors with
* complete position information
*/
int unassign();
/**
* Retrieve the user-defined settings.
*
* @return Slot settings
*/
Settings getSettings();
/**
* Change the slot settings.
*
* @param settings New slot settings
*
* @return 0 if OK
* @return ERR_INVALID_PARAMS if any parameters are invalid
*/
int setSettings(in Settings settings);
};
}
#endif /* !__PERIPHERAL_DEVICE_SLOT_IDL__ */
peripheral::DeviceID_4_0_0
peripheral device identification
Definition: PeripheralDeviceSlot.idl:30
peripheral::DeviceSlot_2_0_3::Location::z
string z
Z coordinate (semantics depends on ZCoordMode)
Definition: PeripheralDeviceSlot.idl:71
peripheral::ONEWIRE_CHAIN_POS
a chain position
Definition: PeripheralDeviceSlot.idl:20
peripheral::PosElement::port
string port
value of the element, a label
Definition: PeripheralDeviceSlot.idl:26
peripheral::DeviceSlot_2_0_3::Settings::name
string name
User-defined name.
Definition: PeripheralDeviceSlot.idl:76
peripheral
Peripheral Devices.
Definition: PeripheralDeviceManager.idl:17
peripheral::Address_4_0_0::channel
int channel
Channel number.
Definition: PeripheralDeviceSlot.idl:42
peripheral::DeviceSlot_2_0_3::Location::y
string y
Y coordinate.
Definition: PeripheralDeviceSlot.idl:70
peripheral::Device_3_0_2
valueobject Device_3_0_2
A peripheral device is the collection of.
Definition: PeripheralDeviceSlot.idl:52
peripheral::position
vector< PosElement > position
Position within 1-wire topo.
Definition: PeripheralDeviceSlot.idl:54
peripheral::Address_4_0_0
peripheral device position based address
Definition: PeripheralDeviceSlot.idl:38
peripheral::PosElement::portType
PortType portType
type of the element
Definition: PeripheralDeviceSlot.idl:25
peripheral::packageClass
string packageClass
physical package identifier
Definition: PeripheralDeviceSlot.idl:55
peripheral::Address_4_0_0::type
sensors::Sensor_4_0_3 TypeSpec type
device&#39;s type spec
Definition: PeripheralDeviceSlot.idl:40
peripheral::device
sensors::Sensor_4_0_3 device
device reference
Definition: PeripheralDeviceSlot.idl:56
peripheral::ONEWIRE_DEV_PORT
a 1-wire port on the device
Definition: PeripheralDeviceSlot.idl:18
idl
Basic IDL definitions.
Definition: Event.idl:10
peripheral::DeviceSlot_2_0_3::Settings
user configurable slot attributes
Definition: PeripheralDeviceSlot.idl:75
peripheral::DeviceSlot_2_0_3::Settings::useDefaultThresholds
boolean useDefaultThresholds
use default thresholds
Definition: PeripheralDeviceSlot.idl:79
peripheral::DeviceID_4_0_0::isActuator
boolean isActuator
true if device is an actuator
Definition: PeripheralDeviceSlot.idl:33
peripheral::Address_4_0_0::position
vector< PosElement > position
Position within 1-wire topo.
Definition: PeripheralDeviceSlot.idl:39
peripheral::DeviceID_4_0_0::type
sensors::Sensor_4_0_3 TypeSpec type
device&#39;s type spec
Definition: PeripheralDeviceSlot.idl:32
peripheral::DeviceSlot_2_0_3::Location
user writeable location
Definition: PeripheralDeviceSlot.idl:68
sensors::Sensor_4_0_3
Sensor interface
Definition: Sensor.idl:15
peripheral::DeviceSlot_2_0_3
Peripheral Device Slot.
Definition: PeripheralDeviceSlot.idl:60
sensors
Sensors Model.
Definition: AccumulatingNumericSensor.idl:13
sensors::Sensor_4_0_3::TypeSpec
Complete sensor type specification.
Definition: Sensor.idl:160
peripheral::DeviceID_4_0_0::channel
int channel
Channel number.
Definition: PeripheralDeviceSlot.idl:34
peripheral::DeviceSlot_2_0_3::Settings::description
string description
User-defined description.
Definition: PeripheralDeviceSlot.idl:77
peripheral::Address_4_0_0::isActuator
boolean isActuator
true if device is an actuator
Definition: PeripheralDeviceSlot.idl:41
peripheral::DeviceSlot_2_0_3::newDevice
Device_3_0_2 newDevice
Device after change.
Definition: PeripheralDeviceSlot.idl:86
peripheral::ONEWIRE_HUB_PORT
a port on a Hub
Definition: PeripheralDeviceSlot.idl:19
peripheral::DeviceSlot_2_0_3::Settings::location
Location location
user-defined device location
Definition: PeripheralDeviceSlot.idl:78
peripheral::PortType
PortType
peripheral device port types
Definition: PeripheralDeviceSlot.idl:16
peripheral::ONEWIRE_ONBOARD
a built in, inaccessible port
Definition: PeripheralDeviceSlot.idl:17
peripheral::DeviceID_4_0_0::serial
string serial
Serial number.
Definition: PeripheralDeviceSlot.idl:31
peripheral::DeviceSlot_2_0_3::newSettings
Settings newSettings
Settings after change.
Definition: PeripheralDeviceSlot.idl:92
peripheral::DeviceSlot_2_0_3::Settings::properties
map< string, string > properties
sensor specific settings
Definition: PeripheralDeviceSlot.idl:80
peripheral::PosElement
peripheral device position element, list forms position
Definition: PeripheralDeviceSlot.idl:24
peripheral::DeviceSlot_2_0_3::Location::x
string x
X coordinate.
Definition: PeripheralDeviceSlot.idl:69