From owner-freebsd-questions Sun Feb 18 16:24:21 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id QAA14550 for questions-outgoing; Sun, 18 Feb 1996 16:24:21 -0800 (PST) Received: from cwbone.bsi.com.br ([200.250.250.14]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id QAA14545 for ; Sun, 18 Feb 1996 16:24:11 -0800 (PST) Received: from lenzi ([200.247.248.103]) by cwbone.bsi.com.br (8.6.12/8.6.9) with SMTP id VAA24090; Sun, 18 Feb 1996 21:23:46 GMT Date: Sun, 18 Feb 1996 21:24:42 -0300 (EST) From: "Lenzi, Sergio" X-Sender: lenzi@lenzi To: "Brian J. McGovern" cc: questions@freebsd.org Subject: Re: tc* questions... In-Reply-To: <199602181553.KAA11380@spoon.beta.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-questions@freebsd.org Precedence: bulk On Sun, 18 Feb 1996, Brian J. McGovern wrote: > > I have been playing with tcgetattr and tcsetattr with some reasonable > success. However, I'm now curious how to do it the "right" way. > > What flags should I set to put a terminal in such a mode so that > characters aren't echo'ed, and characters typed are returned > immediately? I've played with ECHO, CLOCAL, and ICANON to some success. use the c_lflags &= (~ECHO | ~ICANON) c_cc[VMIN]=1; c_cc[V_TIME]=1; after... tcsetattr(file_handler,TCSANOW,&termios) I prefer: if (fork() == 0) { execlp("stty","stty","-echo", "-icanon", "time","1", "min","1", "clocal",NULL); } wait(NULL); ... ... > > What flags should I set for a modem for a "normal dialout"? > ie - port doesn't echo (the device will echo the characters) > - characters should be read() immediately (again, no waiting for CR) > -echo, -icanon,min 1, time 1. > Any changes for inbound calls? I use the ttydx device with a direct rs232 cable and a modem initialized with: at&c1&d2s0=1&w > > Lastly, is there any way to directly look at some of the line signals (CD,DTR, > etc)? > there is an ioctl in the termios.h....