📄 classqextbasetype.html
字号:
</div><div class="memdoc"><p>Flushes all pending I/O to the serial port. This function has no effect if the serial port associated with the class is not currently open. <p>Implements <a class="el" href="classQextSerialBase.html#58df9d786aa70dfe9f547d4118103f39">QextSerialBase</a>.<div class="fragment"><pre class="fragment"><a name="l00878"></a>00878 {<a name="l00879"></a>00879 LOCK_MUTEX();<a name="l00880"></a>00880 <span class="keywordflow">if</span> (<a class="codeRef" doxygen="qiodevice.tag:http://doc.trolltech.com/" href="http://doc.trolltech.com/qiodevice.html#isOpen">isOpen</a>()) {<a name="l00881"></a>00881 <a class="code" href="classPosix__QextSerialPort.html#c4fcc5ae9850c3bc9952a13e4ef82273">Posix_File</a>->flush();<a name="l00882"></a>00882 }<a name="l00883"></a>00883 UNLOCK_MUTEX();<a name="l00884"></a>00884 }</pre></div><p></div></div><p><a class="anchor" name="c72e737e24bda9c14a9388eac8ef2622"></a><!-- doxytag: member="QextBaseType::flush" ref="c72e737e24bda9c14a9388eac8ef2622" args="()" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">void Win_QextSerialPort::flush </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"><code> [virtual, inherited]</code></td> </tr> </table></div><div class="memdoc"><p>Flushes all pending I/O to the serial port. This function has no effect if the serial port associated with the class is not currently open. <p>Implements <a class="el" href="classQextSerialBase.html#58df9d786aa70dfe9f547d4118103f39">QextSerialBase</a>.<div class="fragment"><pre class="fragment"><a name="l00199"></a>00199 {<a name="l00200"></a>00200 LOCK_MUTEX();<a name="l00201"></a>00201 <span class="keywordflow">if</span> (<a class="codeRef" doxygen="qiodevice.tag:http://doc.trolltech.com/" href="http://doc.trolltech.com/qiodevice.html#isOpen">isOpen</a>()) {<a name="l00202"></a>00202 FlushFileBuffers(<a class="code" href="classWin__QextSerialPort.html#f6dae6bb1c6b51e766e551bc11f1721d">Win_Handle</a>);<a name="l00203"></a>00203 }<a name="l00204"></a>00204 UNLOCK_MUTEX();<a name="l00205"></a>00205 }</pre></div><p></div></div><p><a class="anchor" name="099fb47548a3566ed32d4d878fa57f4c"></a><!-- doxytag: member="QextBaseType::isSequential" ref="099fb47548a3566ed32d4d878fa57f4c" args="() const " --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">bool QextSerialBase::isSequential </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"> const<code> [virtual, inherited]</code></td> </tr> </table></div><div class="memdoc"><p>Returns true if device is sequential, otherwise returns false. Serial port is sequential device so this function always returns true. Check <a class="elRef" doxygen="qiodevice.tag:http://doc.trolltech.com/" href="http://doc.trolltech.com/qiodevice.html#isSequential">QIODevice::isSequential()</a> documentation for more information. <div class="fragment"><pre class="fragment"><a name="l00177"></a>00177 {<a name="l00178"></a>00178 <span class="keywordflow">return</span> <span class="keyword">true</span>;<a name="l00179"></a>00179 }</pre></div><p></div></div><p><a class="anchor" name="e4029cb49127422b7e76586930366b05"></a><!-- doxytag: member="QextBaseType::lastError" ref="e4029cb49127422b7e76586930366b05" args="() const " --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">ulong QextSerialBase::lastError </td> <td>(</td> <td class="paramname"> </td> <td> ) </td> <td width="100%"> const<code> [virtual, inherited]</code></td> </tr> </table></div><div class="memdoc"><p>Returns the code for the last error encountered by the port, or E_NO_ERROR if the last port operation was successful. Possible error codes are:<p><div class="fragment"><pre class="fragment">Error Explanation--------------------------- -------------------------------------------------------------E_NO_ERROR No Error has occuredE_INVALID_FD Invalid file descriptor (port was not opened correctly)E_NO_MEMORY Unable to allocate memory tables (POSIX)E_CAUGHT_NON_BLOCKED_SIGNAL Caught a non-blocked signal (POSIX)E_PORT_TIMEOUT Operation timed out (POSIX)E_INVALID_DEVICE The file opened by the port is not a character device (POSIX)E_BREAK_CONDITION The port detected a break conditionE_FRAMING_ERROR The port detected a framing error (usually caused by incorrect baud rate settings)E_IO_ERROR There was an I/O error while communicating with the portE_BUFFER_OVERRUN Character buffer overrunE_RECEIVE_OVERFLOW Receive buffer overflowE_RECEIVE_PARITY_ERROR The port detected a parity error in the received dataE_TRANSMIT_OVERFLOW Transmit buffer overflowE_READ_FAILED General read operation failureE_WRITE_FAILED General write operation failure</pre></div> <div class="fragment"><pre class="fragment"><a name="l00248"></a>00248 {<a name="l00249"></a>00249 <span class="keywordflow">return</span> <a class="code" href="classQextSerialBase.html#31816951ba89902fa1dfdb6f18b80f41">lastErr</a>;<a name="l00250"></a>00250 }</pre></div><p></div></div><p><a class="anchor" name="b419544e866cab58b8a3ce6341f6a7e9"></a><!-- doxytag: member="QextBaseType::lineStatus" ref="b419544e866cab58b8a3ce6341f6a7e9" args="()" --><div class="memitem"><div class="memproto"> <table class="memname"> <tr> <td class="memname">unsigned long Posix_QextSerialPort::lineStatus </td> <td>(</td> <td class="paramtype">void </td> <td class="paramname"> </td> <td> ) </td> <td width="100%"><code> [virtual, inherited]</code></td> </tr> </table></div><div class="memdoc"><p>returns the line status as stored by the port function. This function will retrieve the states of the following lines: DCD, CTS, DSR, and RI. On POSIX systems, the following additional lines can be monitored: DTR, RTS, Secondary TXD, and Secondary RXD. The value returned is an unsigned long with specific bits indicating which lines are high. The following constants should be used to examine the states of individual lines:<p><div class="fragment"><pre class="fragment">Mask Line------ ----LS_CTS CTSLS_DSR DSRLS_DCD DCDLS_RI RILS_RTS RTS (POSIX only)LS_DTR DTR (POSIX only)LS_ST Secondary TXD (POSIX only)LS_SR Secondary RXD (POSIX only)</pre></div><p>This function will return 0 if the port associated with the class is not currently open. <p>Implements <a class="el" href="classQextSerialBase.html#28b87dd41160a61e2953dca38aa332d6">QextSerialBase</a>.<div class="fragment"><pre class="fragment"><a name="l01042"></a>01042 {<a name="l01043"></a>01043 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> Status=0, Temp=0;<a name="l01044"></a>01044 LOCK_MUTEX();<a name="l01045"></a>01045 <span class="keywordflow">if</span> (<a class="codeRef" doxygen="qiodevice.tag:http://doc.trolltech.com/" href="http://doc.trolltech.com/qiodevice.html#isOpen">isOpen</a>()) {<a name="l01046"></a>01046 ioctl(<a class="code" href="classPosix__QextSerialPort.html#c4fcc5ae9850c3bc9
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -