This repository has been archived by the owner on Dec 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 78
/
Definition.xsd
526 lines (504 loc) · 21.4 KB
/
Definition.xsd
1
2
3
4
5
6
7
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
54
55
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
82
83
84
85
86
87
88
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
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
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
298
299
300
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
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
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
383
384
385
386
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
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
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
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is part of Kayak.
Kayak is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Kayak is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with Kayak. If not, see <http://www.gnu.org/licenses/>.
-->
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified"
targetNamespace="http://kayak.2codeornot2code.org/1.0"
xmlns:kcd="http://kayak.2codeornot2code.org/1.0"
xmlns="http://kayak.2codeornot2code.org/1.0">
<xs:element name="NetworkDefinition">
<xs:annotation>
<xs:documentation>Definition of one or more CAN bus networks in one file.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="1" ref="Document"/>
<xs:element minOccurs="0" maxOccurs="unbounded" ref="Node"/>
<xs:element maxOccurs="unbounded" ref="Bus"/>
</xs:sequence>
</xs:complexType>
<xs:key name="nodeIdKey">
<xs:annotation>
<xs:documentation>Assurance that the identifier (id) of a network node is unique.</xs:documentation>
</xs:annotation>
<xs:selector xpath="kcd:Node"/>
<xs:field xpath="@id"/>
</xs:key>
<xs:unique name="busNameUniqueness">
<xs:annotation>
<xs:documentation>Assurance that there are no duplicate bus names (assures bus name uniqueness).</xs:documentation>
</xs:annotation>
<xs:selector xpath="kcd:Bus"/>
<xs:field xpath="@name"/>
</xs:unique>
<xs:keyref name="nodeIdKeyRef" refer="nodeIdKey">
<xs:annotation>
<xs:documentation>Assurance that the references node, to identify the producer of a network message, was already created.</xs:documentation>
</xs:annotation>
<xs:selector xpath="kcd:Bus/kcd:Message/kcd:Producer/kcd:NodeRef"/>
<xs:field xpath="@id"/>
</xs:keyref>
</xs:element>
<xs:element name="Bus">
<xs:annotation>
<xs:documentation>A network transport system that transfers the data between several nodes.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="Message" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="name" use="required" type="xs:string">
<xs:annotation>
<xs:documentation>Human-readable name of the bus network (e.g. "Comfort").</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute default="500000" name="baudrate">
<xs:annotation>
<xs:documentation>Nominal data transfer rate in baud (e.g. 500000, 125000, 100000 or 83333).</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:nonNegativeInteger">
<xs:minInclusive value="5000"/>
<xs:maxInclusive value="1000000"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:unique name="messageIdUniqueness">
<xs:annotation>
<xs:documentation>Assurance that the identifier of a network message is unique.</xs:documentation>
</xs:annotation>
<xs:selector xpath="kcd:Message"/>
<xs:field xpath="@id"/>
</xs:unique>
</xs:element>
<xs:element name="Message">
<xs:annotation>
<xs:documentation>A datagram that is used to transport payload data along the bus network.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" ref="Notes"/>
<xs:element minOccurs="0" ref="Producer"/>
<xs:element minOccurs="0" ref="Multiplex" maxOccurs="unbounded"/>
<xs:element maxOccurs="unbounded" ref="Signal" minOccurs="0"/>
</xs:sequence>
<xs:attribute name="id" use="required">
<xs:annotation>
<xs:documentation>The unique identifier of the message. May have 11-bit (Standard frame format) or 29-bit (Extended frame format). The identifier is usally written in hexadecimal format e.g. 0x123. If format is "extended" this identifier includes both Base ID (11 bits) and Extended ID (18 bits).</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="0x[A-F0-9]+"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="name" use="required" type="xs:string">
<xs:annotation>
<xs:documentation>Human-readable name of the network message (e.g."OBD-Info").</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="length" use="optional" default="auto">
<xs:annotation>
<xs:documentation>Number of bytes available in the data field of the message (data length code). "auto" (default) calculate minimum length for the contained signals in the message. Length greater than 8 is only allowed in messages with flexible data rate (fd).</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="auto"/>
<xs:enumeration value="0"/>
<xs:enumeration value="1"/>
<xs:enumeration value="2"/>
<xs:enumeration value="3"/>
<xs:enumeration value="4"/>
<xs:enumeration value="5"/>
<xs:enumeration value="6"/>
<xs:enumeration value="7"/>
<xs:enumeration value="8"/>
<xs:enumeration value="12"/>
<xs:enumeration value="16"/>
<xs:enumeration value="20"/>
<xs:enumeration value="24"/>
<xs:enumeration value="32"/>
<xs:enumeration value="48"/>
<xs:enumeration value="64"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="interval" use="optional" default="0">
<xs:annotation>
<xs:documentation>Repetition interval of a cyclic network message in milliseconds.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:nonNegativeInteger">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="60000"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="triggered" use="optional" type="xs:boolean" default="false">
<xs:annotation>
<xs:documentation>Sending behavior of the network message. True, if message is triggered by signal changes.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute default="0" name="count">
<xs:annotation>
<xs:documentation>Number of repetitions of a triggered network message. 0 (default) for infinite repetitions.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:nonNegativeInteger">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="1000000"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="format" use="optional" default="standard">
<xs:annotation>
<xs:documentation>Frame format of the network message.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="standard"/>
<xs:enumeration value="extended"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="fd" use="optional" type="xs:boolean" default="false">
<xs:annotation>
<xs:documentation>True, if frame formats of the network message supports flexible data rate (dual bit rate).</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="bitrateswitch" use="optional" type="xs:boolean" default="false">
<xs:annotation>
<xs:documentation>True, if this CAN-FD message is sent with the BRS (bit-rate switch) bit set, i.e. a higher bitrate should be used to send the payload of the message. Setting this to bitrateswitch="true", if canfd="false" or canfd unset (default), is an error.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="remote" use="optional" type="xs:boolean" default="false">
<xs:annotation>
<xs:documentation>True, if message is a remote frame. Not possible in messages with flexible data rate (fd).</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="Multiplex">
<xs:annotation>
<xs:documentation>A looping counter to make a group of signals (MuxGroup) alternately active at a time.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:complexContent>
<xs:extension base="BasicSignalType">
<xs:sequence>
<xs:element ref="MuxGroup" maxOccurs="unbounded"/>
<xs:element ref="Notes" minOccurs="0"/>
<xs:element ref="Consumer" minOccurs="0"/>
<xs:element ref="Value" minOccurs="0"/>
<xs:element ref="LabelSet" minOccurs="0"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="MuxGroup">
<xs:annotation>
<xs:documentation>A group of signals that is just valid when the count value of the group matches with the looping counter (Multiplex).</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="Signal"/>
</xs:sequence>
<xs:attribute name="count" use="required">
<xs:annotation>
<xs:documentation>Count value of the Multiplex when the signals of this group become valid.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:long">
<xs:minInclusive value="0"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="LabelSet">
<xs:annotation>
<xs:documentation>A set of label and label groups. Each label describes the meaning of a single raw value by an alias name. A single value can only belong to a one label or label group.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element ref="Label" minOccurs="0"/>
<xs:element ref="LabelGroup" minOccurs="0"/>
</xs:choice>
</xs:complexType>
</xs:element>
<xs:element name="Signal">
<xs:annotation>
<xs:documentation>A discrete part of information contained in the payload of a message.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:complexContent>
<xs:extension base="BasicSignalType">
<xs:sequence>
<xs:element ref="Notes" minOccurs="0"/>
<xs:element ref="Consumer" minOccurs="0"/>
<xs:element ref="Value" minOccurs="0"/>
<xs:element ref="LabelSet" minOccurs="0"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="Notes" type="xs:string">
<xs:annotation>
<xs:documentation>Describes the purpose of the signal/variable and/or comments on its usage.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="Producer">
<xs:annotation>
<xs:documentation>Origin network node that is the sender of the assigned message.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="NodeRef"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Consumer">
<xs:annotation>
<xs:documentation>Network node that is a user/receiver of the assigned signal.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element maxOccurs="unbounded" ref="NodeRef"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Value">
<xs:annotation>
<xs:documentation>Details of how the raw value of the signal/variable shall be interpreted.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attribute name="type" use="optional" default="unsigned">
<xs:annotation>
<xs:documentation>Datatype of the value e.g. "unsigned","signed" or IEE754 "single", "double".</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="unsigned"/>
<xs:enumeration value="signed"/>
<xs:enumeration value="single"/>
<xs:enumeration value="double"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute default="1" name="slope" use="optional" type="xs:double">
<xs:annotation>
<xs:documentation>The slope "m" of a linear equation y = mx + b.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute default="0" name="intercept" type="xs:double">
<xs:annotation>
<xs:documentation>The y-axis intercept "b" of a linear equation y = mx + b. </xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute default="1" name="unit" use="optional" type="xs:string">
<xs:annotation>
<xs:documentation>Physical unit of the value written as unit term as described in "The Unified Code for Units of Measure" (http://unitsofmeasure.org/ucum.html)</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute default="0" name="min" use="optional" type="xs:double">
<xs:annotation>
<xs:documentation>Lower validity limit of the interpreted value after using the slope/intercept equation.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute default="1" name="max" use="optional" type="xs:double">
<xs:annotation>
<xs:documentation>Upper validity limit of the interpreted value after using the slope/intercept equation.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="Label">
<xs:annotation>
<xs:documentation>Descriptive name for a single value e.g. to describe an enumeration, mark special,invalid or error values.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:complexContent>
<xs:extension base="BasicLabelType">
<xs:attribute name="value" type="xs:nonNegativeInteger">
<xs:annotation>
<xs:documentation>Signal raw value that is described here.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="LabelGroup">
<xs:annotation>
<xs:documentation>Descriptive name for a sequence of adjacent values.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:complexContent>
<xs:extension base="BasicLabelType">
<xs:attribute name="from" use="required" type="xs:nonNegativeInteger">
<xs:annotation>
<xs:documentation>Signal raw value the label group is starting with.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="to" use="required" type="xs:nonNegativeInteger">
<xs:annotation>
<xs:documentation>Signal raw value the label group is ending with.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:complexContent>
</xs:complexType>
</xs:element>
<xs:element name="Node">
<xs:annotation>
<xs:documentation>An endpoint connected to the network (e.g. an electronic control unit) that is able to send messages to or receive messages from other endpoints.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence maxOccurs="unbounded" minOccurs="0">
<xs:element ref="Var"/>
</xs:sequence>
<xs:attribute name="id" use="required" type="xs:string">
<xs:annotation>
<xs:documentation>Unique identifier of the network node.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="name" use="optional" default="" type="xs:string">
<xs:annotation>
<xs:documentation>Human-readable name of the network node (e.g. "Brake").</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="NodeRef">
<xs:annotation>
<xs:documentation>An endpoint connected to the network that is able to send messages to or receive messages from other endpoints.</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:attribute name="id" use="required" type="xs:string">
<xs:annotation>
<xs:documentation>Referencing a network node by its unique identifier.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="Document">
<xs:annotation>
<xs:documentation>Describes the scope of application e.g. the target vehicle or controlled device.</xs:documentation>
</xs:annotation>
<xs:complexType mixed="true">
<xs:attribute name="name">
<xs:annotation>
<xs:documentation>The name of the network definition document.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="version">
<xs:annotation>
<xs:documentation>The version of the network definition document.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="author">
<xs:annotation>
<xs:documentation>The owner or author of the network definition document.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="company">
<xs:annotation>
<xs:documentation>The owner company of the network definition document.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="date">
<xs:annotation>
<xs:documentation>The release date of this version of the network definition document.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:element name="Var">
<xs:annotation>
<xs:documentation>A variable, a symbolic name associated to a chunk of information (e.g. a string or a value).</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="Notes" minOccurs="0" maxOccurs="1"/>
<xs:element ref="Value" minOccurs="1" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="name" use="required" type="xs:string">
<xs:annotation>
<xs:documentation>Unique name of the variable.</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
</xs:element>
<xs:complexType name="BasicLabelType">
<xs:attribute name="name" use="required">
<xs:annotation>
<xs:documentation>Human-readable name for this value.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="type" default="value">
<xs:annotation>
<xs:documentation>Type of value: "value", "invalid" or "error".</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="value"/>
<xs:enumeration value="invalid"/>
<xs:enumeration value="error"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
<xs:complexType name="BasicSignalType">
<xs:attribute name="endianess" default="little">
<xs:annotation>
<xs:documentation>Determines if Byteorder is big-endian (Motorola), little-endian (Intel) otherwise.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="little"/>
<xs:enumeration value="big"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="length" default="1">
<xs:annotation>
<xs:documentation>Bit length of the signal.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:positiveInteger">
<xs:minInclusive value="1"/>
<xs:maxInclusive value="512"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="name" use="required" type="xs:string">
<xs:annotation>
<xs:documentation>Human readable name of the signal.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="offset" use="required">
<xs:annotation>
<xs:documentation>Least significant bit offset of the signal relative to the least significant bit of the messages data payload.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:nonNegativeInteger">
<xs:minInclusive value="0"/>
<xs:maxInclusive value="511"/>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
</xs:schema>