flocklab.xsd 16 KB
Newer Older
1
2
3
4
5
<?xml version="1.0" encoding="UTF-8"?>

<!--
	/*
	 * XML schema for FlockLab test configuration XMLs. 
Reto Da Forno's avatar
Reto Da Forno committed
6
7
	 * This schema can be downloaded from https://user.flocklab.ethz.ch/xml/flocklab.xsd
	 * Help is available at https://gitlab.ethz.ch/tec/public/flocklab/flocklab/-/wikis/Man/XmlConfig
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
	 */
-->

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.flocklab.ethz.ch" xmlns="http://www.flocklab.ethz.ch" elementFormDefault="qualified">

<!-- ############################################################################### 
     # The following block is the main schema for a FlockLab test.                 #
     # It defines which elements have to be present in a valid XML configuration.  #
     ############################################################################### -->
<!-- testConf is the root element of the XML schema. It can only be present once. -->
<xs:element name="testConf">
  <xs:complexType>
    <xs:sequence>
      <xs:group ref="services" minOccurs="0" maxOccurs="unbounded"/>
      <xs:choice minOccurs="1" maxOccurs="1">
        <xs:sequence>
          <xs:element name="generalConf" type="generalConfType" minOccurs="1" maxOccurs="1"/>
          <xs:group ref="services" minOccurs="0" maxOccurs="unbounded"/>
          <xs:element name="targetConf" type="targetConfType" minOccurs="1" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:sequence>
          <xs:element name="targetConf" type="targetConfType" minOccurs="1" maxOccurs="unbounded"/>
          <xs:group ref="services" minOccurs="0" maxOccurs="unbounded"/>
          <xs:element name="generalConf" type="generalConfType" minOccurs="1" maxOccurs="1"/>
        </xs:sequence>
      </xs:choice>
      <xs:group ref="services" minOccurs="0" maxOccurs="unbounded"/>
    </xs:sequence>
  </xs:complexType>
</xs:element>

<!-- ############################################################################### 
     # Choice of available services                                                #
     ############################################################################### -->
<xs:group name="services">
  <xs:choice>
    <!-- Serial service configuration. If service is not to be used, do not specify this element. -->
    <xs:element name="serialConf" type="serialConfType"/>
    <!-- GPIO tracing service configuration. If service is not to be used, do not specify this element. -->
    <xs:element name="gpioTracingConf" type="gpioTracingConfType"/>
    <!-- GPIO actuation service configuration. If service is not to be used, do not specify this element. -->
    <xs:element name="gpioActuationConf" type="gpioActuationConfType"/>
    <!-- Power profiling service configuration. If service is not to be used, do not specify this element. -->
    <xs:element name="powerProfilingConf" type="powerProfilingConfType"/>
    <!-- Target image configuration. If only images from database are to be used, do not specify this element. -->
53
    <xs:element name="embeddedImageConf" type="embeddedImageConfType"/>
54
55
    <!-- Debug service configuration. If service is not to be used, do not specify this element. -->
    <xs:element name="debugConf" type="debugConfType"/>
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
  </xs:choice>
</xs:group>


<!-- ############################################################################### 
     # The following blocks define the types of elements used in the main block    #
     # above.                                                                      #
     ############################################################################### -->
<!-- All elements needed for the general setup of a single FlockLab test -->
<xs:complexType name="generalConfType">
  <xs:sequence>
    <xs:element name="name">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:minLength value="5"/>
          <xs:maxLength value="45"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:element>
    <xs:element name="description" minOccurs="0">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:maxLength value="512"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:element>
Reto Da Forno's avatar
Reto Da Forno committed
82
    <xs:element name="custom" minOccurs="0">
83
84
85
86
87
88
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:maxLength value="4096"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:element>
89
90
91
92
93
94
95
96
97
98
99
100
101
    <xs:choice>
      <xs:element name="scheduleAbsolute">
        <xs:complexType>
          <xs:group ref="testDurationAbsoluteGroup"/>
        </xs:complexType>
      </xs:element>
      <xs:element name="scheduleAsap">
        <xs:complexType>
          <xs:all>
            <xs:element name="durationSecs" type="testDurationSecsType"/>
          </xs:all>
        </xs:complexType>
      </xs:element>
102
103
104
105
106
107
108
109
110
      <xs:element name="schedule">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="start" type="xs:dateTime" minOccurs="0"/>
            <xs:element name="duration" type="testDurationSecsType"/>
            <xs:element name="start" type="xs:dateTime" minOccurs="0"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
    </xs:choice>
    <xs:element name="emailResults" minOccurs="0" default="no">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="yes|no"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:element>
  </xs:sequence>
</xs:complexType>

      
<!-- Configuration of target adapters -->
<xs:complexType name="targetConfType">
  <xs:sequence>
    <xs:element name="obsIds" type="obsIdListRestType"/>
    <xs:element name="targetIds" type="targetIdListRestType" minOccurs="0"/>
    <xs:element name="voltage" minOccurs="0" default="3.3">
      <xs:simpleType>
        <xs:restriction base="xs:decimal">
          <xs:minInclusive value="1.8"/>
          <xs:maxInclusive value="3.6"/>
          <xs:fractionDigits value="1"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:element>
    <xs:choice>
      <xs:group ref="targetimages" minOccurs="1" maxOccurs="4"/>
      <xs:element name="noImage" type="slotNrType"/>
    </xs:choice>
  </xs:sequence>
</xs:complexType>

<!-- ############################################################################### 
     # Choice of for target images                                                 #
     ############################################################################### -->
<xs:group name="targetimages">
  <xs:choice>
    <xs:element name="dbImageId" type="xs:integer"/>
    <xs:element name="embeddedImageId" type="embeddedImageIdType"/>
  </xs:choice>
</xs:group>

<!-- Configuration of target images -->
155
<xs:complexType name="embeddedImageConfType">
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
  <xs:all>
    <xs:element name="embeddedImageId" type="embeddedImageIdType"/>
    <xs:element name="name">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:minLength value="5"/>
          <xs:maxLength value="45"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:element>
    <xs:element name="description" minOccurs="0">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:maxLength value="512"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:element>
    <xs:element name="platform" type="platformType"/>
    <xs:element name="data" type="xs:base64Binary"/>
	<xs:element name="core" type="xs:integer" minOccurs="0" maxOccurs="1"/>
  </xs:all>
</xs:complexType>


<!-- Configuration of the serial service -->
<xs:complexType name="serialConfType">
  <xs:all>
    <xs:element name="obsIds" type="obsIdListRestType"/>
    <xs:element name="port"  minOccurs="0">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="usb|serial"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:element>
    <xs:element name="baudrate" minOccurs="0">
      <xs:simpleType>
        <xs:restriction base="xs:integer">
          <xs:enumeration value="2400"/>
          <xs:enumeration value="4800"/>
          <xs:enumeration value="9600"/>
          <xs:enumeration value="19200"/>
          <xs:enumeration value="38400"/>
          <xs:enumeration value="57600"/>
          <xs:enumeration value="115200"/>
201
202
203
204
205
206
          <xs:enumeration value="230400"/>
          <xs:enumeration value="460800"/>
          <xs:enumeration value="921600"/>
          <xs:enumeration value="1000000"/>
          <xs:enumeration value="2000000"/>
          <xs:enumeration value="3000000"/>
207
208
209
210
211
212
213
214
        </xs:restriction>
      </xs:simpleType>
    </xs:element>
    <xs:element name="remoteIp" type="ipType" minOccurs="0"/>
  </xs:all>
</xs:complexType>


215
216
217
218
<!-- Configuration of the debug service -->
<xs:complexType name="debugConfType">
  <xs:sequence>
    <xs:element name="obsIds" type="obsIdListRestType"/>
Reto Da Forno's avatar
wip    
Reto Da Forno committed
219
    <xs:choice>
220
221
      <xs:element name="gdbPort" type="portType" minOccurs="0" maxOccurs="1"/>
      <xs:element name="remoteIp" type="ipType" minOccurs="0" maxOccurs="1"/>
Reto Da Forno's avatar
wip    
Reto Da Forno committed
222
223
224
225
226
227
228
229
      <xs:element name="dataTraceConf" minOccurs="0" maxOccurs="4">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="variable" type="xs:string"/>
            <xs:element name="mode" type="dataTraceModeType"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
230
231
232
233
234
    </xs:choice>
  </xs:sequence>
</xs:complexType>


235
236
237
238
<!-- Configuration of the GPIO tracing service -->
<xs:complexType name="gpioTracingConfType">
  <xs:sequence>
    <xs:element name="obsIds" type="obsIdListRestType"/>
239
    <xs:element name="pins" type="pinTracingListType" minOccurs="1" maxOccurs="1"/>
240
    <xs:element name="offset" type="offsetSecsType" minOccurs="0" maxOccurs="1"/>
241
242
243
244
245
246
247
248
  </xs:sequence>
</xs:complexType>


<!-- Configuration of the GPIO actuation service -->
<xs:complexType name="gpioActuationConfType">
  <xs:sequence>
    <xs:element name="obsIds" type="obsIdListRestType"/>
249
    <xs:element name="pinConf" type="gpioActuationPinConfType" minOccurs="1" maxOccurs="250"/>
250
251
252
253
254
255
  </xs:sequence>
</xs:complexType>
<xs:complexType name="gpioActuationPinConfType">
  <xs:sequence>
    <xs:element name="pin" type="pinActType"/>
    <xs:element name="level" type="pinActLevelType"/>
256
    <xs:element name="offset" type="offsetSecsFloatType"/>
257
258
259
260
261
262
263
264
  </xs:sequence>
</xs:complexType>


<!-- Configuration of the power profiling service -->
<xs:complexType name="powerProfilingConfType">
  <xs:sequence>
    <xs:element name="obsIds" type="obsIdListRestType"/>
265
266
267
268
    <xs:element name="offset" type="offsetSecsType" minOccurs="1" maxOccurs="1"/>
    <xs:choice minOccurs="0" maxOccurs="3">
      <xs:element name="fileFormat" type="profConfFileFormat" minOccurs="0" maxOccurs="1"/>
      <xs:element name="duration" type="powerProfDurationType" minOccurs="0" maxOccurs="1"/>
Reto Da Forno's avatar
Reto Da Forno committed
269
270
      <xs:element name="samplingRate" type="powerProfSamplingRateType" minOccurs="0" maxOccurs="1"/>
    </xs:choice>
271
272
273
274
275
276
277
278
279
280
281
282
  </xs:sequence>
</xs:complexType>


<!-- ############################################################################### 
     # The following blocks define helper types for custom types that are used in  #
     # several configurations.                                                     #
     ############################################################################### -->

<!-- Type definition for platforms -->
<xs:simpleType name="platformType">
  <xs:restriction base="xs:string">
Reto Da Forno's avatar
Reto Da Forno committed
283
    <xs:pattern value="tmote|dpp|dpp2lora|dpp2lorahg|nrf5"/>
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
  </xs:restriction>
</xs:simpleType>

<!-- Type definitions for observer IDs -->
<xs:simpleType name="obsIdListRestType">
  <xs:restriction base="obsIdListType">
  	<xs:minLength value="1"/>
  </xs:restriction>
</xs:simpleType>

<xs:simpleType name="obsIdListType">
  <xs:list itemType="obsIdType"/>
</xs:simpleType>

<xs:simpleType name="obsIdType">
Reto Da Forno's avatar
Reto Da Forno committed
299
  <xs:restriction base="xs:string">
300
    <xs:pattern value="2|02|4|04|5|05|6|06|7|07|8|08|9|09|10|11|12|ALL"/>
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
  </xs:restriction>
</xs:simpleType>

<!-- Type definition for target IDs -->
<xs:simpleType name="targetIdListRestType">
  <xs:restriction base="targetIdListType">
  	<xs:minLength value="1"/>
  </xs:restriction>
</xs:simpleType>

<xs:simpleType name="targetIdListType">
  <xs:list itemType="xs:unsignedShort"/>
</xs:simpleType>

<!-- Type definition for embedded target image IDs -->
<xs:simpleType name="embeddedImageIdType">
  <xs:restriction base="xs:string">
    <xs:pattern value="([a-zA-Z0-9_])+"/>
  </xs:restriction>
</xs:simpleType>

<!-- Type definition for tracable GPIOs -->
<xs:simpleType name="pinTracingType">
  <xs:restriction base="xs:string">
    <xs:pattern value="INT1|INT2|LED1|LED2|LED3"/>
  </xs:restriction>
</xs:simpleType>

329
330
331
332
<xs:simpleType name="pinTracingListType">
  <xs:list itemType="pinTracingType"/>
</xs:simpleType>

333
334
335
<!-- Type definition for actuation enabled GPIOs -->
<xs:simpleType name="pinActType">
  <xs:restriction base="xs:string">
336
    <xs:pattern value="SIG1|SIG2"/>
337
338
339
340
341
342
343
344
345
346
  </xs:restriction>
</xs:simpleType>

<!-- Type definition for actuation enabled GPIO levels -->
<xs:simpleType name="pinActLevelType">
  <xs:restriction base="xs:string">
    <xs:pattern value="low|high|toggle"/>
  </xs:restriction>
</xs:simpleType>

Reto Da Forno's avatar
Reto Da Forno committed
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
<!-- Type definition for power profiling file format -->
<xs:simpleType name="profConfFileFormat">
  <xs:restriction base="xs:string">
    <xs:enumeration value="csv"/>
    <xs:enumeration value="rld"/>
  </xs:restriction>
</xs:simpleType>

<!-- Type definition for duration of a power profile in seconds -->
<xs:simpleType name="powerProfDurationType">
  <xs:restriction base="xs:integer">
    <xs:minInclusive value="1"/>
    <xs:maxInclusive value="3600"/>
  </xs:restriction>
</xs:simpleType>

<!-- Type definition for samling rate of a power profile -->
<xs:simpleType name="powerProfSamplingRateType">
  <xs:restriction base="xs:integer">
    <xs:pattern value="1|10|100|1000|2000|4000|8000|16000|32000|64000"/>
  </xs:restriction>
</xs:simpleType>

370
371
372
373
374
375
376
377
<!-- Type definition for time offset in seconds -->
<xs:simpleType name="offsetSecsType">
  <xs:restriction base="xs:integer">
    <xs:minInclusive value="0"/>
    <xs:maxInclusive value="3600"/>
  </xs:restriction>
</xs:simpleType>

378
379
380
381
382
383
384
385
<!-- Type definition for time offset in seconds -->
<xs:simpleType name="offsetSecsFloatType">
  <xs:restriction base="xs:float">
    <xs:minInclusive value="0.0"/>
    <xs:maxInclusive value="4294.967295"/>
  </xs:restriction>
</xs:simpleType>

386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
<!-- Type definition for time offset in microseconds -->
<xs:simpleType name="microsecsType">
  <xs:restriction base="xs:integer">
    <xs:minInclusive value="0"/>
    <xs:maxInclusive value="999999"/>
  </xs:restriction>
</xs:simpleType>

<!-- Type definition for slot assignements -->
<xs:simpleType name="slotNrType">
  <xs:restriction base="xs:integer">
    <xs:minInclusive value="1"/>
    <xs:maxInclusive value="4"/>
  </xs:restriction>
</xs:simpleType>

<!-- Type definition for test duration in seconds -->
<xs:simpleType name="testDurationSecsType">
  <xs:restriction base="xs:integer">
405
    <xs:minInclusive value="20"/>
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
  </xs:restriction>
</xs:simpleType>

<!-- Group definition for test start/end -->
<xs:group name="testDurationAbsoluteGroup">
  <xs:all>
    <xs:element name="start" type="xs:dateTime"/>
    <xs:element name="end" type="xs:dateTime"/>
  </xs:all>
</xs:group>

<!-- Type definition for unsigned int -->
<xs:simpleType name="unsignedIntType">
  <xs:restriction base="xs:integer">
    <xs:minInclusive value="0"/>
    <xs:maxInclusive value="4294967295"/>
  </xs:restriction>
</xs:simpleType>

<xs:simpleType name="periodicCountType">
  <xs:restriction base="xs:integer">
    <xs:minInclusive value="1"/>
    <xs:maxInclusive value="4294967295"/>
  </xs:restriction>
</xs:simpleType>

<!-- Type definition for IP addresses -->
<xs:simpleType name="ipType">
  <xs:restriction base="xs:string">
435
    <xs:pattern value="((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])|(\s*)"/>
436
437
438
  </xs:restriction>
</xs:simpleType>

439
440
441
442
443
444
445
<!-- Type definition for TCP port -->
<xs:simpleType name="portType">
  <xs:restriction base="xs:integer">
    <xs:minInclusive value="1025"/>
    <xs:maxInclusive value="65535"/>
  </xs:restriction>
</xs:simpleType>
446

Reto Da Forno's avatar
wip    
Reto Da Forno committed
447
448
449
450
451
452
<xs:simpleType name="dataTraceModeType">
  <xs:restriction base="xs:string">
    <xs:pattern value="R|W|RW|PC"/>
  </xs:restriction>
</xs:simpleType>

453
</xs:schema>