Skip to content

Commit

Permalink
Release v7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
arobenko committed Jan 11, 2025
2 parents 9d14bc8 + 0f344a0 commit 5575b05
Show file tree
Hide file tree
Showing 33 changed files with 699 additions and 222 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ if (NOT ASCIIDOCTOR_PDF_EXE)
message(FATAL_ERROR "asciidoctor-pdf is not found")
endif ()

set (VERSION "v6.1")
set (MAIN_FILE "${PROJECT_SOURCE_DIR}/commsdsl_spec.adoc")
file (READ "${MAIN_FILE}" main_file_contents)
string (REGEX MATCH "v([0-9\.]*)\," _ ${main_file_contents})
set (VERSION "v${CMAKE_MATCH_1}")

add_custom_target("pdf" ALL
COMMAND ${ASCIIDOCTOR_PDF_EXE} ${MAIN_FILE}
Expand Down
79 changes: 28 additions & 51 deletions aliases/aliases.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ traffic reuse the same byte occupied by the `SomeEnum` field, like below.
<?xml version="1.0" encoding="UTF-8"?>
<schema ...>
<message name="Msg1" id="0x1">
<bitfield name="F1"
<bitfield name="F1">
<enum name="SomeEnum" type="uint8" bitLength="2">
<validValue name="V1" val="0" />
<validValue name="V2" val="1" />
Expand All @@ -93,7 +93,7 @@ like this:
<schema ...>
<message name="Msg1" id="0x1">
<fields>
<bitfield name="F1"
<bitfield name="F1">
<enum name="SomeEnum" type="uint8" bitLength="2">
...
</enum>
Expand All @@ -109,6 +109,7 @@ There can be any number of different **&lt;alias&gt;** nodes. The elements
that are allowed to have **&lt;alias&gt;**-es are <<messages-messages, &lt;message&gt; >>,
<<interfaces-interfaces, &lt;interface&gt; >>, and <<fields-bundle, &lt;bundle&gt; >>.

[[aliases-description]]
=== Description ===
The **&lt;alias&gt;** node may also have **description**
<<intro-properties, property>> which is expected to find its way into
Expand All @@ -130,76 +131,52 @@ the generated code as a comment for the relevant access functions.
</schema>
----

=== More on Aliases in &lt;message&gt;-es ===
When a new <<messages-messages, &lt;message&gt; >> is defined, it can
copy all the fields from other already defined <<messages-messages, &lt;message&gt; >> or <<fields-bundle, &lt;bundle&gt; >>
(using **copyFieldsFrom** <<intro-properties, property>>).
By default all the <<aliases-aliases, &lt;alias&gt; >> definitions are also copied.
It is possible to modify this default behavior by using **copyFieldsAliases**
[[aliases-reuse]]
=== Reusing Definition ===
By default when the original definition is <<fields-common-reusing-other-fields, reused>> its aliases are also copied.
It is possible to modify this default behavior by using **reuseAliases**
<<intro-properties, property>> with <<intro-boolean, boolean>> value.
[source,xml]
----
<?xml version="1.0" encoding="UTF-8"?>
<schema ...>
<message name="Msg1" id="1">
...
</message>
<fields>
<bundle name="B1">
...
<alias .../>
<alias .../>
</bundle>
<message name="Msg2" id="2" copyFieldsAliases="false">
...
</message>
<bundle name="B2" reuse="B1" reuseAliases="false">
...
</bundle>
</fields>
</schema>
----

=== More on Aliases in &lt;interface&gt;-es ===
Similar to <<messages-messages, &lt;message&gt; >>-es
<<interfaces-interfaces, &lt;interface&gt; >> can also use **copyFieldsFrom**
<<intro-properties, property>> to copy its field from some other
<<interfaces-interfaces, &lt;interface&gt; >> or <<fields-bundle, &lt;bundle&gt; >> definition and have all
the aliases copied by default. The control of such default copying behavior
is also done by using **copyFieldsAliases**
[[aliases-copy]]
=== Copying Fields ===
When a new <<messages-messages, &lt;message&gt; >> or <<interfaces-interfaces, &lt;interface&gt; >> is defined, it can
copy all the fields from other already defined <<messages-messages, &lt;message&gt; >>, <<interfaces-interfaces, &lt;interface&gt; >>, or <<fields-bundle, &lt;bundle&gt; >>
(using **copyFieldsFrom** <<intro-properties, property>>).
By default all the <<aliases-aliases, &lt;alias&gt; >> definitions are also copied.
It is possible to modify this default behavior by using **copyFieldsAliases**
<<intro-properties, property>> with <<intro-boolean, boolean>> value.
[source,xml]
----
<?xml version="1.0" encoding="UTF-8"?>
<schema ...>
<interface name="Interface1">
<message name="Msg1" id="1">
...
</interface>
</message>
<interface name="Interface2" copyFieldsAliases="false">
<message name="Msg2" id="2" copyFieldsAliases="false">
...
</interface>
</message>
</schema>
----

=== More on Aliases in &lt;bundle&gt;-es ===
When a new <<fields-bundle, &lt;bundle&gt; >> field is defined it can
reuse definition of already defined other <<fields-bundle, &lt;bundle&gt; >>
(using **reuse** <<intro-properties, property>>).
By default all the <<aliases-aliases, &lt;alias&gt; >> definitions are also copied.
It is possible to modify this default behavior by using **reuseAliases**
<<intro-properties, property>> with <<intro-boolean, boolean>> value.
[source,xml]
----
<?xml version="1.0" encoding="UTF-8"?>
<schema ...>
<fields>
<bundle name="B1">
...
<alias .../>
<alias .../>
</bundle>
<bundle name="B2" reuse="B1" reuseAliases="false">
...
</bundle>
</fields>
</schema>
----

Use <<appendix-alias, properties table>> for future references.


5 changes: 4 additions & 1 deletion appendix/bitfield.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ for detailed description.
|===
|Property Name|Allowed Type / Value|DSL Version|Required|Default Value ^.^|Description

|**endian**|"big" or "little"|1|no|endian of <<schema-schema, schema>>|Endian of the field.|
|**copyValidCondFrom**|<<intro-references, reference>> string|7|no||<<fields-bitfield, &lt;bitfield&gt; >> field definition from which extra validity condition needs to be copied.
|**endian**|"big" or "little"|1|no|endian of <<schema-schema, schema>>|Endian of the field.
|**validCond**|string|7|no||Extra validity check operation condition.
|===

Extra child XML elements allowed:
Expand All @@ -20,4 +22,5 @@ Extra child XML elements allowed:

|**&lt;members&gt;**|1|Wraps member fields.
|**&lt;replace&gt;**|5|Wraps replacing member fields after copying using **reuse** property.
|**&lt;validCond&gt;**|7|Multiple extra validity check operation conditions.
|===
5 changes: 4 additions & 1 deletion appendix/bundle.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ for detailed description.
|===
|Property Name|Allowed Type / Value|DSL Version|Required|Default Value ^.^|Description

|**reuseAliases**|<<intro-boolean, bool>>|3|no|true|Control copy of the defined <<aliases-aliases, aliases>> from reused other <<fields-bundle, &lt;bundle&gt; >> when **reuse** property is used.
|**copyValidCondFrom**|<<intro-references, reference>> string|7|no||<<fields-bundle, &lt;bundle&gt; >> field definition from which extra validity condition needs to be copied.
|**reuseAliases**|<<intro-boolean, bool>>|3|no|true|Control copy of the defined <<aliases-aliases, aliases>> from reused other <<fields-bundle, &lt;bundle&gt; >> when **reuse** property is used.
|**validCond**|string|7|no||Extra validity check operation condition.
|===

Extra child XML elements allowed:
Expand All @@ -21,4 +23,5 @@ Extra child XML elements allowed:
|**&lt;alias&gt;**|3|Alias names for other member fields. See <<aliases-aliases, Aliases>> for more info.
|**&lt;members&gt;**|1|Wraps member fields.
|**&lt;replace&gt;**|5|Wraps replacing member fields after copying using **reuse** property.
|**&lt;validCond&gt;**|7|Multiple extra validity check operation conditions.
|===
2 changes: 2 additions & 0 deletions appendix/data.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ for detailed description.
|Property Name|Allowed Type / Value|DSL Version|Required|Default Value ^.^|Description

|**defaultValue**|string|1|no||Default value. Case-insensitive hexadecimal string.
|**defaultValidValue**|string|7|no||Default valid value. Case-insensitive hexadecimal string.
|**length**|<<intro-numeric, unsigned>>|1|no|0|Fixed serialization length. **0** means no length limit. Cannot be used tegether with **lengthPrefix**.
|**lengthPrefix**|<<fields-fields, field>> or <<intro-references, reference>>|1|no||Prefix field containing length of the data. Cannot be used tegether with **length**.
|**validValue**|string|7|no||Valid value. Case-insensitive hexadecimal string.
|===


Expand Down
2 changes: 1 addition & 1 deletion appendix/enum.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ for detailed description.
|**deprecated**|<<intro-numeric, unsigned>>|1|no|max unsigned|Version of the protocol in which value was deprecated. +
Must be greater than value of **sinceVersion**.
|**description**|string|1|no||Human readable description of the value.
|**displayName**|string|1|no||Human readable name of the value to display in various analysis tools.
|**displayName**|string|1|no||Human readable name of the value.
|**name**|<<intro-names, name>> string|1|yes||Name of the value.
|**sinceVersion**|<<intro-numeric, unsigned>>|1|no|0|Version of the protocol in which value was introduced.
|**val**|<<intro-numeric, numeric>>|1|yes||Numeric value.
Expand Down
4 changes: 2 additions & 2 deletions appendix/fields.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ Refer to <<fields-common, Common Properties of Fields>> chapter for detailed des
Must be greater than value of **sinceVersion**. +
Applipable only to members of the <<messages-messages, &lt;message&gt; >> or <<fields-bundle, &lt;bundle&gt; >>.
|**description**|string|1|no||Human readable description of the field.
|**displayHidden**|<<intro-boolean, bool>>|1|no|false|Don't display field at all in visual analysis tool(s).
|**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).
|**displayReadOnly**|<<intro-boolean, bool>>|1|no|false|Disable modification of the field in visual analysis tool(s).
|**failOnInvalid**|<<intro-boolean, bool>>|1|no|false|Fail *read* operation if read value is invalid.
|**fixedValue**|<<intro-boolean, bool>>|7|no|false|Remove an ability to update field's value after the object construction.
|**forceGen**|<<intro-boolean, bool>>|3|no|false|Force generation of field's code regardless of it's being referenced or not.
|**lengthOverride**|"any", "replace", "extend", "none"|4|no|any|Control the overriding code for **length** retrieval.
|**name**|<<intro-names, name>> string|1|yes||Name of the field.
Expand All @@ -32,6 +31,7 @@ Applicable only to members of the <<messages-messages, &lt;message&gt; >> or <<f
|**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.
|**sinceVersion**|<<intro-numeric, unsigned>>|1|no|0|Version of the protocol in which field was introduced. +
Applicable only to members of the <<messages-messages, &lt;message&gt; >> or <<fields-bundle, &lt;bundle&gt; >>.
|**validateMinLength**|<<intro-numeric, numeric>>|7|no||Specify expected minimal serialization length of the field.
|**validOverride**|"any", "replace", "extend", "none"|4|no|any|Control the overriding code for **valid** retrieval.
|**valueOverride**|"any", "replace", "extend", "none"|4|no|any|Control the overriding code for **value** operation.
|**writeOverride**|"any", "replace", "extend", "none"|4|no|any|Control the overriding code for **write** operation.
Expand Down
5 changes: 2 additions & 3 deletions appendix/float.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ for detailed description.
|Property Name|Allowed Type / Value|DSL Version|Required|Default Value ^.^|Description

|**defaultValue**|floating point value, **nan**, **inf**, **-inf**|1|no|0.0|Default value. Must fit the underlying **type**.
|**displayDecimals**|<<intro-numeric, numeric>>|1|no|0|Indicates to GUI analysis how many digits need to be displayed after the fraction point.
|**displaySpecials**|<<intro-boolean, bool>>|2|no|true|Control displaying **&lt;special&gt;** values in analysis tools.
|**displayDecimals**|<<intro-numeric, numeric>>|1|no|0|Specifies number of digits to be displayed after the fraction point.
|**endian**|"big" or "little"|1|no|endian of <<schema-schema, schema>>|Endian of the field.
|**nonUniqueSpecialsAllowed**|<<intro-boolean, bool>>|2|no|false|Allow non unique **&lt;special&gt;**-s.
|**type**|"float", "double"|1|yes||Underlying primitive type
Expand All @@ -32,7 +31,7 @@ for detailed description.
|**deprecated**|<<intro-numeric, unsigned>>|1|no|max unsigned|Version of the protocol in which value was deprecated. +
Must be greater than value of **sinceVersion**.
|**description**|string|1|no||Human readable description of the value.
|**displayName**|string|2|no||Name to display in various analysis tools.
|**displayName**|string|2|no||Human readable name of the value.
|**name**|<<intro-names, name>> string|1|yes||Name of the value.
|**sinceVersion**|<<intro-numeric, unsigned>>|1|no|0|Version of the protocol in which value was introduced.
|**val**|floating point value, **nan**, **inf**, **-inf**|1|yes||Numeric value.
Expand Down
7 changes: 3 additions & 4 deletions appendix/int.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ for detailed description.
|**bitLength**|<<intro-numeric, unsigned>>|1|no|length of **type** in bits|Serialization length in bits, applicable only to a member of <<fields-bitfield, &lt;bitfield&gt; >>.
|**defaultValidValue**|<<intro-numeric, numeric>> or <<intro-names, name>>|4|no||Convenience bunding of the **defaultValue** and **validValue** into a single property.
|**defaultValue**|<<intro-numeric, numeric>> or <<intro-names, name>>|1|no|0|Default value. Must fit the underlying **type**.
|**displayDecimals**|<<intro-numeric, numeric>>|1|no|0|Indicates to GUI analysis tools to display this field as floating point value with specified number of digits after the fraction point.
|**displayOffset**|<<intro-numeric, numeric>>|1|no|0|Indicates to GUI analysis tools to add specified offset value to a field's value when displaying it.
|**displaySpecials**|<<intro-boolean, bool>>|2|no|true|Control displaying **&lt;special&gt;** values in analysis tools.
|**displayDecimals**|<<intro-numeric, numeric>>|1|no|0|Use specified number of digits after the fraction point when displaying the field's value as floating point.
|**displayOffset**|<<intro-numeric, numeric>>|1|no|0|Add specified offset value to a field's value when displaying it.
|**endian**|"big" or "little"|1|no|endian of <<schema-schema, schema>>|Endian of the field.
|**length**|<<intro-numeric, unsigned>>|1|no|length of **type**|Forced serialization length.
|**nonUniqueSpecialsAllowed**|<<intro-boolean, bool>>|2|no|false|Allow non unique **&lt;special&gt;**-s.
Expand All @@ -39,7 +38,7 @@ for detailed description.
|**deprecated**|<<intro-numeric, unsigned>>|1|no|max unsigned|Version of the protocol in which value was deprecated. +
Must be greater than value of **sinceVersion**.
|**description**|string|1|no||Human readable description of the value.
|**displayName**|string|2|no||Name to display in various analysis tools.
|**displayName**|string|2|no||Human readable name of the value.
|**name**|<<intro-names, name>> string|1|yes||Name of the value.
|**sinceVersion**|<<intro-numeric, unsigned>>|1|no|0|Version of the protocol in which value was introduced.
|**val**|<<intro-numeric, numeric>>|1|yes||Numeric value.
Expand Down
5 changes: 3 additions & 2 deletions appendix/interface.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ for detailed description.
|**copyFieldsFrom**|<<intro-references, reference>> string|1|no||Interface or bundle field definition from which fields need to be copied.
|**description**|string|1|no||Human readable description of the interface.
|**name**|<<intro-names, name>> string|1|yes||Name of the interface.
|**reuse**|<<intro-references, reference>> string|7|no||Interface definition of which to copy.
|**reuseAliases**|<<intro-boolean, bool>>|7|no|true|Control copy of the defined <<aliases-aliases, aliases>> from reused other <<interfaces-interfaces, &lt;interface&gt; >> when **reuse** property is used.
|**reuseCode**|<<intro-boolean, bool>>|7|no|false|In case of **reuse** apply **copyCodeFrom** with the same <<intro-references, reference>> string.
|===


Expand All @@ -20,7 +23,5 @@ Extra child XML elements allowed:
[cols="^.^28,^.^10,62", options="header"]
|===
|XML Element|DSL Version ^.^|Description

|**copyFieldsAliases**|<<intro-boolean, bool>>|3|no|true|Control copy of the defined <<aliases-aliases, aliases>> when **copyFieldsFrom** property is used to copy fields from the other <<interfaces-interfaces, &lt;interface&gt; >> or <<fields-bundle, &lt;bundle&gt; >>.
|**&lt;fields&gt;**|1|Wraps member fields.
|===
10 changes: 8 additions & 2 deletions appendix/message.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ for detailed description.
|**construct**|string|6|no||Construction requirement.
|**constructAsReadCond**|bool|6|no|false|Copy **construct** value(s) to **readCond**.
|**constructAsValidCond**|bool|6|no|false|Copy **construct** value(s) to **validCond**.
|**copyCodeFrom**|<<intro-references, reference>> string|5|no||Specify message, overriding or other extra code of which needs to be copied.
|**copyCodeFrom**|<<intro-references, reference>> string|5|no||Message from which overriding or other extra code needs to be copied.
|**copyConstructFrom**|<<intro-references, reference>> string|7|no||Message from which to copy construction requirements.
|**copyFieldsAliases**|<<intro-boolean, bool>>|3|no|true|Control copy of the defined <<aliases-aliases, aliases>> when **copyFieldsFrom** property is used to copy fields from the other <<messages-messages, &lt;message&gt; >> or <<fields-bundle, &lt;bundle&gt; >>.
|**copyFieldsFrom**|<<intro-references, reference>> string|1|no||Message or bundle field definition from which fields need to be copied.
|**copyReadCondFrom**|<<intro-references, reference>> string|7|no||Message from which to copy read conditions.
|**copyValidCondFrom**|<<intro-references, reference>> string|7|no||Message from which to copy validity conditions.
|**customizable**|<<intro-boolean, bool>>|1|no|false|Mark the message to allow compile time customization regardless of code generator's level of customization.
|**deprecated**|<<intro-numeric, unsigned>>|1|no|max unsigned|Version of the protocol in which message was deprecated. +
Must be greater than value of **sinceVersion**.
Expand All @@ -28,13 +31,16 @@ Must be greater than value of **sinceVersion**.
|**readCond**|string|6|no||Extra read operation condition.
|**readOverride**|"any", "replace", "extend", "none"|4|no|any|Control the overriding code for **read** operation.
|**refreshOverride**|"any", "replace", "extend", "none"|4|no|any|Control the overriding code for **refresh** operation.
|**reuse**|<<intro-references, reference>> string|7|no||Message definition of which to copy.
|**reuseAliases**|<<intro-boolean, bool>>|7|no|true|Control copy of the defined <<aliases-aliases, aliases>> from reused other <<messages-messages, &lt;message&gt; >> when **reuse** property is used.
|**reuseCode**|<<intro-boolean, bool>>|7|no|false|In case of **reuse** apply **copyCodeFrom** with the same <<intro-references, reference>> string.
|**removed**|<<intro-boolean, bool>>|1|no|false|Indicates whether deprecated message has been removed from being supported.
|**sender**|"both", "client", "server"|1|no|both|Endpoint that sends the message.
|**sinceVersion**|<<intro-numeric, unsigned>>|1|no|0|Version of the protocol in which message was introduced.
|**validateMinLength**|<<intro-numeric, numeric>>|4|no||Specify expected minimal serialization length of the message fields.
|**writeOverride**|"any", "replace", "extend", "none"|4|no|any|Control the overriding code for **write** operation.
|**validCond**|string|6|no||Extra validity check operation condition.
|**validOverride**|"any", "replace", "extend", "none"|4|no|any|Control the overriding code for **valid** retrieval.
|**writeOverride**|"any", "replace", "extend", "none"|4|no|any|Control the overriding code for **write** operation.
|===

Extra child XML elements allowed:
Expand Down
1 change: 0 additions & 1 deletion appendix/optional.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ for detailed description.

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

0 comments on commit 5575b05

Please sign in to comment.