|
Other BSD and UNIX/UNIX-like Any other flavour of BSD or UNIX that does not have a section of its own. |
|
Thread Tools | Display Modes |
|
|||
Virtual serial port
Hi all
Hope someone can help. I need to create a virtual serial port for use with a serial port redirect. This is under Mac OS X, but I'm hoping OS X's BSD roots will mean there is already an established way of doing this. TIA |
|
|||
I don't quite understand your question, a serial port is simply a FIFO.
http://developer.apple.com/documenta...an4/pty.4.html http://developer.apple.com/documenta.../mkfifo.1.html http://developer.apple.com/documenta.../mkfifo.2.html Hope that helps.. Last edited by BSDfan666; 29th May 2008 at 05:47 PM. |
|
|||
Let me explain a bit better. I have an application which talks to a serial port. I need to redirect its output to a device connected by Ethernet. Currently, I have two USB to Serial adapters connected to my Mac Mini: one as an "output" and one as an "input", with a serial cable running between them. I configure the software to talk to the "output" port, and I have configured Multicom to redirect the "input" port to the IP address of the Ethernet device.
This works, but is obviously messy hardware-wise. I would like to replace the two physical serial ports with a virtual one through software which I can redirect using Multicom. I'll have a read of those links you posted - thanks. At first glance I'm not sure how they would be used to achieve what I'm trying to do, but I'll read them in more depth and let you know if I have any more questions! Cheers |
|
|||
Perhaps you should port an existing project to Mac? The required functionality is likely readily available.
This project, http://www.bsdua.org/netfwd.html seems to be exactly what you want.. |
|
|||
Just compiled netfwd for OS X and it seems to do the same thing as Multicom. It doesn't seem to have any function for creating virtual COM ports itself. However, it does allow you to precisely specify which serial device to redirect, whereas Multicom only allows you to select ones which are exposed as hardware through drivers. So netfwd could still be quite useful.
I did some more digging in to pty, and if I understand correctly, data squirted in to /dev/ptyp0 should come out at /dev/ttyp0. Is that right? |
|
|||
I had an email from the author of netfwd to let me know that it doesn't support pty. He recommended I try socat, which worked perfectly!
# socat GOPEN:/dev/ptyp0,ignoreeof TCP:10.0.1.93:10002 Then point the application at /dev/ttyp0 |
|
|||
I'm glad you found a solution Sorry if I couldn't be of more assistance..
|
|
|||
Well, you pointed me to netfwd which led me to socat which was the solution. And you also made me aware of ptys, which were part of the solution. So you solved it indirectly
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
probleme with serial port | pitbac23 | FreeBSD General | 2 | 4th October 2008 01:42 AM |
Serial connections | JMJ_coder | General software and network | 9 | 25th July 2008 03:28 PM |
Serial Consoles | ddekok | FreeBSD General | 4 | 26th June 2008 07:16 PM |
Usb serial adapter | Business_woman | FreeBSD General | 10 | 4th June 2008 03:06 PM |
Mounting a second serial hd | keyboard112 | Other BSD and UNIX/UNIX-like | 4 | 12th May 2008 08:06 AM |