Command Enum Feature Pseudo-Code

void ACTION(int32 arg)

  • The Feature takes one 32-bit integer argument.
  • The Feature do not return anything.
  • The ACTION is performed on target.


Command Enum Panel



Command Enum Macro

Description:

Macro

Identifier

Displayed Name

Function Identifier

Group*

Enum Item Macro

Enum Value

Button Text


Example using all options:

define_enum_command(

cmdSetLedColor,

"Set LED Color",

SetLedColor,

19,

define_enum_item(

0,

"Green")

\







define_enum_item(

1,

"Red")

\







define_enum_item(

-25,

"Blue")

\







define_enum_item(

3,

"Yellow")

\







define_enum_item(

23,

"White")

)


*optional argument. If Group is omitted the Group-Number will default to 0.

The unique message id is derived from the row number, in source file where the macro is used.



Command Enum XML Definition

Description

XML

Feature Root: Start

<F>

Command Enum: Start

<Ce>

ID

<I>BYTE</I>

SUB ID

<Is>BYTE</Is>

GROUP

<Gr>BYTE</Gr>

NAME

<N>STRING</N>

Array of Enum Pairs: Start

<ps>

Enum Pair: Start

<p>

Enum Pair: Name

<n>STRING</n>

Enum Pair: Integer Value

<i>INT</i>

Enum Pair: End

</p>

The array can hold unlimited number of Enum Pairs

...

Array of Enum Pairs: End

</ps>

Command Enum: End

</Ce>

Feature Root: End

</F>




Command Enum Data Message

The Enum value is a 32-bit signed (one’s complement) value.


The value is represented by 4 bytes in the message, starting with the Least Significant Byte (Big-Endian).

Byte#

0

1

2

3

4

5

6

7

8

9

Name

START

ID

SUB ID

INT32 VALUE

CRC MSB

CRC LSB

END

Value

0xAA

[0..255]

[0..255]

LSB



MSB

CRC16-CITT

0xBB