Configure the terminal's settings
#include <sys/io-char.h>
int ttc(int type,
void *ptr,
int arg );
- type
- One of:
- TTC_INIT_PROC — allocate and configure the basic
resources that are shared by all terminal sessions
- TTC_INIT_CC — configure the character
codes for the terminal
- TTC_INIT_RAW — set the terminal into RAW mode
- TTC_INIT_EDIT — set the terminal into EDITED
i.e. “cooked” mode
- 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,
the handler string returns 0. If an option isn't found, the library returns the option.
- TTC_INIT_START — allow the driver to start
accepting messages
- TTC_INIT_TTYNAME — set up the device name based
on the unit number passed in. You must call ttc() with this command before using
TTC_INIT_POWER and TTC_INIT_ATTACH
- TTC_INIT_POWER — initialize
power-management-related data structures to defaults (ACTIVE mode only).
The driver's call to TTC_INIT_POWER is mandatory.
TTC_INIT_POWER must be called before any calls to
io-char functions such as tti(), and before
interrupt handlers are attached. This type must also be called after
TTC_INIT_TTYNAME and before TTC_INIT_ATTACH.
For power-managed device drivers, the iochar_regdrv_power()
function should be called prior to calling TTC_INIT_POWER.
You must also call this type after
TTC_INIT_TTYNAME and before TTC_INIT_ATTACH.
For power-managed device drivers, you should call
iochar_regdrv_power() prior to calling
TTC_INIT_POWER.
- TTC_INIT_ATTACH — attach the resource manager to the
name initialized by TTC_INIT_TTYNAME
- TTC_TTY_DETACH —detach the resource manager with the linkid in dev.
- TTC_TIMER_QUEUE — register to receive an event once a timer expires
- TTC_INIT_PTY — needed by devc-pty only. Do not use.
- ptr
- A pointer to the structure which will be updated with the new configuration data.
Depending on the type
argument, this argument will be a pointer to a structure of type
TTYCTRL(TTC_INIT_PROC and TTC_INIT_START ),
TTYDEV(TTC_INIT_CC , TTC_INIT_TTYNAME,
TTC_INIT_POWERΒΈ TTC_INIT_ATTACH and TTC_INIT_DETACH ),
or
TTYINIT(TTC_INIT_RAW , TTC_INIT_EDIT ,
TTC_SET_OPTION and TTC_INIT_QUEUE ).
- 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_SET_OPTION : set standard terminal configuration options. The default option is :
- 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 : the canonical buffer size
- I number : the input buffer size
- O number : the output buffer size
- o opt: 0 (pmm_parent power pathname), 1(Disable flow control on power down),
2(RX watermark for input flow control), 3(the pause event priority), 4 (Disable receiver on startup)
- v: verbosity
- TTC_INIT_TTYNAME : the serial unit number for creating the device name.
- Other type arguments don't need the arg argument.
The arg argument can be set to 0.
This function configures the terminal's settings.
- 0
- Success.
- -1
- An error occurred.
- arg
- when you call ttc() with an argument of TTC_SET_OPTION, and arg isn't one of the default options.
QNX Neutrino
Safety: | |
Cancellation point |
No |
Interrupt handler |
No |
Signal handler |
No |
Thread |
No |
TTYCTRL,
TTYDEV,
TTYINIT,
tti(),
tto()