ThingerConsole.hfile and create a instance over
consoleinstance for logging to the remote terminal by using the same interface available in the Arduino
Serialclass, i.e, using
printf, etc. For example, the following code will show a log every second:
Serialinterface, for example, the following code sample will check if there is any data available using the
availablemethod on the console (in the same way it is used on Arduino
Serial) , and will print back to the console:
setupfunction. It is required to call the function
consoleinstance. This function requires two arguments: the
command nameand the
command function. There is an optional parameters that is the
command description, that can be useful to specify command arguments or any other help about the command.
millis, and a function that just print the result of the
millis()function over the console terminal. It also includes a description in the third argument with this content.
millisfunction defined above.
command_runningmethod, that will return false if the console has been closed, or the command was cancelled.
argvparameters, like in any standard C/C++ main function.
argcdetermines the number of arguments, and
argvis an array of
char*which holds all parsed parameters. Any command will receive at least one argument, which is the command name.
esp32name which is the identifier for the device.
set_prompt("my prompt")method on the console instance. For example: