- java.lang.Object
-
- de.ibapl.jnhw.posix.Termios
-
@Include("#include <termios.h>") public final class Termios extends Object
Wrapper around the<termios.h>header. See specs at: termios.h - define values for termios.- Author:
- aploese
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classTermios.Cc_tstatic classTermios.Speed_tspeed_t takes only symbolic constants, so the sign is of no relevance...static classTermios.StructTermiosPOSIX:structure termios.static classTermios.Tcflag_t
-
Field Summary
Fields Modifier and Type Field Description static IntDefine_HAVE_STRUCT_TERMIOS_C_ISPEEDLinux:static IntDefine_HAVE_STRUCT_TERMIOS_C_OSPEEDLinux:static intB0POSIX: Baud Rate Selection Hang up.static IntDefineB1000000Linux: Baud Rate Selection 1000000 baud.static intB110POSIX: Baud Rate Selection 110 baud.static intB115200Non POSIX: Baud Rate Selection 115200 baud.static IntDefineB1152000Linux: Baud Rate Selection 1152000 baud.static intB1200POSIX: Baud Rate Selection 1200 baud.static intB134POSIX: Baud Rate Selection 134.5 baud.static intB150POSIX: Baud Rate Selection 150 baud.static IntDefineB1500000Linux: Baud Rate Selection 1500000 baud.static intB1800POSIX: Baud Rate Selection 1800 baud.static intB19200POSIX: Baud Rate Selection 19200 baud.static intB200POSIX: Baud Rate Selection 200 baud.static IntDefineB2000000Linux: Baud Rate Selection 2000000 baud.static intB230400Non POSIX: Baud Rate Selection 230400 baud.static intB2400POSIX: Baud Rate Selection 2400 baud.static IntDefineB2500000Linux: Baud Rate Selection 2500000 baud.static intB300POSIX: Baud Rate Selection 300 baud.static IntDefineB3000000Linux: Baud Rate Selection 3000000 baud.static IntDefineB3500000Linux: Baud Rate Selection 3500000 baud.static intB38400POSIX: Baud Rate Selection 38400 baud.static IntDefineB4000000Linux: Baud Rate Selection 4000000 baud.static IntDefineB460800Linux,FreeBSD: Baud Rate Selection 460800 baud.static intB4800POSIX: Baud Rate Selection 4800 baud.static intB50POSIX: Baud Rate Selection 50 baud.static IntDefineB500000Linux: Baud Rate Selection 500000 baud.static intB57600Non POSIX: Baud Rate Selection 57600 bausstatic IntDefineB576000Linux: Baud Rate Selection 576000 baud.static intB600POSIX: Baud Rate Selection 600 baud.static intB75POSIX: Baud Rate Selection 75 baud.static IntDefineB921600Linux,FreeBSD: Baud Rate Selection 921600 baud.static intB9600POSIX: Baud Rate Selection 9600 baud.static intBRKINTPOSIX: Input Modes Signal interrupt on break.static IntDefineBS0POSIX.XSI: Output Modes Backspace-delay type 0.static IntDefineBS1POSIX.XSI: Output Modes Backspace-delay type 1.static IntDefineBSDLYPOSIX.XSI: Output Modes Select backspace delays:static intCLOCALPOSIX: Control Modes Ignore modem status lines.static IntDefineCMSPARLinux: Control Modes Use d "stick" (mark/space) parity (supported on certain serial devices).static IntDefineCR0POSIX.XSI: Output Modes Carriage-return delay type 0.static IntDefineCR1POSIX.XSI: Output Modes Carriage-return delay type 1.static IntDefineCR2POSIX.XSI: Output Modes Carriage-return delay type 2.static IntDefineCR3POSIX.XSI: Output Modes Carriage-return delay type 3.static IntDefineCRDLYPOSIX.XSI: Output Modes Select carriage-return delays:static intCREADPOSIX: Control Modes Enable receiver.static intCRTSCTSNon POSIX: Control Modesstatic intCS5POSIX: Control Modes 5 bits.static intCS6POSIX: Control Modes 6 bits.static intCS7POSIX: Control Modes 7 bits.static intCS8POSIX: Control Modes 8 bits.static intCSIZEPOSIX: Control Modes Character size:static intCSTOPBPOSIX: Control Modes Send two stop bits, else one.static intECHOPOSIX: Local Modes Enable echo.static intECHOEPOSIX: Local Modes Echo erase character as error-correcting backspace.static intECHOKPOSIX: Local Modes Echo KILL.static intECHONLPOSIX: Local Modes Echo NL.static IntDefineFF0POSIX.XSI: Output Modes Form-feed delay type 0.static IntDefineFF1POSIX.XSI: Output Modes Form-feed delay type 1.static IntDefineFFDLYPOSIX.XSI: Output Modes Select form-feed delays:static booleanHAVE_TERMIOS_Hstatic intHUPCLPOSIX: Control Modes Hang up on last close.static intICANONPOSIX: Local Modes Canonical input (erase and kill processing).static intICRNLPOSIX: Input Modes Map CR to NL on input.static intIEXTENPOSIX: Local Modes Enable extended input character processing.static intIGNBRKPOSIX: Input Modes Ignore break condition.static intIGNCRPOSIX: Input Modes Ignore CR.static intIGNPARPOSIX: Input Modes Ignore characters with parity errors.static intINLCRPOSIX: Input Modes Map NL to CR on input.static intINPCKPOSIX: Input Modes Enable input parity check.static intISIGPOSIX: Local Modes Enable signals.static intISTRIPPOSIX: Input Modes Strip character.static intIXANYPOSIX: Input Modes Enable any character to restart output.static intIXOFFPOSIX: Input Modes Enable start/stop input control.static intIXONPOSIX: Input Modes Enable start/stop output control.static intNCCSPOSIX: Size of the array c_cc for control characters.static IntDefineNL0POSIX.XSI: Output Modes Newline type 0.static IntDefineNL1POSIX.XSI: Output Modes Newline type 1.static IntDefineNLDLYPOSIX.XSI: Output Modes Select newline delays:NL0orNL1static intNOFLSHPOSIX: Local Modes Disable flush after interrupt or quit.static intOCRNLPOSIX,XSI: Output Modes Map CR to NL on output.static IntDefineOFDELPOSIX.XSI: Output Modes Fill is DEL.static IntDefineOFILLPOSIX.XSI: Output Modes Use fill characters for delay.static intONLCRPOSIX.XSI: Output Modes Map NL to CR-NL on output.static intONLRETPOSIX.XSI: Output Modes NL performs CR function.static intONOCRPOSIX.XSI: Output Modes No CR output at column 0.static intOPOSTPOSIX: Output Modes Post-process output.static intPARENBPOSIX: Control Modes Parity enable.static IntDefinePAREXT???static intPARMRKPOSIX: Input Modes Mark parity errors.static intPARODDPOSIX: Control Modes Odd parity, else even.static IntDefineTAB0POSIX.XSI: Output Modes Horizontal-tab delay type 0.static IntDefineTAB1POSIX.XSI: Output Modes Horizontal-tab delay type 1.static IntDefineTAB2POSIX.XSI: Output Modes Horizontal-tab delay type 2.static IntDefineTAB3POSIX.XSI: Output Modes Expand tabs to spaces.static IntDefineTABDLYPOSIX.XSI: Output Modes Select horizontal-tab delays:static intTCIFLUSHPOSIX: Line Control Flush pending input.static intTCIOFFPOSIX: Line Control Transmit a STOP character, intended to suspend input data.static intTCIOFLUSHPOSIX: Line Control Flush both pending input and untransmitted output.static intTCIONPOSIX: Line Control Transmit a START character, intended to restart input data.static intTCOFLUSHPOSIX: Line Control Flush untransmitted output.static intTCOOFFPOSIX: Line Control Suspend output.static intTCOONPOSIX: Line Control Restart output.static intTCSADRAINPOSIX: Attribute Selection Change attributes when output has drained; also flush pending input.static intTCSAFLUSHPOSIX: Attribute Selection Change attributes when output has drained.static intTCSANOWPOSIX: Attribute Selection Change attributes immediately.static intTOSTOPPOSIX: Local Modes Send SIGTTOU for background output.static intVEOFPOSIX: EOF character in Canonical Mode.static intVEOLPOSIX: EOL character in Canonical Mode.static intVERASEPOSIX: ERASE character in Canonical Mode.static intVINTRPOSIX: INTR character in Canonical Mode and Non-Canonical Mode.static intVKILLPOSIX: KILL character in Canonical Mode.static intVMINPOSIX: MIN value in Non-Canonical Mode.static intVQUITPOSIX: QUIT character in Canonical Mode and Non-Canonical Mode.static intVSTARTPOSIX: START character in Canonical Mode and Non-Canonical Mode.static intVSTOPPOSIX: STOP character in Canonical Mode and Non-Canonical Mode.static intVSUSPPOSIX: VSUSP character in Canonical Mode and Non-Canonical Mode.static IntDefineVT0POSIX.XSI: Output Modes Vertical-tab delay type 0.static IntDefineVT1POSIX.XSI: Output Modes Vertical-tab delay type 1.static IntDefineVTDLYPOSIX.XSI: Output Modes Select vertical-tab delays:static intVTIMEPOSIX: VTIME value in Non-Canonical Mode.
-
Constructor Summary
Constructors Constructor Description Termios()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intcfgetispeed(Termios.StructTermios termios)static intcfgetospeed(Termios.StructTermios termios)static voidcfsetispeed(Termios.StructTermios termios, int speed)static voidcfsetospeed(Termios.StructTermios termios, int speed)static voidcfsetspeed(Termios.StructTermios termios, int speed)Non POSIX: set input and output spped at the same time.static voidtcdrain(int fildes)static voidtcflow(int fildes, int action)static voidtcflush(int fildes, int queue_selector)static voidtcgetattr(int fildes, Termios.StructTermios termios)static inttcgetsid(int fildes)static voidtcsendbreak(int fildes, int duration)static voidtcsetattr(int fildes, int optional_actions, Termios.StructTermios termios)
-
-
-
Field Detail
-
B0
@Define public static final int B0
POSIX: Baud Rate Selection Hang up.
-
B110
@Define public static final int B110
POSIX: Baud Rate Selection 110 baud.
-
B115200
@Define public static final int B115200
Non POSIX: Baud Rate Selection 115200 baud.
-
B1200
@Define public static final int B1200
POSIX: Baud Rate Selection 1200 baud.
-
B134
@Define public static final int B134
POSIX: Baud Rate Selection 134.5 baud.
-
B150
@Define public static final int B150
POSIX: Baud Rate Selection 150 baud.
-
B1800
@Define public static final int B1800
POSIX: Baud Rate Selection 1800 baud.
-
B19200
@Define public static final int B19200
POSIX: Baud Rate Selection 19200 baud.
-
B200
@Define public static final int B200
POSIX: Baud Rate Selection 200 baud.
-
B230400
@Define public static final int B230400
Non POSIX: Baud Rate Selection 230400 baud.
-
B2400
@Define public static final int B2400
POSIX: Baud Rate Selection 2400 baud.
-
B300
@Define public static final int B300
POSIX: Baud Rate Selection 300 baud.
-
B38400
@Define public static final int B38400
POSIX: Baud Rate Selection 38400 baud.
-
B460800
@Define public static final IntDefine B460800
Linux,FreeBSD: Baud Rate Selection 460800 baud.
-
B4800
@Define public static final int B4800
POSIX: Baud Rate Selection 4800 baud.
-
B50
@Define public static final int B50
POSIX: Baud Rate Selection 50 baud.
-
B57600
@Define public static final int B57600
Non POSIX: Baud Rate Selection 57600 baus
-
B600
@Define public static final int B600
POSIX: Baud Rate Selection 600 baud.
-
B75
@Define public static final int B75
POSIX: Baud Rate Selection 75 baud.
-
B921600
@Define public static final IntDefine B921600
Linux,FreeBSD: Baud Rate Selection 921600 baud.
-
B9600
@Define public static final int B9600
POSIX: Baud Rate Selection 9600 baud.
-
BRKINT
@Define public static final int BRKINT
POSIX: Input Modes Signal interrupt on break.
-
CLOCAL
@Define public static final int CLOCAL
POSIX: Control Modes Ignore modem status lines.
-
CMSPAR
@Define public static final IntDefine CMSPAR
Linux: Control Modes Use d "stick" (mark/space) parity (supported on certain serial devices).
-
CRDLY
@Define public static final IntDefine CRDLY
POSIX.XSI: Output Modes Select carriage-return delays:
-
CREAD
@Define public static final int CREAD
POSIX: Control Modes Enable receiver.
-
CRTSCTS
@Define public static final int CRTSCTS
Non POSIX: Control Modes
-
CS5
@Define public static final int CS5
POSIX: Control Modes 5 bits.
-
CS6
@Define public static final int CS6
POSIX: Control Modes 6 bits.
-
CS7
@Define public static final int CS7
POSIX: Control Modes 7 bits.
-
CS8
@Define public static final int CS8
POSIX: Control Modes 8 bits.
-
CSIZE
@Define public static final int CSIZE
POSIX: Control Modes Character size:
-
CSTOPB
@Define public static final int CSTOPB
POSIX: Control Modes Send two stop bits, else one.
-
ECHO
@Define public static final int ECHO
POSIX: Local Modes Enable echo.
-
ECHOE
@Define public static final int ECHOE
POSIX: Local Modes Echo erase character as error-correcting backspace.
-
ECHOK
@Define public static final int ECHOK
POSIX: Local Modes Echo KILL.
-
ECHONL
@Define public static final int ECHONL
POSIX: Local Modes Echo NL.
-
HAVE_TERMIOS_H
public static final boolean HAVE_TERMIOS_H
-
HUPCL
@Define public static final int HUPCL
POSIX: Control Modes Hang up on last close.
-
ICANON
@Define public static final int ICANON
POSIX: Local Modes Canonical input (erase and kill processing).
-
ICRNL
@Define public static final int ICRNL
POSIX: Input Modes Map CR to NL on input.
-
IEXTEN
@Define public static final int IEXTEN
POSIX: Local Modes Enable extended input character processing.
-
IGNBRK
@Define public static final int IGNBRK
POSIX: Input Modes Ignore break condition.
-
IGNCR
@Define public static final int IGNCR
POSIX: Input Modes Ignore CR.
-
IGNPAR
@Define public static final int IGNPAR
POSIX: Input Modes Ignore characters with parity errors.
-
INLCR
@Define public static final int INLCR
POSIX: Input Modes Map NL to CR on input.
-
INPCK
@Define public static final int INPCK
POSIX: Input Modes Enable input parity check.
-
ISIG
@Define public static final int ISIG
POSIX: Local Modes Enable signals.
-
ISTRIP
@Define public static final int ISTRIP
POSIX: Input Modes Strip character.
-
IXANY
@Define public static final int IXANY
POSIX: Input Modes Enable any character to restart output.
-
IXOFF
@Define public static final int IXOFF
POSIX: Input Modes Enable start/stop input control.
-
IXON
@Define public static final int IXON
POSIX: Input Modes Enable start/stop output control.
-
NCCS
@Define public static final int NCCS
POSIX: Size of the array c_cc for control characters.
-
NLDLY
@Define public static final IntDefine NLDLY
POSIX.XSI: Output Modes Select newline delays:NL0orNL1
-
NOFLSH
@Define public static final int NOFLSH
POSIX: Local Modes Disable flush after interrupt or quit.
-
OCRNL
@Define public static final int OCRNL
POSIX,XSI: Output Modes Map CR to NL on output.
-
OFILL
@Define public static final IntDefine OFILL
POSIX.XSI: Output Modes Use fill characters for delay.
-
ONLCR
@Define public static final int ONLCR
POSIX.XSI: Output Modes Map NL to CR-NL on output.
-
ONLRET
@Define public static final int ONLRET
POSIX.XSI: Output Modes NL performs CR function.
-
ONOCR
@Define public static final int ONOCR
POSIX.XSI: Output Modes No CR output at column 0.
-
OPOST
@Define public static final int OPOST
POSIX: Output Modes Post-process output.
-
PARENB
@Define public static final int PARENB
POSIX: Control Modes Parity enable.
-
PAREXT
@Define public static final IntDefine PAREXT
???: Control Modes ???Use d "stick" (mark/space) parity (supported on certain serial devices).???
-
PARMRK
@Define public static final int PARMRK
POSIX: Input Modes Mark parity errors.
-
PARODD
@Define public static final int PARODD
POSIX: Control Modes Odd parity, else even.
-
TAB0
@Define public static final IntDefine TAB0
POSIX.XSI: Output Modes Horizontal-tab delay type 0.
-
TAB1
@Define public static final IntDefine TAB1
POSIX.XSI: Output Modes Horizontal-tab delay type 1.
-
TAB2
@Define public static final IntDefine TAB2
POSIX.XSI: Output Modes Horizontal-tab delay type 2.
-
TABDLY
@Define public static final IntDefine TABDLY
POSIX.XSI: Output Modes Select horizontal-tab delays:
-
TCIFLUSH
@Define public static final int TCIFLUSH
POSIX: Line Control Flush pending input.
-
TCIOFF
@Define public static final int TCIOFF
POSIX: Line Control Transmit a STOP character, intended to suspend input data.
-
TCIOFLUSH
@Define public static final int TCIOFLUSH
POSIX: Line Control Flush both pending input and untransmitted output.
-
TCION
@Define public static final int TCION
POSIX: Line Control Transmit a START character, intended to restart input data.
-
TCOFLUSH
@Define public static final int TCOFLUSH
POSIX: Line Control Flush untransmitted output.
-
TCOOFF
@Define public static final int TCOOFF
POSIX: Line Control Suspend output.
-
TCOON
@Define public static final int TCOON
POSIX: Line Control Restart output.
-
TCSADRAIN
@Define public static final int TCSADRAIN
POSIX: Attribute Selection Change attributes when output has drained; also flush pending input.
-
TCSAFLUSH
@Define public static final int TCSAFLUSH
POSIX: Attribute Selection Change attributes when output has drained.
-
TCSANOW
@Define public static final int TCSANOW
POSIX: Attribute Selection Change attributes immediately.
-
TOSTOP
@Define public static final int TOSTOP
POSIX: Local Modes Send SIGTTOU for background output.
-
VEOF
@Define public static final int VEOF
POSIX: EOF character in Canonical Mode.
-
VEOL
@Define public static final int VEOL
POSIX: EOL character in Canonical Mode.
-
VERASE
@Define public static final int VERASE
POSIX: ERASE character in Canonical Mode.
-
VINTR
@Define public static final int VINTR
POSIX: INTR character in Canonical Mode and Non-Canonical Mode.
-
VKILL
@Define public static final int VKILL
POSIX: KILL character in Canonical Mode.
-
VMIN
@Define public static final int VMIN
POSIX: MIN value in Non-Canonical Mode.
-
VQUIT
@Define public static final int VQUIT
POSIX: QUIT character in Canonical Mode and Non-Canonical Mode.
-
VSTART
@Define public static final int VSTART
POSIX: START character in Canonical Mode and Non-Canonical Mode.
-
VSTOP
@Define public static final int VSTOP
POSIX: STOP character in Canonical Mode and Non-Canonical Mode.
-
VSUSP
@Define public static final int VSUSP
POSIX: VSUSP character in Canonical Mode and Non-Canonical Mode.
-
VTDLY
@Define public static final IntDefine VTDLY
POSIX.XSI: Output Modes Select vertical-tab delays:
-
VTIME
@Define public static final int VTIME
POSIX: VTIME value in Non-Canonical Mode.
-
_HAVE_STRUCT_TERMIOS_C_ISPEED
@Define public static final IntDefine _HAVE_STRUCT_TERMIOS_C_ISPEED
Linux:
-
-
Method Detail
-
cfgetispeed
public static final int cfgetispeed(Termios.StructTermios termios)
- Parameters:
termios- the termios structure from which the input speed is to be extracted.- Returns:
- Upon successful completion, cfgetispeed() shall return a value of type speed_t representing the input speed.
-
cfgetospeed
public static final int cfgetospeed(Termios.StructTermios termios)
- Parameters:
termios- the termios structure from which the output speed is to be extracted.- Returns:
- Upon successful completion, cfgetospeed() shall return a value of type speed_t representing the output speed.
-
cfsetispeed
public static final void cfsetispeed(Termios.StructTermios termios, int speed) throws NativeErrorException
- Parameters:
termios- the termios structure in which the input speed is to be set.speed- the input speed to be set in thetermiosstructure.- Throws:
NativeErrorException- if the return value of the native function indicates an error.
-
cfsetospeed
public static final void cfsetospeed(Termios.StructTermios termios, int speed) throws NativeErrorException
- Parameters:
termios- the termios structure in which the output speed is to be set.speed- the output speed to be set in thetermiosstructure.- Throws:
NativeErrorException- if the return value of the native function indicates an error.
-
cfsetspeed
public static final void cfsetspeed(Termios.StructTermios termios, int speed) throws NativeErrorException
Non POSIX: set input and output spped at the same time.- Parameters:
termios- the termios structure in which the input and output speed is to be set.speed- the speed to be set in thetermiosstructure.- Throws:
NativeErrorException- if the return value of the native function indicates an error.
-
tcdrain
public static final void tcdrain(int fildes) throws NativeErrorException- Parameters:
fildes- an open file descriptor associated with a terminal.- Throws:
NativeErrorException- if the return value of the native function indicates an error.
-
tcflow
public static final void tcflow(int fildes, int action) throws NativeErrorException- Parameters:
fildes- an open file descriptor associated with a terminal.action- one ofTCOOFF,TCOON,TCIOFF,TCION.- Throws:
NativeErrorException- if the return value of the native function indicates an error.
-
tcflush
public static final void tcflush(int fildes, int queue_selector) throws NativeErrorException- Parameters:
fildes- an open file descriptor associated with a terminal.queue_selector- one ofTCIFLUSH,TCOFLUSH,TCIOFLUSH.- Throws:
NativeErrorException- if the return value of the native function indicates an error.
-
tcgetattr
public static final void tcgetattr(int fildes, Termios.StructTermios termios) throws NativeErrorException- Parameters:
fildes- an open file descriptor associated with a terminal.termios- a termios structure to be filled.- Throws:
NativeErrorException- if the return value of the native function indicates an error.
-
tcgetsid
public static final int tcgetsid(int fildes) throws NativeErrorException- Parameters:
fildes- an open file descriptor associated with a terminal.- Returns:
- Upon successful completion, tcgetsid() shall return the process group ID of the session associated with the terminal.
- Throws:
NativeErrorException- if the return value of the native function indicates an error.
-
tcsendbreak
public static final void tcsendbreak(int fildes, int duration) throws NativeErrorException- Parameters:
fildes- an open file descriptor associated with a terminal.duration- the duration for which the terminal transmits a continuous stream of zero-valued bits. If duration is 0, it shall cause transmission of zero-valued bits for at least 0.25 seconds, and not more than 0.5 seconds. If duration is not 0, it shall send zero-valued bits for an implementation-defined period of time.- Throws:
NativeErrorException- if the return value of the native function indicates an error.
-
tcsetattr
public static final void tcsetattr(int fildes, int optional_actions, Termios.StructTermios termios) throws NativeErrorException- Parameters:
fildes- an open file descriptor associated with a terminal.optional_actions- one ofTCSANOW,TCSADRAIN,TCSAFLUSH.termios- the termios structure assosiated whithfildes.- Throws:
NativeErrorException- if the return value of the native function indicates an error.
-
-