IP mapped to tty port
Does someone know a tool to map an IP address to a tty?
I've to connect a device which communicate through RS232 port and connected to a server which can open a socket. So I need a tool that receive from the running application, a TCP/IP packet and translate it to a raw data and sent it to/ a tty port.
Every raw data received from the tty, the tool have to pack it in a tcp/ip packet and send it to the running application which has opened the socket...
Does exists a such (freeware!) tool?
Thanks in advance,
PS: excuse me for my poor english!
Seems like you could do this with netcat. You might have to write a little wrapper that throws the TTY into raw mode before passing the fd over to netcat, depending on your application.
Excuse me but I'm very newbie in linux programming... infact I don't understand how both programs proposed (by cornedbee e brewbook) can "redirect" the data extracted from the tcp packet to tty...
Both netcat and tcpserver listen on a socket. When a client connects, all data send by the client is directed to a file or device. Similarly, any data read from the device is sent back to the client. Sounds like basically what you need.
Originally Posted by lollobrigido
Netcat simply redirects the input to standard output. So to connect the socket to the device, you simply redirect netcat into the device:
In practice you would need to place the tty into the proper mode. You might do this with a smaller wrapper program, say, "initty":
nc -l 9919 > /dev/tty
Or something like it.
nc -l 9919 | initty /dev/tty
Netcat only supports one-way communication as far as I know. tcpserver may be more full-featured, but I have not used it.
tcpserver is full-duplex, as some of the alternatives listed on the site I linked.
Great! tomorrow I try ... !!!
This is the best support I've never experienced!!! leaving the "femto"$oft world everythings seems possible :-))))