/dev/tty1A won accept ioctl-ctsflow, but stty works ok, why?

Dave Binette dave at norsat.UUCP
Sat Apr 1 17:01:15 AEST 1989


I'm going to ask for some technical assistance here so if your not inclined
to answer...

My application requires the use of CTS/RTS flow control.
SCO xenix 2.3.1 ctsflow patches arrived today and are installed
I have a TB+ connected to a COMPAQ 


This code fragment doesnt seem to set the ctsflow or rtsflow flags.
when i run stty from another terminal the other settings are OK but
ctsflow and rtsflow aren't set.

oddly enough there is a workaround for it.

------------------

#define FN_OUTDEV /dev/tty1A
int	fh_out;

...
    if((fh_out=open(FN_OUTDEV,O_RDWR|O_SYNCW))<0)
    {
        (void)sprintf(ns,"Cant open FN_OUTDEV %s\n",FN_OUTDEV);
        note(ns,0);
        exit(1);
    }
...

void setraw()
{
    if(ioctl(fh_out,TCGETA,&tbuf) == -1)
        note("ioctl 1",1);

    tbufsave=tbuf;        /* this is our copy for later restoration */

    tbuf.c_oflag = 0;
    tbuf.c_cflag = (CS8 | CREAD | EXTA | HUPCL);
    tbuf.c_lflag = 0;
    tbuf.c_iflag = (CTSFLOW | RTSFLOW | IXANY | IXON); 
    tbuf.c_cc[VMIN] = 1;    /* get 1 chrs before satisfying read */
    tbuf.c_cc[VTIME] = 1;    /* or 1 char and 1/10 sec. elapse */

    if(ioctl(fh_out,TCSETA,&tbuf) == -1)
        note("ioctl 2",0);
}
...

------------------------

When I run the program, the file opens ok and obeys the requirement
of not succeeding until carrier goes true (the telebit is set to
automatically dial a number when DTR goes on).

but doing   stty </dev/tty1A  on another terminal shows everything
is set ok except ctsflow and rtsflow aren't set.

If I run the setmode script, ctsflow gets set just fine (takes a moment
or two to go into effect).

what am i doing wrong????


------------------------

setmode is a script that opens a port , sttys some stuff on it and then sleeps
forever in the background while doing a never-ending   cat > /dev/null
here is a copy of the setmode script:


x=$1
shift
( stty "$@" ; cat >/dev/null ) <$x &


I run it like this:

setmode /dev/tty1A exta ixon ixany -hupcl -clocal ctsflow


-----------------------

Ok so I'm stumped :-(

Any help on this would be appreciated, its not urgent, but i'll probably
have to do it right eventually.  

Thanks for taking the time to read and possibly answer my question.


---
usenet:  {uunet,ubc-cs}!van-bc!norsat!dave     (Dave Binette)
bbs:     (604) 597 4361     3/12/24/PEP
voice:   (604) 597 6298
-- 
---
usenet:  {uunet,ubc-cs}!van-bc!norsat!dave     (Dave Binette)
bbs:     (604) 597 4361     3/12/24/PEP
voice:   (604) 597 6298



More information about the Comp.unix.questions mailing list