Loading...
Searching...
No Matches
Port.idl
/* SPDX-License-Identifier: BSD-3-Clause */
/*
* Copyright 2011 Raritan Inc. All rights reserved.
*/
#ifndef __PORTSMODEL_PORT_IDL__
#define __PORTSMODEL_PORT_IDL__
#include <Event.idl>
#include <PortFuse.idl>
#include <PosElement.idl>
/**
* Ports
*/
module portsmodel {
/** Port interface */
interface Port {
/** Error codes */
constant int NO_ERROR = 0; ///< operation successful, no error
constant int ERR_INVALID_PARAM = 1; ///< invalid parameter for an operation
constant int ERR_DEVICE_BUSY = 2; ///< operation fails because connected device is busy
/** Port detection type */
enumeration DetectionType {
AUTO, ///< auto detection of connected devices
PINNED, ///< port is pinned to a specific device type
DISABLED ///< port is disabled and will not detect any device connected
};
/** devices types that may be connected to port */
[unknown_fallback("OTHER")]
enumeration DeviceTypeId {
UNSPECIFIED, ///< not specified, means "not detected" in Properties.detectedDeviceTypeId
OTHER, ///< other types, not listet below
SENSOR_HUB, ///< sensor hub
BEEPER, ///< external beeper
ASSET_STRIP, ///< asset strip
POWER_CIM, ///< power cim
GATEWAY_SENSOR ///< modbus RTU gateway sensor
};
structure DeviceTypeWithId {
DeviceTypeId id; ///< device type ID
string type; ///< device type string
};
/** Port detection mode */
structure DetectionMode {
DetectionType type; ///< detection type: auto or pinned
string pinnedDeviceType; ///< contains specific device type in pinned mode, not used for auto
};
/** Port properties */
structure Properties {
string name; ///< user defineable name - NOT USED RIGHT NOW!
string label; ///< label on device
DetectionMode mode; ///< detection mode
string detectedDeviceType; ///< detected device type or empty if nothing connected
string detectedDeviceName; ///< detected device name or empty if nothing connected
DeviceTypeId pinnedDeviceTypeId; ///< contains specific device type ID in pinned mode, or UNSPECIFIED if not pinned
DeviceTypeId detectedDeviceTypeId; ///< detected device type ID or UNSPECIFIED if nothing connected
vector<DeviceTypeWithId> detectableDeviceTypes; ///< all detectable devices of this port as ID-string pairs
string topoId; ///< short id depending on position, e.g. 'REMOTE-HUB-1' or 'USB-2-1-4'
string serialId; ///< serial number of device, e.g. for USB Dongle, maybe empty
peripheral.PortType portType; ///< machine-readable port type information
vector<peripheral.PosElement> position; ///< full machine-readable position information
};
/** Event: The port properties have changed */
valueobject PropertiesChangedEvent extends idl.Event {
Properties oldProperties; ///< Properties before change
Properties newProperties; ///< Properties after change
};
/** Event: The device connected to the port has changed */
valueobject DeviceChangedEvent extends idl.Event {
Object oldDevice; ///< Connected device before change
Object newDevice; ///< Connected device after change
};
/**
* Get the current properties of the port
*
* @return Properties of the Port
*/
Properties getProperties();
/**
* NOT USED RIGHT NOW!
*
* Set the port name
*
* @param name new port name
*/
void setName(in string name);
/**
* Set the detection mode for the port
*
* @param mode new detection mode
* @return NO_ERROR on success
* @return ERR_INVALID_PARAM invalid parameter
* @return ERR_DEVICE_BUSY device busy (e.g. Asset Strip Firmware Update)
*/
int setDetectionMode(in DetectionMode mode);
/**
* Get all detectable devices of this port
*
* @return List of all registered detectable Devices as strings
*/
vector<string> getDetectableDevices();
/**
* Get the connected device of the port
*
* @return Device connected to Port
*/
Object getDevice();
/**
* Get device type specific configuration interface.
*
* @param deviceType Device type to get configuration interface for
*
* @return Device configuration interface
*/
Object getDeviceConfig(in string deviceType);
/**
* Get the fuse for this port
*
* @return A fuse instance, if available
*/
PortFuse getFuse();
};
}
#endif /* __PORTSMODEL_PORT_IDL__ */
portsmodel::PortFuse
Interface describing a controllable fuse for a device port.
Definition PortFuse.idl:17
portsmodel::Port
Port interface.
Definition Port.idl:19
portsmodel::Port::getDeviceConfig
Object getDeviceConfig(in string deviceType)
Get device type specific configuration interface.
portsmodel::Port::DetectionType
DetectionType
Port detection type.
Definition Port.idl:27
portsmodel::Port::PINNED
@ PINNED
port is pinned to a specific device type
Definition Port.idl:29
portsmodel::Port::AUTO
@ AUTO
auto detection of connected devices
Definition Port.idl:28
portsmodel::Port::DeviceTypeId
DeviceTypeId
devices types that may be connected to port
Definition Port.idl:35
portsmodel::Port::UNSPECIFIED
@ UNSPECIFIED
not specified, means "not detected" in Properties::detectedDeviceTypeId
Definition Port.idl:36
portsmodel::Port::SENSOR_HUB
@ SENSOR_HUB
sensor hub
Definition Port.idl:38
portsmodel::Port::BEEPER
@ BEEPER
external beeper
Definition Port.idl:39
portsmodel::Port::OTHER
@ OTHER
other types, not listet below
Definition Port.idl:37
portsmodel::Port::ASSET_STRIP
@ ASSET_STRIP
asset strip
Definition Port.idl:40
portsmodel::Port::POWER_CIM
@ POWER_CIM
power cim
Definition Port.idl:41
portsmodel::Port::getDevice
Object getDevice()
Get the connected device of the port.
portsmodel::Port::setName
void setName(in string name)
NOT USED RIGHT NOW!
portsmodel::Port::setDetectionMode
int setDetectionMode(in DetectionMode mode)
Set the detection mode for the port.
portsmodel::Port::getDetectableDevices
vector< string > getDetectableDevices()
Get all detectable devices of this port.
portsmodel::Port::getProperties
Properties getProperties()
Get the current properties of the port.
portsmodel::Port::getFuse
PortFuse getFuse()
Get the fuse for this port.
idl
Basic IDL definitions.
Definition Event.idl:10
peripheral
Peripheral Devices.
Definition GatewaySensorManager.idl:17
portsmodel
Ports.
Definition Port.idl:16
idl::Event
Common base for all events.
Definition Event.idl:13
peripheral::PosElement
peripheral device position element, list forms position
Definition PosElement.idl:31
portsmodel::Port::DetectionMode
Port detection mode.
Definition Port.idl:51
portsmodel::Port::DetectionMode::pinnedDeviceType
string pinnedDeviceType
contains specific device type in pinned mode, not used for auto
Definition Port.idl:53
portsmodel::Port::DetectionMode::type
DetectionType type
detection type: auto or pinned
Definition Port.idl:52
portsmodel::Port::DeviceChangedEvent
Event: The device connected to the port has changed.
Definition Port.idl:79
portsmodel::Port::DeviceChangedEvent::oldDevice
Object oldDevice
Connected device before change.
Definition Port.idl:80
portsmodel::Port::DeviceChangedEvent::newDevice
Object newDevice
Connected device after change.
Definition Port.idl:81
portsmodel::Port::DeviceTypeWithId
Definition Port.idl:45
portsmodel::Port::DeviceTypeWithId::type
string type
device type string
Definition Port.idl:47
portsmodel::Port::DeviceTypeWithId::id
DeviceTypeId id
device type ID
Definition Port.idl:46
portsmodel::Port::PropertiesChangedEvent
Event: The port properties have changed.
Definition Port.idl:73
portsmodel::Port::PropertiesChangedEvent::newProperties
Properties newProperties
Properties after change.
Definition Port.idl:75
portsmodel::Port::PropertiesChangedEvent::oldProperties
Properties oldProperties
Properties before change.
Definition Port.idl:74
portsmodel::Port::Properties
Port properties.
Definition Port.idl:57
portsmodel::Port::Properties::topoId
string topoId
short id depending on position, e.g. 'REMOTE-HUB-1' or 'USB-2-1-4'
Definition Port.idl:66
portsmodel::Port::Properties::mode
DetectionMode mode
detection mode
Definition Port.idl:60
portsmodel::Port::Properties::detectedDeviceTypeId
DeviceTypeId detectedDeviceTypeId
detected device type ID or UNSPECIFIED if nothing connected
Definition Port.idl:64
portsmodel::Port::Properties::serialId
string serialId
serial number of device, e.g. for USB Dongle, maybe empty
Definition Port.idl:67
portsmodel::Port::Properties::portType
peripheral::PortType portType
machine-readable port type information
Definition Port.idl:68
portsmodel::Port::Properties::position
vector< peripheral::PosElement > position
full machine-readable position information
Definition Port.idl:69
portsmodel::Port::Properties::label
string label
label on device
Definition Port.idl:59
portsmodel::Port::Properties::detectedDeviceType
string detectedDeviceType
detected device type or empty if nothing connected
Definition Port.idl:61
portsmodel::Port::Properties::name
string name
user defineable name - NOT USED RIGHT NOW!
Definition Port.idl:58
portsmodel::Port::Properties::detectableDeviceTypes
vector< DeviceTypeWithId > detectableDeviceTypes
all detectable devices of this port as ID-string pairs
Definition Port.idl:65
portsmodel::Port::Properties::pinnedDeviceTypeId
DeviceTypeId pinnedDeviceTypeId
contains specific device type ID in pinned mode, or UNSPECIFIED if not pinned
Definition Port.idl:63
portsmodel::Port::Properties::detectedDeviceName
string detectedDeviceName
detected device name or empty if nothing connected
Definition Port.idl:62