Loading...
Searching...
No Matches
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>
#include <PosElement.idl>
/** Peripheral Devices */
module peripheral {
/** peripheral device identification */
structure DeviceID {
string serial; ///< Serial number
sensors.Sensor.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 {
vector<PosElement> position; ///< Position within 1-wire topo
sensors.Sensor.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 {
DeviceID deviceID; ///< device identification
vector<PosElement> position; ///< Position within 1-wire topo
string packageClass; ///< physical package identifier
sensors.Sensor device; ///< device reference
};
/** Peripheral Device Slot */
interface DeviceSlot {
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 oldDevice; ///< Device before change
Device 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 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 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 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::DeviceSlot
Peripheral Device Slot.
Definition PeripheralDeviceSlot.idl:47
peripheral::DeviceSlot::CHANNEL_INVALID
constant int CHANNEL_INVALID
Device has no channels.
Definition PeripheralDeviceSlot.idl:52
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::ERR_NOT_SUPPORTED
constant int ERR_NOT_SUPPORTED
Operation not supported.
Definition PeripheralDeviceSlot.idl:50
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::ERR_INVALID_PARAMS
constant int ERR_INVALID_PARAMS
Invalid parameters.
Definition PeripheralDeviceSlot.idl:49
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
serial
Serial Ports.
Definition AnalogModem.idl:12
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::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