|
|
1.1 root 1: .TH BK 4
2: .UC 4
3: .SH NAME
4: bk \- line discipline for machine-machine communication
5: .SH SYNOPSIS
6: .B #include <sgtty.h>
7: .PP
8: .B int ldisc = NETLDISC, fildes;
9: \&...
10: .PP
11: .B ioctl(fildes, TIOCSETD, &ldisc);
12: .SH DESCRIPTION
13: This line discipline provides a replacement for the old and new
14: tty drivers described in
15: .IR tty (4)
16: when high speed output to
17: and especially input from another machine is to be transmitted
18: over a asynchronous communications line. The discipline
19: was designed for use by the Berkeley network
20: .IR net (1)
21: but is
22: well suited to uploading of data from microprocessors into
23: the system. If you are going to send data over asynchronous
24: communications lines at high speed into the system, you must
25: use this discipline, as the system otherwise may detect high
26: input data rates on terminal lines and disables the lines;
27: in any case the processing of such data when normal terminal
28: mechanisms are involved saturates the system.
29: .PP
30: A typical application program then reads a sequence of lines from
31: the terminal port, checking header and sequencing information on each
32: line and acknowledging receipt of each line to the sender, who then
33: transmits another line of data. Typically several hundred bytes of
34: data and a smaller amount of control information will be received on
35: each handshake.
36: .PP
37: The old standard teletype discipline can be restored by doing:
38: .sp
39: .ft B
40: ldisc = OTTYDISC;
41:
42: ioctl(fildes, TIOCSETD, &ldisc);
43: .ft R
44: .sp
45: While in networked mode, normal teletype output functions take place.
46: Thus, if an 8 bit output data path is desired, it is necessary
47: to prepare the output line by putting it into RAW mode using
48: .IR ioctl (2).
49: This must be done
50: .B before
51: changing the discipline with TIOCSETD, as most
52: .IR ioctl (2)
53: calls are disabled while in network line-discipline mode.
54: .PP
55: When in network mode, input processing is very limited to reduce overhead.
56: Currently the input path is only 7 bits wide, with newline the only
57: recognized character, terminating an input record.
58: Each input record must be read and acknowledged before the next input
59: is read as the system refuses to accept any new data when there
60: is a record in the buffer. The buffer is limited in length, but the
61: system guarantees to always be willing to accept input resulting in
62: 512 data characters and then the terminating newline.
63: .PP
64: User level programs should provide sequencing and checksums on the
65: information to guarantee accurate data transfer.
66: .SH "SEE ALSO"
67: tty(4)
68: .SH BUGS
69: A standard program and protocol should be defined for
70: uploading data from microprocessors, so that havoc doesn't
71: result.
72: .PP
73: A full 8-bit input path should be provided with a mechanism
74: for escaping newlines into an input packet.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.