|
Firmware
|
#include <pthread.h>#include <unistd.h>#include <stdbool.h>#include <px4_atomic.h>#include <px4_time.h>#include <px4_log.h>#include <px4_tasks.h>#include <systemlib/px4_macros.h>Go to the source code of this file.
Macros | |
| #define | PRINT_MODULE_USAGE_COMMAND(name) PRINT_MODULE_USAGE_COMMAND_DESCR(name, NULL); |
| #define | PRINT_MODULE_USAGE_DEFAULT_COMMANDS() |
| Prints the default commands: stop & status. More... | |
Functions | |
| __BEGIN_DECLS __EXPORT void | PRINT_MODULE_DESCRIPTION (const char *description) |
| Module documentation and command usage help methods. More... | |
| __EXPORT void | PRINT_MODULE_USAGE_NAME (const char *executable_name, const char *category) |
| Prints the command name. More... | |
| __EXPORT void | PRINT_MODULE_USAGE_SUBCATEGORY (const char *subcategory) |
| Specify a subcategory (optional). More... | |
| __EXPORT void | PRINT_MODULE_USAGE_NAME_SIMPLE (const char *executable_name, const char *category) |
| Prints the name for a command without any sub-commands (. More... | |
| __EXPORT void | PRINT_MODULE_USAGE_COMMAND_DESCR (const char *name, const char *description) |
| Prints a command with a short description what it does. | |
| __EXPORT void | PRINT_MODULE_USAGE_PARAM_INT (char option_char, int default_val, int min_val, int max_val, const char *description, bool is_optional) |
| Prints an integer parameter. More... | |
| __EXPORT void | PRINT_MODULE_USAGE_PARAM_FLOAT (char option_char, float default_val, float min_val, float max_val, const char *description, bool is_optional) |
| Prints a float parameter. More... | |
| __EXPORT void | PRINT_MODULE_USAGE_PARAM_FLAG (char option_char, const char *description, bool is_optional) |
| Prints a flag parameter, without any value. More... | |
| __EXPORT void | PRINT_MODULE_USAGE_PARAM_STRING (char option_char, const char *default_val, const char *values, const char *description, bool is_optional) |
| Prints a string parameter. More... | |
| __EXPORT void | PRINT_MODULE_USAGE_PARAM_COMMENT (const char *comment) |
| Prints a comment, that applies to the next arguments or parameters. More... | |
| __EXPORT void | PRINT_MODULE_USAGE_ARG (const char *values, const char *description, bool is_optional) |
| Prints the definition for an argument, which does not have the typical -p <val> form, but for example 'param set '. More... | |
| #define PRINT_MODULE_USAGE_DEFAULT_COMMANDS | ( | ) |
Prints the default commands: stop & status.
| __BEGIN_DECLS __EXPORT void PRINT_MODULE_DESCRIPTION | ( | const char * | description | ) |
Module documentation and command usage help methods.
These are extracted with the Tools/px_process_module_doc.py script and must be kept in sync. Prints module documentation (will also be used for online documentation). It uses Markdown syntax and should include these sections:
In addition to the Markdown syntax, a line beginning with '$ ' can be used to mark a command: $ module start -p param
| __EXPORT void PRINT_MODULE_USAGE_ARG | ( | const char * | values, |
| const char * | description, | ||
| bool | is_optional | ||
| ) |
Prints the definition for an argument, which does not have the typical -p <val> form, but for example 'param set '.
| values | eg. "<file>", "<param> <value>" or "<value1> [<value2>]" |
| description | Pointer to the usage description. |
| is_optional | true if this parameter is optional |
| __EXPORT void PRINT_MODULE_USAGE_NAME | ( | const char * | executable_name, |
| const char * | category | ||
| ) |
Prints the command name.
| executable_name | command name used in scripts & CLI |
| category | one of: driver, estimator, controller, system, communication, command, template |
| __EXPORT void PRINT_MODULE_USAGE_NAME_SIMPLE | ( | const char * | executable_name, |
| const char * | category | ||
| ) |
Prints the name for a command without any sub-commands (.
| __EXPORT void PRINT_MODULE_USAGE_PARAM_COMMENT | ( | const char * | comment | ) |
Prints a comment, that applies to the next arguments or parameters.
For example to indicate that a parameter applies to several or all commands.
| comment |
| __EXPORT void PRINT_MODULE_USAGE_PARAM_FLAG | ( | char | option_char, |
| const char * | description, | ||
| bool | is_optional | ||
| ) |
Prints a flag parameter, without any value.
| option_char | The option character. |
| description | Pointer to the usage description. |
| is_optional | true if this parameter is optional |
| __EXPORT void PRINT_MODULE_USAGE_PARAM_FLOAT | ( | char | option_char, |
| float | default_val, | ||
| float | min_val, | ||
| float | max_val, | ||
| const char * | description, | ||
| bool | is_optional | ||
| ) |
Prints a float parameter.
| default_val | The parameter default value (set to NaN if not applicable). |
| min_val | The parameter minimum value. |
| max_val | The parameter maximum value. |
| description | Pointer to the usage description. Pointer to the usage description. |
| is_optional | true if this parameter is optional |
| __EXPORT void PRINT_MODULE_USAGE_PARAM_INT | ( | char | option_char, |
| int | default_val, | ||
| int | min_val, | ||
| int | max_val, | ||
| const char * | description, | ||
| bool | is_optional | ||
| ) |
Prints an integer parameter.
| option_char | The option character. |
| default_val | The parameter default value (set to -1 if not applicable). |
| min_val | The parameter minimum value. |
| max_val | The parameter value. |
| description | Pointer to the usage description. |
| is_optional | true if this parameter is optional |
| __EXPORT void PRINT_MODULE_USAGE_PARAM_STRING | ( | char | option_char, |
| const char * | default_val, | ||
| const char * | values, | ||
| const char * | description, | ||
| bool | is_optional | ||
| ) |
Prints a string parameter.
| option_char | The option character. |
| default_val | The default value, can be nullptr. |
| values | The valid values, it has one of the following forms:
|
| description | Pointer to the usage description. |
| is_optional | True iff this parameter is optional. |
| __EXPORT void PRINT_MODULE_USAGE_SUBCATEGORY | ( | const char * | subcategory | ) |
Specify a subcategory (optional).
| subcategory | e.g. if the category is 'driver', subcategory can be 'distance_sensor' |
1.8.12