Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ cfspeed(S) — OpenDesktop Software Development System 3.0.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought


 cfspeed(S)                     6 January 1993                     cfspeed(S)


 Name

    cfspeed: cfgetispeed, cfgetospeed, cfsetispeed, cfsetospeed - baud rate
    functions

 Syntax


    cc  . . .  -lc


    #include  <termios.h>

    speed_t cfgetospeed (termios_p)
    struct termios *termios_p;

    int cfsetospeed (termios_p, speed)
    struct termios *termios_p;
    speed_t speed;

    speed_t cfgetispeed (termios_p)
    struct termios *termios_p;

    int cfsetispeed (termios_p, speed)
    struct termios *termios_p;
    speed_t speed;


 Description

    The following interfaces are provided for getting and setting the values
    of the input and output baud rates in the termios structure.  The effects
    on the terminal device described below do not become effective until the
    tcsetattr function is called successfully.

    The input and output baud rates are stored in the termios structure. The
    values shown in the following table are supported.  The name symbols in
    this table are defined in <termios.h>.


       _________________________________________
       Name   Description   Name     Description
       _________________________________________
       BO     Hang up       B600     600 baud
       B50    50 baud       B1200    1200 baud
       B75    75 baud       B1800    1800 baud
       B110   110 baud      B2400    2400 baud
       B134   134.5 baud    B4800    4800 baud
       B150   150 baud      B9600    9600 baud
       B200   200 baud      B19200   19200 baud
       B300   300 baud      B38400   38400 baud


    The type speedt is defined in <termios.h> and as an unsigned integral
    type.

    The termiosp argument is a pointer to a termios structure. cfgetospeed
    returns the output baud rate stored in the termios structure pointed to
    by termiosp.

    cfsetospeed sets the output baud rate stored in the termios structure
    pointed to by termiosp to speed.  The zero baud rate, BO, is used to
    terminate the connection.  If BO is specified, the modem control lines
    are no longer asserted.  Normally, this disconnects the line.

    cfgetispeed returns the input baud rate stored in the termios structure.

    cfsetispeed sets the input baud rate stored in the termios structure to
    speed.  If the input baud rate is set to zero, the input baud rate is
    specified by the value of the output baud rate.  Both cfsetispeed and
    cfsetospeed return a value of zero if successful and -1 to indicate an
    error.  Attempts to set unsupported baud rates are ignored, and it is
    implementation-defined whether an error is returned by any or all of
    cfsetispeed, cfsetospeed, or tcsetattr.  This refers both to changes to
    baud rates not supported by the hardware, and to changes setting the
    input and output baud rates to different values if the hardware does not
    support this.

 Standards conformance

    cfgetispeed, cfgetospeed, cfsetispeed and cfsetospeed are conformant
    with:
    IEEE POSIX Std 1003.1-1990 System Application Program Interface (API) [C
    Language] (ISO/IEC 9945-1);
    and NIST FIPS 151-1.


Typewritten Software • bear@typewritten.org • Edmonds, WA 98026