Re: Serial device open(2) hang.
Re: Serial device open(2) hang.
- Subject: Re: Serial device open(2) hang.
- From: Steve Checkoway <email@hidden>
- Date: Sun, 28 Jun 2009 11:03:09 -0700
On Jun 27, 2009, at 9:14 PM, David Elliott wrote:
Change your open call to O_RDWR | O_NONBLOCK. This will cause open
not to block thus allowing you to get a working file descriptor and
keeping a handle open to the device (this is important).
Once you have that you need to run stty against it or I suppose you
can use termios functions but honestly I am not all that familiar
with serial programming, I just happened to be doing it the other
week on another project.
What I came up with was this:
This worked perfectly! I now have my computer talking to itself via a
null modem cable with both ends plugged into the usb to serial
adapter. Time to see if I can talk to this microcontroller.
--
Steve Checkoway
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden