1.\" Copyright (c) 1986, 1991, 1993 2.\" The Regents of the University of California. All rights reserved. 3.\" 4.\" %sccs.include.redist.man% 5.\" 6.\" @(#)tb.4 8.1 (Berkeley) 06/05/93 7.\" 8.Dd 9.Dt TB 4 vax 10.Os BSD 4.3 11.Sh NAME 12.Nm tb 13.Nd line discipline for digitizing devices 14.Sh SYNOPSIS 15.Cd pseudo-device tb 16.Sh DESCRIPTION 17This line discipline provides a polled interface to many common 18digitizing devices which are connected to a host through a serial line. 19When these devices stream data at high speed, the use of the 20line discipline is critical in minimizing the number of samples 21that would otherwise be lost due to buffer exhaustion in the 22.Xr tty 4 23handler. 24.Pp 25The line discipline is enabled by a sequence: 26.Bd -literal -offset indent 27#include <sys/tablet.h> 28int ldisc = TBLDISC, fildes; ... 29ioctl(fildes, TIOCSETD, &ldisc); 30.Ed 31.Pp 32A typical application program then polls the digitizing device by 33reading a binary data structure which contains: the current X and 34Y positions (in the device coordinate space), 35up-down status of the buttons or pen stylus, 36proximity information (when available), and a count 37of the number of samples received from the input device 38since it was opened. In addition, devices such as the 39.Tn GTCO 40append tilt and pressure information to the end of 41the aforementioned structure. For the Polhemus 3-D digitizer 42the structure read is completely different. Refer to the 43include file for a complete description. 44.Pp 45While in tablet mode, normal teletype input and output functions take place. 46Thus, if an 8 bit output data path is desired, it is necessary 47to prepare the output line by putting it into 48.Tn RAW 49mode using 50.Xr ioctl 2 . 51This must be done 52.Em before 53changing the discipline with 54.Dv TIOCSETD , 55as most 56.Xr ioctl 2 57calls are disabled while in tablet line-discipline mode. 58.Pp 59The line discipline supports 60.Xr ioctl 2 61requests to get/set the operating mode, and to get/set the tablet type 62and operating mode by 63.Em or Ns -ing 64the two values together. 65.Pp 66The line discipline supports digitizing devices which are 67compatible with Hitachi, 68.Tn GTCO , 69or Polhemus protocol formats. 70For Hitachi there are several formats with that used in the 71newer model 72.Tn HDG-1111B 73the most common. 74.Sh DIAGNOSTICS 75None. 76.Sh SEE ALSO 77.Xr tty 4 78.Sh HISTORY 79The 80.Nm 81interface appeared in 82.Bx 4.3 . 83