EasyManuals Logo

Espressif ESP32-S2 User Manual

Espressif ESP32-S2
1695 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #812 background imageLoading...
Page #812 background image
Chapter 2. API Reference
esp_err_t esp_console_cmd_register(const esp_console_cmd_t *cmd)
Register console command.
Return
ESP_OK on success
ESP_ERR_NO_MEM if out of memory
ESP_ERR_INVALID_ARG if command description includes invalid arguments
Parameters
cmd: pointer to the command description; can point to a temporary value
esp_err_t esp_console_run(const char *cmdline, int *cmd_ret)
Run command line.
Return
ESP_OK, if command was run
ESP_ERR_INVALID_ARG, if the command line is empty, or only contained whitespace
ESP_ERR_NOT_FOUND, if command with given name wasnt registered
ESP_ERR_INVALID_STATE, if esp_console_init wasnt called
Parameters
cmdline: command line (command name followed by a number of arguments)
[out] cmd_ret: return code from the command (set if command was run)
size_t esp_console_split_argv(char *line, char **argv, size_t argv_size)
Split command line into arguments in place.
* - This function finds whitespace-separated arguments in the given input line.
*
* 'abc def 1 20 .3' -> [ 'abc', 'def', '1', '20', '.3' ]
*
* - Argument which include spaces may be surrounded with quotes. In this case
* spaces are preserved and quotes are stripped.
*
* 'abc "123 456" def' -> [ 'abc', '123 456', 'def' ]
*
* - Escape sequences may be used to produce backslash, double quote, and space:
*
* 'a\ b\\c\"' -> [ 'a b\c"' ]
*
Note Pointers to at most argv_size - 1 arguments are returned in argv array. The pointer after the last one (i.e.
argv[argc]) is set to NULL.
Return number of arguments found (argc)
Parameters
line: pointer to buffer to parse; it is modified in place
argv: array where the pointers to arguments are written
argv_size: number of elements in argv_array (max. number of arguments)
void esp_console_get_completion(const char *buf, linenoiseCompletions *lc)
Callback which provides command completion for linenoise library.
When using linenoise for line editing, command completion support can be enabled like this:
linenoiseSetCompletionCallback(&esp_console_get_completion);
Parameters
buf: the string typed by the user
lc: linenoiseCompletions to be filled in
const char *esp_console_get_hint(const char *buf, int *color, int *bold)
Callback which provides command hints for linenoise library.
When using linenoise for line editing, hints support can be enabled as follows:
linenoiseSetHintsCallback((linenoiseHintsCallback*) &esp_console_get_hint);
Espressif Systems 801
Submit Document Feedback
Release v4.4

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Espressif ESP32-S2 and is the answer not in the manual?

Espressif ESP32-S2 Specifications

General IconGeneral
BrandEspressif
ModelESP32-S2
CategorySingle board computers
LanguageEnglish