mseeb.xml 13.4 KB
<?xml version="1.0" encoding="iso-8859-1"?>

<!--tabstop: 4 -->

<!--

+................................................+
:Domain:org.homegatewayinitiative                                  :
:                                                :
:  +..........................................+  :
:  :Module:BooleanState                       :  :
:  :                                          :  :
:  :  +....................................+  :  :
:  :  :Action:get                          :  :  :
:  :  +....................................+  :  :
:  :                                          :  :
:  :  +....................................+  :  :
:  :  :Action:setTarget                    :  :  :
:  :  +....................................+  :  :
:  +..........................................+  :
:                                                :
:  +..........................................+  :
:  :Device:MSEEB.root                         :  :
:  :                                          :  :
:  :  +....................................+  :  :
:  :  :Module<REF>:BooleanState            :  :  :
:  :  +....................................+  :  :
:  :                                          :  :
:  :  +....................................+  :  :
:  :  :Module:extensionBlockDataPoints     :  :  :
:  :  :                                    :  :  :
:  :  :  +..............................+  :  :  :
:  :  :  :DataPoint:firmwareVersion     :  :  :  :
:  :  :  +..............................+  :  :  :
:  :  :                                    :  :  :
:  :  :  +..............................+  :  :  :
:  :  :  :DataPoint:powerSwitchNames    :  :  :  :
:  :  :  +..............................+  :  :  :
:  :  +....................................+  :  :
:  :                                          :  :
:  :  +....................................+  :  :
:  :  :SubDevices                          :  :  :
:  :  :                                    :  :  :
:  :  :  +..............................+  :  :  :
:  :  :  :SubDevice:switch.power.1      :  :  :  :
:  :  :  :                              :  :  :  :
:  :  :  :+...........................+ :  :  :  :
:  :  :  ::Module<REF>:BooleanState   : :  :  :  :
:  :  :  :+...........................+ :  :  :  :
:  :  :  +..............................+  :  :  :
:  :  :                                    :  :  :
:  :  :  +..............................+  :  :  :
:  :  :  :SubDevice:switch.power.2      :  :  :  :
:  :  :  :                              :  :  :  :
:  :  :  :+...........................+ :  :  :  :
:  :  :  ::Module<REF>:BooleanState   : :  :  :  :
:  :  :  :+...........................+ :  :  :  :
:  :  :  +..............................+  :  :  :
:  :  +....................................+  :  :
:  +..........................................+  :
+................................................+

-->
<Domain xmlns:xi="http://www.w3.org/2001/XInclude"
    xmlns="http://homegatewayinitiative.org/xml/dal/3.0" 
    id="org.homegatewayinitiative">

<!-- The following import statements include ModuleClasses from HGI -->

    <Imports>
        <xi:include href="./dal-core.xml" parse="xml" />
    </Imports>

    <Modules>
        <ModuleClass name="BooleanState">
            <Doc>
                <tt>BooleanState</tt> is the preferred module for modelling a functionality corresponding to an underlying binary state.This module should be used to abstract away from the actual datatype and values in question. Note that the module does not define whether the execution mode is blocking or non-blocking.
            </Doc>
            <Actions>
                <Action name="get" optional="true">
                    <Doc>
                        Obtain the current associated state.
                    </Doc>
                    <DataType>
                        <SimpleType type="boolean" />
                    </DataType>
                </Action>
                <Action name="setTarget">
                    <Doc>
                        Set the associated state to the specified value.
                    </Doc>
                    <Args>
                        <Arg name="value">
                            <Doc>
                            The desired value of the associated state.
                            </Doc>
                            <DataType>
                                <SimpleType type="boolean" />
                            </DataType>
                        </Arg>
                    </Args>
                </Action>
          </Actions>
          <Events>
                <Event name="stateChanged" optional="true">
                    <Data>
                        <DataPoint name="state" readable="true">
                            <DataType>
                        		<SimpleType type="boolean" />
                            </DataType>
                        </DataPoint>
                    </Data>
                </Event>      
          </Events>
        </ModuleClass>
    </Modules>

<!-- Definition of the Device starts here. -->

    <Devices>

<!-- The Device contains several sub-devices and offers one action on its own. -->

        <Device id="MSEEB.root">
            <Doc>
                This device is intended as a demonstration of how to define a Root Device with multiple sub-devices.
            </Doc>
            <Properties>
                <Property name="Name">
                    <Doc>Original value: Multi Socket Electrical-Extension-Block</Doc>
                    <SimpleType type="string" />
                </Property>
                <Property name="Vendor">
                    <Doc>Original value: HGI</Doc>
                    <SimpleType type="string" />
                </Property>
                <Property name="FirmwareVersion">
                  <Doc>Original value: 1.0</Doc>
                  <SimpleType type="string" />
                </Property>
                <Property name="VendorURL">
                  <Doc>Original value: http://www.homegatewayinitative.org</Doc>
                  <SimpleType type="uri" />
                </Property>
                <Property name="SerialNumber">
                  <Doc>Original value: 1234.5</Doc>
                  <SimpleType type="string" />
                </Property>
            </Properties>

<!-- These are the modules for the device:
    - Switch on/off all contained switches. It inherits from hgi.dal.core.BooleanState.
    - A module with some data points for the firmware version of the whole device and a list of names of the containted power switches.
-->

            <Modules>
                <Module name="rootPowerOnOff" optional="true">
                    <extends domain="hgi.dal.core" class="BooleanState"/>
                    <Doc>
                        The proprietry interface for turning all switches of the extension block on and off. 
                        The action "BooleanState:get" returns "true" when any of the sub-devices is in the state "on", otherwise it returns "false".
                    </Doc>
                    <Properties>
                        <Property name="version" value="1.0.0">
                            <Doc>Version for this ModuleClass</Doc>
                            <SimpleType type="string" />
                        </Property>
                    </Properties>
                </Module>
                <Module name="power">
                    <Actions>
                    	<Action name="getPowerConsumption">
                            <Doc>Get the power consumption.</Doc>
                            <DataType name="consumption">
                    			<Struct>
                                    <DataType name="values">
                        				<Array>
                                           <DataType>
                                                <Doc>This is an example simple data type with a minimum-value constraint.</Doc>
                            					<SimpleType type="float" />
                                                <Constraints>
                                                    <Constraint name="minValue" type="float" value="0.0">
                                                        <Doc>The value must be equal or greater 0.0</Doc>
                                                    </Constraint>
                                                      <Constraint name="step" type="float" value="0.1">
                                                        <Doc>Steps are 0.1</Doc>
                                                    </Constraint>
                                                </Constraints>
                                            </DataType>
                				        </Array>
                                    </DataType>
                                    <DataType name="timeFrame">
                        				<Array>
                                            <DataType>
                            					<SimpleType type="datetime" />
                                            </DataType>
                				        </Array>
                                    </DataType>
                                </Struct>
                            </DataType>
                    	</Action>
                    </Actions>
                </Module>

                <Module name="extensionBlockDataPoints">
                    <Actions>
                        <Action name="getNames">
                            <DataType name="names">
                                <Array>
                                    <DataType>
                                        <SimpleType type="string" />
                                    </DataType>
                                </Array>
                            </DataType>
                        </Action>
                    </Actions>
                    <Data>
                        <DataPoint  name="firmwareVersion" 
                                    writable="false"
                                    readable="true">
                            <Doc>
                                This datapoint represents the firmware version of the extension block.
                            </Doc>
                            <DataType>
                                <SimpleType type="string" />
                            </DataType>
                        </DataPoint>
                        
                        <DataPoint  name="powerSwitchNames"
                                    writable="false"
                                    readable="true">
                            <Doc>
                                This datapoint is an array of strings with the names of the contained devices.
                            </Doc>
                            <DataType>
                                <Array>
                                    <DataType>
                                        <SimpleType type="string" />
                                    </DataType>
                                </Array>
                            </DataType>
                        </DataPoint>
                    </Data>
                </Module>
            </Modules>

<!-- Definition of sub-devices starts here. -->

            <SubDevices>

<!-- This is the first power switch of the extension block. For sake of simplicity no new ModuleClasses are defined, but only referenced.
-->

                <SubDevice id="switch.power.1">
                    <Doc>
                        This sub device is intended as a demonstration of how to use the abstract modules defined in the <em>HGI Core</em> domain.
                    </Doc>
                    <Properties>
                        <Property name="Name" value="PowerSwitch 1">
                            <SimpleType type="string" />
                        </Property>
                        <Property name="Vendor" value="HGI">
                            <SimpleType type="string" />
                        </Property>
                    </Properties>
                    <Modules>
                        <Module name="power">
                            <extends domain="hgi.dal.core" class="BooleanState"/>
                        </Module>
                    </Modules>
                </SubDevice>

<!-- This is the second power switch of the extension block. -->

                <SubDevice id="switch.power.2">
                    <Doc>
                        This sub device is intended as a demonstration of how to use the abstract modules defined in the <em>HGI Core</em> domain.
                    </Doc>
                    <Properties>
                        <Property name="Name" value="PowerSwitch 2">
                            <SimpleType type="string" />
                        </Property>
                        <Property name="Vendor" value="HGI">
                            <SimpleType type="string" />
                        </Property>
                        <Property name="VendorURL" value="http://homegatwaysinitiative.org">
                            <SimpleType type="uri" />
                        </Property>
                        <Property name="maximumAltitude" value="2800">
                            <SimpleType type="integer" />
                        </Property>
                    </Properties>
                    <Modules>
                        <Module name="power">
                            <extends domain="hgi.dal.core" class="BooleanState"/>
                        </Module>
                    </Modules>
                </SubDevice>

            </SubDevices>

        </Device>
    </Devices>
</Domain>