I need to write a very basic command interpreter on a micro controller that will communicate over a virtual serial port. Before I go ahead and write my own version of this, I was wondering if anyone knew of any libraries for very simple, shell-like text processing. I’d like the features that are standard in a shell, such as text received only being available after the user types in a new line, pressing backspace removes the last character in the queue rather than adding another char in the queue, stuff like that.
Any ideas?
Thanks
to achieve a truly simple “shell” with line buffering (line buffering means processing only after an “enter” or ‘\n’) in a microcontroller, i would do something like this (in the middle of the main loop:
The secret then, would be the
process_input()function, where you would parse the commands and its parameters, so you could call the appropriate functions to handle them.This is just an idea far from finished, you would need to put a limit to the number of chars received before a
'\n'to prevent overflow.