ttc()

Configure the terminal's settings

Synopsis:

#include <sys/io-char.h>
                
int ttc( int type,
         void *ptr,
         int arg );

Arguments:

type
One of:
  • TTC_INIT_ATTACH — Attach the resource manager to the name initialized by TTC_INIT_TTYNAME.
  • TTC_INIT_CC — Configure the character codes for the terminal.
  • TTC_INIT_EDIT — Set the terminal into EDITED (cooked) mode.
  • TTC_INIT_POWER — Initialize power-management related data structures to defaults (ACTIVE mode only). The driver's call to TTC_INIT_POWER is mandatory.

    You must call TTC_INIT_POWER before any calls to io-char functions, such as tti(), and before attaching interrupt handlers.

    You must also call this type after TTC_INIT_TTYNAME and before TTC_INIT_ATTACH.

  • TTC_INIT_PROC — Allocate and configure the basic resources that are shared by all terminal sessions.
  • TTC_INIT_PTY — Don't use; needed by devc-pty only.
  • TTC_INIT_RAW — Set the terminal into RAW mode.
  • TTC_INIT_START — Allow the driver to start accepting messages.
  • TTC_INIT_STOP — Let the driver clean up dispatch when unloaded.
  • TTC_INIT_TTYNAME — Set up the device name based on the unit number passed in. You must call ttc() with this command before using TT_INIT_POWER and TTC_INIT_ATTACH.
  • TTC_SET_OPTION — Pass the standard terminal configuration options to the io-char library for handling. If an option is found in the common string of options, IO_CHAR_COMMON_OPTIONS, then the handler string returns 0. If an option isn't found, the library returns the option.
  • TTC_TIMER_QUEUE — Register to receive an event once a timer expires.
  • TTC_TTY_DETACH — If arg is 0, does a full detach (i.e., resmgr_detach and rsrcdbmgr_devno_detach()). Otherwise, only detaches the current device (i.e., only calls rsrcdbmgr_devno_detach()).
ptr
A pointer to the structure which will be updated with the new configuration data. Depending on the type argument, the ptr argument is a pointer to a structure of type:
ptr structure type
TTYCTRL TTC_INIT_PROC
TTC_INIT_START
TTC_INIT_STOP
TTYDEV TTC_INIT_CC
TTC_INIT_TTYNAME
TTC_INIT_DETACH
TTC_INIT_ATTACH
TTC_TIMER_QUEUE
TTYINIT TTC_INIT_RAW
TTC_INIT_EDIT
TTC_SET_OPTIONS
TTYINITPTY TTC_INIT_PTY
arg
Data that describes the new setting. The values that are valid for this argument vary depending on the type argument. The arg values for the following type arguments are as follows:
  • TTC_INIT_PROC — Set a pause timer priority value.
  • TTC_INIT_TTYNAME — The serial unit number for creating the device name.
  • TTC_SET_OPTION — Set standard terminal configuration options. The options include:
    • b number — Define the baud rate.
    • e — Set to edit mode.
    • E — Set to raw mode.
    • f — Enable hardware flow control.
    • F — Disable hardware flow control.
    • s — Enable software flow control.
    • S — Enable hardware flow control.
    • C number — Define the canonical buffer size.
    • I number — Define the input buffer size.
    • O number — Define the output buffer size.
    • o opt — Additional options, separated by commas. The options include:
      • 0pmm_parent power pathname.
      • 1 — Disable flow control on power down.
      • 2 — RX watermark for input flow control.
      • 3 — Pause event priority.
      • 4— Disable receiver on startup.
    • v — Verbosity.

For other type arguments, set arg to 0.

Description:

The ttc() function configures the terminal's settings.

Returns:

0
Success.
-1
An error occurred.
arg
You called ttc() with an argument of TTC_SET_OPTION, and arg isn't one of the default options.

Classification:

QNX OS

Safety:
Cancellation point No
Signal handler No
Thread No
Page updated: