⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 classposix__qextserialport.html

📁 QT 串口开发开发库
💻 HTML
📖 第 1 页 / 共 3 页
字号:
Closes a serial port. This function has no effect if the serial port associated with the class is not currently open. <p>Reimplemented from <a class="el" href="classQextSerialBase.html">QextSerialBase</a>.    </td>  </tr></table><a name="b0" doxytag="Posix_QextSerialPort::construct"></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::construct </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">void&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [protected, virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Common constructor function, called by all versions of  <a class="el" href="classPosix__QextSerialPort.html#a0">Posix_QextSerialPort::Posix_QextSerialPort</a>(). Sets up default port settings (115200 8N1  Hardware flow control where supported, otherwise no flow control, and 500 ms timeout). <p>Reimplemented from <a class="el" href="classQextSerialBase.html#a3">QextSerialBase</a>.    </td>  </tr></table><a name="a9" doxytag="Posix_QextSerialPort::flush"></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::flush </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><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>Reimplemented from <a class="el" href="classQextSerialBase.html">QextSerialBase</a>.    </td>  </tr></table><a name="a11" doxytag="Posix_QextSerialPort::getch"></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::getch </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Returns a single character from the serial port, or -1 on error. This function has no effect if the serial port associated with the class is not currently open. <p>Reimplemented from <a class="el" href="classQextSerialBase.html">QextSerialBase</a>.    </td>  </tr></table><a name="a21" doxytag="Posix_QextSerialPort::lineStatus"></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"> unsigned long Posix_QextSerialPort::lineStatus </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">void&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp;          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><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>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>Reimplemented from <a class="el" href="classQextSerialBase.html">QextSerialBase</a>.    </td>  </tr></table><a name="a7" doxytag="Posix_QextSerialPort::open"></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"> bool Posix_QextSerialPort::open </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">int&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>mode</em> = 0          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Opens a serial port. Note that this function does not specify which device to open. If you need to open a device by name, see <a class="el" href="classQextSerialBase.html#a7">Posix_QextSerialPort::open</a>(const char*). This function has no  effect if the port associated with the class is already open. The port is also configured to the  current settings, as stored in the Settings structure. <p>Reimplemented from <a class="el" href="classQextSerialBase.html">QextSerialBase</a>.    </td>  </tr></table><a name="a5" doxytag="Posix_QextSerialPort::operator="></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 &amp; Posix_QextSerialPort::operator= </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">const Posix_QextSerialPort &amp;&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>s</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Override the = operator.     </td>  </tr></table><a name="a12" doxytag="Posix_QextSerialPort::putch"></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::putch </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">int&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>ch</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Writes a single character to the serial port. Return value is the byte written, or -1 on  error. This function has no effect if the serial port associated with the class is not  currently open. <p>Reimplemented from <a class="el" href="classQextSerialBase.html">QextSerialBase</a>.    </td>  </tr></table><a name="a18" doxytag="Posix_QextSerialPort::setBaudRate"></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::setBaudRate </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">BaudRateType&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>baudRate</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>    <td><p>Sets the baud rate of the serial port. Note that not all rates are applicable on  all platforms. The following table shows translations of the various baud rate  constants on Windows(including NT/2000) and POSIX platforms. Speeds marked with an * are speeds that are usable on both Windows and POSIX.<p><dl compact><dt><b>Note: </b><dd>BAUD76800 may not be supported on all POSIX systems. SGI/IRIX systems do not support  BAUD1800.</dl><div class="fragment"><pre>  RATE          Windows Speed   POSIX Speed  -----------   -------------   -----------   BAUD50                 110          50   BAUD75                 110          75  *BAUD110                110         110   BAUD134                110         134.5   BAUD150                110         150   BAUD200                110         200  *BAUD300                300         300  *BAUD600                600         600  *BAUD1200              1200        1200   BAUD1800              1200        1800  *BAUD2400              2400        2400  *BAUD4800              4800        4800  *BAUD9600              9600        9600   BAUD14400            14400        9600  *BAUD19200            19200       19200  *BAUD38400            38400       38400   BAUD56000            56000       38400  *BAUD57600            57600       57600   BAUD76800            57600       76800  *BAUD115200          115200      115200   BAUD128000          128000      115200   BAUD256000          256000      115200</pre></div> <p>Reimplemented from <a class="el" href="classQextSerialBase.html">QextSerialBase</a>.    </td>  </tr></table><a name="a16" doxytag="Posix_QextSerialPort::setDataBits"></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::setDataBits </td>          <td class="md" valign="top">(&nbsp;</td>          <td class="md" nowrap valign="top">DataBitsType&nbsp;</td>          <td class="mdname1" valign="top" nowrap>&nbsp; <em>dataBits</em>          </td>          <td class="md" valign="top">)&nbsp;</td>          <td class="md" nowrap><code> [virtual]</code></td>        </tr>      </table>    </td>  </tr></table><table cellspacing=5 cellpadding=0 border=0>  <tr>    <td>      &nbsp;    </td>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -