ppedro74 / Arduino-SerialCommands

BSD 3-Clause "New" or "Revised" License
87 stars 29 forks source link

terminal echo #10

Open GralfR opened 3 years ago

GralfR commented 3 years ago

When I first used SerialCommands with the given example and putty I wondered why this didn't work. The first problem was the line-ending, which I then matched on putty and SerialCommands. The second thing was: there was no echo of the input on the client. Okay, one could force putty to do an echo itself. My way was to add an echo to SerialCommands. Inside SerialCommands.cpp i've added a Serial.write(ch); //ECHO after the int ch = serial_->read(); inside the ReadSerial() function.

In my case this is working, but I think this could be done better, at least concerning a multi-serial-support. Maybe You'd like to add an echo-option to Your code and also make that an option to the initialisation (maybe a TRUE or FALSE behind the delimiter argument?).

Thanks

pointer2null commented 3 years ago

+1 Was going to submit a PR with exactly that but don't have permission.