Re: Correction: Serial port arbitration
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com 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 _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... 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. This email sent to site_archiver@lists.apple.com
participants (1)
-
Gregory Weston