Commit bcbcaab4acaec9ea2c37809cef58da99207ab606

Authored by ankraft
1 parent 8ec88ed1

Changed examples to latest changes of the SDT

... ... @@ -15,14 +15,18 @@
15 15 <Actions>
16 16 <Action name="get">
17 17 <Doc>Obtain the current associated state.</Doc>
18   - <SimpleType type="boolean" />
  18 + <DataType>
  19 + <SimpleType type="boolean" />
  20 + </DataType>
19 21 </Action>
20 22 <Action name="setTarget">
21 23 <Doc>Set the associated state to the specified value.</Doc>
22 24 <Args>
23 25 <Arg name="value">
24 26 <Doc>The desired value of the associated state.</Doc>
25   - <SimpleType type="boolean" />
  27 + <DataType>
  28 + <SimpleType type="boolean" />
  29 + </DataType>
26 30 </Arg>
27 31 </Args>
28 32 </Action>
... ...
... ... @@ -8,9 +8,6 @@
8 8 <xi:include href="./dal-core.xml" parse="xml" />
9 9 </Imports>
10 10  
11   - <Modules>
12   - </Modules>
13   -
14 11 <Devices>
15 12  
16 13 <Device id="switch.power">
... ... @@ -31,7 +28,7 @@
31 28 <!-- The Vendor field should probably be part of the domain -->
32 29 <Characteristic name="Vendor">
33 30 <Doc>Original value: Telekom Innovation Laboratories</Doc>
34   - <SimpleType type="string" />
  31 + <SimpleType type="string" />
35 32 </Characteristic>
36 33 </Characteristics>
37 34  
... ... @@ -56,7 +53,9 @@
56 53 </Action>
57 54 <Action name="state">
58 55 <Doc>Query the state of the switch. Returns the string "<tt>on</tt>" or "<tt>off</tt>".</Doc>
59   - <SimpleType type="string" />
  56 + <DataType>
  57 + <SimpleType type="string" />
  58 + </DataType>
60 59 </Action>
61 60 </Actions>
62 61  
... ... @@ -66,7 +65,9 @@
66 65 </Doc>
67 66 <Data>
68 67 <DataPoint name="state" writable="false">
69   - <SimpleType type="boolean" />
  68 + <DataType>
  69 + <SimpleType type="boolean" />
  70 + </DataType>
70 71 </DataPoint>
71 72 </Data>
72 73 </Event>
... ...
... ... @@ -81,7 +81,9 @@
81 81 <Doc>
82 82 Obtain the current associated state.
83 83 </Doc>
84   - <SimpleType type="boolean" />
  84 + <DataType>
  85 + <SimpleType type="boolean" />
  86 + </DataType>
85 87 </Action>
86 88 <Action name="setTarget">
87 89 <Doc>
... ... @@ -92,7 +94,9 @@
92 94 <Doc>
93 95 The desired value of the associated state.
94 96 </Doc>
95   - <SimpleType type="boolean" />
  97 + <DataType>
  98 + <SimpleType type="boolean" />
  99 + </DataType>
96 100 </Arg>
97 101 </Args>
98 102 </Action>
... ... @@ -101,7 +105,9 @@
101 105 <Event name="stateChanged" optional="true">
102 106 <Data>
103 107 <DataPoint name="state" readable="true">
104   - <SimpleType type="boolean" />
  108 + <DataType>
  109 + <SimpleType type="boolean" />
  110 + </DataType>
105 111 </DataPoint>
106 112 </Data>
107 113 </Event>
... ... @@ -165,14 +171,30 @@
165 171 <Actions>
166 172 <Action name="getPowerConsumption">
167 173 <Doc>Get the power consumption.</Doc>
168   - <Struct name="values">
169   - <Array name="consumption">
170   - <SimpleType type="float" />
171   - </Array>
172   - <Array name="timeFrame">
173   - <SimpleType type="datetime" />
174   - </Array>
175   - </Struct>
  174 + <DataType name="consumption">
  175 + <Struct>
  176 + <DataType name="values">
  177 + <Array>
  178 + <DataType>
  179 + <Doc>This is an example simple data type with a minimum-value constraint.</Doc>
  180 + <SimpleType type="float" />
  181 + <Constraints>
  182 + <Constraint name="minValue" type="float" value="0.0">
  183 + <Doc>The value must be equal or greater 0.0</Doc>
  184 + </Constraint>
  185 + </Constraints>
  186 + </DataType>
  187 + </Array>
  188 + </DataType>
  189 + <DataType name="timeFrame">
  190 + <Array>
  191 + <DataType>
  192 + <SimpleType type="datetime" />
  193 + </DataType>
  194 + </Array>
  195 + </DataType>
  196 + </Struct>
  197 + </DataType>
176 198 </Action>
177 199 </Actions>
178 200 </Module>
... ... @@ -180,9 +202,13 @@
180 202 <Module name="extensionBlockDataPoints">
181 203 <Actions>
182 204 <Action name="getNames">
183   - <Array name="names">
184   - <SimpleType type="string" />
185   - </Array>
  205 + <DataType name="names">
  206 + <Array>
  207 + <DataType>
  208 + <SimpleType type="string" />
  209 + </DataType>
  210 + </Array>
  211 + </DataType>
186 212 </Action>
187 213 </Actions>
188 214 <Data>
... ... @@ -192,7 +218,9 @@
192 218 <Doc>
193 219 This datapoint represents the firmware version of the extension block.
194 220 </Doc>
195   - <SimpleType type="string" />
  221 + <DataType>
  222 + <SimpleType type="string" />
  223 + </DataType>
196 224 </DataPoint>
197 225  
198 226 <DataPoint name="powerSwitchNames"
... ... @@ -201,9 +229,13 @@
201 229 <Doc>
202 230 This datapoint is an array of strings with the names of the contained devices.
203 231 </Doc>
204   - <Array>
205   - <SimpleType type="string" />
206   - </Array>
  232 + <DataType>
  233 + <Array>
  234 + <DataType>
  235 + <SimpleType type="string" />
  236 + </DataType>
  237 + </Array>
  238 + </DataType>
207 239 </DataPoint>
208 240 </Data>
209 241 </Module>
... ... @@ -221,12 +253,10 @@
221 253 This sub device is intended as a demonstration of how to use the abstract modules defined in the <em>HGI Core</em> domain.
222 254 </Doc>
223 255 <Characteristics>
224   - <Characteristic name="Name">
225   - <Doc>Original value: PowerSwitch 1</Doc>
  256 + <Characteristic name="Name" value="PowerSwitch 1">
226 257 <SimpleType type="string" />
227 258 </Characteristic>
228   - <Characteristic name="Vendor">
229   - <Doc>Original value: HGI</Doc>
  259 + <Characteristic name="Vendor" value="HGI">
230 260 <SimpleType type="string" />
231 261 </Characteristic>
232 262 </Characteristics>
... ... @@ -244,16 +274,13 @@
244 274 This sub device is intended as a demonstration of how to use the abstract modules defined in the <em>HGI Core</em> domain.
245 275 </Doc>
246 276 <Characteristics>
247   - <Characteristic name="Name">
248   - <Doc>Original value: PowerSwitch 2</Doc>
  277 + <Characteristic name="Name" value="PowerSwitch 2">
249 278 <SimpleType type="string" />
250 279 </Characteristic>
251   - <Characteristic name="Vendor">
252   - <Doc>Original value: HGI</Doc>
  280 + <Characteristic name="Vendor" value="HGI">
253 281 <SimpleType type="string" />
254 282 </Characteristic>
255 283 <Characteristic name="VendorURL" value="http://homegatwaysinitiative.org">
256   - <Doc>Original value: http://homegatwaysinitiative.org</Doc>
257 284 <SimpleType type="uri" />
258 285 </Characteristic>
259 286 <Characteristic name="maximumAltitude" value="2800">
... ...