1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250
|
<HTML>
<HEAD>
<TITLE>class UART</TITLE>
<META NAME="Generator" CONTENT="KDOC ">
</HEAD>
<BODY bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#000099" alink= "#ffffff">
<TABLE WIDTH="100%" BORDER="0">
<TR>
<TD>
<TABLE BORDER="0">
<TR><TD valign="top" align="left" cellspacing="10">
<h1>class UART</h1>
</TD>
<TD valign="top" align="right" colspan="1">An UART receiver/transmitter. <small><A HREF="#longdesc">More...</A></small></TD></TR>
</TABLE>
<HR>
<TABLE BORDER="0">
<TR><TH>Full name</TH><TD><code><A HREF="TelEngine.html">TelEngine</A>::UART</code></TD></TR>
<TR><TH>Definition</TH><TD><code>#include <<A HREF="libs___ymodem___yatemodem_h.html">libs/ymodem/yatemodem.h</A>></code></TD></TR>
<TR><TH>Inherits</TH><TD><A HREF="TelEngine__DebugEnabler.html">TelEngine::DebugEnabler</A> <small>[public ]</small></TD></TR>
<TR><TH>Inherited by</TH><TD><A HREF="TelEngine__ETSIModem.html">ETSIModem</A></TD></TR>
<TR><TH><A HREF="full-list-TelEngine__UART.html">List of all Methods</A></TH></TR>
</TABLE>
</TD>
<TD align="right"><TABLE BORDER="0"><TR><TD><small><A HREF="index-long.html">Annotated List</A></small></TD></TR>
<TR><TD><small><A HREF="header-list.html">Files</A></small></TD></TR>
<TR><TD><small><A HREF="all-globals.html">Globals</A></small></TD></TR>
<TR><TD><small><A HREF="hier.html">Hierarchy</A></small></TD></TR>
<TR><TD><small><A HREF="index.html">Index</A></small></TD></TR>
</TABLE></TD></TR></TABLE>
<h4>Public Types</h4><ul><LI>enum <A HREF="#ref1">State</A> { Idle,
BitStart,
BitData,
BitParity,
BitStop,
UARTError,
}
</LI>
<LI>enum <A HREF="#ref2">Error</A> { EFraming,
EParity,
EChksum,
EInvalidData,
EUnknown,
EStopped,
ENone
}
</LI>
</ul><h4>Public Methods</h4><ul><LI> <b><A HREF="#ref3">UART</A></b> (State state, const NamedList& params, const char* name = 0)
</LI>
<LI>virtual <b><A HREF="#ref4">~UART</A></b> ()
</LI>
<LI>inline State <b><A HREF="#ref5">state</A></b> () const
</LI>
<LI>inline Error <b><A HREF="#ref6">error</A></b> () const
</LI>
<LI>inline int <b><A HREF="#ref7">modemType</A></b> () const
</LI>
<LI>inline const BitAccumulator& <b><A HREF="#ref8">accumulator</A></b> () const
</LI>
<LI>virtual void <b><A HREF="#ref9">reset</A></b> (State newState = Idle)
</LI>
<LI>inline bool <b><A HREF="#ref10">demodulate</A></b> (const DataBlock& data)
</LI>
<LI>inline bool <b><A HREF="#ref11">modulate</A></b> (DataBlock& dest, NamedList& params)
</LI>
<LI>inline void <b><A HREF="#ref12">modulate</A></b> (DataBlock& dest, const DataBlock& src)
</LI>
<LI>bool <b><A HREF="#ref13">recvBit</A></b> (bool value)
</LI>
<LI>virtual bool <b><A HREF="#ref14">recvByte</A></b> (unsigned char data)
</LI>
<LI>virtual bool <b><A HREF="#ref15">fskStarted</A></b> ()
</LI>
</ul><h4>Public Members</h4><ul><LI>static TokenDict <b><A HREF="#ref16">s_errors[]</A></b></LI>
</ul><h4>Protected Methods</h4><ul><LI>virtual int <b><A HREF="#ref17">idleRecvByte</A></b> (unsigned char data)
</LI>
<LI>virtual bool <b><A HREF="#ref18">createMsg</A></b> (NamedList& params, DataBlock& data)
</LI>
<LI>bool <b><A HREF="#ref19">error</A></b> (Error e)
</LI>
</ul><HR><H2><A NAME="longdesc">Detailed Description</A></H2><p>
Accumulate data bits received from a modem
</p>
<A NAME="State"></A><A NAME="ref1"></A><table width="100%"><tr bgcolor="#eeeeee"><td>enum <strong>State</strong> { Idle,
BitStart,
BitData,
BitParity,
BitStop,
UARTError,
}
</td><td align="right"><h3><strong>State</strong></h3></td></tr></table><p></p><p>
UART state enumeration
</p>
<A NAME="Error"></A><A NAME="ref2"></A><table width="100%"><tr bgcolor="#eeeeee"><td>enum <strong>Error</strong> { EFraming,
EParity,
EChksum,
EInvalidData,
EUnknown,
EStopped,
ENone
}
</td><td align="right"><h3><strong>Error</strong></h3></td></tr></table><p></p><p>
UART error enumeration
</p>
<A NAME="UART"></A><A NAME="ref3"></A><table width="100%"><tr bgcolor="#eeeeee"><td> <strong>UART</strong> (State state, const NamedList& params, const char* name = 0)
<br></td><td align="right"><h3><strong>UART</strong></h3></td></tr></table><p></p><p>
Constructor
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>state</i></TD><TD align="left" valign="top">The initial state of this UART
</TD></TR>
<TR><TD align="left" valign="top"><i>params</i></TD><TD align="left" valign="top">The UART's parameters
</TD></TR>
<TR><TD align="left" valign="top"><i>name</i></TD><TD align="left" valign="top">The name of this debug enabler
</TD></TR>
</TABLE></P>
<A NAME="~UART"></A><A NAME="ref4"></A><table width="100%"><tr bgcolor="#eeeeee"><td> <strong>~UART</strong> ()
<br></td><td align="right"><h3><strong>~UART</strong></h3></td></tr></table><p> <small>[virtual]</small></p><p>
Destructor
</p>
<A NAME="state"></A><A NAME="ref5"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline State <strong>state</strong> ()
<br></td><td align="right"><h3><strong>state</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
Get the current state of this UART
</p>
<p><b>Returns</b>: The current state of this UART as enumeration
</p>
<A NAME="error"></A><A NAME="ref6"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline Error <strong>error</strong> ()
<br></td><td align="right"><h3><strong>error</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
Get the current error state of this UART, if any
</p>
<p><b>Returns</b>: The current error state of this UART as enumeration
</p>
<A NAME="modemType"></A><A NAME="ref7"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline int <strong>modemType</strong> ()
<br></td><td align="right"><h3><strong>modemType</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
Get the type of this UART's modem
</p>
<p><b>Returns</b>: The type of this UART's modem
</p>
<A NAME="accumulator"></A><A NAME="ref8"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline const BitAccumulator& <strong>accumulator</strong> ()
<br></td><td align="right"><h3><strong>accumulator</strong></h3></td></tr></table><p> <small>[const]</small></p><p>
Get the data bit accumulator used by this UART
</p>
<p><b>Returns</b>: The data bit accumulator used by this UART
</p>
<A NAME="reset"></A><A NAME="ref9"></A><table width="100%"><tr bgcolor="#eeeeee"><td> void <strong>reset</strong> (State newState = Idle)
<br></td><td align="right"><h3><strong>reset</strong></h3></td></tr></table><p> <small>[virtual]</small></p><p>
Reset this UART
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>newState</i></TD><TD align="left" valign="top">The state to reset to
</TD></TR>
</TABLE></P>
<A NAME="demodulate"></A><A NAME="ref10"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline bool <strong>demodulate</strong> (const DataBlock& data)
<br></td><td align="right"><h3><strong>demodulate</strong></h3></td></tr></table><p></p><p>
Send data to the enclosed modem to be demodulated
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>data</i></TD><TD align="left" valign="top">The data to process
</TD></TR>
</TABLE></P>
<p><b>Returns</b>: False to stop processing
</p>
<A NAME="modulate"></A><A NAME="ref11"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline bool <strong>modulate</strong> (DataBlock& dest, NamedList& params)
<br></td><td align="right"><h3><strong>modulate</strong></h3></td></tr></table><p></p><p>
Create a buffer containing the modulated representation of a list of parameters
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>dest</i></TD><TD align="left" valign="top">Destination buffer
</TD></TR>
<TR><TD align="left" valign="top"><i>params</i></TD><TD align="left" valign="top">The list containing the values to be modulated
</TD></TR>
</TABLE></P>
<p><b>Returns</b>: False on failure (an 'error' parameter will be set in params)
</p>
<A NAME="modulate"></A><A NAME="ref12"></A><table width="100%"><tr bgcolor="#eeeeee"><td>inline void <strong>modulate</strong> (DataBlock& dest, const DataBlock& src)
<br></td><td align="right"><h3><strong>modulate</strong></h3></td></tr></table><p></p><p>
Create a buffer containing the modulated representation of another one
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>dest</i></TD><TD align="left" valign="top">Destination buffer
</TD></TR>
<TR><TD align="left" valign="top"><i>src</i></TD><TD align="left" valign="top">Source buffer
</TD></TR>
</TABLE></P>
<A NAME="recvBit"></A><A NAME="ref13"></A><table width="100%"><tr bgcolor="#eeeeee"><td>bool <strong>recvBit</strong> (bool value)
<br></td><td align="right"><h3><strong>recvBit</strong></h3></td></tr></table><p></p><p>
Push a bit of data into this UART. Once a data byte is accumulated, push it back to itself
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>value</i></TD><TD align="left" valign="top">The bit to be processed
</TD></TR>
</TABLE></P>
<p><b>Returns</b>: False to stop feeding data
</p>
<A NAME="recvByte"></A><A NAME="ref14"></A><table width="100%"><tr bgcolor="#eeeeee"><td> bool <strong>recvByte</strong> (unsigned char data)
<br></td><td align="right"><h3><strong>recvByte</strong></h3></td></tr></table><p> <small>[virtual]</small></p><p>
Push a data byte into this UART
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>data</i></TD><TD align="left" valign="top">The byte to be processed
</TD></TR>
</TABLE></P>
<p><b>Returns</b>: False to stop feeding data
</p>
<A NAME="fskStarted"></A><A NAME="ref15"></A><table width="100%"><tr bgcolor="#eeeeee"><td> bool <strong>fskStarted</strong> ()
<br></td><td align="right"><h3><strong>fskStarted</strong></h3></td></tr></table><p> <small>[virtual]</small></p><p>
Notification from modem that the FSK start was detected
</p>
<p><b>Returns</b>: False to stop the modem
</p>
<A NAME="s_errors[]"></A><A NAME="ref16"></A><table width="100%"><tr bgcolor="#eeeeee"><td>static TokenDict <strong>s_errors[]</strong>
</td><td align="right"><h3><strong>s_errors[]</strong></h3></td></tr></table><p></p><A NAME="idleRecvByte"></A><A NAME="ref17"></A><table width="100%"><tr bgcolor="#eeeeee"><td> int <strong>idleRecvByte</strong> (unsigned char data)
<br></td><td align="right"><h3><strong>idleRecvByte</strong></h3></td></tr></table><p> <small>[protected virtual]</small></p><p>
Process an accumulated byte in Idle state
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>data</i></TD><TD align="left" valign="top">The byte to process
</TD></TR>
</TABLE></P>
<p><b>Returns</b>: Negative to stop, positive to change state to BitStart, 0 to continue
</p>
<A NAME="createMsg"></A><A NAME="ref18"></A><table width="100%"><tr bgcolor="#eeeeee"><td> bool <strong>createMsg</strong> (NamedList& params, DataBlock& data)
<br></td><td align="right"><h3><strong>createMsg</strong></h3></td></tr></table><p> <small>[protected virtual]</small></p><p>
Create a buffer containing the byte representation of a message to be sent
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>params</i></TD><TD align="left" valign="top">The list containing message parameters
</TD></TR>
<TR><TD align="left" valign="top"><i>data</i></TD><TD align="left" valign="top">Destination message data buffer
</TD></TR>
</TABLE></P>
<p><b>Returns</b>: False on failure
</p>
<A NAME="error"></A><A NAME="ref19"></A><table width="100%"><tr bgcolor="#eeeeee"><td>bool <strong>error</strong> (Error e)
<br></td><td align="right"><h3><strong>error</strong></h3></td></tr></table><p> <small>[protected]</small></p><p>
Set the error state of this UART
</p>
<p><b>Parameters</b>:<TABLE BORDER="0" CELLPADDING="5">
<TR><TD align="left" valign="top"><i>e</i></TD><TD align="left" valign="top">The error
</TD></TR>
</TABLE></P>
<p><b>Returns</b>: False
</p>
<HR>
<table>
<tr><td><small>Generated by: paulc on bussard on Mon Mar 8 12:18:15 2010, using kdoc 2.0a54.</small></td></tr>
</table>
</BODY>
</HTML>
|