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?

Properties

Almost every element in CommsDSL has one or more properties, such as name. Any property can be defined using multiple ways. In can be useful when an element has too many properties to specify in a single line for a convenient reading. Any of the described below supported ways of defining a single property can be used for any element in the schema.

The property can be defined as an XML attribute.

<int name="SomeField" type="uint8" />

Or as child node with value attribute:

<int>
    <name value="SomeField" />
    <type value="uint8" />
</int>

Property value can also be defined as a text of the child XML element.

<int>
    <name>SomeField</name>
    <type>uint8</type>
</int>

It is allowed to mix ways of defining properties for a single element

<int name="SomeField">
    <type value="uint8" />
    <endian>big</endian>
</int>

Many properties must be defined only once for a specific element. In this case, repetition of it is prohibited. The definition below must cause an error (even if provided type value is not changed).

<int name="SomeField" type="uint8" >
    <type value="uint8" />
</int>

NOTE, that properties can be defined in any order.

PreviousReferencesNextNumeric Values

Last updated 5 years ago

Was this helpful?