flocklab.xsd 19.1 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
53
	 */
-->

<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. -->
    <xs:element name="imageConf" type="imageConfType"/>
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
102
103
104
105
106
107
108
109
110
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
155
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
201
202
203
204
205
206
    <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>
    </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 -->
<xs:complexType name="imageConfType">
  <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"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:element>
    <xs:element name="mode" minOccurs="0">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="pck|ascii|raw"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:element>
    <xs:element name="remoteIp" type="ipType" minOccurs="0"/>
  </xs:all>
</xs:complexType>


207
208
209
210
211
212
213
214
215
216
217
218
<!-- Configuration of the debug service -->
<xs:complexType name="debugConfType">
  <xs:sequence>
    <xs:element name="obsIds" type="obsIdListRestType"/>
    <xs:choice minOccurs="0" maxOccurs="2">
      <xs:element name="gdbPort" type="portType" minOccurs="0" maxOccurs="1"/>
      <xs:element name="remoteIp" type="ipType" minOccurs="0" maxOccurs="1"/>
    </xs:choice>
  </xs:sequence>
</xs:complexType>


219
220
221
222
<!-- Configuration of the GPIO tracing service -->
<xs:complexType name="gpioTracingConfType">
  <xs:sequence>
    <xs:element name="obsIds" type="obsIdListRestType"/>
223
224
225
226
    <xs:choice>
      <xs:element name="pinConf" type="gpioTracingPinConfType" minOccurs="1" maxOccurs="unbounded"/>
      <xs:element name="pins" type="pinTracingListType"/>
    </xs:choice>
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
  </xs:sequence>
</xs:complexType>
<xs:complexType name="gpioTracingPinConfType">
  <xs:sequence>
    <xs:element name="pin" type="pinTracingType"/>
    <xs:element name="edge">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="rising|falling|both"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:element>
    <xs:element name="mode">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:pattern value="single|continuous"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:element>
    <xs:choice minOccurs="0" maxOccurs="1">
      <xs:element name="callbackGpioActAdd">
        <xs:complexType>
          <xs:group ref="gpioTracCallbackActAddGroup"/>
        </xs:complexType>
      </xs:element>
      <xs:element name="callbackPowerProfAdd">
        <xs:complexType>
          <xs:group ref="gpioTraccallbackPowerProfAddGroup"/>
        </xs:complexType>
      </xs:element>
    </xs:choice>
  </xs:sequence>
</xs:complexType>


<!-- Configuration of the GPIO actuation service -->
<xs:complexType name="gpioActuationConfType">
  <xs:sequence>
    <xs:element name="obsIds" type="obsIdListRestType"/>
    <xs:element name="pinConf" type="gpioActuationPinConfType" minOccurs="1" maxOccurs="unbounded"/>
  </xs:sequence>
</xs:complexType>
<xs:complexType name="gpioActuationPinConfType">
  <xs:sequence>
    <xs:element name="pin" type="pinActType"/>
    <xs:element name="level" type="pinActLevelType"/>
    <xs:element name="periodic" minOccurs="0" maxOccurs="1">
      <xs:complexType>
        <xs:group ref="gpioActuationPeriodicGroup"/>
      </xs:complexType>
    </xs:element>
    <xs:choice>
      <xs:element name="relativeTime">
        <xs:complexType>
          <xs:group ref="timingRelativeGroup"/>
        </xs:complexType>
      </xs:element>
      <xs:element name="absoluteTime">
        <xs:complexType>
          <xs:group ref="timingAbsoluteGroup"/>
        </xs:complexType>
      </xs:element>
    </xs:choice>
  </xs:sequence>
</xs:complexType>


<!-- Configuration of the power profiling service -->
<xs:complexType name="powerProfilingConfType">
  <xs:sequence>
    <xs:element name="obsIds" type="obsIdListRestType"/>
Reto Da Forno's avatar
Reto Da Forno committed
298
299
    <xs:element name="fileFormat" type="profConfFileFormat" minOccurs="0" maxOccurs="1"/>
    <xs:element name="profConf" type="profConfType" minOccurs="1" maxOccurs="1"/>
300
301
302
303
304
  </xs:sequence>
</xs:complexType>
<xs:complexType name="profConfType">
  <xs:sequence>
    <xs:choice>
Reto Da Forno's avatar
Reto Da Forno committed
305
306
307
308
309
      <xs:element name="durationMillisecs" type="powerProfDurationMSType"/>
      <xs:element name="duration" type="powerProfDurationType"/>
    </xs:choice>
    <xs:choice>
      <xs:element name="offset" type="offsetSecsType"/>
310
311
312
313
314
315
316
317
318
319
320
      <xs:element name="relativeTime">
        <xs:complexType>
          <xs:group ref="timingRelativeGroup"/>
        </xs:complexType>
      </xs:element>
      <xs:element name="absoluteTime">
        <xs:complexType>
          <xs:group ref="timingAbsoluteGroup"/>
        </xs:complexType>
      </xs:element>
    </xs:choice>
Reto Da Forno's avatar
Reto Da Forno committed
321
322
323
324
    <xs:choice>
      <xs:element name="samplingDivider" type="powerProfSamplingDividerType" minOccurs="0" maxOccurs="1"/>
      <xs:element name="samplingRate" type="powerProfSamplingRateType" minOccurs="0" maxOccurs="1"/>
    </xs:choice>
325
326
327
328
329
330
331
332
333
334
335
336
  </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">
337
    <xs:pattern value="dpp|dpp2lora|dpp2lorahg|nrf5"/>
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
  </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
353
  <xs:restriction base="xs:string">
354
    <xs:pattern value="2|02|4|04|5|05|6|06|7|07|8|08|9|09|10|11|12|ALL"/>
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
  </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>

383
384
385
386
<xs:simpleType name="pinTracingListType">
  <xs:list itemType="pinTracingType"/>
</xs:simpleType>

387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
<!-- Type definition for actuation enabled GPIOs -->
<xs:simpleType name="pinActType">
  <xs:restriction base="xs:string">
    <xs:pattern value="SIG1|SIG2|RST"/>
  </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>

<!-- Group definitions for GPIO tracing callbacks -->
<xs:group name="gpioTracCallbackActAddGroup">
  <xs:all>
    <xs:element name="pin" type="pinActType"/>
    <xs:element name="level" type="pinActLevelType"/>
    <xs:element name="offsetSecs" type="offsetSecsType"/>
    <xs:element name="offsetMicrosecs" type="microsecsType"/>
  </xs:all>
</xs:group>

<xs:group name="gpioTraccallbackPowerProfAddGroup">
  <xs:all>
Reto Da Forno's avatar
Reto Da Forno committed
413
    <xs:element name="durationMillisecs" type="powerProfDurationMSType"/>
414
415
416
417
418
    <xs:element name="offsetSecs" type="offsetSecsType"/>
    <xs:element name="offsetMicrosecs" type="microsecsType"/>
  </xs:all>
</xs:group>

Reto Da Forno's avatar
Reto Da Forno committed
419
420
421
422
423
424
425
426
<!-- 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>

427
<!-- Type definition for duration of a power profile in milliseconds -->
Reto Da Forno's avatar
Reto Da Forno committed
428
<xs:simpleType name="powerProfDurationMSType">
429
430
431
432
433
434
  <xs:restriction base="xs:integer">
    <xs:minInclusive value="50"/>
    <xs:maxInclusive value="3600000"/>
  </xs:restriction>
</xs:simpleType>

Reto Da Forno's avatar
Reto Da Forno committed
435
436
437
438
439
440
441
442
<!-- 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>

443
444
445
<!-- Type definition for samling divider of a power profile -->
<xs:simpleType name="powerProfSamplingDividerType">
  <xs:restriction base="xs:integer">
Reto Da Forno's avatar
Reto Da Forno committed
446
    <xs:pattern value="1|2|4|8|16|32|64|640|6400|64000"/>
447
448
449
  </xs:restriction>
</xs:simpleType>

Reto Da Forno's avatar
Reto Da Forno committed
450
451
452
453
454
455
456
<!-- 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>

457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
<!-- 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>

<!-- 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>

<!-- Group definitions for timing groups -->
<xs:group name="timingRelativeGroup">
  <xs:all>
    <xs:element name="offsetSecs" type="offsetSecsType"/>
    <xs:element name="offsetMicrosecs" type="microsecsType" minOccurs="0" maxOccurs="1"/>
  </xs:all>
</xs:group>

<xs:group name="timingAbsoluteGroup">
  <xs:all>
    <xs:element name="absoluteDateTime" type="xs:dateTime"/>
    <xs:element name="absoluteMicrosecs" type="microsecsType" minOccurs="0" maxOccurs="1"/>
  </xs:all>
</xs:group>

<!-- 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">
    <xs:minInclusive value="10"/>
  </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>

<!-- Type definitions for periodic GPIO actuations -->
<xs:simpleType name="periodicIntervalMicrosecsType">
  <xs:restriction base="xs:integer">
    <xs:minInclusive value="100"/>
    <xs:maxInclusive value="3600000000"/>
  </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>

<!-- Group definition for GPIO actuation periodic group -->
<xs:group name="gpioActuationPeriodicGroup">
  <xs:all>
    <xs:element name="intervalMicrosecs" type="periodicIntervalMicrosecsType"/>
    <xs:element name="count" type="periodicCountType"/>
  </xs:all>
</xs:group>

<!-- Type definition for IP addresses -->
<xs:simpleType name="ipType">
  <xs:restriction base="xs:string">
545
    <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*)"/>
546
547
548
  </xs:restriction>
</xs:simpleType>

549
550
551
552
553
554
555
<!-- 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>
556
557

</xs:schema>