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
  • Name
  • Description
  • Inner Field

Was this helpful?

  1. Frames

Common Properties of Layers

PreviousFramesNextpayload Layer

Last updated 5 years ago

Was this helpful?

Every layer is different, and defines its own properties and/or other aspects. However, there are common properties, that are applicable to every layer. They are summarized below.

Name

Every layer must define it's , which is expected to be used by a code generator when defining a relevant class. The name is defined using name .

<?xml version="1.0" encoding="UTF-8"?>
<schema ...>
    <frame name="ProtocolFrame">
        <id name="Id" ... />
        <payload name="Data" />
    </frame>
</schema>

Description

It is possible to provide a description of the layer about what it is and how it is expected to be used. This description is only for documentation purposes and may find it's way into the generated code as a comment for the generated class. The is description.

<?xml version="1.0" encoding="UTF-8"?>
<schema ...>
    <frame name="ProtocolFrame">
        <id name="Id" ...>
            <description>
                Some long
                multiline
                description
            </description>        
        </id>
        <payload name="Data" />
    </frame>
</schema>

Inner Field

<?xml version="1.0" encoding="UTF-8"?>
<schema ...>
    <frame name="ProtocolFrame">
        <id name="Id">
            <int name="IdField" type="uint8" />  
        </id>
        <payload name="Data" />
    </frame>
</schema>
<?xml version="1.0" encoding="UTF-8"?>
<schema ...>
    <frame name="ProtocolFrame">
        <id>
            <name value="Id" />
            <field>
                <int name="IdField" type="uint8" />  
            </field>
        </id>
        <payload name="Data" />
    </frame>
</schema>

If the inner field is defined globally in <fields> section, it can be referenced using field property.

<?xml version="1.0" encoding="UTF-8"?>
<schema ...>
    <fields>
        <enum name="MsgId" type="uint8" semanticType="messageId">
            <validValue name="Msg1" val=0x1" />
            <validValue name="Msg2" val=0x2" />
        </enum>
    </fields>

    <frame name="ProtocolFrame">
        <id name="Id" field="MsgId" />
        <payload name="Data" />
    </frame>
</schema>

Every layer, except for , needs to specify its inner it wraps. The field can be specified as XML child element.

If there is any other defined as XML child of the layer, then the inner field must be wrapped in <field> XML element for separation.

Use for future references.

name
property
property
<payload>
field
property
properties table