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

📄 c-iosys7.html

📁 vxworks相关论文
💻 HTML
📖 第 1 页 / 共 5 页
字号:
</tr></table></p></p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="84532">Raw Mode and Line Mode</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84534"> </a>A <i class="acronym_lc">tty</i> device operates in one of two modes: <i class="term">raw mode </i>(unbuffered) or <i class="term">line mode</i>. Raw mode is the default. Line mode is selected by the <b class="symbol_UC">OPT_LINE</b> bit of the device option word (see <a href="c-iosys7.html#84451"><i class="title">Tty Options</i></a>).</p><dd><p class="Body"><a name="84538"> </a>In <i class="term">raw mode</i>, each input character is available to readers as soon as it is input from the device. Reading from a <i class="acronym_lc">tty</i> device in raw mode causes as many characters as possible to be extracted from the input ring, up to the limit of the user's read buffer. Input cannot be modified except as directed by other <i class="acronym_lc">tty</i> option bits.</p><dd><p class="Body"><a name="95770"> </a>In <i class="term">line mode</i>, all input characters are saved until a <kbd>NEWLINE</kbd> character is input; then the entire line of characters, including the <kbd>NEWLINE</kbd>, is made available in the ring at one time. Reading from a <i class="acronym_lc">tty</i> device in line mode causes characters up to the end of the next line to be extracted from the input ring, up to the limit of the user's read buffer. Input can be modified by the special characters <kbd>CTRL+H</kbd> (backspace), <kbd>CTRL+U</kbd> (line-delete), and <kbd>CTRL+D</kbd> (end-of-file), which are discussed in <a href="c-iosys7.html#84545"><i class="title">Tty Special Characters</i></a>.</p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="84545">Tty Special Characters</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84546"> </a>The following special characters are enabled if the <i class="acronym_lc">tty</i> device operates in line mode, that is, with the <b class="symbol_UC">OPT_LINE</b> bit set:</p></dl><dl class="margin"><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84548"> </a>The backspace character, by default <kbd>CTRL+H</kbd>, causes successive previous characters to be deleted from the current line, up to the start of the line. It does this by echoing a backspace followed by a space, and then another backspace.</li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84550"> </a>The line-delete character, by default <kbd>CTRL+U</kbd>, deletes all the characters of the current line.</li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84552"> </a>The end-of-file (EOF) character, by default <kbd>CTRL+D</kbd>, causes the current line to become available in the input ring without a <kbd>NEWLINE</kbd> and without entering the EOF character itself. Thus if the EOF character is the first character typed on a line, reading that line returns a zero byte count, which is the usual indication of end-of-file.</li></ul></p></dl><dl class="margin"><dd><p class="Body"><a name="84553"> </a>The following characters have special effects if the <i class="acronym_lc">tty</i> device is operating with the corresponding option bit set:</p></dl><dl class="margin"><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84556"> </a>The flow control characters, <kbd>CTRL+Q</kbd> and <kbd>CTRL+S</kbd>, commonly known as <i class="term">X-on/X-off protocol</i>. Receipt of a <kbd>CTRL+S</kbd> input character suspends output to that channel. Subsequent receipt of a <kbd>CTRL+Q</kbd> resumes the output. Conversely, when the VxWorks input buffer is almost full, a <kbd>CTRL+S</kbd> is output to signal the other side to suspend transmission. When the input buffer is empty enough, a <kbd>CTRL+Q</kbd> is output to signal the other side to resume transmission.<b class="symbol_UC"> </b>X-on/X-off protocol is enabled by <b class="symbol_UC">OPT_TANDEM</b>.</li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84558"> </a>The <i class="term">ROM monitor trap</i> character, by default <kbd>CTRL+X</kbd>. This character traps to the ROM-resident monitor program. Note that this is drastic. All normal VxWorks functioning is suspended, and the computer system is controlled entirely by the monitor. Depending on the particular monitor, it may or may not be possible to restart VxWorks from the point of interruption.<sup><a href="#foot"><b class="FootnoteMarker">2</b></a></sup> The monitor trap character is enabled by <b class="symbol_UC">OPT_MON_TRAP</b>.</li></ul></p><p class="listspace"><ul class="Bullet" type="disc"><li><a name="84560"> </a>The special <i class="term">target shell abort</i> character, by default <kbd>CTRL+C</kbd>. This character restarts the target shell if it gets stuck in an unfriendly routine, such as one that has taken an unavailable semaphore or is caught in an infinite loop. The target shell abort character is enabled by <b class="symbol_UC">OPT_ABORT</b>.</li></ul></p></dl><dl class="margin"><dd><p class="Body"><a name="84561"> </a>The characters for most of these functions can be changed using the <b class="library">tyLib</b> routines shown in <a href="c-iosys7.html#84568">Table&nbsp;3-8</a>. <p class="table"><h4 class="EntityTitle"><a name="84568"><font face="Helvetica, sans-serif" size="-1" class="sans">Table 3-8:&nbsp;&nbsp;Tty Special Characters</font></a></h4><table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="84574"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Character</font></b></div></th><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="84576"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Description</font></b></div></th><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="84578"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Modifier</font></b></div></th></tr><tr><td colspan="20"><hr class="tablerule2"></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84586"> </a><kbd>CTRL+H</kbd> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84588"> </a>backspace (character delete)&nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84591"> </a><b class="routine"><i class="routine">tyBackspaceSet</i></b><b>(</b>&nbsp;<b>)</b> &nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84593"> </a><kbd>CTRL+U</kbd> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84595"> </a>line delete&nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84598"> </a><b class="routine"><i class="routine">tyDeleteLineSet</i></b><b>(</b>&nbsp;<b>)</b> &nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84600"> </a><kbd>CTRL+D</kbd> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84602"> </a>EOF (end of file)&nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84605"> </a><b class="routine"><i class="routine">tyEOFSet</i></b><b>(</b>&nbsp;<b>)</b> &nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84607"> </a><kbd>CTRL+C</kbd> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84609"> </a>target shell abort &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84612"> </a><b class="routine"><i class="routine">tyAbortSet</i></b><b>(</b>&nbsp;<b>)</b> &nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84614"> </a><kbd>CTRL+X</kbd> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84616"> </a>trap to boot ROMs&nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84619"> </a><b class="routine"><i class="routine">tyMonitorTrapSet</i></b><b>(</b>&nbsp;<b>)</b> &nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84621"> </a><kbd>CTRL+S</kbd> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84623"> </a>output suspend &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84625"> </a>N/A&nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84627"> </a><kbd>CTRL+Q</kbd> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84629"> </a>output resume&nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84632"> </a>N/A&nbsp;</div></td></tr><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><td colspan="20"></td></tr></table></p></p></dl></dl><font face="Helvetica, sans-serif" class="sans"><h4 class="H4"><i><a name="84640">I/O Control Functions</a></i></h4></font><dl class="margin"><dl class="margin"><dd><p class="Body"><a name="84645"> </a>The <i class="acronym_lc">tty</i> devices respond to the <b class="routine"><i class="routine">ioctl</i></b><b>(</b>&nbsp;<b>)</b> functions in <a href="c-iosys7.html#84649">Table&nbsp;3-9</a>, defined in <b class="file">ioLib.h</b>. For more information, see the reference entries for <b class="library">tyLib</b>, <b class="library">ttyDrv</b>, and <b class="routine"><i class="routine">ioctl</i></b><b>(</b>&nbsp;<b>)</b>.<p class="table"><h4 class="EntityTitle"><a name="84649"><font face="Helvetica, sans-serif" size="-1" class="sans">Table 3-9:&nbsp;&nbsp;I/O Control Functions Supported by <b class="library">tyLib &nbsp;</b></font></a></h4><table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="20"><hr class="tablerule"></td></tr><tr valign="middle"><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="84653"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Function</font></b></div></th><th rowspan="1" colspan="1"><div class="CellHeading"><b><a name="84655"> </a><font face="Helvetica, sans-serif" size="-1" class="sans">Description</font></b></div></th></tr><tr><td colspan="20"><hr class="tablerule2"></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84662"> </a><b class="symbol_UC">FIOBAUDRATE</b> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84664"> </a>Set the baud rate to the specified argument.&nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84667"> </a><b class="symbol_UC">FIOCANCEL</b> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84669"> </a>Cancel a read or write.&nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84672"> </a><b class="symbol_UC">FIOFLUSH</b> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84674"> </a>Discard all bytes in the input and output buffers.&nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84677"> </a><b class="symbol_UC">FIOGETNAME</b> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84679"> </a>Get the file name of the <i class="acronym_lc">fd</i>.&nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84682"> </a><b class="symbol_UC">FIOGETOPTIONS</b> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84684"> </a>Return the current device option word.&nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84687"> </a><b class="symbol_UC">FIONREAD</b> &nbsp;</div></td><td colspan=1 rowspan=1><div class="CellBody"><a name="84689"> </a>Get the number of unread bytes in the input buffer.&nbsp;</div></td></tr><tr valign="top"><td colspan=1 rowspan=1><div class="CellBody"><a name="84692"> </a><b class="symbol_UC">FIONWRITE</b> &nbsp;</div></td><td colspan=1 rowspan=1>

⌨️ 快捷键说明

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