From: Marc D. <ma...@us...> - 2005-02-15 19:04:12
|
Update of /cvsroot/pclasses/pclasses2/include/pclasses/System In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20751/include/pclasses/System Modified Files: SerialDevice.h Log Message: get and set control and local flags Index: SerialDevice.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/include/pclasses/System/SerialDevice.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- SerialDevice.h 14 Feb 2005 22:53:14 -0000 1.3 +++ SerialDevice.h 15 Feb 2005 19:03:53 -0000 1.4 @@ -95,27 +95,110 @@ SignalFullQueque }; - enum OutputMode { - CRtoNL, - IgnoreNL, - IgnoreCR - }; - - enum ControlMode { - EnableReceiver, - LocalLine, - HangupLine + enum OutputFlags { + // Enable implementation-defined output processing.(OPOST) + Post, + // Map lowercase characters to uppercase on output. (OLCUC) (not in POSIX) + LowerToUpper, + // (XSI) Map NL to CR-NL on output. (ONLCR) + ONlToCr, + // Map CR to NL on output. (OCRNL) + OCrToNl, + // Don't output CR at column 0. (ONOCR) + NoCrCol0, + // Don't output CR. (ONLRET) + NoCr, + //Send fill characters for a delay, rather than using a timed delay. (OFILL) + Fill, + // Fill character is ASCII DEL (0177). If unset, fill character is ASCII NUL. (OFDEL) + FillDel + //NLDLY Newline delay mask. Values are NL0 and NL1. + //CRDLY Carriage return delay mask. Values are CR0, CR1, CR2, or CR3. + //TABDLY Horizontal tab delay mask. + //BSDLY Backspace delay mask. + //VTDLY Vertical tab delay mask. Values are VT0 or VT1. + //FFDLY Form feed delay mask. Values are FF0 or FF1. }; - enum LocalMode { + enum ControlFlags { + // Set two stop bits, rather than one. (CSTOPB) + StopBits, + // Enable receiver. (CREAD) + Read, + // Lower modem control lines after last process closes the device(hang up). (HUPCL) + HangUp, + // Ignore modem control lines. (CLOCAL) + Local, + // (not in POSIX) Block output from a noncurrent shell layer. (LOBLK) + BlockShell + //CIBAUD + }; + + enum Localflags { + //ISIG When any of the characters INTR, QUIT, SUSP, or DSUSP are + //received, generate the corresponding signal. + Signal, + //ICANON Enable canonical mode. This enables the special characters EOF, + //EOL, EOL2, ERASE, KILL, LNEXT, REPRINT, STATUS, and WERASE, and + //buffers by lines. + Canonical, + //XCASE (not in POSIX; not supported under Linux) If ICANON is also set, + //terminal is uppercase only. Input is converted to lowercase, + //except for characters preceded by \. On output, uppercase char- + //acters are preceded by \ and lowercase characters are converted + //to uppercase. + XCase, + //ECHO Echo input characters. Echo, - NoFlush + //ECHOE If ICANON is also set, the ERASE character erases the preceding + //input character, and WERASE erases the preceding word. + EchoErase, + //ECHOK If ICANON is also set, the KILL character erases the current + //line. + EchoKill, + //ECHONL If ICANON is also set, echo the NL character even if ECHO is not + //set. + EchoNl, + //ECHOCTL + //(not in POSIX) If ECHO is also set, ASCII control signals other + //than TAB, NL, START, and STOP are echoed as ^X, where X is the + //character with ASCII code 0x40 greater than the control signal. + //For example, character 0x08 (BS) is echoed as ^H. + EchoCtl, + //ECHOPRT + //(not in POSIX) If ICANON and IECHO are also set, characters are + //printed as they are being erased. + EchoPrint, + //ECHOKE (not in POSIX) If ICANON is also set, KILL is echoed by erasing + //each character on the line, as specified by ECHOE and ECHOPRT. + EchoKillErase, + //DEFECHO + //(not in POSIX) Echo only when a process is reading. + DefEcho, + //FLUSHO (not in POSIX; not supported under Linux) Output is being + //flushed. This flag is toggled by typing the DISCARD character. + FlushOutput, + //NOFLSH Disable flushing the input and output queues when generating the + //SIGINT, SIGQUIT and SIGSUSP signals. + NoFlush, + //TOSTOP Send the SIGTTOU signal to the process group of a background + //process which tries to write to its controlling terminal. + ToStop, + //PENDIN (not in POSIX; not supported under Linux) All characters in the + //input queue are reprinted when the next character is read. + //(bash handles typeahead this way.) + ReprintOnRead, + //IEXTEN Enable implementation-defined input processing. This flag, as + //well as ICANON must be enabled for the special characters EOL2, + //LNEXT, REPRINT, WERASE to be interpreted, and for the IUCLC flag + //to be effective. + EnableInputProcessing }; enum FlushMode { - FlushInput, - FlushOutput, - FlushAll + Input, + Output, + All }; public: @@ -146,6 +229,14 @@ InputFlags inputFlags() throw(IO::IOError); void setInputFlags(InputFlags mode) throw(IO::IOError); + + OutputFlags outputFlags() throw(IO::IOError); + + void setOutputFlags(OutputFlags mode) throw(IO::IOError); + + ControlFlags controlFlags() throw(IO::IOError); + + void setControlFlags(ControlFlags mode) throw(IO::IOError); void put(const UInt8& byte) throw(IO::IOError); |