Skip to content

Commit 985bbf6

Browse files
committed
Release v5.0
2 parents 71a3de9 + 0b5f07a commit 985bbf6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+936
-54
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ if (NOT ASCIIDOCTOR_PDF_EXE)
1111
message(FATAL_ERROR "asciidoctor-pdf is not found")
1212
endif ()
1313

14-
set (VERSION "v4.0")
14+
set (VERSION "v5.0")
1515
set (MAIN_FILE "${PROJECT_SOURCE_DIR}/commsdsl_spec.adoc")
1616

1717
add_custom_target("pdf" ALL

aliases/aliases.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2+
<<<
13
[[aliases-aliases]]
24
== Aliases ==
35
It is not uncommon for a particular field to change its meaning and as the

appendix/alias.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<<<
12
[[appendix-alias]]
23
=== Properties of &lt;alias&gt; ===
34
Refer to <<aliases-aliases, Aliases>> chapter for detailed description.

appendix/appendix.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
2+
<<<
13
[[appendix-appendix]]
24
== Appendix ==
35
This chapter contains list of properties for all the elements described earlier
46
in this document for a quick reference.
57

8+
include::reference.adoc[]
69
include::schema.adoc[]
710
include::fields.adoc[]
811
include::enum.adoc[]

appendix/bitfield.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<<<
12
[[appendix-bitfield]]
23
=== Properties of &lt;bitfield&gt; Field ===
34
The **&lt;bitfield&gt;** field has all the <<appendix-fields, common>> properties as
@@ -18,4 +19,5 @@ Extra child XML elements allowed:
1819
|XML Element|DSL Version ^.^|Description
1920

2021
|**&lt;members&gt;**|1|Wraps member fields.
22+
|**&lt;replace&gt;**|5|Wraps replacing member fields after copying using **reuse** property.
2123
|===

appendix/bundle.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<<<
12
[[appendix-bundle]]
23
=== Properties of &lt;bundle&gt; Field ===
34
The **&lt;bundle&gt;** field has all the <<appendix-fields, common>> properties as
@@ -19,4 +20,5 @@ Extra child XML elements allowed:
1920

2021
|**&lt;members&gt;**|1|Wraps member fields.
2122
|**&lt;alias&gt;**|3|Alias names for other member fields. See <<aliases-aliases, Aliases>> for more info.
23+
|**&lt;replace&gt;**|5|Wraps replacing member fields after copying using **reuse** property.
2224
|===

appendix/checksum.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<<<
12
[[appendix-checksum]]
23
=== Properties of &lt;checksum&gt; Frame Layer ===
34
The **&lt;checksum&gt;** layer has all the <<appendix-layers, common>> properties as

appendix/custom.adoc

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
1+
<<<
12
[[appendix-custom]]
23
=== Properties of &lt;custom&gt; Frame Layer ===
34
The **&lt;custom&gt;** layer has all the <<appendix-layers, common>> properties as
45
well as ones listed below. Refer to <<frames-custom, &lt;custom&gt; Layer>> chapter
56
for detailed description.
67

7-
[cols="^.^28,^.^10,^.^8,^.^8,^.^10,36", options="header"]
8+
[cols="^.^27,^.^11,^.^8,^.^10,^.^10,34", options="header"]
89
|===
910
|Property Name|Allowed Type / Value|DSL Version|Required|Default Value ^.^|Description
10-
11-
|**idReplacement**|<<intro-boolean, bool>>|1|no|false|Mark the layer as one replacing <<frames-id, &lt;id&gt; >>.
11+
|**[.line-through]#idReplacement#**|<<intro-boolean, bool>>|1|no|false|Mark the layer as one replacing <<frames-id, &lt;id&gt; >>. +
12+
**Deprecated**, use `semanticLayerType="id"` instead.
13+
|**semanticLayerType**|"payload", "id", "size", "sync", "checksum", "value", "custom"|5|no|custom|Specify what other layer **&lt;custom&gt;** one is replacing.
14+
|**checksumFrom**|<<intro-names, name>> string|5|no (unless **semanticLayerType** is "checksum" and **checksumUntil** is empty)||Name of the frame layer, from which the checksum calculation starts. Applicable only when `semanticLayerType="checksum"`.
15+
|**checksumUntil**|<<intro-names, name>> string|5|no (unless **semanticLayerType** is "checksum" and **checksumFrom** is empty)||Name of the frame layer, until (and including) which the checksum calculation is executed. Applicable only when `semanticLayerType="checksum"`.
1216
|===

appendix/data.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<<<
12
[[appendix-data]]
23
=== Properties of &lt;data&gt; Field ===
34
The **&lt;data&gt;** field has all the <<appendix-fields, common>> properties as

appendix/enum.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<<<
12
[[appendix-enum]]
23
=== Properties of &lt;enum&gt; Field ===
34
The **&lt;enum&gt;** field has all the <<appendix-fields, common>> properties as

appendix/fields.adoc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
2+
<<<
13
[[appendix-fields]]
24
=== Common Properties of Fields ===
35
Refer to <<fields-common, Common Properties of Fields>> chapter for detailed description.
@@ -8,7 +10,7 @@ Refer to <<fields-common, Common Properties of Fields>> chapter for detailed des
810

911
|**name**|<<intro-names, name>> string|1|yes||Name of the field.
1012
|**description**|string|1|no||Human readable description of the field.
11-
|**reuse**|<<intro-references, reference>> string|1|no||Field definition of which to copy.
13+
|**reuse**|<<intro-references, reference>> string|1|no||Field, definition of which to copy.
1214
|**displayName**|string|1|no||Name of the field to display. If empty, the code generator must use value of property **name** instead. In order to force empty name to display, use "_" (underscore).
1315
|**displayReadOnly**|<<intro-boolean, bool>>|1|no|false|Disable modification of the field in visual analysis tool(s).
1416
|**displayHidden**|<<intro-boolean, bool>>|1|no|false|Don't display field at all in visual analysis tool(s).
@@ -24,10 +26,13 @@ Applicable only to members of the <<messages-messages, &lt;message&gt; >> or <<f
2426
|**customizable**|<<intro-boolean, bool>>|1|no|false|Mark the field to allow compile time customization regardless of code generator's level of customization.
2527
|**semanticType**|"none", "messageId", "version", "length"|1|no|none|Specify semantic type of the field. It allows code generator to generate special code for special cases. Value "length" was introduced in **v2** of this specification.
2628
|**forceGen**|<<intro-boolean, bool>>|3|no|false|Force generation of field's code regardless of it's being referenced or not.
29+
|**valueOverride**|"any", "replace", "extend", "none"|4|no|any|Control the overriding code for **value** operation.
2730
|**readOverride**|"any", "replace", "extend", "none"|4|no|any|Control the overriding code for **read** operation.
2831
|**writeOverride**|"any", "replace", "extend", "none"|4|no|any|Control the overriding code for **write** operation.
2932
|**refreshOverride**|"any", "replace", "extend", "none"|4|no|any|Control the overriding code for **refresh** operation.
3033
|**lengthOverride**|"any", "replace", "extend", "none"|4|no|any|Control the overriding code for **length** retrieval.
3134
|**validOverride**|"any", "replace", "extend", "none"|4|no|any|Control the overriding code for **valid** retrieval.
3235
|**nameOverride**|"any", "replace", "extend", "none"|4|no|any|Control the overriding code for **name** retrieval.
36+
|**copyCodeFrom**|<<intro-references, reference>> string|5|no||Specify field, overriding or other extra code of which needs to be copied.
37+
|**reuseCode**|<<intro-boolean, bool>>|5|no|false|In case of **reuse** apply **copyCodeFrom** with the same <<intro-references, reference>> string.
3338
|===

appendix/float.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<<<
12
[[appendix-float]]
23
=== Properties of &lt;float&gt; Field ===
34
The **&lt;float&gt;** field has all the <<appendix-fields, common>> properties as

appendix/frame.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<<<
12
[[appendix-frame]]
23
=== Properties of &lt;frame&gt; ===
34
Refer to <<frames-frames, Frames>> chapter

appendix/int.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<<<
12
[[appendix-int]]
23
=== Properties of &lt;int&gt; Field ===
34
The **&lt;int&gt;** field has all the <<appendix-fields, common>> properties as

appendix/interface.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<<<
12
[[appendix-interface]]
23
=== Properties of &lt;interface&gt; ===
34
Refer to <<interfaces-interfaces, Interfaces>> chapter

appendix/layers.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<<<
12
[[appendix-layers]]
23
=== Common Properties of Frame Layers ===
34
Refer to <<frames-common, Common Properties of Layers>> chapter for detailed description.

appendix/list.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<<<
12
[[appendix-list]]
23
=== Properties of &lt;list&gt; Field ===
34
The **&lt;list&gt;** field has all the <<appendix-fields, common>> properties as
@@ -14,5 +15,6 @@ for detailed description.
1415
|**lengthPrefix**|<<fields-fields, field>> or <<intro-references, reference>>|1|no||Prefix field containing serialization length of the list. Cannot be used tegether with **count** or **countPrefix**.
1516
|**elemLengthPrefix**|<<fields-fields, field>>|1|no||Prefix field containing serialization length of the list **element**.
1617
|**elemFixedLength**|<<intro-boolean, bool>>|1|no|false|Indication of whether list has and will allways have fixed length element, so **elemLengthPrefix** prefixes only the first element and not the rest.
18+
|**termSuffix**|<<fields-fields, field>>|5|no||Suffix field terminating the list.
1719
|===
1820

appendix/message.adoc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<<<
12
[[appendix-message]]
23
=== Properties of &lt;message&gt; ===
34
Refer to <<messages-messages, Messages>> chapter
@@ -27,6 +28,7 @@ Must be greater than value of **sinceVersion**.
2728
|**lengthOverride**|"any", "replace", "extend", "none"|4|no|any|Control the overriding code for **length** retrieval.
2829
|**validOverride**|"any", "replace", "extend", "none"|4|no|any|Control the overriding code for **valid** retrieval.
2930
|**nameOverride**|"any", "replace", "extend", "none"|4|no|any|Control the overriding code for **name** retrieval.
31+
|**copyCodeFrom**|<<intro-references, reference>> string|5|no||Specify message, overriding or other extra code of which needs to be copied.
3032
|===
3133

3234
Extra child XML elements allowed:
@@ -37,4 +39,5 @@ Extra child XML elements allowed:
3739

3840
|**&lt;fields&gt;**|1|Wraps member fields.
3941
|**&lt;alias&gt;**|3|Alias names for other member fields. See <<aliases-aliases, Aliases>> for more info.
42+
|**&lt;replace&gt;**|5|Wraps replacing fields after copying using **copyFieldsFrom** property.
4043
|===

appendix/optional.adoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
1+
<<<
12
[[appendix-optional]]
23
=== Properties of &lt;optional&gt; Field ===
34
The **&lt;optional&gt;** field has all the <<appendix-fields, common>> properties as
45
well as ones listed below. Refer to <<fields-optional, &lt;optional&gt; Field>> chapter
56
for detailed description.
67

7-
[cols="^.^28,^.^10,^.^8,^.^8,^.^10,36", options="header"]
8+
[cols="^.^27,^.^11,^.^8,^.^8,^.^10,36", options="header"]
89
|===
910
|Property Name|Allowed Type / Value|DSL Version|Required|Default Value ^.^|Description
1011

1112
|**field**|<<fields-fields, field>>|1|no||Wrapped field.
1213
|**defaultMode**|"tentative", "missing", "exist"|1|no|tentative|Default mode of the field. See also <<appendix-optional-default-mode, Default Mode Strings>> below.
1314
|**cond**|string|1|no||Condition when the field exists.
1415
|**displayExtModeCtrl**|<<intro-boolean, bool>>|1|no|false|Disable manual update of the mode in GUI analysis tools.
16+
|**missingOnReadFail**|<<intro-boolean, bool>>|5|no|false|Mark the field as "missing" if its read operation fails.
17+
|**missingOnInvalid**|<<intro-boolean, bool>>|5|no|false|Mark the field as "missing" if the field's value is invalid.
1518
|===
1619

1720
Inner field must be specified using **field** property or as

appendix/ref.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<<<
12
[[appendix-ref]]
23
=== Properties of &lt;ref&gt; Field ===
34
The **&lt;ref&gt;** field has all the <<appendix-fields, common>> properties as

appendix/reference.adoc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[[appendix-reference]]
2+
=== Reference Prefix ===
3+
Lists available prefixes allowing distinction of different <<intro-references, references>>.
4+
5+
[cols="^.^10,^.^20,70", options="header"]
6+
|===
7+
|Prefix Character|DSL Version|Description
8+
9+
||1|Regular reference to a field within the same schema.
10+
|`$`|1|Reference to a sibling field.
11+
|`^`|2|Reference to a field when it's not possible to distinguish between value and reference.
12+
|`@`|5|Reference to a field in a different schema.
13+
|===
14+

appendix/schema.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<<<
12
[[appendix-schema]]
23
=== Properties of &lt;schema&gt; ===
34
Refer to <<schema-schema, Schema>> chapter for detailed description.

appendix/set.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<<<
12
[[appendix-set]]
23
=== Properties of &lt;set&gt; Field ===
34
The **&lt;set&gt;** field has all the <<appendix-fields, common>> properties as
@@ -16,6 +17,7 @@ for detailed description.
1617
|**endian**|"big" or "little"|1|no|endian of <<schema-schema, schema>>|Endian of the field.
1718
|**nonUniqueAllowed**|<<intro-boolean, bool>>|1|no|false|Allow non unique **&lt;bit&gt;**-s.
1819
|**validCheckVersion**|<<intro-boolean, bool>>|1|no|false|Take into account protocol version when generating code for field's value validity check.
20+
|**availableLengthLimit**|<<intro-boolean, bool>>|4|no|false|Allow having less bytes in the buffer than required by the **type** or **length** when performing (de)serialization.
1921
|===
2022

2123
==== Properties of &lt;bit&gt; Child Element of &lt;set&gt; Field ====

appendix/string.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<<<
12
[[appendix-string]]
23
=== Properties of &lt;string&gt; Field ===
34
The **&lt;string&gt;** field has all the <<appendix-fields, common>> properties as

appendix/units.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<<<
12
[[appendix-units]]
23
=== Units ===
34
The tables below contain lists of available units.

appendix/value.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<<<
12
[[appendix-value]]
23
=== Properties of &lt;value&gt; Frame Layer ===
34
The **&lt;value&gt;** layer has all the <<appendix-layers, common>> properties as

appendix/variant.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
<<<
12
[[appendix-variant]]
23
=== Properties of &lt;variant&gt; Field ===
34
The **&lt;variant&gt;** field has all the <<appendix-fields, common>> properties as
@@ -20,5 +21,6 @@ Extra child XML elements allowed:
2021
|XML Element|DSL Version ^.^|Description
2122

2223
|**&lt;members&gt;**|1|Wraps member fields.
24+
|**&lt;replace&gt;**|5|Wraps replacing member fields after copying using **reuse** property.
2325
|===
2426

commsdsl_spec.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
= CommsDSL Specification v4.0
1+
= CommsDSL Specification v5.0
22
Alex Robenko
3-
v4.0, 2022-05
3+
v5.0, 2022-08
44
:doctype: article
55
:toc: left
66
:source-highlighter: rouge

fields/bitfield.adoc

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Since **v2** of the specification it is also allowed to use
1414
The **&lt;bitfield&gt;** field has all the <<fields-common, common>> properties
1515
as well as extra properties and elements described below.
1616

17+
[[fields-bitfield-member-fields]]
1718
==== Member Fields ====
1819
Member fields need to be listed as children XML elements of the **&lt;bitfield&gt;**.
1920
Every such member is expected to use **bitLength** property to specify its
@@ -69,6 +70,7 @@ of the **&lt;bitfield&gt;**, then all the members must be wrapped in
6970
</schema>
7071
----
7172

73+
[[fields-bitfield-endian]]
7274
==== Endian ====
7375
When serializing, the **&lt;bitfield&gt;** object needs to combine the
7476
values of all the members into single unsigned raw value of appropriate length,
@@ -87,4 +89,58 @@ is overridden using extra **endian** property of the **&lt;bitfield&gt;** field.
8789
</schema>
8890
----
8991

92+
[[fields-bitfield-replacing-member-fields]]
93+
==== Replacing Member Fields ====
94+
It is possible to replace some of the copied member fields after
95+
<<fields-common-reusing-other-fields, reuse>> using **&lt;replace&gt;**
96+
child node, which wraps the replacing fields.
97+
[source,xml]
98+
----
99+
<?xml version="1.0" encoding="UTF-8"?>
100+
<schema name="MyProtocol" endian="big">
101+
<fields>
102+
<bitfield name="SomeBitfield" endian="little">
103+
<int name="Mem1" type="uint8" bitLength="4" />
104+
<enum name="Mem2" type="uint8" bitLength="4">
105+
<validValue name="V0" val="0" />
106+
<validValue name="V1" val="1" />
107+
</enum>
108+
</bitfield>
109+
110+
<bitfield name="SomeOtherBitfield" reuse="SomeBitfield">
111+
<replace>
112+
<set name="Mem2" type="uint8" bitLength="4">
113+
<bit name="B0" idx="0" />
114+
<bit name="B1" idx="1" />
115+
</set>
116+
</replace>
117+
</bitfield>
118+
</fields>
119+
</schema>
120+
----
121+
The replacing field must have the same name as the reused member field it is
122+
replacing. The **&lt;replace&gt;** child node may have multiple member fields replacing
123+
the copied ones. The order of the fields inside the **&lt;replace&gt;** child node
124+
is not important, the order of the fields is determined by the original
125+
**&lt;bitfield&gt;** field, which was <<fields-common-reusing-other-fields, reused>>.
126+
127+
The example above is equivalent to defining `SomeOtherBitfield` **&lt;bitfield&gt;** field
128+
in the following way.
129+
130+
[source,xml]
131+
----
132+
<?xml version="1.0" encoding="UTF-8"?>
133+
<schema name="MyProtocol" endian="big">
134+
<fields>
135+
<bitfield name="SomeOtherBitfield">
136+
<int name="Mem1" type="uint8" bitLength="4" />
137+
<set name="Mem2" type="uint8" bitLength="4">
138+
<bit name="B0" idx="0" />
139+
<bit name="B1" idx="1" />
140+
</set>
141+
</bitfield>
142+
</fields>
143+
</schema>
144+
----
145+
90146
Use <<appendix-bitfield, properties table>> for future references.

0 commit comments

Comments
 (0)