My Opera is closing 3rd of March

Raphael's Pflock

miscellaneous Opera, Debian, Media and German posts

Subscribe to RSS feed

serial-to-tcp-socket bridge

There is a better solution than mine: ser2net. Google it.

WARNING: the current code contains a small bug which limits the length of a line transmitted via RS-232.

While working on my diploma thesis I have written a simple tool that gets the data from a serial port and outputs it via a TCP socket. I haven't found anything like this on the web.

What's nice:
parameters: TCP port, serial port device file, baudrate
very extensively commented (large parts from tutorials)
free (as in beer and as defined by RMS)

What's ugly:
Only works under Linux
not the smallest one (9 kb source, 14 kb binary)
probably some small bugs
only one-way (yet) - no socket-to-serial functionality

If you find a use for it - here it is:
Source: capboard_bridge.c
Binary: capboard_bridge

Please build the tool from source - it's inherently safer - and you can learn about serial and TCP socket programming.
Just download the source file and execute
 gcc -o capboard_bridge capboard_bridge.c 
to compile it.

BTW: it's named 'capboard_bridge' because I use it for interfacing a custom circuit board (capboard) with a USART and a Java analyzer app.