Hardware Reference
In-Depth Information
meaning that:
Flag
Description
Setting
CSIZE
Data bits mask
Masked-out data bits
PARENB
Generate/detect parity
Disabled
CS8
8 data bits
Set to 8-bit data
The CSIZE masking is used to reset the data bits field to zeros. This allows the CS8
bit pattern to be or-ed in later, setting the data bits value to 8 bits. Disabling the PARENB
flag causes parity generation on output to be disabled, and disables parity checking on
input. If your raw link requires parity generation and checking, you'll need to undo this
particular change in your own code.
You can see from this list that a plethora of special processing is altered to go from
cooked mode to raw mode. It is no wonder that this support routine was made available.
cfgetispeed(3)
The current input baud rate for the line can be queried by the cfgetispeed(3) function:
speed_t cfgetispeed(const struct termios * termios_p);
where
termios_p is the pointer to the structure containing the terminal configuration.
Because the termios structure has been extended and modified over the years, this
function provides a more portable way to extract the input baud rate, including the more
recently added higher baud rates.
struct termios term;
speed_t baud_rate;
baud_rate = cfgetispeed(&term);
cfgetospeed(3)
The current output baud rate can be extracted from the termios structure with
speed_t cfgetospeed(const struct termios * termios_p);
where
termios_p is the pointer to the structure containing the terminal configuration.
Because the termios structure has been extended and modified over the years, this
function provides a portable way to extract the output baud rate, including the more
recently added higher baud rates.
 
 
Search WWH ::




Custom Search