I currently have a working "one character" serial menu system that processes one character at a time and is designed to be nonblocking, so other periodical tasks keep running.
My original code is:
if (Console0.available()) inbyte = Console0.read();
Then inbyte is processed and finally set to 0 upon completing the task.
I can enter a one character command at a time, or even stack a series of characters.
They get processed one after the other using several cycles.
I want to make a telnet version of this system.
The way ESPtelnet.h processes input is however different: it takes always a full line.
So my original idea is to take that string and, at each cycle, extract the left character to inbyte and store the shortened string for the next cycle, returning to telnet.onInputReceived once the string is empty.
That will probably work, but looks a bit clumsy and string processing is known to be problematic.
Have you got a better idea how to do it more elegantly?