Now that the telnet client is it working, I had to add telnetClient.print() line to EVERY Serial.print() & Serial.println() statements in my codes ...
Is there a more efficient way to send to an intermediate function that will check if telnet client isConnected and only send to those telnet client, the default is still send to the Serial.print
Any advise or suggestions are welcome and appreciated ...
stan001:
Now that the telnet client is it working, I had to add telnetClient.print() line to EVERY Serial.print() & Serial.println() statements in my codes ...
are you saying you modified the CmdArduino library to instead redirect to the telnet connection instead of Serial?
It seems to me that creating a function that checks for a Telnet connection and then either prints to Serial or to the client is somewhat trivial.
Serial and EthernetClient are both Stream devices. Setup a pointer to Stream, and set the pointer to either &Serial or &client, and use that pointer to print.