Skip to content

Latest commit

 

History

History
62 lines (42 loc) · 2.12 KB

usage.rst

File metadata and controls

62 lines (42 loc) · 2.12 KB

Usage

#include <uuid/console.h>

Create a std::shared_ptr<uuid::console::Commands> and populate it with the commands to be available on the shell.

Create a std::shared_ptr<uuid::console::Shell> referencing the Serial stream and the commands list. Call start() on the instance and then uuid::console::Shell::loop_all() regularly. (The static set of all shells will retain a copy of the shared_ptr until the shell is stopped.)

Log messages are written as output to the shell automatically. Call log_level() on the shell to change the log level.

Example (Digital I/O)

.. literalinclude:: ../examples/DigitalIO.cpp

Output

.. literalinclude:: ../examples/DigitalIO_output.txt
   :language: console

Example (WiFi network scan)

.. literalinclude:: ../examples/WiFi.cpp

Output

.. literalinclude:: ../examples/WiFi_output.txt
   :language: console