CommsDSL Specification
  • Introduction
  • Version
  • Schema Definition
  • Multiple Files
  • Namespaces
  • Platforms
  • References
  • Properties
  • Numeric Values
  • Boolean Values
  • Names
  • Protocol Versioning
  • Schema
  • Fields
    • Common Properties of Fields
    • enum Field
    • int Field
    • set Field
    • bitfield Field
    • bundle Field
    • string Field
    • data Field
    • list Field
    • float Field
    • ref Field
    • optional Field
    • variant Field
    • Referencing Values of Other Fields
  • Messages
  • Interfaces
  • Aliases
  • Frames
    • Common Properties of Layers
    • payload Layer
    • id Layer
    • size Layer
    • sync Layer
    • checksum Layer
    • value Layer
    • custom Layer
  • Protocol Versioning Summary
  • Appendix
    • Properties of schema
    • Common Properties of Fields
    • Properties of enum Field
    • Properties of int Field
    • Properties of set Field
    • Properties of bitfield Field
    • Properties of bundle Field
    • Properties of string Field
    • Properties of data Field
    • Properties of list Field
    • Properties of float Field
    • Properties of ref Field
    • Properties of optional Field
    • Properties of variant Field
    • Units
    • Properties of message
    • Properties of interface
    • Properties of alias
    • Properties of frame
    • Common Properties of Layers
    • Properties of checksum Layer
    • Properties of value Layer
    • Properties of custom Layer
Powered by GitBook
On this page

Was this helpful?

Fields

PreviousSchemaNextCommon Properties of Fields

Last updated 5 years ago

Was this helpful?

Any field can be defined as independent element inside the <fields> child of the or a .

<?xml version="1.0" encoding="UTF-8"?>
<schema ...>
    <fields>
        <int name="SomeField" type="uint8" />
        ...
    </fields>
</schema>

It can also be defined as a member of a message.

<?xml version="1.0" encoding="UTF-8"?>
<schema ...>
    <message name="SomeMessage" id="1">
        <int name="SomeField" type="uint8" />
        ...
    </message>
</schema>

Field that is defined as a child of <fields> node of the or can be referenced by other fields to avoid duplication of the same definition.

<?xml version="1.0" encoding="UTF-8"?>
<schema ...>
    <ns name="ns1">
        <int name="SomeField" type="uint8" />
        <ref name="AliasToField" field="ns1.SomeField" />
    </ns>
    <message name="SomeMessage" id="1">
        <ref name="Mem1" field="ns1.SomeField"" />
        ...
    </message>
</schema>

The available fields are described in details in the sections to follow. They are:

- Enumeration field.

- Integral value field.

- Bitset (bitmask) field.

- Bitfield field.

- Bundle field.

- String field.

- Raw data field.

- List of other fields.

- Floating point value field.

- Reference to (alias of) other field.

- Optional field.

- Variant field.

All this fields have as well as their own specific set of properties.

<schema>
namespace
<schema>
<ns>
<enum>
<int>
<set>
<bitfield>
<bundle>
<string>
<data>
<list>
<float>
<ref>
<optional>
<variant>
common