Skip to content
Snippets Groups Projects
Commit c1a9f54f authored by ankraft's avatar ankraft
Browse files

Fixed optionals in XSD.

Fixed various examples.
parent ea53785e
No related branches found
No related tags found
No related merge requests found
start = Domain start = Domain
Domain = Domain =
element Domain { element Domain {
# still having some problems with included documents ... # still having some problems with included documents ...
...@@ -13,27 +12,28 @@ Domain = ...@@ -13,27 +12,28 @@ Domain =
# </attribute> # </attribute>
attribute xml:base { xsd:anyURI }?, attribute xml:base { xsd:anyURI }?,
attribute id { xsd:ID }, attribute id { xsd:ID },
Imports, Doc,
element Imports { Domain* }?,
element Modules { element Modules {
element ModuleClass { ModuleDef }* element ModuleClass { ModuleDef }*
}?, }?,
element Devices { element Devices {
element Device { element Device {
attribute id { xsd:Name }, attribute id { xsd:Name },
DeviceInfo,
Doc, Doc,
DeviceInfo,
Modules?, Modules?,
element SubDevices { element SubDevices {
element SubDevice { DeviceDef }* element SubDevice {
attribute id { xsd:Name },
Doc,
DeviceInfo,
Modules?
}*
}? }?
}* }*
}? }?
} }
DeviceDef =
attribute id { xsd:Name },
DeviceInfo,
Doc,
Modules?
DeviceInfo = DeviceInfo =
element DeviceInfo { element DeviceInfo {
element Name { text } element Name { text }
...@@ -42,7 +42,29 @@ DeviceInfo = ...@@ -42,7 +42,29 @@ DeviceInfo =
& element SerialNumber { text }? & element SerialNumber { text }?
& element VendorURL { xsd:anyURI }? & element VendorURL { xsd:anyURI }?
} }
DataType = DataTypeElement = element DataType { DataTypeDef }
DataTypeDef =
# Discuss: Doc on DataType?
attribute unitOfMeasure { text }?,
(StructType | ArrayType | SimpleType)
StructType =
element Struct {
attribute name { text }?,
DataTypeDef+
}
ArrayType =
element Array {
attribute name { text }?,
DataTypeDef
}
SimpleType =
element SimpleType {
attribute name { text }?,
attribute type { BasicType }
# TODO Constraints
}
BasicType =
"integer" "integer"
| "boolean" | "boolean"
| "string" | "string"
...@@ -88,13 +110,13 @@ Actions = ...@@ -88,13 +110,13 @@ Actions =
element Actions { element Actions {
element Action { element Action {
attribute name { text }, attribute name { text },
attribute type { DataType }?,
attribute optional { xsd:boolean }?, attribute optional { xsd:boolean }?,
Doc, Doc,
DataTypeDef?,
element Arg { element Arg {
attribute name { text }, attribute name { text },
attribute type { DataType }, Doc,
Doc DataTypeDef
}* }*
}* }*
} }
...@@ -103,11 +125,11 @@ Data = ...@@ -103,11 +125,11 @@ Data =
element DataPoint { element DataPoint {
attribute name { text }, attribute name { text },
attribute optional { xsd:boolean }?, attribute optional { xsd:boolean }?,
attribute type { DataType },
attribute writable { xsd:boolean }?, attribute writable { xsd:boolean }?,
attribute readable { xsd:boolean }?, attribute readable { xsd:boolean }?,
attribute eventable { xsd:boolean }?, attribute eventable { xsd:boolean }?,
Doc Doc,
DataTypeDef
}* }*
} }
Events = Events =
...@@ -115,7 +137,7 @@ Events = ...@@ -115,7 +137,7 @@ Events =
element Event { element Event {
attribute name { text }, attribute name { text },
attribute optional { xsd:boolean }?, attribute optional { xsd:boolean }?,
Data, Doc,
Doc Data
}* }*
} }
...@@ -6,16 +6,6 @@ ...@@ -6,16 +6,6 @@
<ref name="Domain"/> <ref name="Domain"/>
</start> </start>
<define name="Imports">
<optional>
<element name="Imports">
<zeroOrMore>
<ref name="Domain"/>
</zeroOrMore>
</element>
</optional>
</define>
<define name="Domain"> <define name="Domain">
<element name="Domain"> <element name="Domain">
<optional> <optional>
...@@ -38,7 +28,14 @@ ...@@ -38,7 +28,14 @@
<attribute name="id"> <attribute name="id">
<data type="ID"/> <data type="ID"/>
</attribute> </attribute>
<ref name="Imports"/> <ref name="Doc"/>
<optional>
<element name="Imports">
<zeroOrMore>
<ref name="Domain"/>
</zeroOrMore>
</element>
</optional>
<optional> <optional>
<element name="Modules"> <element name="Modules">
<zeroOrMore> <zeroOrMore>
...@@ -55,20 +52,27 @@ ...@@ -55,20 +52,27 @@
<attribute name="id"> <attribute name="id">
<data type="Name"/> <data type="Name"/>
</attribute> </attribute>
<ref name="DeviceInfo"/>
<ref name="Doc"/> <ref name="Doc"/>
<ref name="DeviceInfo"/>
<optional> <optional>
<ref name="Modules"/> <ref name="Modules"/>
</optional> </optional>
<optional> <optional>
<element name="SubDevices"> <element name="SubDevices">
<zeroOrMore> <zeroOrMore>
<element name="SubDevice"> <element name="SubDevice">
<ref name="DeviceDef"/> <attribute name="id">
</element> <data type="Name"/>
</zeroOrMore> </attribute>
</element> <ref name="Doc"/>
</optional> <ref name="DeviceInfo"/>
<optional>
<ref name="Modules"/>
</optional>
</element>
</zeroOrMore>
</element>
</optional>
</element> </element>
</zeroOrMore> </zeroOrMore>
</element> </element>
...@@ -76,17 +80,6 @@ ...@@ -76,17 +80,6 @@
</element> </element>
</define> </define>
<define name="DeviceDef">
<attribute name="id">
<data type="Name"/>
</attribute>
<ref name="DeviceInfo"/>
<ref name="Doc"/>
<optional>
<ref name="Modules"/>
</optional>
</define>
<define name="DeviceInfo"> <define name="DeviceInfo">
<element name="DeviceInfo"> <element name="DeviceInfo">
...@@ -117,7 +110,70 @@ ...@@ -117,7 +110,70 @@
</define> </define>
<define name="DataType"> <define name="DataTypeElement">
<element name="DataType">
<ref name="DataTypeDef" />
</element>
</define>
<define name="DataTypeDef">
<!-- Discuss: Doc on DataType? -->
<optional>
<attribute name="unitOfMeasure">
<text/>
</attribute>
</optional>
<choice>
<ref name="StructType" />
<ref name="ArrayType" />
<ref name="SimpleType" />
</choice>
</define>
<define name="StructType">
<element name="Struct">
<optional>
<attribute name="name">
<text/>
</attribute>
</optional>
<oneOrMore>
<ref name="DataTypeDef" />
</oneOrMore>
</element>
</define>
<define name="ArrayType">
<element name="Array">
<optional>
<attribute name="name">
<text/>
</attribute>
</optional>
<ref name="DataTypeDef" />
</element>
</define>
<define name="SimpleType">
<element name="SimpleType">
<optional>
<attribute name="name">
<text/>
</attribute>
</optional>
<attribute name="type">
<ref name="BasicType" />
</attribute>
<!-- TODO Constraints -->
</element>
</define>
<define name="BasicType">
<choice> <choice>
<value>integer</value> <value>integer</value>
<value>boolean</value> <value>boolean</value>
...@@ -134,6 +190,7 @@ ...@@ -134,6 +190,7 @@
</choice> </choice>
</define> </define>
<define name="DocText"> <define name="DocText">
<zeroOrMore> <zeroOrMore>
<choice> <choice>
...@@ -224,24 +281,20 @@ ...@@ -224,24 +281,20 @@
<attribute name="name"> <attribute name="name">
<text/> <text/>
</attribute> </attribute>
<optional>
<attribute name="type">
<ref name="DataType"/>
</attribute>
</optional>
<optional> <optional>
<attribute name="optional"> <attribute name="optional">
<data type="boolean"/> <data type="boolean"/>
</attribute> </attribute>
</optional> </optional>
<ref name="Doc"/> <ref name="Doc"/>
<optional>
<ref name="DataTypeDef"/>
</optional>
<zeroOrMore> <zeroOrMore>
<element name="Arg"> <element name="Arg">
<attribute name="name"/> <attribute name="name"/>
<attribute name="type">
<ref name="DataType"/>
</attribute>
<ref name="Doc"/> <ref name="Doc"/>
<ref name="DataTypeDef"/>
</element> </element>
</zeroOrMore> </zeroOrMore>
</element> </element>
...@@ -262,9 +315,6 @@ ...@@ -262,9 +315,6 @@
<data type="boolean"/> <data type="boolean"/>
</attribute> </attribute>
</optional> </optional>
<attribute name="type">
<ref name="DataType"/>
</attribute>
<optional> <optional>
<attribute name="writable"> <attribute name="writable">
<data type="boolean"/> <data type="boolean"/>
...@@ -281,6 +331,7 @@ ...@@ -281,6 +331,7 @@
</attribute> </attribute>
</optional> </optional>
<ref name="Doc"/> <ref name="Doc"/>
<ref name="DataTypeDef"/>
</element> </element>
</zeroOrMore> </zeroOrMore>
</element> </element>
...@@ -299,13 +350,12 @@ ...@@ -299,13 +350,12 @@
<data type="boolean"/> <data type="boolean"/>
</attribute> </attribute>
</optional> </optional>
<ref name="Data" />
<ref name="Doc"/> <ref name="Doc"/>
<ref name="Data" />
</element> </element>
</zeroOrMore> </zeroOrMore>
</element> </element>
</define> </define>
</grammar> </grammar>
...@@ -5,22 +5,11 @@ ...@@ -5,22 +5,11 @@
elementFormDefault="qualified"> elementFormDefault="qualified">
<xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/03/xml.xsd"/> <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/03/xml.xsd"/>
<xs:group name="Imports">
<xs:sequence>
<xs:element minOccurs="0" ref="Imports"/>
</xs:sequence>
</xs:group>
<xs:element name="Imports">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="Domain"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Domain"> <xs:element name="Domain">
<xs:complexType> <xs:complexType>
<xs:sequence> <xs:sequence>
<xs:group ref="Imports"/> <xs:group ref="Doc"/>
<xs:element minOccurs="0" ref="Imports"/>
<xs:element minOccurs="0" name="Modules"> <xs:element minOccurs="0" name="Modules">
<xs:complexType> <xs:complexType>
<xs:sequence> <xs:sequence>
...@@ -34,6 +23,13 @@ ...@@ -34,6 +23,13 @@
<xs:attribute name="id" use="required" type="xs:ID"/> <xs:attribute name="id" use="required" type="xs:ID"/>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="Imports">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="Domain"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ModuleClass" type="ModuleDef"/> <xs:element name="ModuleClass" type="ModuleDef"/>
<xs:element name="Devices"> <xs:element name="Devices">
<xs:complexType> <xs:complexType>
...@@ -45,8 +41,8 @@ ...@@ -45,8 +41,8 @@
<xs:element name="Device"> <xs:element name="Device">
<xs:complexType> <xs:complexType>
<xs:sequence> <xs:sequence>
<xs:element ref="DeviceInfo"/>
<xs:group ref="Doc"/> <xs:group ref="Doc"/>
<xs:element ref="DeviceInfo"/>
<xs:element minOccurs="0" ref="Modules"/> <xs:element minOccurs="0" ref="Modules"/>
<xs:element minOccurs="0" ref="SubDevices"/> <xs:element minOccurs="0" ref="SubDevices"/>
</xs:sequence> </xs:sequence>
...@@ -60,15 +56,16 @@ ...@@ -60,15 +56,16 @@
</xs:sequence> </xs:sequence>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="SubDevice" type="DeviceDef"/> <xs:element name="SubDevice">
<xs:complexType name="DeviceDef"> <xs:complexType>
<xs:sequence> <xs:sequence>
<xs:element ref="DeviceInfo"/> <xs:group ref="Doc"/>
<xs:group ref="Doc"/> <xs:element ref="DeviceInfo"/>
<xs:element minOccurs="0" ref="Modules"/> <xs:element minOccurs="0" ref="Modules"/>
</xs:sequence> </xs:sequence>
<xs:attribute name="id" use="required" type="xs:Name"/> <xs:attribute name="id" use="required" type="xs:Name"/>
</xs:complexType> </xs:complexType>
</xs:element>
<xs:element name="DeviceInfo"> <xs:element name="DeviceInfo">
<xs:complexType> <xs:complexType>
<xs:all> <xs:all>
...@@ -85,7 +82,43 @@ ...@@ -85,7 +82,43 @@
<xs:element name="FirmwareVersion" type="xs:string"/> <xs:element name="FirmwareVersion" type="xs:string"/>
<xs:element name="SerialNumber" type="xs:string"/> <xs:element name="SerialNumber" type="xs:string"/>
<xs:element name="VendorURL" type="xs:anyURI"/> <xs:element name="VendorURL" type="xs:anyURI"/>
<xs:simpleType name="DataType"> <xs:element name="DataType">
<xs:complexType>
<xs:sequence>
<xs:element ref="DataTypeDef"/>
</xs:sequence>
<xs:attributeGroup ref="DataTypeDef"/>
</xs:complexType>
</xs:element>
<xs:element name="DataTypeDef" abstract="true"/>
<xs:attributeGroup name="DataTypeDef">
<xs:attribute name="unitOfMeasure"/>
</xs:attributeGroup>
<xs:element name="Struct" substitutionGroup="DataTypeDef">
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="DataTypeDef"/>
</xs:sequence>
<xs:attribute name="name"/>
<xs:attributeGroup ref="DataTypeDef"/>
</xs:complexType>
</xs:element>
<xs:element name="Array" substitutionGroup="DataTypeDef">
<xs:complexType>
<xs:sequence>
<xs:element ref="DataTypeDef"/>
</xs:sequence>
<xs:attribute name="name"/>
<xs:attributeGroup ref="DataTypeDef"/>
</xs:complexType>
</xs:element>
<xs:element name="SimpleType" substitutionGroup="DataTypeDef">
<xs:complexType>
<xs:attribute name="name"/>
<xs:attribute name="type" use="required" type="BasicType"/>
</xs:complexType>
</xs:element>
<xs:simpleType name="BasicType">
<xs:restriction base="xs:token"> <xs:restriction base="xs:token">
<xs:enumeration value="integer"/> <xs:enumeration value="integer"/>
<xs:enumeration value="boolean"/> <xs:enumeration value="boolean"/>
...@@ -179,18 +212,22 @@ ...@@ -179,18 +212,22 @@
<xs:complexType> <xs:complexType>
<xs:sequence> <xs:sequence>
<xs:group ref="Doc"/> <xs:group ref="Doc"/>
<xs:element minOccurs="0" ref="DataTypeDef"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="Arg"/> <xs:element minOccurs="0" maxOccurs="unbounded" ref="Arg"/>
</xs:sequence> </xs:sequence>
<xs:attribute name="name" use="required"/> <xs:attribute name="name" use="required"/>
<xs:attribute name="type" type="DataType"/>
<xs:attribute name="optional" type="xs:boolean"/> <xs:attribute name="optional" type="xs:boolean"/>
<xs:attributeGroup ref="DataTypeDef"/>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="Arg"> <xs:element name="Arg">
<xs:complexType> <xs:complexType>
<xs:group ref="Doc"/> <xs:sequence>
<xs:group ref="Doc"/>
<xs:element ref="DataTypeDef"/>
</xs:sequence>
<xs:attribute name="name" use="required"/> <xs:attribute name="name" use="required"/>
<xs:attribute name="type" use="required" type="DataType"/> <xs:attributeGroup ref="DataTypeDef"/>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="Data"> <xs:element name="Data">
...@@ -202,13 +239,16 @@ ...@@ -202,13 +239,16 @@
</xs:element> </xs:element>
<xs:element name="DataPoint"> <xs:element name="DataPoint">
<xs:complexType> <xs:complexType>
<xs:group ref="Doc"/> <xs:sequence>
<xs:group ref="Doc"/>
<xs:element ref="DataTypeDef"/>
</xs:sequence>
<xs:attribute name="name" use="required"/> <xs:attribute name="name" use="required"/>
<xs:attribute name="optional" type="xs:boolean"/> <xs:attribute name="optional" type="xs:boolean"/>
<xs:attribute name="type" use="required" type="DataType"/>
<xs:attribute name="writable" type="xs:boolean"/> <xs:attribute name="writable" type="xs:boolean"/>
<xs:attribute name="readable" type="xs:boolean"/> <xs:attribute name="readable" type="xs:boolean"/>
<xs:attribute name="eventable" type="xs:boolean"/> <xs:attribute name="eventable" type="xs:boolean"/>
<xs:attributeGroup ref="DataTypeDef"/>
</xs:complexType> </xs:complexType>
</xs:element> </xs:element>
<xs:element name="Events"> <xs:element name="Events">
...@@ -221,8 +261,8 @@ ...@@ -221,8 +261,8 @@
<xs:element name="Event"> <xs:element name="Event">
<xs:complexType> <xs:complexType>
<xs:sequence> <xs:sequence>
<xs:element ref="Data"/>
<xs:group ref="Doc"/> <xs:group ref="Doc"/>
<xs:element ref="Data"/>
</xs:sequence> </xs:sequence>
<xs:attribute name="name" use="required"/> <xs:attribute name="name" use="required"/>
<xs:attribute name="optional" type="xs:boolean"/> <xs:attribute name="optional" type="xs:boolean"/>
......
...@@ -3,33 +3,29 @@ ...@@ -3,33 +3,29 @@
<Domain xmlns="http://homegatewayinitiative.org/xml/dal/3.0" <Domain xmlns="http://homegatewayinitiative.org/xml/dal/3.0"
id="hgi.dal.core"> id="hgi.dal.core">
<Modules> <Modules>
<ModuleClass name="BooleanState"> <ModuleClass name="BooleanState">
<Doc> <Doc>
<tt>BooleanState</tt> is the preferred module for modelling a <tt>BooleanState</tt> is the preferred module for modelling a
functionality corresponding to an underlying binary state. This functionality corresponding to an underlying binary state. This
module should be used to abstract away from the actual datatype module should be used to abstract away from the actual datatype
and values in question. Note that the module does not define whether and values in question. Note that the module does not define whether
the execution mode is blocking or non-blocking. the execution mode is blocking or non-blocking.
</Doc> </Doc>
<Actions> <Actions>
<Action name="get" type="boolean"> <Action name="get">
<Doc> <Doc>Obtain the current associated state.</Doc>
Obtain the current associated state. <SimpleType type="boolean" />
</Doc> </Action>
</Action> <Action name="setTarget">
<Action name="setTarget"> <Doc>Set the associated state to the specified value.</Doc>
<Doc> <Arg name="value">
Set the associated state to the specified value. <Doc>The desired value of the associated state.</Doc>
</Doc> <SimpleType type="boolean" />
<Arg name="value" type="boolean"> </Arg>
<Doc> </Action>
The desired value of the associated state. </Actions>
</Doc> </ModuleClass>
</Arg> </Modules>
</Action>
</Actions>
</ModuleClass>
</Modules>
</Domain> </Domain>
...@@ -14,11 +14,6 @@ ...@@ -14,11 +14,6 @@
<Devices> <Devices>
<Device id="switch.power"> <Device id="switch.power">
<DeviceInfo>
<Name>PowerSwitch</Name>
<!-- The Vendor field should probably be part of the domain -->
<Vendor>Telekom Innovation Laboratories</Vendor>
</DeviceInfo>
<Doc> <Doc>
This device is intended as a demonstration of how to use the This device is intended as a demonstration of how to use the
...@@ -27,6 +22,11 @@ ...@@ -27,6 +22,11 @@
<tt>on</tt> and <tt>off</tt>. This is clearly a candidate for the <tt>on</tt> and <tt>off</tt>. This is clearly a candidate for the
module class <tt>BooleanState</tt>. module class <tt>BooleanState</tt>.
</Doc> </Doc>
<DeviceInfo>
<Name>PowerSwitch</Name>
<!-- The Vendor field should probably be part of the domain -->
<Vendor>Telekom Innovation Laboratories</Vendor>
</DeviceInfo>
<Modules> <Modules>
<Module name="proprietaryPower"> <Module name="proprietaryPower">
...@@ -47,22 +47,21 @@ ...@@ -47,22 +47,21 @@
Turn the switch off. Turn the switch off.
</Doc> </Doc>
</Action> </Action>
<Action name="state" type="string"> <Action name="state">
<Doc> <Doc>Query the state of the switch. Returns the string "<tt>on</tt>" or "<tt>off</tt>".</Doc>
Query the state of the switch. Returns the string "<tt>on</tt>" <SimpleType type="string" />
or "<tt>off</tt>".
</Doc>
</Action> </Action>
</Actions> </Actions>
<Events> <Events>
<Event name="switchEvent"> <Event name="switchEvent">
<Doc>An event that indicates the new state of the switch.
</Doc>
<Data> <Data>
<DataPoint name="state" type="boolean" writable="false"> <DataPoint name="state" writable="false">
<SimpleType type="boolean" />
</DataPoint> </DataPoint>
</Data> </Data>
<Doc>An event that indicates the new state of the switch.
</Doc>
</Event> </Event>
</Events> </Events>
</Module> </Module>
......
...@@ -77,29 +77,29 @@ ...@@ -77,29 +77,29 @@
<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. <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> </Doc>
<Actions> <Actions>
<Action name="get" type="boolean" optional="true"> <Action name="get" optional="true">
<Doc> <Doc>
Obtain the current associated state. Obtain the current associated state.
</Doc> </Doc>
<SimpleType type="boolean" />
</Action> </Action>
<Action name="setTarget"> <Action name="setTarget">
<Doc> <Doc>
Set the associated state to the specified value. Set the associated state to the specified value.
</Doc> </Doc>
<Arg name="value" type="boolean"> <Arg name="value">
<DataType>
<PrimitiveDataType type="boolean" />
</DataType>
<Doc> <Doc>
The desired value of the associated state. The desired value of the associated state.
</Doc> </Doc>
<SimpleType type="boolean" />
</Arg> </Arg>
</Action> </Action>
</Actions> </Actions>
<Events> <Events>
<Event name="stateChanged" optional="true"> <Event name="stateChanged" optional="true">
<Data> <Data>
<DataPoint name="state" optional="true" type="boolean"> <DataPoint name="state" optional="true">
<SimpleType type="boolean" />
</DataPoint> </DataPoint>
</Data> </Data>
</Event> </Event>
...@@ -114,6 +114,9 @@ ...@@ -114,6 +114,9 @@
<!-- The Device contains several sub-devices and offers one action on its own. --> <!-- The Device contains several sub-devices and offers one action on its own. -->
<Device id="MSEEB.root"> <Device id="MSEEB.root">
<Doc>
This device is intended as a demonstration of how to define a Root Device with multiple sub-devices.
</Doc>
<DeviceInfo> <DeviceInfo>
<Name>Multi Socket Electrical-Extension-Block</Name> <Name>Multi Socket Electrical-Extension-Block</Name>
<Vendor>HGI</Vendor> <Vendor>HGI</Vendor>
...@@ -121,9 +124,6 @@ ...@@ -121,9 +124,6 @@
<VendorURL>http://www.homegatewayinitative.org</VendorURL> <VendorURL>http://www.homegatewayinitative.org</VendorURL>
<SerialNumber>1234.5</SerialNumber> <SerialNumber>1234.5</SerialNumber>
</DeviceInfo> </DeviceInfo>
<Doc>
This device is intended as a demonstration of how to define a Root Device with multiple sub-devices.
</Doc>
<!-- These are the modules for the device: <!-- These are the modules for the device:
- Switch on/off all contained switches. It inherits from hgi.dal.core.BooleanState. - Switch on/off all contained switches. It inherits from hgi.dal.core.BooleanState.
...@@ -138,23 +138,40 @@ ...@@ -138,23 +138,40 @@
The action "BooleanState:get" returns "true" when any of the sub-devices is in the state "on", otherwise it returns "false". The action "BooleanState:get" returns "true" when any of the sub-devices is in the state "on", otherwise it returns "false".
</Doc> </Doc>
</Module> </Module>
<Module name="power">
<Actions>
<Action name="getPowerConsumption">
<Doc>Get the power consumption.</Doc>
<Struct name="values">
<Array name="consumption">
<SimpleType type="float" />
</Array>
<Array name="timeFrame">
<SimpleType type="datetime" />
</Array>
</Struct>
</Action>
</Actions>
</Module>
<Module name="extensionBlockDataPoints"> <Module name="extensionBlockDataPoints">
<Data> <Data>
<DataPoint name="firmwareVersion" <DataPoint name="firmwareVersion"
type="string"
writable="false"> writable="false">
<Doc> <Doc>
This datapoint represents the firmware version of the extension block. This datapoint represents the firmware version of the extension block.
</Doc> </Doc>
<SimpleType type="string" />
</DataPoint> </DataPoint>
<DataPoint name="powerSwitchNames" <DataPoint name="powerSwitchNames"
type="array"
writable="false"> writable="false">
<Doc> <Doc>
This datapoint is an array of strings with the names of the contained devices. This datapoint is an array of strings with the names of the contained devices.
</Doc> </Doc>
<Array>
<SimpleType type="string" />
</Array>
</DataPoint> </DataPoint>
</Data> </Data>
</Module> </Module>
...@@ -168,13 +185,13 @@ ...@@ -168,13 +185,13 @@
--> -->
<SubDevice id="switch.power.1"> <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>
<DeviceInfo> <DeviceInfo>
<Name>PowerSwitch 1</Name> <Name>PowerSwitch 1</Name>
<Vendor>HGI</Vendor> <Vendor>HGI</Vendor>
</DeviceInfo> </DeviceInfo>
<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>
<Modules> <Modules>
<Module name="power"> <Module name="power">
<extends domain="hgi.dal.core" class="BooleanState"/> <extends domain="hgi.dal.core" class="BooleanState"/>
...@@ -185,13 +202,13 @@ ...@@ -185,13 +202,13 @@
<!-- This is the second power switch of the extension block. --> <!-- This is the second power switch of the extension block. -->
<SubDevice id="switch.power.2"> <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>
<DeviceInfo> <DeviceInfo>
<Name>PowerSwitch 2</Name> <Name>PowerSwitch 2</Name>
<Vendor>HGI</Vendor> <Vendor>HGI</Vendor>
</DeviceInfo> </DeviceInfo>
<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>
<Modules> <Modules>
<Module name="power"> <Module name="power">
<extends domain="hgi.dal.core" class="BooleanState"/> <extends domain="hgi.dal.core" class="BooleanState"/>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment