The Embedded Macros help to create the Feature objects, to be used in your code.

It is not mandatory to use the macros but they will help you build XML-strings and keeping track of message Id's.


The macros create:

  • One XML definition string
  • One Feature Object, including reference to the XML string
  • One Pointer to the Feature Object. This pointer is name according to "Var Name" and will be your handle to the Feature.



Example: Command Void Macro

Description:

Macro

Identifier

Displayed Name

Function Identifier

Group*


Example:

define_void_command(

cmdRestartSystem,

"Restart System",

RestartSystem,

0

);


*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.


Macro on line number 22

The line number you put your macro will be the ID of the Feature.

define_void_command(cmdRestartSystem, "Restart System", 0, RestartSystem );

Macro Expanded: XML String

static const char AZANDE_XML_STRING_cmdRestartSystem[] __FLASH_DIRECTIVE =  

 "<F><C><I>100</I><Is>22</Is><N>Restart System</N><Gr>0</Gr></C></F>";

Macro Expanded: Feature Object

static const AZANDE_COMMAND NAME_FEATURE_OBJ __FLASH_DIRECTIVE =

{

       100, // Id

     22,  // Sub Id

       AZANDE_XML_STRING_cmdRestartSystem,

       AZANDE_COMMAND_TYPE_VOID,

       (AZANDE_VOID_VOID_FUNC_PTR_T)RestartSystem

};

Macro Expanded: Pointer to Feature Object

static const AZANDE_COMMAND* const cmdRestartSystem __FLASH_DIRECTIVE = &AZANDE_XML_STRING_cmdRestartSystem;


Group

The Group Number is optional in the embedded macros. If Group is omitted, in macro, the Group Number will default to 0.


Copy to your project

Here you can find "prototypes" to all macros. Copy them to your project and use them as a starting point when you define your own Features.

Id derived from row

/*

define_void_command(Identifier, "DisplayedName", CommandFunction, optional_GroupNr);

define_bool_command(Identifier, "DisplayedName", CommandFunction, optional_GroupNr, "TrueText", "FalseText");

define_double_command(Identifier, "DisplayedName", CommandFunction, optional_GroupNr, "optional_Unit", optional_Min, optional_Max);

define_enum_command(Identifier, "DisplayedName", CommandFunction, optional_GroupNr,\

   define_enum_item(0, "ButtonText_0") \

   define_enum_item(1, "ButtonText_1") \

   define_enum_item(2, "ButtonText_2") );

define_int_command(Identifier, "DisplayedName", CommandFunction, optional_GroupNr, "optional_Unit", optional_Min, optional_Max);

define_text_command(Identifier, "DisplayedName", CommandFunction, optional_GroupNr, MaxLength);

define_bool_event(Identifier, "DisplayedName", optional_GroupNr, "TrueText", "FalseText" );

define_double_event(Identifier, "DisplayedName", optional_GroupNr, "optional_Unit", optional_Min, optional_Max, "optional_Formatter" );

define_int_event(Identifier, "DisplayedName", optional_GroupNr, "optional_Unit", optional_Min, optional_Max, "optional_Formatter" );

define_text_event(Identifier, "DisplayedName", optional_GroupNr, MaxLength );

*/


User specified Id

/*

define_void_command_id(Identifier, "DisplayedName", CommandFunction, Id, SubId, optional_GroupNr);

define_bool_command_id(Identifier, "DisplayedName", CommandFunction, Id, SubId, optional_GroupNr, "TrueText", "FalseText");

define_double_command_id(Identifier, "DisplayedName", CommandFunction, Id, SubId, optional_GroupNr, "optional_Unit", optional_Min, optional_Max);

define_enum_command_id(Identifier, "DisplayedName", CommandFunction, Id, SubId, optional_GroupNr,\

   define_enum_item(0, "ButtonText_0") \

   define_enum_item(1, "ButtonText_1") \

   define_enum_item(2, "ButtonText_2") );

define_int_command_id(Identifier, "DisplayedName", CommandFunction, Id, SubId, optional_GroupNr, "optional_Unit", optional_Min, optional_Max);

define_text_command_id(Identifier, "DisplayedName", CommandFunction, Id, SubId, optional_GroupNr, MaxLength);

define_bool_event_id(Identifier, "DisplayedName", Id, SubId, optional_GroupNr, "TrueText", "FalseText" );

define_double_event_id(Identifier, "DisplayedName", Id, SubId, optional_GroupNr, "optional_Unit", optional_Min, optional_Max, "optional_Formatter" );

define_int_event_id(Identifier, "DisplayedName", Id, SubId, optional_GroupNr, "optional_Unit", optional_Min, optional_Max, "optional_Formatter" );

define_text_event_id(Identifier, "DisplayedName", Id, SubId, optional_GroupNr, MaxLength );

*/

Available Macros

Command Void Macro

Command Bool Macro

Command Double Macro

Command Enum Macro

Command Int32 Macro

Command Text Macro

Event Bool Macro

Event Double Macro

Event Int32 Macro

Event Text Macro

Target Information Macro