Serial To Telnet Example 4 U
Posted: Sun May 17, 2009 6:05 am
I have used this piece of code for a while now to allow me to view the serial port using telnet instead of a serial hardware connection. This code does a couple things.
#1) if no telnet session is made, it will allows the serial port 0,1,2 to be used as normal. I.E. routs the serial to the hardware.
#2) if a telnet connection is made it then routes the serial pors 0,1,2 to the telnet session. when the telnet session is closed, it automatically routs the serial ports back to the hardware.
This is handy if you have several boards running on the net and have some debug information, health info or whatever using printf's, and its just impractical to connect a serial cable to them to see this information.
Just add the attached code to your code and add it as a task, compile, download and then connect to your board using Telnet, its that simple.
#1) if no telnet session is made, it will allows the serial port 0,1,2 to be used as normal. I.E. routs the serial to the hardware.
#2) if a telnet connection is made it then routes the serial pors 0,1,2 to the telnet session. when the telnet session is closed, it automatically routs the serial ports back to the hardware.
This is handy if you have several boards running on the net and have some debug information, health info or whatever using printf's, and its just impractical to connect a serial cable to them to see this information.
Just add the attached code to your code and add it as a task, compile, download and then connect to your board using Telnet, its that simple.