idfxx 1.0.0
Modern C++23 components for ESP-IDF
Loading...
Searching...
No Matches
idfxx::console Namespace Reference

Classes

struct  command
 Command descriptor for registration. More...
 
struct  config
 Configuration for low-level console initialization. More...
 
class  repl
 Interactive REPL (Read-Eval-Print Loop) console. More...
 

Typedefs

using handler = std::move_only_function< int(int argc, char **argv)>
 Command handler callback type.
 

Functions

void register_command (const command &cmd, handler callback)
 Registers a command with a callback handler.
 
void deregister_command (std::string_view name)
 Deregisters a previously registered command.
 
void register_help_command ()
 Registers the built-in 'help' command.
 
void deregister_help_command ()
 Deregisters the built-in 'help' command.
 
result< voidtry_register_command (const command &cmd, handler callback)
 Registers a command with a callback handler.
 
result< voidtry_deregister_command (std::string_view name)
 Deregisters a previously registered command.
 
result< voidtry_register_help_command ()
 Registers the built-in 'help' command.
 
result< voidtry_deregister_help_command ()
 Deregisters the built-in 'help' command.
 
void init (const config &cfg={})
 Initializes the console module.
 
void deinit ()
 Deinitializes the console module.
 
int run (std::string_view cmdline)
 Runs a command line string.
 
result< voidtry_init (const config &cfg={})
 Initializes the console module.
 
result< voidtry_deinit ()
 Deinitializes the console module.
 
result< inttry_run (std::string_view cmdline)
 Runs a command line string.