BSD 4_4 release
[unix-history] / usr / src / share / man / man4 / man4.vax / tb.4
CommitLineData
d5bbf259
KB
1.\" Copyright (c) 1986, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
117af647 3.\"
ad787160
C
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice, this list of conditions and the following disclaimer.
9.\" 2. Redistributions in binary form must reproduce the above copyright
10.\" notice, this list of conditions and the following disclaimer in the
11.\" documentation and/or other materials provided with the distribution.
12.\" 3. All advertising materials mentioning features or use of this software
13.\" must display the following acknowledgement:
14.\" This product includes software developed by the University of
15.\" California, Berkeley and its contributors.
16.\" 4. Neither the name of the University nor the names of its contributors
17.\" may be used to endorse or promote products derived from this software
18.\" without specific prior written permission.
117af647 19.\"
ad787160
C
20.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
24.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE.
9903e566 31.\"
ad787160
C
32.\" @(#)tb.4 8.1 (Berkeley) 6/5/93
33.\"
34.Dd June 5, 1993
9903e566
CL
35.Dt TB 4 vax
36.Os BSD 4.3
37.Sh NAME
38.Nm tb
39.Nd line discipline for digitizing devices
40.Sh SYNOPSIS
41.Cd pseudo-device tb
42.Sh DESCRIPTION
117af647
KM
43This line discipline provides a polled interface to many common
44digitizing devices which are connected to a host through a serial line.
45When these devices stream data at high speed, the use of the
ff72c000 46line discipline is critical in minimizing the number of samples
117af647 47that would otherwise be lost due to buffer exhaustion in the
9903e566 48.Xr tty 4
117af647 49handler.
9903e566 50.Pp
117af647 51The line discipline is enabled by a sequence:
9903e566
CL
52.Bd -literal -offset indent
53#include <sys/tablet.h>
54int ldisc = TBLDISC, fildes; ...
55ioctl(fildes, TIOCSETD, &ldisc);
56.Ed
57.Pp
117af647
KM
58A typical application program then polls the digitizing device by
59reading a binary data structure which contains: the current X and
60Y positions (in the device coordinate space),
61up-down status of the buttons or pen stylus,
62proximity information (when available), and a count
63of the number of samples received from the input device
64since it was opened. In addition, devices such as the
9903e566
CL
65.Tn GTCO
66append tilt and pressure information to the end of
ff72c000
MS
67the aforementioned structure. For the Polhemus 3-D digitizer
68the structure read is completely different. Refer to the
117af647 69include file for a complete description.
9903e566 70.Pp
117af647
KM
71While in tablet mode, normal teletype input and output functions take place.
72Thus, if an 8 bit output data path is desired, it is necessary
9903e566
CL
73to prepare the output line by putting it into
74.Tn RAW
75mode using
76.Xr ioctl 2 .
117af647 77This must be done
9903e566
CL
78.Em before
79changing the discipline with
80.Dv TIOCSETD ,
81as most
82.Xr ioctl 2
350ed45d 83calls are disabled while in tablet line-discipline mode.
9903e566 84.Pp
117af647 85The line discipline supports
9903e566 86.Xr ioctl 2
117af647 87requests to get/set the operating mode, and to get/set the tablet type
9903e566
CL
88and operating mode by
89.Em or Ns -ing
90the two values together.
91.Pp
ff72c000 92The line discipline supports digitizing devices which are
9903e566
CL
93compatible with Hitachi,
94.Tn GTCO ,
95or Polhemus protocol formats.
117af647 96For Hitachi there are several formats with that used in the
9903e566
CL
97newer model
98.Tn HDG-1111B
99the most common.
100.Sh DIAGNOSTICS
117af647 101None.
9903e566
CL
102.Sh SEE ALSO
103.Xr tty 4
104.Sh HISTORY
105The
106.Nm
107interface appeared in
108.Bx 4.3 .