the argtable3 provides string based output return, there is no need to go via
stdio structures.
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Signed-off-by: Ivan Grokhotkov <ivan@espressif.com>
Closes https://github.com/espressif/esp-idf/pull/12507
* Users can now use libbsd string.h and sys/cdefs.h functionality
(e.g., strlcpy, containerof) on Linux by just including
string.h or sys/cdefs.h. In other words, the includes are the same
on the Linux target as well as on chips targets (ESP32, etc.).
* libbsd linking is done by the linux component (belongs to common
components) now instead of handling it separately in each component
This commit fixes the following build issues when CONFIG_ESP_CONSOLE_NONE is
enabled:
- vfs_console.c will attempt to register a VFS entry for STDIO console even if
CONFIG_ESP_CONSOLE_NONE is enabled. This results in "undeclared `primary_path`"
error.
- esp_console_repl_chpi.c does not use "TAG" when CONFIG_ESP_CONSOLE_NONE is
enabled, leading to a "defined by not used" warning.
Closes https://github.com/espressif/esp-idf/issues/12984
This commit fixes a potential issue where in the prompt length used
for the linenoise based console could be calculated as a negative
integer, leading to a console hang.
Closes https://github.com/espressif/esp-idf/issues/4924
Current implementation implicitly forces the developer to use global variables
to enter its context during the command invocation, this change enables each
module to register a context for command to find without the need to manage
global variables.
No API breakage.
Fields added:
esp_console_cmd_t::func_w_context - (*)(int argc, char **argv, void *context)
Functions added:
esp_err_t esp_console_cmd_set_context(const char *cmd, void *context)
Usage:
esp_console_cmd_register(&cmd));
esp_console_cmd_set_context(cmd.command, (void *)"context"));
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
console commands may be registered in random order in application, for example
each module registers its own commands.
the output of help is displayed to human, best to have consistent sorted
output so that the implementation ordering will not affect the output and
allow the user to see a list in some logic order.
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
* All components which won't build (yet) on Linux are excluded.
This enables switching to Linux in an application without
explicitly setting COMPONENTS to main in the main
CMakeLists.txt.
* ESP Timer provides headers for Linux now
* automatically disabling LWIP in Kconfig if it is not available
doc(linux): brought section
"Component Linux/Mock Support Overview" up to date
For usb_serial_jtag REPL only, xTaskCreate was passing a pointer to
esp_console_repl_com_t, while esp_console_repl_task was expecting
a pointer to esp_console_repl_universal_t.
The way the two structures are defined, this makes no difference, and
the pointer values are the same. Still, this could potentially break
in the future.
(I am not sure what is the distinction between repl_com (common?) and
repl_universal; it seems that `int uart_channel` could just as well
be part of esp_console_repl_com_t; alternatively, as suggested in the
previous commit, this structure could contain a callback function
pointer, which would allow `esp_console_new_repl_*` functions to
specify how stdin/stdout should be initialized by the REPL task.)