Re: Correction: Serial port arbitration
Re: Correction: Serial port arbitration
- Subject: Re: Correction: Serial port arbitration
- From: Gregory Weston <email@hidden>
- Date: Sat, 9 Apr 2005 08:35:03 -0400
On Apr 9, 2005, at 4:21 AM, Dan Bernstein wrote:
I had a similar problem with the code. Solved it by turning on the
CLOCAL bit in the termios struct's c_cflag field and turning off
CCTLS_FLOW and CRTS_IFLOW. Here's my setup code:
struct termios options;
if ( tcgetattr( fd, &options )==-1 )
{ /* throw an exception */ }
cfmakeraw(&options);
options.c_cc[VMIN] = 1; // characters
options.c_cc[VTIME] = 10; // tenths of a second
if ( cfsetspeed( &options, B57600 )==-1 ) // Set 57600 baud
{ /* throw an exception */ }
options.c_cflag |= ( CS8 | CLOCAL ); // Use 8 bit words,
ignore status lines
if ( tcsetattr( [modemFileHandle fileDescriptor], TCSANOW,
&options )==-1 )
{ /* throw an exception */ }
That looks like a success in my testbed app. I'll try it in the real
project later. Thanks very much.
_______________________________________________
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