Commit c1a9f54fea55322638899774f765b8563c9038e9

Authored by ankraft
1 parent ea53785e

Fixed optionals in XSD.

Fixed various examples.
1 1 start = Domain
2   -
3 2 Domain =
4 3 element Domain {
5 4 # still having some problems with included documents ...
... ... @@ -13,27 +12,28 @@ Domain =
13 12 # </attribute>
14 13 attribute xml:base { xsd:anyURI }?,
15 14 attribute id { xsd:ID },
16   - Imports,
  15 + Doc,
  16 + element Imports { Domain* }?,
17 17 element Modules {
18 18 element ModuleClass { ModuleDef }*
19 19 }?,
20 20 element Devices {
21 21 element Device {
22 22 attribute id { xsd:Name },
23   - DeviceInfo,
24 23 Doc,
  24 + DeviceInfo,
25 25 Modules?,
26 26 element SubDevices {
27   - element SubDevice { DeviceDef }*
  27 + element SubDevice {
  28 + attribute id { xsd:Name },
  29 + Doc,
  30 + DeviceInfo,
  31 + Modules?
  32 + }*
28 33 }?
29 34 }*
30 35 }?
31 36 }
32   -DeviceDef =
33   - attribute id { xsd:Name },
34   - DeviceInfo,
35   - Doc,
36   - Modules?
37 37 DeviceInfo =
38 38 element DeviceInfo {
39 39 element Name { text }
... ... @@ -42,7 +42,29 @@ DeviceInfo =
42 42 & element SerialNumber { text }?
43 43 & element VendorURL { xsd:anyURI }?
44 44 }
45   -DataType =
  45 +DataTypeElement = element DataType { DataTypeDef }
  46 +DataTypeDef =
  47 + # Discuss: Doc on DataType?
  48 + attribute unitOfMeasure { text }?,
  49 + (StructType | ArrayType | SimpleType)
  50 +StructType =
  51 + element Struct {
  52 + attribute name { text }?,
  53 + DataTypeDef+
  54 + }
  55 +ArrayType =
  56 + element Array {
  57 + attribute name { text }?,
  58 + DataTypeDef
  59 + }
  60 +SimpleType =
  61 + element SimpleType {
  62 + attribute name { text }?,
  63 + attribute type { BasicType }
  64 + # TODO Constraints
  65 +
  66 + }
  67 +BasicType =
46 68 "integer"
47 69 | "boolean"
48 70 | "string"
... ... @@ -88,13 +110,13 @@ Actions =
88 110 element Actions {
89 111 element Action {
90 112 attribute name { text },
91   - attribute type { DataType }?,
92 113 attribute optional { xsd:boolean }?,
93 114 Doc,
  115 + DataTypeDef?,
94 116 element Arg {
95 117 attribute name { text },
96   - attribute type { DataType },
97   - Doc
  118 + Doc,
  119 + DataTypeDef
98 120 }*
99 121 }*
100 122 }
... ... @@ -103,11 +125,11 @@ Data =
103 125 element DataPoint {
104 126 attribute name { text },
105 127 attribute optional { xsd:boolean }?,
106   - attribute type { DataType },
107 128 attribute writable { xsd:boolean }?,
108 129 attribute readable { xsd:boolean }?,
109 130 attribute eventable { xsd:boolean }?,
110   - Doc
  131 + Doc,
  132 + DataTypeDef
111 133 }*
112 134 }
113 135 Events =
... ... @@ -115,7 +137,7 @@ Events =
115 137 element Event {
116 138 attribute name { text },
117 139 attribute optional { xsd:boolean }?,
118   - Data,
119   - Doc
  140 + Doc,
  141 + Data
120 142 }*
121 143 }
... ...
... ... @@ -6,16 +6,6 @@
6 6 <ref name="Domain"/>
7 7 </start>
8 8  
9   - <define name="Imports">
10   - <optional>
11   - <element name="Imports">
12   - <zeroOrMore>
13   - <ref name="Domain"/>
14   - </zeroOrMore>
15   - </element>
16   - </optional>
17   - </define>
18   -
19 9 <define name="Domain">
20 10 <element name="Domain">
21 11 <optional>
... ... @@ -38,7 +28,14 @@
38 28 <attribute name="id">
39 29 <data type="ID"/>
40 30 </attribute>
41   - <ref name="Imports"/>
  31 + <ref name="Doc"/>
  32 + <optional>
  33 + <element name="Imports">
  34 + <zeroOrMore>
  35 + <ref name="Domain"/>
  36 + </zeroOrMore>
  37 + </element>
  38 + </optional>
42 39 <optional>
43 40 <element name="Modules">
44 41 <zeroOrMore>
... ... @@ -55,20 +52,27 @@
55 52 <attribute name="id">
56 53 <data type="Name"/>
57 54 </attribute>
58   - <ref name="DeviceInfo"/>
59 55 <ref name="Doc"/>
  56 + <ref name="DeviceInfo"/>
60 57 <optional>
61 58 <ref name="Modules"/>
62 59 </optional>
63   - <optional>
64   - <element name="SubDevices">
65   - <zeroOrMore>
66   - <element name="SubDevice">
67   - <ref name="DeviceDef"/>
68   - </element>
69   - </zeroOrMore>
70   - </element>
71   - </optional>
  60 + <optional>
  61 + <element name="SubDevices">
  62 + <zeroOrMore>
  63 + <element name="SubDevice">
  64 + <attribute name="id">
  65 + <data type="Name"/>
  66 + </attribute>
  67 + <ref name="Doc"/>
  68 + <ref name="DeviceInfo"/>
  69 + <optional>
  70 + <ref name="Modules"/>
  71 + </optional>
  72 + </element>
  73 + </zeroOrMore>
  74 + </element>
  75 + </optional>
72 76 </element>
73 77 </zeroOrMore>
74 78 </element>
... ... @@ -76,17 +80,6 @@
76 80 </element>
77 81 </define>
78 82  
79   - <define name="DeviceDef">
80   - <attribute name="id">
81   - <data type="Name"/>
82   - </attribute>
83   - <ref name="DeviceInfo"/>
84   - <ref name="Doc"/>
85   - <optional>
86   - <ref name="Modules"/>
87   - </optional>
88   - </define>
89   -
90 83  
91 84 <define name="DeviceInfo">
92 85 <element name="DeviceInfo">
... ... @@ -117,7 +110,70 @@
117 110 </define>
118 111  
119 112  
120   - <define name="DataType">
  113 + <define name="DataTypeElement">
  114 + <element name="DataType">
  115 + <ref name="DataTypeDef" />
  116 + </element>
  117 + </define>
  118 +
  119 +
  120 + <define name="DataTypeDef">
  121 + <!-- Discuss: Doc on DataType? -->
  122 + <optional>
  123 + <attribute name="unitOfMeasure">
  124 + <text/>
  125 + </attribute>
  126 + </optional>
  127 + <choice>
  128 + <ref name="StructType" />
  129 + <ref name="ArrayType" />
  130 + <ref name="SimpleType" />
  131 + </choice>
  132 + </define>
  133 +
  134 +
  135 + <define name="StructType">
  136 + <element name="Struct">
  137 + <optional>
  138 + <attribute name="name">
  139 + <text/>
  140 + </attribute>
  141 + </optional>
  142 + <oneOrMore>
  143 + <ref name="DataTypeDef" />
  144 + </oneOrMore>
  145 + </element>
  146 + </define>
  147 +
  148 +
  149 + <define name="ArrayType">
  150 + <element name="Array">
  151 + <optional>
  152 + <attribute name="name">
  153 + <text/>
  154 + </attribute>
  155 + </optional>
  156 + <ref name="DataTypeDef" />
  157 + </element>
  158 + </define>
  159 +
  160 +
  161 + <define name="SimpleType">
  162 + <element name="SimpleType">
  163 + <optional>
  164 + <attribute name="name">
  165 + <text/>
  166 + </attribute>
  167 + </optional>
  168 + <attribute name="type">
  169 + <ref name="BasicType" />
  170 + </attribute>
  171 + <!-- TODO Constraints -->
  172 + </element>
  173 + </define>
  174 +
  175 +
  176 + <define name="BasicType">
121 177 <choice>
122 178 <value>integer</value>
123 179 <value>boolean</value>
... ... @@ -134,6 +190,7 @@
134 190 </choice>
135 191 </define>
136 192  
  193 +
137 194 <define name="DocText">
138 195 <zeroOrMore>
139 196 <choice>
... ... @@ -225,23 +282,19 @@
225 282 <text/>
226 283 </attribute>
227 284 <optional>
228   - <attribute name="type">
229   - <ref name="DataType"/>
230   - </attribute>
231   - </optional>
232   - <optional>
233 285 <attribute name="optional">
234 286 <data type="boolean"/>
235 287 </attribute>
236 288 </optional>
237 289 <ref name="Doc"/>
  290 + <optional>
  291 + <ref name="DataTypeDef"/>
  292 + </optional>
238 293 <zeroOrMore>
239 294 <element name="Arg">
240 295 <attribute name="name"/>
241   - <attribute name="type">
242   - <ref name="DataType"/>
243   - </attribute>
244 296 <ref name="Doc"/>
  297 + <ref name="DataTypeDef"/>
245 298 </element>
246 299 </zeroOrMore>
247 300 </element>
... ... @@ -262,9 +315,6 @@
262 315 <data type="boolean"/>
263 316 </attribute>
264 317 </optional>
265   - <attribute name="type">
266   - <ref name="DataType"/>
267   - </attribute>
268 318 <optional>
269 319 <attribute name="writable">
270 320 <data type="boolean"/>
... ... @@ -281,6 +331,7 @@
281 331 </attribute>
282 332 </optional>
283 333 <ref name="Doc"/>
  334 + <ref name="DataTypeDef"/>
284 335 </element>
285 336 </zeroOrMore>
286 337 </element>
... ... @@ -299,13 +350,12 @@
299 350 <data type="boolean"/>
300 351 </attribute>
301 352 </optional>
302   - <ref name="Data" />
303 353 <ref name="Doc"/>
  354 + <ref name="Data" />
304 355 </element>
305 356 </zeroOrMore>
306 357 </element>
307 358 </define>
308 359  
309   -
310 360 </grammar>
311 361  
... ...
... ... @@ -5,22 +5,11 @@
5 5  
6 6 elementFormDefault="qualified">
7 7 <xs:import namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/03/xml.xsd"/>
8   - <xs:group name="Imports">
9   - <xs:sequence>
10   - <xs:element minOccurs="0" ref="Imports"/>
11   - </xs:sequence>
12   - </xs:group>
13   - <xs:element name="Imports">
14   - <xs:complexType>
15   - <xs:sequence>
16   - <xs:element minOccurs="0" maxOccurs="unbounded" ref="Domain"/>
17   - </xs:sequence>
18   - </xs:complexType>
19   - </xs:element>
20 8 <xs:element name="Domain">
21 9 <xs:complexType>
22 10 <xs:sequence>
23   - <xs:group ref="Imports"/>
  11 + <xs:group ref="Doc"/>
  12 + <xs:element minOccurs="0" ref="Imports"/>
24 13 <xs:element minOccurs="0" name="Modules">
25 14 <xs:complexType>
26 15 <xs:sequence>
... ... @@ -34,6 +23,13 @@
34 23 <xs:attribute name="id" use="required" type="xs:ID"/>
35 24 </xs:complexType>
36 25 </xs:element>
  26 + <xs:element name="Imports">
  27 + <xs:complexType>
  28 + <xs:sequence>
  29 + <xs:element minOccurs="0" maxOccurs="unbounded" ref="Domain"/>
  30 + </xs:sequence>
  31 + </xs:complexType>
  32 + </xs:element>
37 33 <xs:element name="ModuleClass" type="ModuleDef"/>
38 34 <xs:element name="Devices">
39 35 <xs:complexType>
... ... @@ -45,8 +41,8 @@
45 41 <xs:element name="Device">
46 42 <xs:complexType>
47 43 <xs:sequence>
48   - <xs:element ref="DeviceInfo"/>
49 44 <xs:group ref="Doc"/>
  45 + <xs:element ref="DeviceInfo"/>
50 46 <xs:element minOccurs="0" ref="Modules"/>
51 47 <xs:element minOccurs="0" ref="SubDevices"/>
52 48 </xs:sequence>
... ... @@ -60,15 +56,16 @@
60 56 </xs:sequence>
61 57 </xs:complexType>
62 58 </xs:element>
63   - <xs:element name="SubDevice" type="DeviceDef"/>
64   - <xs:complexType name="DeviceDef">
65   - <xs:sequence>
66   - <xs:element ref="DeviceInfo"/>
67   - <xs:group ref="Doc"/>
68   - <xs:element minOccurs="0" ref="Modules"/>
69   - </xs:sequence>
70   - <xs:attribute name="id" use="required" type="xs:Name"/>
71   - </xs:complexType>
  59 + <xs:element name="SubDevice">
  60 + <xs:complexType>
  61 + <xs:sequence>
  62 + <xs:group ref="Doc"/>
  63 + <xs:element ref="DeviceInfo"/>
  64 + <xs:element minOccurs="0" ref="Modules"/>
  65 + </xs:sequence>
  66 + <xs:attribute name="id" use="required" type="xs:Name"/>
  67 + </xs:complexType>
  68 + </xs:element>
72 69 <xs:element name="DeviceInfo">
73 70 <xs:complexType>
74 71 <xs:all>
... ... @@ -85,7 +82,43 @@
85 82 <xs:element name="FirmwareVersion" type="xs:string"/>
86 83 <xs:element name="SerialNumber" type="xs:string"/>
87 84 <xs:element name="VendorURL" type="xs:anyURI"/>
88   - <xs:simpleType name="DataType">
  85 + <xs:element name="DataType">
  86 + <xs:complexType>
  87 + <xs:sequence>
  88 + <xs:element ref="DataTypeDef"/>
  89 + </xs:sequence>
  90 + <xs:attributeGroup ref="DataTypeDef"/>
  91 + </xs:complexType>
  92 + </xs:element>
  93 + <xs:element name="DataTypeDef" abstract="true"/>
  94 + <xs:attributeGroup name="DataTypeDef">
  95 + <xs:attribute name="unitOfMeasure"/>
  96 + </xs:attributeGroup>
  97 + <xs:element name="Struct" substitutionGroup="DataTypeDef">
  98 + <xs:complexType>
  99 + <xs:sequence>
  100 + <xs:element maxOccurs="unbounded" ref="DataTypeDef"/>
  101 + </xs:sequence>
  102 + <xs:attribute name="name"/>
  103 + <xs:attributeGroup ref="DataTypeDef"/>
  104 + </xs:complexType>
  105 + </xs:element>
  106 + <xs:element name="Array" substitutionGroup="DataTypeDef">
  107 + <xs:complexType>
  108 + <xs:sequence>
  109 + <xs:element ref="DataTypeDef"/>
  110 + </xs:sequence>
  111 + <xs:attribute name="name"/>
  112 + <xs:attributeGroup ref="DataTypeDef"/>
  113 + </xs:complexType>
  114 + </xs:element>
  115 + <xs:element name="SimpleType" substitutionGroup="DataTypeDef">
  116 + <xs:complexType>
  117 + <xs:attribute name="name"/>
  118 + <xs:attribute name="type" use="required" type="BasicType"/>
  119 + </xs:complexType>
  120 + </xs:element>
  121 + <xs:simpleType name="BasicType">
89 122 <xs:restriction base="xs:token">
90 123 <xs:enumeration value="integer"/>
91 124 <xs:enumeration value="boolean"/>
... ... @@ -179,18 +212,22 @@
179 212 <xs:complexType>
180 213 <xs:sequence>
181 214 <xs:group ref="Doc"/>
  215 + <xs:element minOccurs="0" ref="DataTypeDef"/>
182 216 <xs:element minOccurs="0" maxOccurs="unbounded" ref="Arg"/>
183 217 </xs:sequence>
184 218 <xs:attribute name="name" use="required"/>
185   - <xs:attribute name="type" type="DataType"/>
186 219 <xs:attribute name="optional" type="xs:boolean"/>
  220 + <xs:attributeGroup ref="DataTypeDef"/>
187 221 </xs:complexType>
188 222 </xs:element>
189 223 <xs:element name="Arg">
190 224 <xs:complexType>
191   - <xs:group ref="Doc"/>
  225 + <xs:sequence>
  226 + <xs:group ref="Doc"/>
  227 + <xs:element ref="DataTypeDef"/>
  228 + </xs:sequence>
192 229 <xs:attribute name="name" use="required"/>
193   - <xs:attribute name="type" use="required" type="DataType"/>
  230 + <xs:attributeGroup ref="DataTypeDef"/>
194 231 </xs:complexType>
195 232 </xs:element>
196 233 <xs:element name="Data">
... ... @@ -202,13 +239,16 @@
202 239 </xs:element>
203 240 <xs:element name="DataPoint">
204 241 <xs:complexType>
205   - <xs:group ref="Doc"/>
  242 + <xs:sequence>
  243 + <xs:group ref="Doc"/>
  244 + <xs:element ref="DataTypeDef"/>
  245 + </xs:sequence>
206 246 <xs:attribute name="name" use="required"/>
207 247 <xs:attribute name="optional" type="xs:boolean"/>
208   - <xs:attribute name="type" use="required" type="DataType"/>
209 248 <xs:attribute name="writable" type="xs:boolean"/>
210 249 <xs:attribute name="readable" type="xs:boolean"/>
211 250 <xs:attribute name="eventable" type="xs:boolean"/>
  251 + <xs:attributeGroup ref="DataTypeDef"/>
212 252 </xs:complexType>
213 253 </xs:element>
214 254 <xs:element name="Events">
... ... @@ -221,8 +261,8 @@
221 261 <xs:element name="Event">
222 262 <xs:complexType>
223 263 <xs:sequence>
224   - <xs:element ref="Data"/>
225 264 <xs:group ref="Doc"/>
  265 + <xs:element ref="Data"/>
226 266 </xs:sequence>
227 267 <xs:attribute name="name" use="required"/>
228 268 <xs:attribute name="optional" type="xs:boolean"/>
... ...
... ... @@ -3,33 +3,29 @@
3 3 <Domain xmlns="http://homegatewayinitiative.org/xml/dal/3.0"
4 4 id="hgi.dal.core">
5 5  
6   - <Modules>
7   - <ModuleClass name="BooleanState">
8   - <Doc>
9   - <tt>BooleanState</tt> is the preferred module for modelling a
10   - functionality corresponding to an underlying binary state. This
11   - module should be used to abstract away from the actual datatype
12   - and values in question. Note that the module does not define whether
13   - the execution mode is blocking or non-blocking.
14   - </Doc>
15   - <Actions>
16   - <Action name="get" type="boolean">
17   - <Doc>
18   - Obtain the current associated state.
19   - </Doc>
20   - </Action>
21   - <Action name="setTarget">
22   - <Doc>
23   - Set the associated state to the specified value.
24   - </Doc>
25   - <Arg name="value" type="boolean">
26   - <Doc>
27   - The desired value of the associated state.
28   - </Doc>
29   - </Arg>
30   - </Action>
31   - </Actions>
32   - </ModuleClass>
33   - </Modules>
  6 + <Modules>
  7 + <ModuleClass name="BooleanState">
  8 + <Doc>
  9 + <tt>BooleanState</tt> is the preferred module for modelling a
  10 + functionality corresponding to an underlying binary state. This
  11 + module should be used to abstract away from the actual datatype
  12 + and values in question. Note that the module does not define whether
  13 + the execution mode is blocking or non-blocking.
  14 + </Doc>
  15 + <Actions>
  16 + <Action name="get">
  17 + <Doc>Obtain the current associated state.</Doc>
  18 + <SimpleType type="boolean" />
  19 + </Action>
  20 + <Action name="setTarget">
  21 + <Doc>Set the associated state to the specified value.</Doc>
  22 + <Arg name="value">
  23 + <Doc>The desired value of the associated state.</Doc>
  24 + <SimpleType type="boolean" />
  25 + </Arg>
  26 + </Action>
  27 + </Actions>
  28 + </ModuleClass>
  29 + </Modules>
34 30  
35 31 </Domain>
... ...
... ... @@ -14,11 +14,6 @@
14 14 <Devices>
15 15  
16 16 <Device id="switch.power">
17   - <DeviceInfo>
18   - <Name>PowerSwitch</Name>
19   - <!-- The Vendor field should probably be part of the domain -->
20   - <Vendor>Telekom Innovation Laboratories</Vendor>
21   - </DeviceInfo>
22 17  
23 18 <Doc>
24 19 This device is intended as a demonstration of how to use the
... ... @@ -27,6 +22,11 @@
27 22 <tt>on</tt> and <tt>off</tt>. This is clearly a candidate for the
28 23 module class <tt>BooleanState</tt>.
29 24 </Doc>
  25 + <DeviceInfo>
  26 + <Name>PowerSwitch</Name>
  27 + <!-- The Vendor field should probably be part of the domain -->
  28 + <Vendor>Telekom Innovation Laboratories</Vendor>
  29 + </DeviceInfo>
30 30  
31 31 <Modules>
32 32 <Module name="proprietaryPower">
... ... @@ -47,22 +47,21 @@
47 47 Turn the switch off.
48 48 </Doc>
49 49 </Action>
50   - <Action name="state" type="string">
51   - <Doc>
52   - Query the state of the switch. Returns the string "<tt>on</tt>"
53   - or "<tt>off</tt>".
54   - </Doc>
  50 + <Action name="state">
  51 + <Doc>Query the state of the switch. Returns the string "<tt>on</tt>" or "<tt>off</tt>".</Doc>
  52 + <SimpleType type="string" />
55 53 </Action>
56 54 </Actions>
57 55  
58 56 <Events>
59 57 <Event name="switchEvent">
  58 + <Doc>An event that indicates the new state of the switch.
  59 + </Doc>
60 60 <Data>
61   - <DataPoint name="state" type="boolean" writable="false">
  61 + <DataPoint name="state" writable="false">
  62 + <SimpleType type="boolean" />
62 63 </DataPoint>
63 64 </Data>
64   - <Doc>An event that indicates the new state of the switch.
65   - </Doc>
66 65 </Event>
67 66 </Events>
68 67 </Module>
... ...
... ... @@ -77,29 +77,29 @@
77 77 <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.
78 78 </Doc>
79 79 <Actions>
80   - <Action name="get" type="boolean" optional="true">
  80 + <Action name="get" optional="true">
81 81 <Doc>
82 82 Obtain the current associated state.
83 83 </Doc>
  84 + <SimpleType type="boolean" />
84 85 </Action>
85 86 <Action name="setTarget">
86 87 <Doc>
87 88 Set the associated state to the specified value.
88 89 </Doc>
89   - <Arg name="value" type="boolean">
90   - <DataType>
91   - <PrimitiveDataType type="boolean" />
92   - </DataType>
  90 + <Arg name="value">
93 91 <Doc>
94 92 The desired value of the associated state.
95 93 </Doc>
  94 + <SimpleType type="boolean" />
96 95 </Arg>
97 96 </Action>
98 97 </Actions>
99 98 <Events>
100 99 <Event name="stateChanged" optional="true">
101 100 <Data>
102   - <DataPoint name="state" optional="true" type="boolean">
  101 + <DataPoint name="state" optional="true">
  102 + <SimpleType type="boolean" />
103 103 </DataPoint>
104 104 </Data>
105 105 </Event>
... ... @@ -114,6 +114,9 @@
114 114 <!-- The Device contains several sub-devices and offers one action on its own. -->
115 115  
116 116 <Device id="MSEEB.root">
  117 + <Doc>
  118 + This device is intended as a demonstration of how to define a Root Device with multiple sub-devices.
  119 + </Doc>
117 120 <DeviceInfo>
118 121 <Name>Multi Socket Electrical-Extension-Block</Name>
119 122 <Vendor>HGI</Vendor>
... ... @@ -121,9 +124,6 @@
121 124 <VendorURL>http://www.homegatewayinitative.org</VendorURL>
122 125 <SerialNumber>1234.5</SerialNumber>
123 126 </DeviceInfo>
124   - <Doc>
125   - This device is intended as a demonstration of how to define a Root Device with multiple sub-devices.
126   - </Doc>
127 127  
128 128 <!-- These are the modules for the device:
129 129 - Switch on/off all contained switches. It inherits from hgi.dal.core.BooleanState.
... ... @@ -138,23 +138,40 @@
138 138 The action "BooleanState:get" returns "true" when any of the sub-devices is in the state "on", otherwise it returns "false".
139 139 </Doc>
140 140 </Module>
  141 + <Module name="power">
  142 + <Actions>
  143 + <Action name="getPowerConsumption">
  144 + <Doc>Get the power consumption.</Doc>
  145 + <Struct name="values">
  146 + <Array name="consumption">
  147 + <SimpleType type="float" />
  148 + </Array>
  149 + <Array name="timeFrame">
  150 + <SimpleType type="datetime" />
  151 + </Array>
  152 + </Struct>
  153 + </Action>
  154 + </Actions>
  155 + </Module>
141 156  
142 157 <Module name="extensionBlockDataPoints">
143 158 <Data>
144 159 <DataPoint name="firmwareVersion"
145   - type="string"
146 160 writable="false">
147 161 <Doc>
148 162 This datapoint represents the firmware version of the extension block.
149 163 </Doc>
  164 + <SimpleType type="string" />
150 165 </DataPoint>
151 166  
152 167 <DataPoint name="powerSwitchNames"
153   - type="array"
154 168 writable="false">
155 169 <Doc>
156 170 This datapoint is an array of strings with the names of the contained devices.
157 171 </Doc>
  172 + <Array>
  173 + <SimpleType type="string" />
  174 + </Array>
158 175 </DataPoint>
159 176 </Data>
160 177 </Module>
... ... @@ -168,13 +185,13 @@
168 185 -->
169 186  
170 187 <SubDevice id="switch.power.1">
  188 + <Doc>
  189 + This sub device is intended as a demonstration of how to use the abstract modules defined in the <em>HGI Core</em> domain.
  190 + </Doc>
171 191 <DeviceInfo>
172 192 <Name>PowerSwitch 1</Name>
173 193 <Vendor>HGI</Vendor>
174 194 </DeviceInfo>
175   - <Doc>
176   - This sub device is intended as a demonstration of how to use the abstract modules defined in the <em>HGI Core</em> domain.
177   - </Doc>
178 195 <Modules>
179 196 <Module name="power">
180 197 <extends domain="hgi.dal.core" class="BooleanState"/>
... ... @@ -185,13 +202,13 @@
185 202 <!-- This is the second power switch of the extension block. -->
186 203  
187 204 <SubDevice id="switch.power.2">
  205 + <Doc>
  206 + This sub device is intended as a demonstration of how to use the abstract modules defined in the <em>HGI Core</em> domain.
  207 + </Doc>
188 208 <DeviceInfo>
189 209 <Name>PowerSwitch 2</Name>
190 210 <Vendor>HGI</Vendor>
191 211 </DeviceInfo>
192   - <Doc>
193   - This sub device is intended as a demonstration of how to use the abstract modules defined in the <em>HGI Core</em> domain.
194   - </Doc>
195 212 <Modules>
196 213 <Module name="power">
197 214 <extends domain="hgi.dal.core" class="BooleanState"/>
... ...