<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>EchoLib: EchoLinkQso.h Source File</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.6.2-20100208 --> <div class="navigation" id="top"> <div class="tabs"> <ul> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li><a href="annotated.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li><a href="dirs.html"><span>Directories</span></a></li> <li><a href="examples.html"><span>Examples</span></a></li> </ul> </div> <div class="tabs"> <ul> <li><a href="files.html"><span>File List</span></a></li> </ul> </div> <div class="navpath"><a class="el" href="dir_d583404e3b046262ade615a4e7154c3b.html">include</a> </div> </div> <div class="contents"> <h1>EchoLinkQso.h</h1><a href="EchoLinkQso_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <a name="l00040"></a>00040 <span class="preprocessor">#ifndef ECHOLINK_QSO_INCLUDED</span> <a name="l00041"></a>00041 <span class="preprocessor"></span><span class="preprocessor">#define ECHOLINK_QSO_INCLUDED</span> <a name="l00042"></a>00042 <span class="preprocessor"></span> <a name="l00043"></a>00043 <a name="l00044"></a>00044 <span class="comment">/****************************************************************************</span> <a name="l00045"></a>00045 <span class="comment"> *</span> <a name="l00046"></a>00046 <span class="comment"> * System Includes</span> <a name="l00047"></a>00047 <span class="comment"> *</span> <a name="l00048"></a>00048 <span class="comment"> ****************************************************************************/</span> <a name="l00049"></a>00049 <a name="l00050"></a>00050 <span class="preprocessor">#include <sys/time.h></span> <a name="l00051"></a>00051 <span class="preprocessor">#include <sigc++/sigc++.h></span> <a name="l00052"></a>00052 <span class="preprocessor">#include <stdint.h></span> <a name="l00053"></a>00053 <span class="preprocessor">#include <string></span> <a name="l00054"></a>00054 <a name="l00055"></a>00055 <a name="l00056"></a>00056 <span class="comment">/****************************************************************************</span> <a name="l00057"></a>00057 <span class="comment"> *</span> <a name="l00058"></a>00058 <span class="comment"> * Project Includes</span> <a name="l00059"></a>00059 <span class="comment"> *</span> <a name="l00060"></a>00060 <span class="comment"> ****************************************************************************/</span> <a name="l00061"></a>00061 <a name="l00062"></a>00062 <span class="keyword">extern</span> <span class="stringliteral">"C"</span> { <a name="l00063"></a>00063 <span class="preprocessor">#include <gsm.h></span> <a name="l00064"></a>00064 } <a name="l00065"></a>00065 <span class="preprocessor">#include <AsyncTimer.h></span> <a name="l00066"></a>00066 <span class="preprocessor">#include <AsyncIpAddress.h></span> <a name="l00067"></a>00067 <span class="preprocessor">#include <AsyncAudioSink.h></span> <a name="l00068"></a>00068 <span class="preprocessor">#include <AsyncAudioSource.h></span> <a name="l00069"></a>00069 <a name="l00070"></a>00070 <a name="l00071"></a>00071 <span class="comment">/****************************************************************************</span> <a name="l00072"></a>00072 <span class="comment"> *</span> <a name="l00073"></a>00073 <span class="comment"> * Local Includes</span> <a name="l00074"></a>00074 <span class="comment"> *</span> <a name="l00075"></a>00075 <span class="comment"> ****************************************************************************/</span> <a name="l00076"></a>00076 <a name="l00077"></a>00077 <a name="l00078"></a>00078 <a name="l00079"></a>00079 <span class="comment">/****************************************************************************</span> <a name="l00080"></a>00080 <span class="comment"> *</span> <a name="l00081"></a>00081 <span class="comment"> * Forward declarations</span> <a name="l00082"></a>00082 <span class="comment"> *</span> <a name="l00083"></a>00083 <span class="comment"> ****************************************************************************/</span> <a name="l00084"></a>00084 <a name="l00085"></a>00085 <a name="l00086"></a>00086 <a name="l00087"></a>00087 <span class="comment">/****************************************************************************</span> <a name="l00088"></a>00088 <span class="comment"> *</span> <a name="l00089"></a>00089 <span class="comment"> * Namespace</span> <a name="l00090"></a>00090 <span class="comment"> *</span> <a name="l00091"></a>00091 <span class="comment"> ****************************************************************************/</span> <a name="l00092"></a>00092 <a name="l00093"></a>00093 <span class="keyword">namespace </span>EchoLink <a name="l00094"></a>00094 { <a name="l00095"></a>00095 <a name="l00096"></a>00096 <span class="comment">/****************************************************************************</span> <a name="l00097"></a>00097 <span class="comment"> *</span> <a name="l00098"></a>00098 <span class="comment"> * Forward declarations inside the declared namespace</span> <a name="l00099"></a>00099 <span class="comment"> *</span> <a name="l00100"></a>00100 <span class="comment"> ****************************************************************************/</span> <a name="l00101"></a>00101 <a name="l00102"></a>00102 <a name="l00103"></a>00103 <a name="l00104"></a>00104 <span class="comment">/****************************************************************************</span> <a name="l00105"></a>00105 <span class="comment"> *</span> <a name="l00106"></a>00106 <span class="comment"> * Defines & typedefs</span> <a name="l00107"></a>00107 <span class="comment"> *</span> <a name="l00108"></a>00108 <span class="comment"> ****************************************************************************/</span> <a name="l00109"></a>00109 <a name="l00110"></a>00110 <a name="l00111"></a>00111 <a name="l00112"></a>00112 <span class="comment">/****************************************************************************</span> <a name="l00113"></a>00113 <span class="comment"> *</span> <a name="l00114"></a>00114 <span class="comment"> * Exported Global Variables</span> <a name="l00115"></a>00115 <span class="comment"> *</span> <a name="l00116"></a>00116 <span class="comment"> ****************************************************************************/</span> <a name="l00117"></a>00117 <a name="l00118"></a>00118 <a name="l00119"></a>00119 <a name="l00120"></a>00120 <span class="comment">/****************************************************************************</span> <a name="l00121"></a>00121 <span class="comment"> *</span> <a name="l00122"></a>00122 <span class="comment"> * Class definitions</span> <a name="l00123"></a>00123 <span class="comment"> *</span> <a name="l00124"></a>00124 <span class="comment"> ****************************************************************************/</span> <a name="l00125"></a>00125 <a name="l00145"></a><a class="code" href="classEchoLink_1_1Qso.html">00145</a> <span class="keyword">class </span><a class="code" href="classEchoLink_1_1Qso.html" title="A class for creating an EchoLink connection.">Qso</a> <a name="l00146"></a>00146 : <span class="keyword">public</span> SigC::Object, <span class="keyword">public</span> Async::AudioSink, <span class="keyword">public</span> Async::AudioSource <a name="l00147"></a>00147 { <a name="l00148"></a>00148 <span class="keyword">public</span>: <a name="l00149"></a><a class="code" href="classEchoLink_1_1Qso_1_1GsmVoicePacket.html">00149</a> <span class="keyword">class </span><a class="code" href="classEchoLink_1_1Qso_1_1GsmVoicePacket.html">GsmVoicePacket</a> <a name="l00150"></a>00150 { <a name="l00151"></a>00151 <span class="keyword">public</span>: <a name="l00152"></a><a class="code" href="classEchoLink_1_1Qso_1_1GsmVoicePacket.html#a6def1cb8f5faf0e1d9d4c878bf220503">00152</a> uint8_t <a class="code" href="classEchoLink_1_1Qso_1_1GsmVoicePacket.html#a6def1cb8f5faf0e1d9d4c878bf220503">version</a>; <a name="l00153"></a><a class="code" href="classEchoLink_1_1Qso_1_1GsmVoicePacket.html#a62156e4ad6c969ac6b40cd910214d19e">00153</a> uint8_t <a class="code" href="classEchoLink_1_1Qso_1_1GsmVoicePacket.html#a62156e4ad6c969ac6b40cd910214d19e">pt</a>; <a name="l00154"></a><a class="code" href="classEchoLink_1_1Qso_1_1GsmVoicePacket.html#acc3a184b094e67e8792786792958424c">00154</a> uint16_t <a class="code" href="classEchoLink_1_1Qso_1_1GsmVoicePacket.html#acc3a184b094e67e8792786792958424c">seqNum</a>; <a name="l00155"></a><a class="code" href="classEchoLink_1_1Qso_1_1GsmVoicePacket.html#af36efdb5249ccfd9cfd8ba25e18580a8">00155</a> uint32_t <a class="code" href="classEchoLink_1_1Qso_1_1GsmVoicePacket.html#af36efdb5249ccfd9cfd8ba25e18580a8">time</a>; <a name="l00156"></a><a class="code" href="classEchoLink_1_1Qso_1_1GsmVoicePacket.html#ab349ab8d98b5d171449b1338e73358b2">00156</a> uint32_t <a class="code" href="classEchoLink_1_1Qso_1_1GsmVoicePacket.html#ab349ab8d98b5d171449b1338e73358b2">ssrc</a>; <a name="l00157"></a><a class="code" href="classEchoLink_1_1Qso_1_1GsmVoicePacket.html#aa71383c2bb65d4823066eb9b244b60b7">00157</a> uint8_t <a class="code" href="classEchoLink_1_1Qso_1_1GsmVoicePacket.html#aa71383c2bb65d4823066eb9b244b60b7">data</a>[33*4]; <a name="l00158"></a>00158 } __attribute__ ((<a class="code" href="classEchoLink_1_1Qso.html#ab9d67dad41bcfa624f66cc0121e357fc">packed</a>)); <a name="l00159"></a>00159 <a name="l00163"></a><a class="code" href="classEchoLink_1_1Qso.html#af23753f0f8487728b975b18dc4da26b2">00163</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> <a name="l00164"></a>00164 { <a name="l00165"></a><a class="code" href="classEchoLink_1_1Qso.html#af23753f0f8487728b975b18dc4da26b2a2b2bb73fb446db8348c4fa664a567706">00165</a> <a class="code" href="classEchoLink_1_1Qso.html#af23753f0f8487728b975b18dc4da26b2a2b2bb73fb446db8348c4fa664a567706" title="No connection to the remote station.">STATE_DISCONNECTED</a>, <a name="l00166"></a><a class="code" href="classEchoLink_1_1Qso.html#af23753f0f8487728b975b18dc4da26b2ace37dbb81de4e77abd6b766cd87660d0">00166</a> <a class="code" href="classEchoLink_1_1Qso.html#af23753f0f8487728b975b18dc4da26b2ace37dbb81de4e77abd6b766cd87660d0" title="Connecting to remote station (not established).">STATE_CONNECTING</a>, <a name="l00167"></a><a class="code" href="classEchoLink_1_1Qso.html#af23753f0f8487728b975b18dc4da26b2a3644e0a33d6e3e5ea0a1c3d76c5a2132">00167</a> <a class="code" href="classEchoLink_1_1Qso.html#af23753f0f8487728b975b18dc4da26b2a3644e0a33d6e3e5ea0a1c3d76c5a2132" title="Received a disconnect request from remote station.">STATE_BYE_RECEIVED</a>, <a name="l00168"></a><a class="code" href="classEchoLink_1_1Qso.html#af23753f0f8487728b975b18dc4da26b2ada85947853d658b985a274d4bcee8cf2">00168</a> <a class="code" href="classEchoLink_1_1Qso.html#af23753f0f8487728b975b18dc4da26b2ada85947853d658b985a274d4bcee8cf2" title="Connected to remote station.">STATE_CONNECTED</a> <a name="l00169"></a>00169 } <a class="code" href="classEchoLink_1_1Qso.html#af23753f0f8487728b975b18dc4da26b2" title="The type of the connection state.">State</a>; <a name="l00170"></a>00170 <a name="l00178"></a>00178 <a class="code" href="classEchoLink_1_1Qso.html#ad1d126b749a731a2a27788e912ea6320" title="Constructor.">Qso</a>(<span class="keyword">const</span> Async::IpAddress& ip, <span class="keyword">const</span> std::string& callsign=<span class="stringliteral">""</span>, <a name="l00179"></a>00179 <span class="keyword">const</span> std::string& name=<span class="stringliteral">""</span>, <span class="keyword">const</span> std::string& info=<span class="stringliteral">""</span>); <a name="l00180"></a>00180 <a name="l00184"></a>00184 <a class="code" href="classEchoLink_1_1Qso.html#a686b63d867729819b4edade99c1afc95" title="Destructor.">~Qso</a>(<span class="keywordtype">void</span>); <a name="l00185"></a>00185 <a name="l00194"></a><a class="code" href="classEchoLink_1_1Qso.html#ad2973518786fa3b0dc1ac27c02f768dc">00194</a> <span class="keywordtype">bool</span> <a class="code" href="classEchoLink_1_1Qso.html#ad2973518786fa3b0dc1ac27c02f768dc" title="Check that the initialization went ok.">initOk</a>(<span class="keywordtype">void</span>) { <span class="keywordflow">return</span> init_ok; } <a name="l00195"></a>00195 <a name="l00201"></a>00201 <span class="keywordtype">bool</span> <a class="code" href="classEchoLink_1_1Qso.html#ad863b45beee7971efce2891e88299a73" title="Set the local callsign.">setLocalCallsign</a>(<span class="keyword">const</span> std::string& callsign); <a name="l00202"></a>00202 <a name="l00207"></a><a class="code" href="classEchoLink_1_1Qso.html#a1dc54e8cb88776397f86f23648585166">00207</a> <span class="keyword">const</span> std::string& <a class="code" href="classEchoLink_1_1Qso.html#a1dc54e8cb88776397f86f23648585166" title="Retrieve the local callsign.">localCallsign</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> callsign; } <a name="l00208"></a>00208 <a name="l00214"></a>00214 <span class="keywordtype">bool</span> <a class="code" href="classEchoLink_1_1Qso.html#ad0965204ebdfe109f3ad90ec6c36537c" title="Set the local name (name of station operator).">setLocalName</a>(<span class="keyword">const</span> std::string& name); <a name="l00215"></a>00215 <a name="l00220"></a><a class="code" href="classEchoLink_1_1Qso.html#ac3b9bbd2e3000a87cbdc69a967d2fe50">00220</a> <span class="keyword">const</span> std::string& <a class="code" href="classEchoLink_1_1Qso.html#ac3b9bbd2e3000a87cbdc69a967d2fe50" title="Retrieve the local name.">localName</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> name; } <a name="l00221"></a>00221 <a name="l00227"></a>00227 <span class="keywordtype">void</span> <a class="code" href="classEchoLink_1_1Qso.html#a83c45a48c6eb5a1a86fd08a272d12034" title="Set the local info.">setLocalInfo</a>(<span class="keyword">const</span> std::string& info); <a name="l00228"></a>00228 <a name="l00233"></a><a class="code" href="classEchoLink_1_1Qso.html#a1bad13b2b789d07949ef47fb1c818b10">00233</a> <span class="keyword">const</span> std::string& <a class="code" href="classEchoLink_1_1Qso.html#a1bad13b2b789d07949ef47fb1c818b10" title="Retrieve the local station info.">localInfo</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> local_stn_info; } <a name="l00234"></a>00234 <a name="l00247"></a>00247 <span class="keywordtype">bool</span> <a class="code" href="classEchoLink_1_1Qso.html#af8a6ac8d0ffed85e39c10018a937db1a" title="Initiate a connection to the remote station.">connect</a>(<span class="keywordtype">void</span>); <a name="l00248"></a>00248 <a name="l00266"></a>00266 <span class="keywordtype">bool</span> <a class="code" href="classEchoLink_1_1Qso.html#a1aad7dada5631dc8cd98ed6d88b62769" title="Accept an incoming connection.">accept</a>(<span class="keywordtype">void</span>); <a name="l00267"></a>00267 <a name="l00273"></a>00273 <span class="keywordtype">bool</span> <a class="code" href="classEchoLink_1_1Qso.html#a327f18e881b2266e378bd479d15efd58" title="Initiate a disconnection from the remote station.">disconnect</a>(<span class="keywordtype">void</span>); <a name="l00274"></a>00274 <a name="l00280"></a>00280 <span class="keywordtype">bool</span> <a class="code" href="classEchoLink_1_1Qso.html#ac8b030640008b4d9eba05dfc70cef15e" title="Send info data to the remote station.">sendInfoData</a>(<span class="keyword">const</span> std::string& info=<span class="stringliteral">""</span>); <a name="l00281"></a>00281 <a name="l00287"></a>00287 <span class="keywordtype">bool</span> <a class="code" href="classEchoLink_1_1Qso.html#a41a93e17222e9cb5f00132296707ff60" title="Send chat data to the remote station.">sendChatData</a>(<span class="keyword">const</span> std::string& msg); <a name="l00288"></a>00288 <a name="l00293"></a><a class="code" href="classEchoLink_1_1Qso.html#a330a3747f8b46dcc86e155d312520be4">00293</a> <span class="keyword">const</span> Async::IpAddress& <a class="code" href="classEchoLink_1_1Qso.html#a330a3747f8b46dcc86e155d312520be4" title="Get the IP address of the remote station.">remoteIp</a>(<span class="keywordtype">void</span>)<span class="keyword"> const</span> <a name="l00294"></a>00294 <span class="keyword"> </span>{ <a name="l00295"></a>00295 <span class="keywordflow">return</span> remote_ip; <a name="l00296"></a>00296 } <a name="l00297"></a>00297 <a name="l00306"></a>00306 <span class="keywordtype">bool</span> <a class="code" href="classEchoLink_1_1Qso.html#a1a31a877c33a34c5eddf534c0cac43cb" title="Send a raw GSM audio packet to the remote station.">sendAudioRaw</a>(GsmVoicePacket *packet); <a name="l00307"></a>00307 <a name="l00312"></a><a class="code" href="classEchoLink_1_1Qso.html#acbf28297e322425b39e71c8d5902afe1">00312</a> <span class="keywordtype">void</span> <a class="code" href="classEchoLink_1_1Qso.html#acbf28297e322425b39e71c8d5902afe1" title="Set the name of the remote station.">setRemoteName</a>(<span class="keyword">const</span> std::string& name) { remote_name = name; } <a name="l00313"></a>00313 <a name="l00319"></a><a class="code" href="classEchoLink_1_1Qso.html#a7ee6033cb5c05107feaa14d607ec1018">00319</a> <span class="keyword">const</span> std::string& <a class="code" href="classEchoLink_1_1Qso.html#a7ee6033cb5c05107feaa14d607ec1018" title="Get the remote name.">remoteName</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> remote_name; } <a name="l00320"></a>00320 <a name="l00325"></a><a class="code" href="classEchoLink_1_1Qso.html#aeb0f5c52e05895a3f99f555106365745">00325</a> <span class="keywordtype">void</span> <a class="code" href="classEchoLink_1_1Qso.html#aeb0f5c52e05895a3f99f555106365745" title="Set the callsign of the remote station.">setRemoteCallsign</a>(<span class="keyword">const</span> std::string& call) { remote_call = call; } <a name="l00326"></a>00326 <a name="l00332"></a><a class="code" href="classEchoLink_1_1Qso.html#a2cc09ae45adeaa9d3bca8fb4193e1156">00332</a> <span class="keyword">const</span> std::string& <a class="code" href="classEchoLink_1_1Qso.html#a2cc09ae45adeaa9d3bca8fb4193e1156" title="Get the remote callsign.">remoteCallsign</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> remote_call; } <a name="l00333"></a>00333 <a name="l00341"></a><a class="code" href="classEchoLink_1_1Qso.html#a86783e5d9d401fccd6cd6b68a52ab341">00341</a> <span class="keywordtype">bool</span> <a class="code" href="classEchoLink_1_1Qso.html#a86783e5d9d401fccd6cd6b68a52ab341" title="Find out if the connection is remotely initiated or locally initiated.">isRemoteInitiated</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> is_remote_initiated; } <a name="l00342"></a>00342 <a name="l00348"></a><a class="code" href="classEchoLink_1_1Qso.html#a9045b66b82d573e8ab86a604ba802e23">00348</a> <span class="keywordtype">bool</span> <a class="code" href="classEchoLink_1_1Qso.html#a9045b66b82d573e8ab86a604ba802e23" title="Find out if there is audio coming in on this connection.">receivingAudio</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> receiving_audio; } <a name="l00349"></a>00349 <a name="l00354"></a><a class="code" href="classEchoLink_1_1Qso.html#af5dda85e8e9218c3466753898ed2278f">00354</a> <a class="code" href="classEchoLink_1_1Qso.html#af23753f0f8487728b975b18dc4da26b2" title="The type of the connection state.">State</a> <a class="code" href="classEchoLink_1_1Qso.html#af5dda85e8e9218c3466753898ed2278f" title="Get the current state of the connection.">currentState</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> state; } <a name="l00355"></a>00355 <a name="l00360"></a><a class="code" href="classEchoLink_1_1Qso.html#ab9172127abc03b8ce862b27f4e2f68a8">00360</a> SigC::Signal1<void, const std::string&> <a class="code" href="classEchoLink_1_1Qso.html#ab9172127abc03b8ce862b27f4e2f68a8" title="A signal that is emitted when a station info message is received.">infoMsgReceived</a>; <a name="l00361"></a>00361 <a name="l00366"></a><a class="code" href="classEchoLink_1_1Qso.html#a5b689f6dd34a810590bd34c312c27246">00366</a> SigC::Signal1<void, const std::string&> <a class="code" href="classEchoLink_1_1Qso.html#a5b689f6dd34a810590bd34c312c27246" title="A signal that is emitted when a chat message is received.">chatMsgReceived</a>; <a name="l00367"></a>00367 <a name="l00372"></a><a class="code" href="classEchoLink_1_1Qso.html#a85bf86e82f6a9d5b10efbc0a1e954be5">00372</a> SigC::Signal1<void, State> <a class="code" href="classEchoLink_1_1Qso.html#a85bf86e82f6a9d5b10efbc0a1e954be5" title="A signal that is emitted when the connection state changes.">stateChange</a>; <a name="l00373"></a>00373 <a name="l00380"></a><a class="code" href="classEchoLink_1_1Qso.html#af38aaa8840ef44e72c1aa4930de5e545">00380</a> SigC::Signal1<void, bool> <a class="code" href="classEchoLink_1_1Qso.html#af38aaa8840ef44e72c1aa4930de5e545" title="A signal that is emitted when the audio receive state changes.">isReceiving</a>; <a name="l00381"></a>00381 <a name="l00391"></a><a class="code" href="classEchoLink_1_1Qso.html#ae5099a2be41885fcdf163b40d5ce2f2a">00391</a> SigC::Signal1<void, GsmVoicePacket*> <a class="code" href="classEchoLink_1_1Qso.html#ae5099a2be41885fcdf163b40d5ce2f2a" title="A signal that is emitted when an audio datagram has been received.">audioReceivedRaw</a>; <a name="l00392"></a>00392 <a name="l00393"></a>00393 <a name="l00405"></a>00405 <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="classEchoLink_1_1Qso.html#a92c4bc2191f2f644cae82a290feb511d" title="Write samples into this audio sink.">writeSamples</a>(<span class="keyword">const</span> <span class="keywordtype">float</span> *samples, <span class="keywordtype">int</span> count); <a name="l00406"></a>00406 <a name="l00415"></a>00415 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classEchoLink_1_1Qso.html#aa400993b95ade83b52bc8d52c6a1d1fa" title="Tell the sink to flush the previously written samples.">flushSamples</a>(<span class="keywordtype">void</span>); <a name="l00416"></a>00416 <a name="l00424"></a>00424 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classEchoLink_1_1Qso.html#a3eda10132182056a5a37a7c3a010fc0e" title="Resume audio output to the sink.">resumeOutput</a>(<span class="keywordtype">void</span>); <a name="l00425"></a>00425 <a name="l00426"></a>00426 <a name="l00427"></a>00427 <span class="keyword">protected</span>: <a name="l00436"></a>00436 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classEchoLink_1_1Qso.html#afc8a0a6e5712e6e1eaae3822a5e943c3" title="The registered sink has flushed all samples.">allSamplesFlushed</a>(<span class="keywordtype">void</span>); <a name="l00437"></a>00437 <a name="l00438"></a>00438 <a name="l00439"></a>00439 <span class="keyword">private</span>: <a name="l00440"></a>00440 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> KEEP_ALIVE_TIME = 10000; <a name="l00441"></a>00441 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> MAX_CONNECT_RETRY_CNT = 5; <a name="l00442"></a>00442 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> CON_TIMEOUT_TIME = 50000; <a name="l00443"></a>00443 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> RX_INDICATOR_HANG_TIME = 200; <a name="l00444"></a>00444 <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> SEND_BUFFER_SIZE = 4*160; <span class="comment">// Four 20ms GSM frames</span> <a name="l00445"></a>00445 <a name="l00446"></a>00446 <span class="keywordtype">bool</span> init_ok; <a name="l00447"></a>00447 <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> sdes_packet[1500]; <a name="l00448"></a>00448 <span class="keywordtype">int</span> sdes_length; <a name="l00449"></a>00449 <a class="code" href="classEchoLink_1_1Qso.html#af23753f0f8487728b975b18dc4da26b2" title="The type of the connection state.">State</a> state; <a name="l00450"></a>00450 gsm gsmh; <a name="l00451"></a>00451 uint16_t next_audio_seq; <a name="l00452"></a>00452 Async::Timer * keep_alive_timer; <a name="l00453"></a>00453 <span class="keywordtype">int</span> connect_retry_cnt; <a name="l00454"></a>00454 Async::Timer * con_timeout_timer; <a name="l00455"></a>00455 std::string callsign; <a name="l00456"></a>00456 std::string name; <a name="l00457"></a>00457 std::string local_stn_info; <a name="l00458"></a>00458 gsm_signal send_buffer[SEND_BUFFER_SIZE]; <a name="l00459"></a>00459 <span class="keywordtype">int</span> send_buffer_cnt; <a name="l00460"></a>00460 Async::IpAddress remote_ip; <a name="l00461"></a>00461 Async::Timer * rx_indicator_timer; <a name="l00462"></a>00462 <span class="keyword">struct </span>timeval last_audio_packet_received; <a name="l00463"></a>00463 std::string remote_name; <a name="l00464"></a>00464 std::string remote_call; <a name="l00465"></a>00465 <span class="keywordtype">bool</span> is_remote_initiated; <a name="l00466"></a>00466 <span class="keywordtype">bool</span> receiving_audio; <a name="l00467"></a>00467 <a name="l00468"></a>00468 <a class="code" href="classEchoLink_1_1Qso.html#ad1d126b749a731a2a27788e912ea6320" title="Constructor.">Qso</a>(<span class="keyword">const</span> <a class="code" href="classEchoLink_1_1Qso.html" title="A class for creating an EchoLink connection.">Qso</a>&); <a name="l00469"></a>00469 <a class="code" href="classEchoLink_1_1Qso.html" title="A class for creating an EchoLink connection.">Qso</a>& operator=(<span class="keyword">const</span> <a class="code" href="classEchoLink_1_1Qso.html" title="A class for creating an EchoLink connection.">Qso</a>&); <a name="l00470"></a>00470 <span class="keywordtype">void</span> printData(<span class="keyword">const</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *buf, <span class="keywordtype">int</span> len); <a name="l00471"></a>00471 <span class="keywordtype">void</span> handleCtrlInput(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *buf, <span class="keywordtype">int</span> len); <a name="l00472"></a>00472 <span class="keyword">inline</span> <span class="keywordtype">void</span> handleByePacket(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *buf, <span class="keywordtype">int</span> len); <a name="l00473"></a>00473 <span class="keyword">inline</span> <span class="keywordtype">void</span> handleSdesPacket(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *buf, <span class="keywordtype">int</span> len); <a name="l00474"></a>00474 <span class="keywordtype">void</span> handleAudioInput(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *buf, <span class="keywordtype">int</span> len); <a name="l00475"></a>00475 <span class="keyword">inline</span> <span class="keywordtype">void</span> handleNonAudioPacket(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *buf, <span class="keywordtype">int</span> len); <a name="l00476"></a>00476 <span class="keyword">inline</span> <span class="keywordtype">void</span> handleAudioPacket(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> *buf, <span class="keywordtype">int</span> len); <a name="l00477"></a>00477 <span class="keywordtype">void</span> micAudioRead(<span class="keywordtype">void</span> *buf, <span class="keywordtype">size_t</span> len); <a name="l00478"></a>00478 <span class="keywordtype">bool</span> sendSdesPacket(<span class="keywordtype">void</span>); <a name="l00479"></a>00479 <span class="keywordtype">void</span> sendKeepAlive(Async::Timer *timer); <a name="l00480"></a>00480 <span class="keywordtype">void</span> setState(<a class="code" href="classEchoLink_1_1Qso.html#af23753f0f8487728b975b18dc4da26b2" title="The type of the connection state.">State</a> state); <a name="l00481"></a>00481 <span class="keywordtype">void</span> connectionTimeout(Async::Timer *timer); <a name="l00482"></a>00482 <span class="keywordtype">bool</span> setupConnection(<span class="keywordtype">void</span>); <a name="l00483"></a>00483 <span class="keywordtype">void</span> cleanupConnection(<span class="keywordtype">void</span>); <a name="l00484"></a>00484 <span class="keywordtype">bool</span> sendGsmPacket(<span class="keywordtype">void</span>); <a name="l00485"></a>00485 <span class="keywordtype">void</span> checkRxActivity(Async::Timer *timer); <a name="l00486"></a>00486 <span class="keywordtype">bool</span> sendByePacket(<span class="keywordtype">void</span>); <a name="l00487"></a>00487 <a name="l00488"></a>00488 <a name="l00489"></a>00489 }; <span class="comment">/* class Qso */</span> <a name="l00490"></a>00490 <a name="l00491"></a>00491 <a name="l00492"></a>00492 } <span class="comment">/* namespace */</span> <a name="l00493"></a>00493 <a name="l00494"></a>00494 <span class="preprocessor">#endif </span><span class="comment">/* ECHOLINK_QSO_INCLUDED */</span> <a name="l00495"></a>00495 <a name="l00496"></a>00496 <a name="l00497"></a>00497 <a name="l00498"></a>00498 <span class="comment">/*</span> <a name="l00499"></a>00499 <span class="comment"> * This file has not been truncated</span> <a name="l00500"></a>00500 <span class="comment"> */</span> <a name="l00501"></a>00501 </pre></div></div> <hr class="footer"/><address style="text-align: right;"><small>Generated by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.2-20100208 </small></address> </body> </html>