[comp.unix.questions] Control-A sequences over UNIX ports

bob@imsvax.UUCP (Bob Burch) (11/05/87)

Short of modifying a port driver (which we lack source code for) and re-
building unix, the right way to do it, is there any way to prevent application
programs from ever seeing a string begun by a Control-A (hex 1) and ended with
a carriage return coming from a port?  You would think you could write a filter
which looked sort of like:


	 for(;;)
	 {
	   c = getc();
	   if (c == 1)
	   {
	     while( (c = getc()) != 13);
           }
	   else putc(c)();
         }

possibly using reads and writes to dev/tty and possibly using some combination
of "stty raw" or "stty raw > /dev/tty" etc. and then piping the application
programs with the filter.  The filter is easy enough to make work under DOS,
but I have tried every combination of things I can think of which is anywhere
close to being logical and can't make it work under unix (ULTRIX).  The unix
daemons and gremlins take over every time, and strange and exotic things
happen.  The situation arises from a customer's insistance on connecting a
computer to a device which appears to be intended only to connect terminals
together in a sort of a talk-net and which produces the control-A strings at
unpredictable times, often to let a terminal user know that someone other
than the one he is talking to is trying to get through (call on hold).  Any
help would be appreciated.

Ted Holden
HT Enterprises