Re: Virtual serial ports
Re: Virtual serial ports
- Subject: Re: Virtual serial ports
- From: Terry Lambert <email@hidden>
- Date: Tue, 11 Sep 2007 16:35:30 -0700
On Sep 11, 2007, at 3:09 PM, Thomas Hauk wrote:
On Sep 11, 2007, at 1:42 PM, mm w wrote:
you should make a quick search on Darwin-Driver mailing list it's a
while(1) question
Now that the Apple mailing list search facility is (mostly) working
again (was getting Interal Server Errors for over an hour), I did
what you suggested, but I didn't find anything related, especially
regarding anything similar to the Win32 com0com project. It could be
that my search-fu is weak, though.
Any further assistance would be most appreciated.
How virtual do you need it?
If they should both think they are talking to serial ports, then you
can write a little program that opens the master side of two ptys,
calls grantpt() on both and unlockpt() on both, uses fcntl() to put
them in non-blocking mode, then calls select() on both, and when they
become active, writes the data from one end to the other and vice versa.
This is probably about a 70 line program, if you include signal
handling and EOF processing, and make sure you include all the right
headers for making the compiler happy when -Wall -Werror is specified,
and put some comments in the thing.
Then you can use the slave sides as if they were com ports from both
ends.
If you need pseudo CTS/RTS/DTR/DSR/BRK signal processing, you will
need to get fancier, and if you want both ends to look like a dataset
(e.g. a Hayes modem or other device, and accept AT commands, etc.),
then you will need to get more complicated.
-- Terry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden