1*47674Scael.\" Copyright (c) 1986, 1991 Regents of the University of California. 2*47674Scael.\" All rights reserved. 327089Smckusick.\" 4*47674Scael.\" %sccs.include.redist.man% 527089Smckusick.\" 6*47674Scael.\" @(#)tb.4 6.4 (Berkeley) 03/27/91 7*47674Scael.\" 8*47674Scael.Dd 9*47674Scael.Dt TB 4 vax 10*47674Scael.Os BSD 4.3 11*47674Scael.Sh NAME 12*47674Scael.Nm tb 13*47674Scael.Nd line discipline for digitizing devices 14*47674Scael.Sh SYNOPSIS 15*47674Scael.Cd pseudo-device tb 16*47674Scael.Sh DESCRIPTION 1727089SmckusickThis line discipline provides a polled interface to many common 1827089Smckusickdigitizing devices which are connected to a host through a serial line. 1927089SmckusickWhen these devices stream data at high speed, the use of the 2028930Smisline discipline is critical in minimizing the number of samples 2127089Smckusickthat would otherwise be lost due to buffer exhaustion in the 22*47674Scael.Xr tty 4 2327089Smckusickhandler. 24*47674Scael.Pp 2527089SmckusickThe line discipline is enabled by a sequence: 26*47674Scael.Bd -literal -offset indent 27*47674Scael#include <sys/tablet.h> 28*47674Scaelint ldisc = TBLDISC, fildes; ... 29*47674Scaelioctl(fildes, TIOCSETD, &ldisc); 30*47674Scael.Ed 31*47674Scael.Pp 3227089SmckusickA typical application program then polls the digitizing device by 3327089Smckusickreading a binary data structure which contains: the current X and 3427089SmckusickY positions (in the device coordinate space), 3527089Smckusickup-down status of the buttons or pen stylus, 3627089Smckusickproximity information (when available), and a count 3727089Smckusickof the number of samples received from the input device 3827089Smckusicksince it was opened. In addition, devices such as the 39*47674Scael.Tn GTCO 40*47674Scaelappend tilt and pressure information to the end of 4128930Smisthe aforementioned structure. For the Polhemus 3-D digitizer 4228930Smisthe structure read is completely different. Refer to the 4327089Smckusickinclude file for a complete description. 44*47674Scael.Pp 4527089SmckusickWhile in tablet mode, normal teletype input and output functions take place. 4627089SmckusickThus, if an 8 bit output data path is desired, it is necessary 47*47674Scaelto prepare the output line by putting it into 48*47674Scael.Tn RAW 49*47674Scaelmode using 50*47674Scael.Xr ioctl 2 . 5127089SmckusickThis must be done 52*47674Scael.Em before 53*47674Scaelchanging the discipline with 54*47674Scael.Dv TIOCSETD , 55*47674Scaelas most 56*47674Scael.Xr ioctl 2 5727198Ssamcalls are disabled while in tablet line-discipline mode. 58*47674Scael.Pp 5927089SmckusickThe line discipline supports 60*47674Scael.Xr ioctl 2 6127089Smckusickrequests to get/set the operating mode, and to get/set the tablet type 62*47674Scaeland operating mode by 63*47674Scael.Em or Ns -ing 64*47674Scaelthe two values together. 65*47674Scael.Pp 6628930SmisThe line discipline supports digitizing devices which are 67*47674Scaelcompatible with Hitachi, 68*47674Scael.Tn GTCO , 69*47674Scaelor Polhemus protocol formats. 7027089SmckusickFor Hitachi there are several formats with that used in the 71*47674Scaelnewer model 72*47674Scael.Tn HDG-1111B 73*47674Scaelthe most common. 74*47674Scael.Sh DIAGNOSTICS 7527089SmckusickNone. 76*47674Scael.Sh SEE ALSO 77*47674Scael.Xr tty 4 78*47674Scael.Sh HISTORY 79*47674ScaelThe 80*47674Scael.Nm 81*47674Scaelinterface appeared in 82*47674Scael.Bx 4.3 . 83