Re: Serial port over TCP/IP

Rob van Nieuwkerk (robn@verdi.et.tudelft.nl)
Sun, 06 Apr 2003 15:35:41 +0200


Michael Buesch wrote:
> Is it possible to make a char-dev (a serial device ttyS0)
> available via TCP/IP on a network like it is possible
> for block-devices like a harddisk via nbd?
> Is kernel-support for this present?
> If not, is it technically possible to develop such a driver?

Hi Michael,

No need for kernel support. This simple shell-script is what I use for
a project at the moment.

greetings,
Rob van Nieuwkerk

------------------------------------------------
#!/bin/sh

TCP_PORT=4000
SERIAL_PORT=/dev/ttyS1
BAUDRATE=19200

while (true)
do
(stty $BAUDRATE -echo clocal raw pass8 ; exec nc -l -p $TCP_PORT) \
< $SERIAL_PORT > $SERIAL_PORT
done
------------------------------------------------
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/