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

Interactive REPL (Read-Eval-Print Loop) console. More...

Classes

struct  config
 REPL configuration parameters. More...
 

Public Member Functions

 ~repl ()
 Destroys the REPL.
 
 repl (const repl &)=delete
 
reploperator= (const repl &)=delete
 
 repl (repl &&other) noexcept
 Move constructor.
 
reploperator= (repl &&other) noexcept
 Move assignment.
 
esp_console_repl_tidf_handle () const noexcept
 Returns the underlying ESP-IDF REPL handle.
 

Detailed Description

Interactive REPL (Read-Eval-Print Loop) console.

Provides an interactive command-line interface over UART, USB CDC, or USB Serial JTAG. The REPL runs in a background FreeRTOS task and processes commands from the global command registry.

This type is non-copyable and move-only. Result-returning methods on a moved-from object return errc::invalid_state.

// Register commands
{.name = "hello", .help = "Say hello"},
[](int, char**) { std::printf("Hello!\n"); return 0; });
// Create UART REPL (starts accepting input immediately)
idfxx::console::repl console({}, {});
Interactive REPL (Read-Eval-Print Loop) console.
Definition console.hpp:289
void register_command(const command &cmd, handler callback)
Registers a command with a callback handler.
void register_help_command()
Registers the built-in 'help' command.
std::expected< T, std::error_code > result
result type wrapping a value or error code.
Definition error.hpp:120

Definition at line 289 of file console.hpp.

Constructor & Destructor Documentation

◆ ~repl()

idfxx::console::repl::~repl ( )

Destroys the REPL.

Stops the REPL task and releases all resources.

◆ repl() [1/2]

idfxx::console::repl::repl ( const repl )
delete

◆ repl() [2/2]

idfxx::console::repl::repl ( repl &&  other)
noexcept

Move constructor.

Transfers ownership of the REPL.

Member Function Documentation

◆ idf_handle()

esp_console_repl_t * idfxx::console::repl::idf_handle ( ) const
inlinenoexcept

Returns the underlying ESP-IDF REPL handle.

Returns
The esp_console_repl_t pointer, or nullptr if moved-from.

Definition at line 448 of file console.hpp.

◆ operator=() [1/2]

repl & idfxx::console::repl::operator= ( const repl )
delete

◆ operator=() [2/2]

repl & idfxx::console::repl::operator= ( repl &&  other)
noexcept

Move assignment.

Transfers ownership of the REPL.


The documentation for this class was generated from the following file: