Any field can be defined as independent element inside the <fields> child of the <schema> or a <ns> .
<?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 <schema> or <ns> 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:
-
<enum> - Enumeration field.
-
<int> - Integral value field.
-
<set> - Bitset (bitmask) field.
-
<bitfield> - Bitfield field.
-
<bundle> - Bundle field.
-
<string> - String field.
-
<data> - Raw data field.
-
<list> - List of other fields.
-
<float> - Floating point value field.
-
<ref> - Reference to (alias of) other field.
-
<optional> - Optional field.
-
<variant> - Variant field.
All this fields have common as well as their own specific set of properties.