ErriezSerialTerminal
ErriezSerialTerminal copied to clipboard
Add case insensitive commands
It would be nice if the command string wasn't case sensitive.
Something along the lines of adding it as an OPTIONAL parameter to addCommand()
.
This could be implemented by using strupr()
or strlwr()
in addCommand()
when adding to the _commandList
. Then use the same (lower or upper) function in the readSerial()
function. Specifically here: https://github.com/Erriez/ErriezSerialTerminal/blob/a9f8a8bbe159ae85ad868b84fe4207fa29629052/src/ErriezSerialTerminal.cpp#L146
The conversion would only be carried out if configured to do so.
Thanks for your feedback. What do you think of replacingstrncmp()
with strncasecmp()
to perform case insensitive comparison of all commands?
I think that would be a better solution 👍