flocklab.xsd 17.4 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
	 * This schema can be downloaded from https://user.flocklab.ethz.ch/xml/flocklab.xsd
Reto Da Forno's avatar
Reto Da Forno committed
7
	 * Help is available at https://gitlab.ethz.ch/tec/public/flocklab/wiki/-/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
  <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">
187
          <xs:pattern value="usb|serial|swo"/>
188
189
190
191
192
193
194
195
196
197
198
        </xs:restriction>
      </xs:simpleType>
    </xs:element>
    <xs:element name="baudrate" minOccurs="0">
      <xs:simpleType>
        <xs:restriction base="xs:integer">
          <xs:enumeration value="9600"/>
          <xs:enumeration value="19200"/>
          <xs:enumeration value="38400"/>
          <xs:enumeration value="57600"/>
          <xs:enumeration value="115200"/>
199
200
201
202
          <xs:enumeration value="230400"/>
          <xs:enumeration value="460800"/>
          <xs:enumeration value="921600"/>
          <xs:enumeration value="1000000"/>
Reto Da Forno's avatar
Reto Da Forno committed
203
204
          <xs:enumeration value="1152000"/>
          <xs:enumeration value="1500000"/>
205
          <xs:enumeration value="2000000"/>
Reto Da Forno's avatar
Reto Da Forno committed
206
          <xs:enumeration value="2500000"/>
207
          <xs:enumeration value="3000000"/>
Reto Da Forno's avatar
Reto Da Forno committed
208
209
          <xs:enumeration value="3500000"/>
          <xs:enumeration value="4000000"/>
210
211
212
        </xs:restriction>
      </xs:simpleType>
    </xs:element>
213
    <xs:element name="cpuSpeed" type="cpuSpeedType" minOccurs="0" maxOccurs="1"/>
214
215
216
217
218
    <xs:element name="remoteIp" type="ipType" minOccurs="0"/>
  </xs:all>
</xs:complexType>


219
220
221
222
<!-- Configuration of the debug service -->
<xs:complexType name="debugConfType">
  <xs:sequence>
    <xs:element name="obsIds" type="obsIdListRestType"/>
223
224
    <xs:element name="cpuSpeed" type="cpuSpeedType" minOccurs="0" maxOccurs="1"/>
    <xs:choice minOccurs="1" maxOccurs="1">
225
226
      <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
227
228
229
      <xs:element name="dataTraceConf" minOccurs="0" maxOccurs="4">
        <xs:complexType>
          <xs:sequence>
230
231
232
233
234
235
236
237
238
239
240
            <xs:element name="variable" type="xs:string" />
            <xs:element name="mode" type="dataTraceModeListType" minOccurs="0" />
            <xs:element name="size" minOccurs="0">
              <xs:simpleType>
                <xs:restriction base="xs:integer">
                  <xs:enumeration value="1"/>
                  <xs:enumeration value="2"/>
                  <xs:enumeration value="4"/>
                </xs:restriction>
              </xs:simpleType>
            </xs:element>
Reto Da Forno's avatar
wip    
Reto Da Forno committed
241
242
243
          </xs:sequence>
        </xs:complexType>
      </xs:element>
244
245
246
247
248
    </xs:choice>
  </xs:sequence>
</xs:complexType>


249
250
251
252
<!-- Configuration of the GPIO tracing service -->
<xs:complexType name="gpioTracingConfType">
  <xs:sequence>
    <xs:element name="obsIds" type="obsIdListRestType"/>
253
    <xs:element name="pins" type="pinTracingListType" minOccurs="1" maxOccurs="1"/>
254
    <xs:element name="offset" type="offsetSecsType" minOccurs="0" maxOccurs="1"/>
255
256
257
258
259
260
261
262
  </xs:sequence>
</xs:complexType>


<!-- Configuration of the GPIO actuation service -->
<xs:complexType name="gpioActuationConfType">
  <xs:sequence>
    <xs:element name="obsIds" type="obsIdListRestType"/>
263
    <xs:element name="pinConf" type="gpioActuationPinConfType" minOccurs="1" maxOccurs="1000"/>
264
265
266
267
268
269
  </xs:sequence>
</xs:complexType>
<xs:complexType name="gpioActuationPinConfType">
  <xs:sequence>
    <xs:element name="pin" type="pinActType"/>
    <xs:element name="level" type="pinActLevelType"/>
270
    <xs:element name="offset" type="offsetSecsFloatType"/>
271
272
    <xs:element name="period" type="periodSecsFloatType" minOccurs="0"/>
    <xs:element name="count" type="periodicCountType" minOccurs="0"/>
273
274
275
276
277
278
279
280
  </xs:sequence>
</xs:complexType>


<!-- Configuration of the power profiling service -->
<xs:complexType name="powerProfilingConfType">
  <xs:sequence>
    <xs:element name="obsIds" type="obsIdListRestType"/>
281
282
283
284
    <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
285
286
      <xs:element name="samplingRate" type="powerProfSamplingRateType" minOccurs="0" maxOccurs="1"/>
    </xs:choice>
287
288
289
290
291
292
293
294
295
296
297
298
  </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
299
    <xs:pattern value="tmote|dpp|dpp2lora|dpp2lorahg|nrf5"/>
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
  </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
315
  <xs:restriction base="xs:string">
Reto Da Forno's avatar
Reto Da Forno committed
316
    <xs:pattern value="1|01|2|02|3|03|4|04|5|05|6|06|7|07|8|08|9|09|10|11|12|13|15|16|17|19|20|21|22|23|24|25|26|27|28|29|31|ALL"/>
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
  </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>

345
346
347
348
<xs:simpleType name="pinTracingListType">
  <xs:list itemType="pinTracingType"/>
</xs:simpleType>

349
350
351
<!-- Type definition for actuation enabled GPIOs -->
<xs:simpleType name="pinActType">
  <xs:restriction base="xs:string">
Reto Da Forno's avatar
Reto Da Forno committed
352
    <xs:pattern value="SIG1|SIG2|nRST"/>
353
354
355
356
357
358
359
360
361
362
  </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
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
<!-- 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>

386
387
388
389
390
391
392
393
<!-- 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>

394
395
396
397
398
399
400
401
<!-- 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>

402
403
404
405
406
407
408
<xs:simpleType name="periodSecsFloatType">
  <xs:restriction base="xs:float">
    <xs:minInclusive value="0.001"/>
    <xs:maxInclusive value="1000.0"/>
  </xs:restriction>
</xs:simpleType>

409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
<!-- 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">
428
    <xs:minInclusive value="20"/>
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
  </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"/>
451
    <xs:maxInclusive value="500"/>
452
453
454
455
456
457
  </xs:restriction>
</xs:simpleType>

<!-- Type definition for IP addresses -->
<xs:simpleType name="ipType">
  <xs:restriction base="xs:string">
458
    <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*)"/>
459
460
461
  </xs:restriction>
</xs:simpleType>

462
463
464
465
466
467
468
<!-- 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>
469

Reto Da Forno's avatar
wip    
Reto Da Forno committed
470
471
472
473
474
475
<xs:simpleType name="dataTraceModeType">
  <xs:restriction base="xs:string">
    <xs:pattern value="R|W|RW|PC"/>
  </xs:restriction>
</xs:simpleType>

476
477
478
479
480
481
482
<xs:simpleType name="cpuSpeedType">
  <xs:restriction base="xs:integer">
    <xs:minInclusive value="1000000"/>
    <xs:maxInclusive value="80000000"/>
  </xs:restriction>
</xs:simpleType>

Reto Da Forno's avatar
Reto Da Forno committed
483
484
485
486
<xs:simpleType name="dataTraceModeListType">
  <xs:list itemType="dataTraceModeType"/>
</xs:simpleType>

487
</xs:schema>