Macros
Command specific macros. More...
Macros | |
#define | ZOS_CMD_ADD_CMD_LIST(name, list_ptr, _list_type) |
Helper macro to initialize a zos_cmd_list_t struct. | |
#define | ZOS_CMD_CREATE_CMD_LISTS(_commands, _getters, _setters) |
Helper macro to initialize a zos_cmd_lists_t struct. | |
#define | ZOS_ADD_GETTER(key, name) {key, 0, 0, &__zos_get_ ## name ## _command, 255} |
Helper macro to add a getter to a command listSee zos_var_args_command_t. More... | |
#define | ZOS_ADD_SETTER(key, name) {key, 0, 0, &__zos_set_ ## name ## _command, 255} |
Helper macro to add a setter to a command listSee zos_var_args_command_t. More... | |
#define | ZOS_ADD_COMMAND(key, min, max, retval, name) { key, NULL, & __zos_cmd_ ## name ## _command, min, max, retval, ZOS_TRUE} |
Helper macro to add a command to a command listSee zos_command_t. More... | |
#define | ZOS_GETTERS_START(id) static zos_var_args_command_t _zos_getters_list_ ## id[] = { |
Utility macro to declare a getters command list This should be used with ZOS_COMMAND_LISTS() and ZOS_CMD_REGISTER_COMMANDS() | |
#define | ZOS_GETTERS_END }; |
End list of getters. | |
#define | ZOS_SETTERS_START(id) static zos_var_args_command_t _zos_setters_list_ ## id[] = { |
Utility macro to declare a setters command list This should be used with ZOS_COMMAND_LISTS() and ZOS_CMD_REGISTER_COMMANDS() | |
#define | ZOS_SETTERS_END }; |
End list of setters. | |
#define | ZOS_COMMANDS_START(id) static zos_command_t _zos_command_list_ ## id[] = { |
Utility macro to declare a command list This should be used with ZOS_COMMAND_LISTS() and ZOS_CMD_REGISTER_COMMANDS() | |
#define | ZOS_COMMANDS_END }; |
End list of commands. | |
#define | ZOS_COMMAND_LISTS(id) static zos_cmd_lists_t _zos_commands_ ## id = ZOS_CMD_CREATE_CMD_LISTS(_zos_command_list_ ## id, _zos_getters_list_ ## id, _zos_setters_list_ ## id); |
Utility macro to declare and initialize a zos_cmd_lists_t struct. | |
#define | ZOS_CMD_REGISTER_COMMANDS(id) zn_cmd_register_commands(&_zos_commands_ ## id) |
Utility macro to register custom commands with ZentriOS. | |
#define | ZOS_CMD_UNREGISTER_COMMANDS(id) |
Utility macro to unregister custom serial commands. | |
#define | ZOS_DEFINE_GETTER(name) static zos_cmd_result_t __zos_get_ ## name ## _command(int argc, char **argv) |
Help macro to define a getter command implementationThe getter function is of the format: More... | |
#define | ZOS_DEFINE_SETTER(name) static zos_cmd_result_t __zos_set_ ## name ## _command(int argc, char **argv) |
Help macro to define a setter command implementationThe getter function is of the format: More... | |
#define | ZOS_DEFINE_COMMAND(name) static zos_cmd_result_t __zos_cmd_ ## name ## _command(int argc, char **argv) |
Help macro to define a command implementationThe command function is of the format: More... | |
#define | ZOS_CMD_PARSE_INT_ARG_WITH_VAR(type, var, str, min, max) |
Utility macro to parse an integer argument and store in supplied variable. More... | |
#define | ZOS_CMD_PARSE_INT_ARG(type, name, str, min, max) |
Utility macro to parse an integer argument and store in created variable. More... | |
#define | ZOS_CMD_PARSE_HEX_ARG_WITH_VAR(type, var, str, min, max) |
Utility macro to parse an hexadecimal argument and store in supplied variable. More... | |
#define | ZOS_CMD_PARSE_HEX_ARG(type, name, str, min, max) |
Utility macro to parse an hexadecimal argument and store in created variable. More... | |
Detailed Description
Command specific macros.
Macro Definition Documentation
#define ZOS_ADD_COMMAND | ( | key, |
|
min, |
|||
max, |
|||
retval, |
|||
name |
|||
) | { key, NULL, & __zos_cmd_ ## name ## _command, min, max, retval, ZOS_TRUE} |
Helper macro to add a command to a command listSee zos_command_t.
- Parameters
-
key
The command name string min
The minimum number of arguments the command accepts max
The maximum number of arguments the command accepts name
The name of the command function retval
if ZOS_TRUE then command local prints a return value, if ZOS_FALSE then ZentriOS should print a return value
#define ZOS_ADD_GETTER | ( | key, |
|
name |
|||
) | {key, 0, 0, &__zos_get_ ## name ## _command, 255} |
Helper macro to add a getter to a command listSee zos_var_args_command_t.
- Parameters
-
key
The 'getter name' (i.e. variable name) string name
The name of the getter function
#define ZOS_ADD_SETTER | ( | key, |
|
name |
|||
) | {key, 0, 0, &__zos_set_ ## name ## _command, 255} |
Helper macro to add a setter to a command listSee zos_var_args_command_t.
- Parameters
-
key
The 'setter name' (i.e. variable name) string name
The name of the getter function
#define ZOS_CMD_PARSE_HEX_ARG | ( | type, |
|
name, |
|||
str, |
|||
min, |
|||
max |
|||
) |
Utility macro to parse an hexadecimal argument and store in created variable.
- Note
- If parsing fails then then function returns with the value CMD_BAD_ARGS
- Parameters
-
type
The datatype of varaible to create(e.g. uint32_t) name
The name of the variable to create str
Hex string to parse min
Minumum value of the integer max
Maximum value of the integer
#define ZOS_CMD_PARSE_HEX_ARG_WITH_VAR | ( | type, |
|
var, |
|||
str, |
|||
min, |
|||
max |
|||
) |
Utility macro to parse an hexadecimal argument and store in supplied variable.
- Note
- If parsing fails then then function returns with the value CMD_BAD_ARGS
- Parameters
-
type
The argument datatype (e.g. uint32_t) var
The name of existing variable str
Hex string to parse min
Minumum value of the integer max
Maximum value of the integer
#define ZOS_CMD_PARSE_INT_ARG | ( | type, |
|
name, |
|||
str, |
|||
min, |
|||
max |
|||
) |
Utility macro to parse an integer argument and store in created variable.
- Note
- If parsing fails then then function returns with the value CMD_BAD_ARGS
- Parameters
-
type
The datatype of varaible to create(e.g. uint32_t) name
The name of the variable to create str
Integer string to parse min
Minumum value of the integer max
Maximum value of the integer
- Examples:
- basic/buffer_dump/buffer_dump.c.
#define ZOS_CMD_PARSE_INT_ARG_WITH_VAR | ( | type, |
|
var, |
|||
str, |
|||
min, |
|||
max |
|||
) |
Utility macro to parse an integer argument and store in supplied variable.
- Note
- If parsing fails then then function returns with the value CMD_BAD_ARGS
- Parameters
-
type
The argument datatype (e.g. uint32_t) var
The name of existing variable str
Integer string to parse min
Minumum value of the integer max
Maximum value of the integer
#define ZOS_DEFINE_COMMAND | ( | name | ) | static zos_cmd_result_t __zos_cmd_ ## name ## _command(int argc, char **argv) |
Help macro to define a command implementationThe command function is of the format:
- Parameters
-
name
The name of the 'command' function
#define ZOS_DEFINE_GETTER | ( | name | ) | static zos_cmd_result_t __zos_get_ ## name ## _command(int argc, char **argv) |
Help macro to define a getter command implementationThe getter function is of the format:
- Parameters
-
name
The name of the 'getter' function
#define ZOS_DEFINE_SETTER | ( | name | ) | static zos_cmd_result_t __zos_set_ ## name ## _command(int argc, char **argv) |
Help macro to define a setter command implementationThe getter function is of the format:
- Parameters
-
name
The name of the 'setter' function