source: rtems/doc/new_chapters/device.t @ be4284d0

4.104.114.84.95
Last change on this file since be4284d0 was 05d49928, checked in by Wade A Smith <warm38@…>, on 09/30/98 at 21:18:46

Corrected TYPO error in the file.

  • Property mode set to 100644
File size: 8.6 KB
Line 
1@c
2@c  COPYRIGHT (c) 1988-1998.
3@c  On-Line Applications Research Corporation (OAR).
4@c  All rights reserved.
5@c
6@c  $Id$
7@c
8
9@chapter Device- and Class- Specific Functions Manager
10
11@section Introduction
12
13The device- and class- specific functions manager is ...
14
15The directives provided by the device- and class- specific functions
16manager are:
17
18@itemize @bullet
19@item @code{cfgetispeed} - Reads terminal input baud rate
20@item @code{cfgetospeed} - Reads terminal output baud rate
21@item @code{cfsetispeed} - Sets terminal input baud rate
22@item @code{cfsetospeed} - Set terminal output baud rate
23@item @code{tcgetattr} - Gets terminal attributes
24@item @code{tcsetattr} - Set terminal attributes
25@item @code{tcsendbreak} - Sends a break to a terminal
26@item @code{tcdrain} - Waits for all output to be transmitted to the terminal
27@item @code{tcflush} - Discards terminal data
28@item @code{tcflow} - Suspends/restarts terminal output
29@item @code{tcgetpgrp} - Gets foreground process group ID
30@item @code{tcsetpgrp} - Sets foreground process group ID
31@end itemize
32
33@section Background
34
35There is currently no text in this section.
36
37@section Operations
38
39There is currently no text in this section.
40
41@section Directives
42
43This section details the device- and class- specific functions manager's
44directives.  A subsection is dedicated to each of this manager's directives
45and describes the calling sequence, related constants, usage,
46and status codes.
47
48@page
49@subsection cfgetispeed - Reads terminal input baud rate
50
51@subheading CALLING SEQUENCE:
52
53@ifset is-C
54@example
55#include <termios.h>
56
57int cfgetispeed(
58  const struct termios *p
59);
60@end example
61@end ifset
62
63@ifset is-Ada
64@end ifset
65
66@subheading STATUS CODES:
67
68The @code{cfgetispeed()} function returns a code for baud rate. 
69
70@subheading DESCRIPTION:
71
72The @code{cfsetispeed()} function stores a code for the terminal speed
73stored in a struct termios.  The codes are defined in @code{<termios.h>}
74by the macros BO, B50, B75, B110, B134, B150, B200, B300, B600, B1200,
75B1800, B2400, B4800, B9600, B19200, and B38400.
76
77The @code{cfsetispeed()} function does not do anything to the hardware.
78It merely stores a value for use by @code{tcsetattr()}.
79
80@subheading NOTES:
81
82Baud rates are defined by symbols, such as B110, B1200, B2400.  The actual
83number returned for any given speed may change from system to system.
84
85@page
86@subsection cfgetospeed - Reads terminal output baud rate
87
88@subheading CALLING SEQUENCE:
89
90@ifset is-C
91@example
92#include <termios.h>
93
94int cfgetospeed(
95  const struct termios *p
96);
97@end example
98@end ifset
99
100@ifset is-Ada
101@end ifset
102
103@subheading STATUS CODES:
104
105The @code{cfgetospeed()} function returns the termios code for the baud rate.
106
107@subheading DESCRIPTION:
108
109The @code{cfgetospeed()} function returns a code for the terminal speed
110stored in a @code{struct termios}.  The codes are defined in @code{<termios.h>}
111by the macros BO, B50, B75, B110, B134, B150, B200, B300, B600, B1200, B1800,
112B2400, B4800, B9600, B19200, and B38400.
113
114The @code{cfgetospeed()} function does not do anything to the hardware.
115It merely returns the value stored by a previous call to @code{tcgetattr()}.
116
117@subheading NOTES:
118
119Baud rates are defined by symbols, such as B110, B1200, B2400.  The actual
120number returned for any given speed may change from system to system.
121
122@page
123@subsection cfsetispeed - Sets terminal input baud rate
124
125@subheading CALLING SEQUENCE:
126
127@ifset is-C
128@example
129#include <termios.h>
130
131int cfsetispeed(
132  struct termios *p,
133  speed_t         speed
134);
135@end example
136@end ifset
137
138@ifset is-Ada
139@end ifset
140
141@subheading STATUS CODES:
142
143The @code{cfsetispeed()} function returns a zero when successful and
144returns -1 when an error occurs. 
145
146@subheading DESCRIPTION:
147
148The @code{cfsetispeed()} function stores a code for the terminal speed
149stored in a struct termios.  The codes are defined in @code{<termios.h>}
150by the macros B0, B50, B75, B110, B134, B150, B200, B300, B600, B1200,
151B1800, B2400, B4800, B9600, B19200, and B38400.
152
153@subheading NOTES:
154
155This function merely stores a value in the @code{termios} structure.  It
156does not change the terminal speed until a @code{tcsetattr()} is done.
157It does not detect impossible terminal speeds.
158
159@page
160@subsection cfsetospeed - Sets terminal output baud rate
161
162@subheading CALLING SEQUENCE:
163
164@ifset is-C
165@example
166#include <termios.h>
167
168int cfsetospeed(
169  struct termios *p,
170  speed_t         speed
171);
172@end example
173@end ifset
174
175@ifset is-Ada
176@end ifset
177
178@subheading STATUS CODES:
179
180The @code{cfsetospeed()} function returns a zero when successful and
181returns -1 when an error occurs. 
182
183
184@subheading DESCRIPTION:
185
186The @code{cfsetospeed()} function stores a code for the terminal speed stored
187in a struct @code{termios}.  The codes are defiined in @code{<termios.h>} by the
188macros B0, B50, B75, B110, B134, B150, B200, B300, B600, B1200, B1800, B2400,
189B4800, B9600, B19200, and B38400.
190
191The @code{cfsetospeed()} function does not do anything to the hardware.  It
192merely stores a value for use by @code{tcsetattr()}.
193
194@subheading NOTES:
195
196This function merely stores a value in the @code{termios} structure.
197It does not change the terminal speed until a @code{tcsetattr()} is done.
198It does not detect impossible terminal speeds.
199
200@page
201@subsection tcgetattr - Gets terminal attributes
202
203@subheading CALLING SEQUENCE:
204
205@ifset is-C
206@example
207#include <termios.h>
208#include <unistd.h>
209
210int tcgetattr(
211  int fildes,
212  struct termios *p
213);
214@end example
215@end ifset
216
217@ifset is-Ada
218@end ifset
219
220@subheading STATUS CODES:
221
222@table @b
223@item EBADF
224Invalid file descriptor
225
226@item ENOOTY
227Terminal control function attempted for a file that is not a terminal.
228@end table
229
230@subheading DESCRIPTION:
231
232The @code{tcgetattr()} gets the parameters associated with the terminal
233referred to by @code{fildes} and stores them into the @code{termios()}
234structure pointed to by @code{termios_p}.
235
236@subheading NOTES:
237
238NONE
239
240@page
241@subsection tcsetattr - Set terminal attributes
242
243@subheading CALLING SEQUENCE:
244
245@ifset is-C
246@example
247#include <termios.h>
248#include <unistd.h>
249
250int tcsetattr(
251  int                   fildes,
252  int                   options,
253  const struct termios *tp
254);
255@end example
256@end ifset
257
258@ifset is-Ada
259@end ifset
260
261@subheading STATUS CODES:
262
263@table @b
264@item E
265The
266
267@end table
268
269@subheading DESCRIPTION:
270
271@subheading NOTES:
272
273@page
274@subsection tcsendbreak - Sends a break to a terminal
275
276@subheading CALLING SEQUENCE:
277
278@ifset is-C
279@example
280int tcsendbreak(
281);
282@end example
283@end ifset
284
285@ifset is-Ada
286@end ifset
287
288@subheading STATUS CODES:
289
290@table @b
291@item E
292The
293
294@end table
295
296@subheading DESCRIPTION:
297
298@subheading NOTES:
299
300This routine is not currently supported by RTEMS but could be
301in a future version.
302
303@page
304@subsection tcdrain - Waits for all output to be transmitted to the terminal.
305
306@subheading CALLING SEQUENCE:
307
308@ifset is-C
309@example
310#include <termios.h>
311#include <unistd.h>
312
313int tcdrain(
314  int fildes
315);
316@end example
317@end ifset
318
319@ifset is-Ada
320@end ifset
321
322@subheading STATUS CODES:
323
324@table @b
325@item EBADF
326Invalid file descriptor
327
328@item EINTR
329Function was interrupted by a signal
330
331@item ENOTTY
332Terminal control function attempted for a file that is not a terminal.
333
334@end table
335
336@subheading DESCRIPTION:
337
338The @code{tcdrain()} function waits until all output written to
339@code{fildes} has been transmitted.
340
341@subheading NOTES:
342
343NONE
344
345@page
346@subsection tcflush - Discards terminal data
347
348@subheading CALLING SEQUENCE:
349
350@ifset is-C
351@example
352int tcflush(
353);
354@end example
355@end ifset
356
357@ifset is-Ada
358@end ifset
359
360@subheading STATUS CODES:
361
362@table @b
363@item E
364The
365
366@end table
367
368@subheading DESCRIPTION:
369
370@subheading NOTES:
371
372This routine is not currently supported by RTEMS but could be
373in a future version.
374
375@page
376@subsection tcflow - Suspends/restarts terminal output.
377
378@subheading CALLING SEQUENCE:
379
380@ifset is-C
381@example
382int tcflow(
383);
384@end example
385@end ifset
386
387@ifset is-Ada
388@end ifset
389
390@subheading STATUS CODES:
391
392@table @b
393@item E
394The
395
396@end table
397
398@subheading DESCRIPTION:
399
400@subheading NOTES:
401
402This routine is not currently supported by RTEMS but could be
403in a future version.
404
405@page
406@subsection tcgetpgrp - Gets foreground process group ID
407
408@subheading CALLING SEQUENCE:
409
410@ifset is-C
411@example
412int tcgetpgrp(
413);
414@end example
415@end ifset
416
417@ifset is-Ada
418@end ifset
419
420@subheading STATUS CODES:
421
422@table @b
423@item E
424The
425
426@end table
427
428@subheading DESCRIPTION:
429
430@subheading NOTES:
431
432This routine is not currently supported by RTEMS but could be
433in a future version.
434
435@page
436@subsection tcsetpgrp - Sets foreground process group ID
437
438@subheading CALLING SEQUENCE:
439
440@ifset is-C
441@example
442int tcsetpgrp(
443);
444@end example
445@end ifset
446
447@ifset is-Ada
448@end ifset
449
450@subheading STATUS CODES:
451
452@table @b
453@item E
454The
455
456@end table
457
458@subheading DESCRIPTION:
459
460@subheading NOTES:
461
462This routine is not currently supported by RTEMS but could be
463in a future version.
464
465
Note: See TracBrowser for help on using the repository browser.