🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.dec
Article #339

SUMMARY: Reading from a Digitizier to Decstation 5000

#339
From: Aditya Talwar
Date: Tue, 07 Apr 1992 20:35
87 lines
3467 bytes
Hi everyone,

	yesterday, i had posted a disperate help message to read
	input from a digitizier on a DECstation 5000, the digitizier
	was GTCO, 4 x 5 feet. My question was whether I was reading
	the correct /dec/tty** dev. driver to get to the Digitizier?
	And also the method. I must give my thanks to:

From: Stefan Manke <manke@ira.uka.de>
From rogerhef@matt.ksu.ksu.edu Tue Apr  7 08:15:52 1992

	Stefan, sent me a piece of code , from which we realized our mistake.
	Basically, from the developers standpoint, Victory was over
	different flavors of UNIX and UNIX-boxes. The initial code
	was working on the Sun, but on the DECstation, we realized later
	was working only with -POSIX complilation option. DEC box has 3 option
	to set ioctl calls, standard ultrix, POSIX, System V. Here are the
	summaries, and our kludge.
thanks
cosc4hf@menudo.uh.edu
1
*************************************************************
Subject: RE: Digitizier input to a Decstation 5000
Date: Tue, 07 Apr 92 09:42:15 +0200
From: Stefan Manke <manke@ira.uka.de>
Yes, you are right: /dev/tty00 should be the right device driver for port 2 at your
DECstation (I use my WACOM digitizer at port 3 with /dev/tty01.)
I haven't made any changes in /etc/ttys.
My source code for opening the digitizer for read/write looks as follows:
	
static int OpenRS232C (device, baudrate)
char *device;
int baudrate;
{
  int fd, i;
  struct sgttyb portstat;

   /* open device */
   if ((fd = open (device, O_RDWR, 0)) < 0) {
     /* unable to open device */
     fprintf (stderr, "!!! error: can't open RS232C device \"%s\"\n", device);
     return -1;
   }
   else { /* device now is open */
     /* set baud rate and transmission mode of device */
     portstat.sg_ispeed = portstat.sg_ospeed = baudrate;
     portstat.sg_flags = RAW|ANYP;
     if (ioctl (fd, TIOCSETP, &portstat) == -1) {
       fprintf (stderr, "!!! error: ioctl TIOCSETP\n");
       return -1;
     }
     else {
       return fd;
     }
   }
}

where device is defined as "/dev/tty01" and baudrate is B19200.
Don't forget to set the corresponding baudrate at your digitizer!
Just a hint: Have you set the file protection mode of /dev/tty00 to it's right value?
In your particular case it should be crw-r--r-- or crw-rw-rw-. By default it has
crw--w--w- .
*************************************************
2
*************************************************	
Get kermit and use it to read the port.  I don't believe we were
ever able to read a tablet on a port without using kermit.  It is
also a little easier to see what is or isn't going on with kermit.
***********************************************
3 our kludge
************************************************	
#if defined(DECMIPS) 
#define TCSETS		TCSANOW
#endif

	    /*
	     * Set the characteristics.
	     */
	    unix_status = ioctl (digi_fd, TCSETS , &characteristics);
	
	    if (unix_status != 0)
	    {
	        *status_ptr = E$NOT$DEVICE;
	    }
	
	} /* End of digi_setup */
****************************************************	
Technical Details
Message-ID: <1992Apr7.203558.10086@menudo.uh.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!menudo.uh.edu!cosc4hf

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.dec,comp.unix.ultrix
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!menudo.uh.edu!cosc4hf
From: cosc4hf@menudo.uh.edu (Aditya Talwar)
Subject: SUMMARY: Reading from a Digitizier to Decstation 5000
Message-ID: <1992Apr7.203558.10086@menudo.uh.edu>
Organization: University of Houston
Date: Tue, 7 Apr 1992 20:35:58 GMT