Date: Sun, 30 Jan 2005 08:32:03 GMT From: Marcel Moolenaar <marcel@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 69963 for review Message-ID: <200501300832.j0U8W3UT000517@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=69963 Change 69963 by marcel@marcel_nfs on 2005/01/30 08:31:58 Make the DTE drain the output and wait for the DCE to drop DSR. This fixes termination problems when the DCE needs a lot of time to receive the data. Lower the speed to 19200. The Zilog Z8530 can't even be programmed for 115200. Affected files ... .. //depot/projects/uart/dev/uart/uarttest.c#4 edit Differences ... ==== //depot/projects/uart/dev/uart/uarttest.c#4 (text+ko) ==== @@ -100,6 +100,12 @@ } } printf("dte: %u bytes transmitted\n", count); + + ioctl(fd, TIOCDRAIN); + do { + sleep(1); + ioctl(fd, TIOCMGET, &sig); + } while (sig & TIOCM_DSR); } static void @@ -185,7 +191,7 @@ tcgetattr(fd, &t0); t1 = t0; cfmakeraw(&t1); - cfsetspeed(&t1, B115200); + cfsetspeed(&t1, B19200); switch (how) { case AS_DCE: t1.c_cflag |= CRTS_IFLOW; @@ -211,7 +217,6 @@ break; } - sleep(2); tcsetattr(fd, TCSADRAIN, &t0); close(fd); return (EX_OK);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200501300832.j0U8W3UT000517>