Sophie

Sophie

distrib > Fedora > 14 > x86_64 > by-pkgid > 3ebaf504d69f581a8834e53e04e712a5 > files > 160

gearbox-devel-9.11-6.fc14.i686.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>GearBox Project</title>

<link rel="icon" href="gbx_icon_cardbox_sky.png" type="image/png">
<link rel="shortcut icon" href="gbx_icon_cardbox_sky.png" type="image/png">

<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
<!-- Google Analytics -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-3583782-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
<!-- Returning you to your regular programming -->
</head><body>

<!-- Header -->

<table border="0" cellspacing="0" cellpadding="0">

<tr><!-- create row -->

<!-- spacer cell -->
<!-- #CC CC CC -->
<td rowspan="1" colspan="1" bgcolor="#EEEEEE">&nbsp;&nbsp;&nbsp;&nbsp;</td>

<!-- menu cell -->
<td width="170" rowspan="1" colspan="1" align="left" valign="top" bgcolor="#EEEEEE">


<p>&nbsp;</p>
<p align="center"><a href="index.html"><img src="gbx_logo_cardbox_sky_150x150.png"></a></p><br>

<strong>INTRODUCTION</strong><br>
<strong><a href="gbx_doc_overview.html" style="text-decoration:none">Overview</a></strong><br>
<strong><a href="gbx_doc_getting.html" style="text-decoration:none">Download and Install</a></strong><br>
<!-- <strong><a href="gbx_doc_quickstart.html" style="text-decoration:none">Quick Start</a></strong><br> -->
<strong><a href="gbx_doc_documentation.html" style="text-decoration:none">Documentation</a></strong><br>
<strong><a href="gbx_doc_publications.html" style="text-decoration:none">Publications</a></strong><br>
<br>

<strong>REPOSITORY</strong><br>
<strong><a href="group__gbx__libs.html" style="text-decoration:none">Libraries</a></strong><br>
<!-- <strong><a href="group__gbx__utils.html" style="text-decoration:none">Utilities</a></strong><br> -->
<br>

<strong>DEVELOPER</strong><br>

<!--<strong><a href="gbx_doc_tutorials.html" style="text-decoration:none">Tutorials</a></strong><br>
<strong><a href="group__gbx__examples.html" style="text-decoration:none">Examples</a></strong><br>-->
<strong><a href="gbx_doc_devguide.html" style="text-decoration:none">Dev Guide</a></strong><br>
<!-- 
<strong><a href="gbx_doc_faq.html" style="text-decoration:none">FAQ</a></strong><br>
-->
<strong><a href="http://cdash.acfr.usyd.edu.au/index.php?project=Gearbox" style="text-decoration:none">Dashboard</a></strong><br>
<!--<strong><a href="http://wiki2.cas.edu.au/orca">Wiki</a></strong><br>
login/pass: orca/orca<br>-->
<br>

<strong>PEOPLE</strong><br>
<strong><a href="gbx_doc_contributors.html" style="text-decoration:none">Contributors</a></strong><br>
<strong><a href="gbx_doc_users.html" style="text-decoration:none">Users</a></strong><br>
<br>

<a href="http://sourceforge.net"><img src="http://sourceforge.net/sflogo.php?group_id=216468&amp;type=2" width="125" height="37" border="0" alt="SourceForge.net Logo" /></a><br>
<strong><a href="http://sourceforge.net/projects/gearbox">Project</a></strong><br>
<strong><a href="http://sourceforge.net/project/showfiles.php?group_id=216468">Download</a></strong><br>
<!--<strong><a href="http://sourceforge.net/tracker/?group_id=216468">Bugs/Feedback</a></strong><br>-->
<strong><a href="http://sourceforge.net/mail/?group_id=216468">Mailing lists</a></strong></p>
<p>&nbsp;</p>

</td><!-- /menu cell -->

<!-- one grey spacer cells -->
<td rowspan="1" colspan="1" bgcolor="#EEEEEE">&nbsp;&nbsp;&nbsp;&nbsp;</td>

<!-- one white spacer cells -->
<td rowspan="1" colspan="1">&nbsp;&nbsp;&nbsp;&nbsp;</td>

<!-- main content cell -->
<td rowspan="1" colspan="1" align="left" valign="top">


<!-- Generated by Doxygen 1.6.2-20100208 -->
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
      <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
    </ul>
  </div>
  <div class="navpath"><a class="el" href="namespacegbxserialacfr.html">gbxserialacfr</a>::<a class="el" href="classgbxserialacfr_1_1Serial.html">Serial</a>
  </div>
</div>
<div class="contents">
<h1>gbxserialacfr::Serial Class Reference</h1><!-- doxytag: class="gbxserialacfr::Serial" --><!-- doxytag: inherits="gbxserialacfr::Uncopyable" -->
<p>Encapsulates a serial port.  
<a href="#_details">More...</a></p>

<p><code>#include &lt;<a class="el" href="serial_8h_source.html">serial.h</a>&gt;</code></p>

<p>Inherits gbxserialacfr::Uncopyable.</p>

<p><a href="classgbxserialacfr_1_1Serial-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgbxserialacfr_1_1Serial.html#a768a31692dbbb411f6d67137228cf716">Serial</a> (const std::string &amp;dev, int baudRate, const Timeout &amp;timeout, int debuglevel=0, bool useLockFile=true)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa046f044851699e2631fa5d8f9c24172"></a><!-- doxytag: member="gbxserialacfr::Serial::~Serial" ref="aa046f044851699e2631fa5d8f9c24172" args="()" -->
&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgbxserialacfr_1_1Serial.html#aa046f044851699e2631fa5d8f9c24172">~Serial</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destructor closes serial port. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae89ed90ef411e36284f0d16a1fe7b21c"></a><!-- doxytag: member="gbxserialacfr::Serial::setDebugLevel" ref="ae89ed90ef411e36284f0d16a1fe7b21c" args="(int debugLevel)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgbxserialacfr_1_1Serial.html#ae89ed90ef411e36284f0d16a1fe7b21c">setDebugLevel</a> (int debugLevel)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Debug messages are printed to stdout. debugLevel should be in the range [0,3]. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a77b91acc400428930e3622f96e59a55a"></a><!-- doxytag: member="gbxserialacfr::Serial::setBaudRate" ref="a77b91acc400428930e3622f96e59a55a" args="(int baud)" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgbxserialacfr_1_1Serial.html#a77b91acc400428930e3622f96e59a55a">setBaudRate</a> (int baud)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Sets the baud rate. Flushes any data. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgbxserialacfr_1_1Serial.html#a72633b3f3bdc3eb14876ff6b93015c11">setTimeout</a> (const Timeout &amp;timeout)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">const Timeout &amp;&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgbxserialacfr_1_1Serial.html#a4fa15d028de9391c4b8d357864a8bbfb">timeout</a> () const </td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgbxserialacfr_1_1Serial.html#a30696b67eb115a5ccd8dfe0c074fc97b">read</a> (void *buf, int count)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgbxserialacfr_1_1Serial.html#a864cb0cac472618a92750acdefd1cee1">readFull</a> (void *buf, int count)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgbxserialacfr_1_1Serial.html#a0a1b6049826fd09fe436229b12412f40">readStringUntil</a> (std::string &amp;str, char termchar)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgbxserialacfr_1_1Serial.html#a49373840e91f22cc819f1a963fe02d82">readLine</a> (std::string &amp;str)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ad0bd7a37e819d726605f6280072d8862"></a><!-- doxytag: member="gbxserialacfr::Serial::bytesAvailable" ref="ad0bd7a37e819d726605f6280072d8862" args="()" -->
int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgbxserialacfr_1_1Serial.html#ad0bd7a37e819d726605f6280072d8862">bytesAvailable</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the number of bytes available for reading (non-blocking). <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgbxserialacfr_1_1Serial.html#ad537dad3a99fedd4259dc3fe2a3bf9f8">bytesAvailableWait</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a92f7f321e378d53bcb6ab8b51ea1f1f4"></a><!-- doxytag: member="gbxserialacfr::Serial::write" ref="a92f7f321e378d53bcb6ab8b51ea1f1f4" args="(const void *buf, int count)" -->
int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgbxserialacfr_1_1Serial.html#a92f7f321e378d53bcb6ab8b51ea1f1f4">write</a> (const void *buf, int count)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Writes some data. Returns the number of bytes written. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgbxserialacfr_1_1Serial.html#ab5f93b9d284bd1dabed1a0318d0b067f">writeString</a> (const char *buf)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgbxserialacfr_1_1Serial.html#a68ab2663cd9acadc6914944ffdf284a1">flush</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ab1d9329423dd295de01696c12d86e8f4"></a><!-- doxytag: member="gbxserialacfr::Serial::drain" ref="ab1d9329423dd295de01696c12d86e8f4" args="()" -->
void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgbxserialacfr_1_1Serial.html#ab1d9329423dd295de01696c12d86e8f4">drain</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Finishes transmission from output buffers and drains input buffers. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1db4c0f21a7208fb882cfec9036cc699"></a><!-- doxytag: member="gbxserialacfr::Serial::fileDescriptor" ref="a1db4c0f21a7208fb882cfec9036cc699" args="()" -->
int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgbxserialacfr_1_1Serial.html#a1db4c0f21a7208fb882cfec9036cc699">fileDescriptor</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This gives direct access to the file descriptor: be careful with this... <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5bfc3150bf900dcf8fe5b8e2272e7221"></a><!-- doxytag: member="gbxserialacfr::Serial::getStatusString" ref="a5bfc3150bf900dcf8fe5b8e2272e7221" args="()" -->
std::string&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgbxserialacfr_1_1Serial.html#a5bfc3150bf900dcf8fe5b8e2272e7221">getStatusString</a> ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Print some diagnostic information about the current status of the port to cout. <br/></td></tr>
</table>
<hr/><a name="_details"></a><h2>Detailed Description</h2>
<p>Encapsulates a serial port. </p>
<p>This class hard-codes some options, such as:</p>
<ul>
<li>8 data bits</li>
<li>no handshaking</li>
</ul>
<dl class="author"><dt><b>Author:</b></dt><dd>Matthew Ridley, Alex Brooks </dd></dl>
<hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a768a31692dbbb411f6d67137228cf716"></a><!-- doxytag: member="gbxserialacfr::Serial::Serial" ref="a768a31692dbbb411f6d67137228cf716" args="(const std::string &amp;dev, int baudRate, const Timeout &amp;timeout, int debuglevel=0, bool useLockFile=true)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">gbxserialacfr::Serial::Serial </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>dev</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>baudRate</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const Timeout &amp;&nbsp;</td>
          <td class="paramname"> <em>timeout</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>debuglevel</em> = <code>0</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&nbsp;</td>
          <td class="paramname"> <em>useLockFile</em> = <code>true</code></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Opens a device <code>dev</code>. Throws SerialException's or LockFileException's (both derive from std::exception) on error. Timeouts control the various read functions below. A timeout value of (sec=0,usec=0) indicates 'timeouts disabled'. If useLockFile is set to true, <a class="el" href="classgbxserialacfr_1_1Serial.html" title="Encapsulates a serial port.">Serial</a> will use the file-system to prevent concurrent access to a serial device by multiple instances of <a class="el" href="classgbxserialacfr_1_1Serial.html" title="Encapsulates a serial port.">Serial</a>. </p>

<p>References <a class="el" href="serial_8cpp_source.html#l00774">getStatusString()</a>, and <a class="el" href="serial_8cpp_source.html#l00435">setBaudRate()</a>.</p>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ad537dad3a99fedd4259dc3fe2a3bf9f8"></a><!-- doxytag: member="gbxserialacfr::Serial::bytesAvailableWait" ref="ad537dad3a99fedd4259dc3fe2a3bf9f8" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int gbxserialacfr::Serial::bytesAvailableWait </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Returns the number of bytes available for reading. Waits according to the timeout. Returns:</p>
<ul>
<li>&lt;0 : timed out</li>
<li>&gt;0 : data ready </li>
</ul>

<p>References <a class="el" href="serial_8cpp_source.html#l00684">bytesAvailable()</a>.</p>

</div>
</div>
<a class="anchor" id="a68ab2663cd9acadc6914944ffdf284a1"></a><!-- doxytag: member="gbxserialacfr::Serial::flush" ref="a68ab2663cd9acadc6914944ffdf284a1" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void gbxserialacfr::Serial::flush </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Flushs both input and output buffers. This discards all data in buffers. </p>

<p>Referenced by <a class="el" href="oceanserverreader_8cpp_source.html#l00073">gbxsmartbatteryacfr::OceanServerReader::reset()</a>.</p>

</div>
</div>
<a class="anchor" id="a30696b67eb115a5ccd8dfe0c074fc97b"></a><!-- doxytag: member="gbxserialacfr::Serial::read" ref="a30696b67eb115a5ccd8dfe0c074fc97b" args="(void *buf, int count)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int gbxserialacfr::Serial::read </td>
          <td>(</td>
          <td class="paramtype">void *&nbsp;</td>
          <td class="paramname"> <em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>count</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Reads up to <code>count</code> bytes into buffer <code>buf</code>. Returns the number of bytes read, or '-1' on timeout (if timeouts are enabled). If timeouts are not enabled, blocks till it gets something. </p>

<p>Referenced by <a class="el" href="serial_8cpp_source.html#l00592">readFull()</a>, and <a class="el" href="serial_8cpp_source.html#l00630">readStringUntil()</a>.</p>

</div>
</div>
<a class="anchor" id="a864cb0cac472618a92750acdefd1cee1"></a><!-- doxytag: member="gbxserialacfr::Serial::readFull" ref="a864cb0cac472618a92750acdefd1cee1" args="(void *buf, int count)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int gbxserialacfr::Serial::readFull </td>
          <td>(</td>
          <td class="paramtype">void *&nbsp;</td>
          <td class="paramname"> <em>buf</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>count</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Tries to read exactly <code>count</code> bytes into <code>buf</code>. Returns the number of bytes read, or throws an exception.</p>
<p>If timeouts are not enabled we might block forever, waiting for the number of bytes we want or an error.</p>
<p>If timeouts are enabled we won't block more than the timeout specified. Returns -1 if it timed out. NOTE: The timeout applies for each individual <a class="el" href="classgbxserialacfr_1_1Serial.html#a30696b67eb115a5ccd8dfe0c074fc97b">read()</a> call. We might have to make lots of them, so the total time for which this function blocks might be longer than the specified timeout. </p>

<p>References <a class="el" href="serial_8cpp_source.html#l00565">read()</a>.</p>

</div>
</div>
<a class="anchor" id="a49373840e91f22cc819f1a963fe02d82"></a><!-- doxytag: member="gbxserialacfr::Serial::readLine" ref="a49373840e91f22cc819f1a963fe02d82" args="(std::string &amp;str)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int gbxserialacfr::Serial::readLine </td>
          <td>(</td>
          <td class="paramtype">std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>str</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td><code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Short-hand for "readStringUntil(str,'\n');" Reads everything up to and including the '<br/>
'. </p>

<p>References <a class="el" href="serial_8cpp_source.html#l00630">readStringUntil()</a>.</p>

</div>
</div>
<a class="anchor" id="a0a1b6049826fd09fe436229b12412f40"></a><!-- doxytag: member="gbxserialacfr::Serial::readStringUntil" ref="a0a1b6049826fd09fe436229b12412f40" args="(std::string &amp;str, char termchar)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int gbxserialacfr::Serial::readStringUntil </td>
          <td>(</td>
          <td class="paramtype">std::string &amp;&nbsp;</td>
          <td class="paramname"> <em>str</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">char&nbsp;</td>
          <td class="paramname"> <em>termchar</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Reads a string into , up to and including the first instance of  Returns the number of bytes read (or '-1' on timeout).</p>
<p>If timeouts are not enabled we might block forever, waiting for the number of bytes we want or an error.</p>
<p>If timeouts are enabled we won't block more than the timeout specified. Returns -1 if it timed out. NOTE: The timeout applies for each individual <a class="el" href="classgbxserialacfr_1_1Serial.html#a30696b67eb115a5ccd8dfe0c074fc97b">read()</a> call. We might have to make lots of them, so the total time for which this function blocks might be longer than the specified timeout. </p>

<p>References <a class="el" href="serial_8cpp_source.html#l00565">read()</a>.</p>

<p>Referenced by <a class="el" href="serial_8h_source.html#l00115">readLine()</a>.</p>

</div>
</div>
<a class="anchor" id="a72633b3f3bdc3eb14876ff6b93015c11"></a><!-- doxytag: member="gbxserialacfr::Serial::setTimeout" ref="a72633b3f3bdc3eb14876ff6b93015c11" args="(const Timeout &amp;timeout)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void gbxserialacfr::Serial::setTimeout </td>
          <td>(</td>
          <td class="paramtype">const Timeout &amp;&nbsp;</td>
          <td class="paramname"> <em>timeout</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Sets timeout. Can be used to change the value of timeouts if they're set, but can't set the {en|dis}abled state of timeouts. </p>

</div>
</div>
<a class="anchor" id="a4fa15d028de9391c4b8d357864a8bbfb"></a><!-- doxytag: member="gbxserialacfr::Serial::timeout" ref="a4fa15d028de9391c4b8d357864a8bbfb" args="() const " -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const Timeout&amp; gbxserialacfr::Serial::timeout </td>
          <td>(</td>
          <td class="paramname"></td>
          <td>&nbsp;)&nbsp;</td>
          <td> const<code> [inline]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Gets the current timeout. A timeout value of (sec=0,usec=0) indicates 'timeouts disabled'. </p>

<p>Referenced by <a class="el" href="serialdevicehandler_8cpp_source.html#l00093">gbxserialdeviceacfr::SerialDeviceHandler::walk()</a>.</p>

</div>
</div>
<a class="anchor" id="ab5f93b9d284bd1dabed1a0318d0b067f"></a><!-- doxytag: member="gbxserialacfr::Serial::writeString" ref="ab5f93b9d284bd1dabed1a0318d0b067f" args="(const char *buf)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int gbxserialacfr::Serial::writeString </td>
          <td>(</td>
          <td class="paramtype">const char *&nbsp;</td>
          <td class="paramname"> <em>buf</em></td>
          <td>&nbsp;)&nbsp;</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">
<p>Writes a ("\0"-terminated) string. Returns the number of bytes written. </p>

<p>References <a class="el" href="serial_8cpp_source.html#l00829">write()</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="serial_8h_source.html">serial.h</a></li>
<li>serial.cpp</li>
</ul>
</div>

            </td>
            <td colspan="1">&nbsp;</td>
         </tr>
        </table>
<!-- end of table -->

 <hr size="1"><address style="align: right;"><small>Generated for GearBox by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.5 </small></address>
</body>
</html>