> For the complete documentation index, see [llms.txt](https://alex-robenko.gitbook.io/commsdsl-specification/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alex-robenko.gitbook.io/commsdsl-specification/appendix/enum.md).

# Properties of enum Field

The **\<enum>** field has all the [common](/commsdsl-specification/appendix/fields.md) properties as well as ones listed below. Refer to [\<enum> Field](/commsdsl-specification/fields/enum.md) chapter for detailed description.

|     Property Name     |                                      Allowed type / value                                     | DSL Version | Required |                     Default Value                     | Description                                                                                                             |
| :-------------------: | :-------------------------------------------------------------------------------------------: | :---------: | :------: | :---------------------------------------------------: | ----------------------------------------------------------------------------------------------------------------------- |
|        **type**       | "int8", "uint8", "int16", "uint16", "int32", "uint32", "int64", "uint64", "intvar", "uintvar" |      1      |    yes   |                                                       | Underlying primitive type.                                                                                              |
|    **defaultValue**   |   [numeric](/commsdsl-specification/numeric.md) or [name](/commsdsl-specification/names.md)   |      1      |    no    |                           0                           | Default value. Must fit the underlying **type**.                                                                        |
|       **endian**      |                                       "big" or "little"                                       |      1      |    no    | endian of [schema](/commsdsl-specification/schema.md) | Endian of the field.                                                                                                    |
|       **length**      |                         [unsigned](/commsdsl-specification/numeric.md)                        |      1      |    no    |                   length of **type**                  | Forced serialization length.                                                                                            |
|     **bitLength**     |                         [unsigned](/commsdsl-specification/numeric.md)                        |      1      |    no    |               length of **type** in bits              | Serialization length in bits, applicable only to a member of [\<bitfield>](/commsdsl-specification/fields/bitfield.md). |
|     **hexAssign**     |                           [bool](/commsdsl-specification/boolean.md)                          |      1      |    no    |                         false                         | Assign generated enum values using hexadecimal numbers.                                                                 |
|  **nonUniqueAllowed** |                           [bool](/commsdsl-specification/boolean.md)                          |      1      |    no    |                         false                         | Allow non unique **\<validValue>**-es.                                                                                  |
| **validCheckVersion** |                           [bool](/commsdsl-specification/boolean.md)                          |      1      |    no    |                         false                         | Take into account protocol version when generating code for field's value validity check.                               |

## Properties of \<validValue> Child Element of \<enum> Field

|   Property Name  |               Allowed type / value              | DSL Version | Required | Default Value | Description                                                                                                                   |
| :--------------: | :---------------------------------------------: | :---------: | :------: | :-----------: | ----------------------------------------------------------------------------------------------------------------------------- |
|     **name**     | [name](/commsdsl-specification/names.md) string |      1      |    yes   |               | Name of the value.                                                                                                            |
|      **val**     |  [numeric](/commsdsl-specification/numeric.md)  |      1      |    yes   |               | Numeric value.                                                                                                                |
|  **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.                                                        |
| **sinceVersion** |  [unsigned](/commsdsl-specification/numeric.md) |      1      |    no    |       0       | Version of the protocol in which value was introduced.                                                                        |
|  **deprecated**  |  [unsigned](/commsdsl-specification/numeric.md) |      1      |    no    |  max unsigned | <p>Version of the protocol in which value was deprecated.<br>Must be greater than value of <strong>sinceVersion</strong>.</p> |
