📄 classposix__qextserialport.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>Posix_QextSerialPort class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body bgcolor="#ffffff"><!-- Generated by Doxygen 1.2.13.1 --><center><a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="annotated.html">Compound List</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Compound Members</a> </center><hr><h1>Posix_QextSerialPort Class Reference</h1><p>Inheritance diagram for Posix_QextSerialPort::<p><center><img src="classPosix__QextSerialPort.gif" usemap="#Posix_QextSerialPort_map" border="0"></center><map name="Posix_QextSerialPort_map"><area href="classQextSerialBase.html" alt="QextSerialBase" shape="rect" coords="0,0,131,24"></map><a href="classPosix__QextSerialPort-members.html">List of all members.</a><table border=0 cellpadding=0 cellspacing=0><tr><td colspan=2><br><h2>Public Methods</h2></td></tr><tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classPosix__QextSerialPort.html#a0">Posix_QextSerialPort</a> ()</td></tr><tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classPosix__QextSerialPort.html#a1">Posix_QextSerialPort</a> (const Posix_QextSerialPort &s)</td></tr><tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classPosix__QextSerialPort.html#a2">Posix_QextSerialPort</a> (const char *name)</td></tr><tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classPosix__QextSerialPort.html#a3">Posix_QextSerialPort</a> (const PortSettings &settings)</td></tr><tr><td nowrap align=right valign=top> </td><td valign=bottom><a class="el" href="classPosix__QextSerialPort.html#a4">Posix_QextSerialPort</a> (const char *name, const PortSettings &settings)</td></tr><tr><td nowrap align=right valign=top>Posix_QextSerialPort & </td><td valign=bottom><a class="el" href="classPosix__QextSerialPort.html#a5">operator=</a> (const Posix_QextSerialPort &s)</td></tr><tr><td nowrap align=right valign=top>virtual </td><td valign=bottom><a class="el" href="classPosix__QextSerialPort.html#a6">~Posix_QextSerialPort</a> ()</td></tr><tr><td nowrap align=right valign=top>virtual bool </td><td valign=bottom><a class="el" href="classPosix__QextSerialPort.html#a7">open</a> (int mode=0)</td></tr><tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classPosix__QextSerialPort.html#a8">close</a> ()</td></tr><tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classPosix__QextSerialPort.html#a9">flush</a> ()</td></tr><tr><td nowrap align=right valign=top>virtual Offset </td><td valign=bottom><a class="el" href="classPosix__QextSerialPort.html#a10">size</a> () const</td></tr><tr><td nowrap align=right valign=top>virtual int </td><td valign=bottom><a class="el" href="classPosix__QextSerialPort.html#a11">getch</a> ()</td></tr><tr><td nowrap align=right valign=top>virtual int </td><td valign=bottom><a class="el" href="classPosix__QextSerialPort.html#a12">putch</a> (int)</td></tr><tr><td nowrap align=right valign=top>virtual int </td><td valign=bottom><a class="el" href="classPosix__QextSerialPort.html#a13">ungetch</a> (int)</td></tr><tr><td nowrap align=right valign=top><a name="a14" doxytag="Posix_QextSerialPort::setFlowControl"></a>virtual void </td><td valign=bottom><b>setFlowControl</b> (FlowType)</td></tr><tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classPosix__QextSerialPort.html#a15">setParity</a> (ParityType)</td></tr><tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classPosix__QextSerialPort.html#a16">setDataBits</a> (DataBitsType)</td></tr><tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classPosix__QextSerialPort.html#a17">setStopBits</a> (StopBitsType)</td></tr><tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classPosix__QextSerialPort.html#a18">setBaudRate</a> (BaudRateType)</td></tr><tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classPosix__QextSerialPort.html#a19">setDtr</a> (bool set=true)</td></tr><tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classPosix__QextSerialPort.html#a20">setRts</a> (bool set=true)</td></tr><tr><td nowrap align=right valign=top>virtual unsigned long </td><td valign=bottom><a class="el" href="classPosix__QextSerialPort.html#a21">lineStatus</a> (void)</td></tr><tr><td nowrap align=right valign=top>virtual int </td><td valign=bottom><a class="el" href="classPosix__QextSerialPort.html#a22">bytesWaiting</a> ()</td></tr><tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classPosix__QextSerialPort.html#a23">translateError</a> (unsigned long)</td></tr><tr><td nowrap align=right valign=top>virtual void </td><td valign=bottom><a class="el" href="classPosix__QextSerialPort.html#a24">setTimeout</a> (unsigned long=0, unsigned long=0)</td></tr><tr><td nowrap align=right valign=top><a name="a25" doxytag="Posix_QextSerialPort::readBlock"></a>virtual Q_LONG </td><td valign=bottom><b>readBlock</b> (char *data, unsigned long maxlen)</td></tr><tr><td nowrap align=right valign=top><a name="a26" doxytag="Posix_QextSerialPort::writeBlock"></a>virtual Q_LONG </td><td valign=bottom><b>writeBlock</b> (const char *data, unsigned long len)</td></tr><tr><td colspan=2><br><h2>Protected Methods</h2></td></tr><tr><td nowrap align=right valign=top>void </td><td valign=bottom><a class="el" href="classPosix__QextSerialPort.html#b0">construct</a> (void)</td></tr><tr><td colspan=2><br><h2>Protected Attributes</h2></td></tr><tr><td nowrap align=right valign=top><a name="n0" doxytag="Posix_QextSerialPort::Posix_Timeout"></a>timeval </td><td valign=bottom><b>Posix_Timeout</b></td></tr><tr><td nowrap align=right valign=top><a name="n1" doxytag="Posix_QextSerialPort::Posix_Copy_Timeout"></a>timeval </td><td valign=bottom><b>Posix_Copy_Timeout</b></td></tr><tr><td nowrap align=right valign=top><a name="n2" doxytag="Posix_QextSerialPort::Posix_File"></a>QFile * </td><td valign=bottom><b>Posix_File</b></td></tr><tr><td nowrap align=right valign=top><a name="n3" doxytag="Posix_QextSerialPort::Posix_CommConfig"></a>termios </td><td valign=bottom><b>Posix_CommConfig</b></td></tr></table><hr><a name="_details"></a><h2>Detailed Description</h2><dl compact><dt><b>Version: </b><dd>0.70 (pre-alpha) </dl><dl compact><dt><b>Author: </b><dd>Wayne Roth</dl>A cross-platform serial port class. This class encapsulates the POSIX portion of <a class="el" href="classQextSerialPort.html">QextSerialPort</a>. The user will be notified of errors and possible portability conflicts at run-time by default - this behavior can be turned off by defining _TTY_NOWARN_ (to turn off all warnings) or _TTY_NOWARN_PORT_ (to turn off portability warnings) in the project. Note that _TTY_NOWARN_ will also turn off portability warnings. <p><hr><h2>Constructor & Destructor Documentation</h2><a name="a0" doxytag="Posix_QextSerialPort::Posix_QextSerialPort"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> Posix_QextSerialPort::Posix_QextSerialPort </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Default constructor. Note that the name of the device used by a <a class="el" href="classQextSerialPort.html">QextSerialPort</a> constructed with this constructor will be determined by defined constants, or lack thereof - the default behavior is the same as _TTY_LINUX_. Possible naming conventions and their associated constants are:<p><div class="fragment"><pre>Constant Used By Naming Convention---------- ------------- ------------------------_TTY_WIN_ Windows COM1, COM2_TTY_IRIX_ SGI/IRIX /dev/ttyf1, /dev/ttyf2_TTY_HPUX_ HP-UX /dev/tty1p0, /dev/tty2p0_TTY_SUN_ SunOS/Solaris /dev/ttya, /dev/ttyb_TTY_DIGITAL_ Digital UNIX /dev/tty01, /dev/tty02_TTY_LINUX_ Linux /dev/ttyS0, /dev/ttyS1<none> Linux /dev/ttyS0, /dev/ttyS1</pre></div><p>This constructor assigns the device name to the name of the first port on the specified system. See the other constructors if you need to open a different port. </td> </tr></table><a name="a1" doxytag="Posix_QextSerialPort::Posix_QextSerialPort"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> Posix_QextSerialPort::Posix_QextSerialPort </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const Posix_QextSerialPort & </td> <td class="mdname1" valign="top" nowrap> <em>s</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Copy constructor. </td> </tr></table><a name="a2" doxytag="Posix_QextSerialPort::Posix_QextSerialPort"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> Posix_QextSerialPort::Posix_QextSerialPort </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const char * </td> <td class="mdname1" valign="top" nowrap> <em>name</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Constructs a serial port attached to the port specified by name. name is the name of the device, which is windowsystem-specific, e.g."COM2" or "/dev/ttyS0". </td> </tr></table><a name="a3" doxytag="Posix_QextSerialPort::Posix_QextSerialPort"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> Posix_QextSerialPort::Posix_QextSerialPort </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const PortSettings & </td> <td class="mdname1" valign="top" nowrap> <em>settings</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Constructs a port with default name and specified settings. </td> </tr></table><a name="a4" doxytag="Posix_QextSerialPort::Posix_QextSerialPort"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> Posix_QextSerialPort::Posix_QextSerialPort </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">const char * </td> <td class="mdname" nowrap> <em>name</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>const PortSettings & </td> <td class="mdname" nowrap> <em>settings</em></td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Constructs a port with specified name and settings. </td> </tr></table><a name="a6" doxytag="Posix_QextSerialPort::~Posix_QextSerialPort"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> Posix_QextSerialPort::~Posix_QextSerialPort </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Standard destructor. </td> </tr></table><hr><h2>Member Function Documentation</h2><a name="a22" doxytag="Posix_QextSerialPort::bytesWaiting"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> int Posix_QextSerialPort::bytesWaiting </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Returns the number of bytes waiting in the port's receive queue. This function will return 0 if the port is not currently open, or -1 on error. Error information can be retrieved by calling Posix_QextSerialPort::getLastError(). <p>Reimplemented from <a class="el" href="classQextSerialBase.html">QextSerialBase</a>. </td> </tr></table><a name="a8" doxytag="Posix_QextSerialPort::close"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> void Posix_QextSerialPort::close </td> <td class="md" valign="top">( </td> <td class="mdname1" valign="top" nowrap> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -