Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/panconnection_8h-source.html
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/panconnection_8h-source.html Fri Jan 22 18:26:19 2010 +0000
@@ -0,0 +1,163 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
+<title>TB10.1 Example Applications: examples/Bluetooth/BTExample1/inc/panconnection.h Source File</title>
+<link href="doxygen.css" rel="stylesheet" type="text/css">
+<link href="tabs.css" rel="stylesheet" type="text/css">
+</head><body>
+<!-- Generated by Doxygen 1.5.3 -->
+<h1>examples/Bluetooth/BTExample1/inc/panconnection.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).</span>
+<a name="l00002"></a>00002 <span class="comment">// All rights reserved.</span>
+<a name="l00003"></a>00003 <span class="comment">// This component and the accompanying materials are made available</span>
+<a name="l00004"></a>00004 <span class="comment">// under the terms of "Eclipse Public License v1.0"</span>
+<a name="l00005"></a>00005 <span class="comment">// which accompanies this distribution, and is available</span>
+<a name="l00006"></a>00006 <span class="comment">// at the URL "http://www.eclipse.org/legal/epl-v10.html".</span>
+<a name="l00007"></a>00007 <span class="comment">//</span>
+<a name="l00008"></a>00008 <span class="comment">// Initial Contributors:</span>
+<a name="l00009"></a>00009 <span class="comment">// Nokia Corporation - initial contribution.</span>
+<a name="l00010"></a>00010 <span class="comment">//</span>
+<a name="l00011"></a>00011 <span class="comment">// Contributors:</span>
+<a name="l00012"></a>00012 <span class="comment">//</span>
+<a name="l00013"></a>00013 <span class="comment">// Description:</span>
+<a name="l00014"></a>00014 <span class="comment">//</span>
+<a name="l00015"></a>00015
+<a name="l00016"></a>00016 <span class="preprocessor">#ifndef PANCONNECTION_H</span>
+<a name="l00017"></a>00017 <span class="preprocessor"></span><span class="preprocessor">#define PANCONNECTION_H</span>
+<a name="l00018"></a>00018 <span class="preprocessor"></span>
+<a name="l00019"></a>00019
+<a name="l00020"></a>00020 <span class="preprocessor">#include <e32base.h></span>
+<a name="l00021"></a>00021 <span class="preprocessor">#include <e32cons.h></span>
+<a name="l00022"></a>00022 <span class="preprocessor">#include <bt_sock.h></span>
+<a name="l00023"></a>00023 <span class="preprocessor">#include <es_sock.h></span>
+<a name="l00024"></a>00024 <span class="preprocessor">#include <in_sock.h></span>
+<a name="l00025"></a>00025 <span class="preprocessor">#include <btsdp.h></span>
+<a name="l00026"></a>00026
+<a name="l00027"></a>00027 <span class="comment">// Enum for determining which side we want to change role on</span>
+<a name="l00028"></a>00028 <span class="keyword">enum</span> TSide
+<a name="l00029"></a>00029 {
+<a name="l00030"></a>00030 ELocalRole,
+<a name="l00031"></a>00031 EPeerRole
+<a name="l00032"></a>00032 };
+<a name="l00033"></a>00033
+<a name="l00034"></a>00034 <span class="comment">// SDP constants</span>
+<a name="l00035"></a>00035
+<a name="l00036"></a>00036 <span class="keyword">const</span> TInt KIpUUID = 0x0009; <span class="comment">// IP UUID for SDP</span>
+<a name="l00037"></a>00037 <span class="keyword">const</span> TInt KTcpUUID = 0x0004;<span class="comment">// TCP UUID for SDP </span>
+<a name="l00038"></a>00038
+<a name="l00039"></a>00039 <span class="comment">/* Attribute ID for service description is calculated from the sum of offset and language base */</span>
+<a name="l00040"></a>00040 <span class="keyword">static</span> <span class="keyword">const</span> TSdpAttributeID KSdpAttrIdServiceDescription
+<a name="l00041"></a>00041 = KSdpAttrIdBasePrimaryLanguage + KSdpAttrIdOffsetServiceDescription;
+<a name="l00042"></a>00042 <span class="comment">/* Attribute ID for service description is calculated from the sum of offset and language base */</span>
+<a name="l00043"></a>00043 <span class="keyword">static</span> <span class="keyword">const</span> TSdpAttributeID KSdpAttrIdServiceName
+<a name="l00044"></a>00044 = KSdpAttrIdBasePrimaryLanguage + KSdpAttrIdOffsetServiceName;
+<a name="l00045"></a>00045
+<a name="l00046"></a>00046 _LIT(KServiceName, <span class="stringliteral">"PAN Profile Engine"</span>);
+<a name="l00047"></a>00047 _LIT(KServiceDescription, <span class="stringliteral">"This device is ready to use PAN profile"</span>);
+<a name="l00048"></a>00048
+<a name="l00056"></a><a class="code" href="class_c_pan_connections.html">00056</a> <span class="keyword">class </span><a class="code" href="class_c_pan_connections.html">CPanConnections</a> : <span class="keyword">public</span> CActive
+<a name="l00057"></a>00057 {
+<a name="l00058"></a>00058 <span class="keyword">public</span>:
+<a name="l00059"></a>00059 <span class="keyword">static</span> <a class="code" href="class_c_pan_connections.html">CPanConnections</a>* <a class="code" href="class_c_pan_connections.html#b3d65eba7c9b59bc2bf952a7e881a626">NewL</a>(CConsoleBase & aConsole);
+<a name="l00060"></a>00060
+<a name="l00061"></a>00061 <a class="code" href="class_c_pan_connections.html#6f1e2360d9b792b4eb67233dd0757d41">~CPanConnections</a>();
+<a name="l00062"></a>00062 <span class="keywordtype">void</span> <a class="code" href="class_c_pan_connections.html#38e615144ac8636db223dfab4d84dedb">CancelRecvFrom</a>();
+<a name="l00063"></a>00063 TInt <a class="code" href="class_c_pan_connections.html#34c21dab326042522928cc4796c92df2">StartConnection</a>(TBTDevAddr* aDevAddr, TBool aUsePANNotifier, TBool aUseTcpTransport);
+<a name="l00064"></a>00064 TInt <a class="code" href="class_c_pan_connections.html#6ca7760ec4140c02725dc8a29c061ba9">StopConnection</a>();
+<a name="l00065"></a>00065 TInt <a class="code" href="class_c_pan_connections.html#0eec65826c0323a9ab6e85b0739bbc44">SetActivePanConn</a>(TUint aConnIndex);
+<a name="l00066"></a>00066 <span class="keywordtype">void</span> <a class="code" href="class_c_pan_connections.html#c3da88ca7fc0fb64434fd84f81cddc98">SetLocalIpAddrL</a>(TUint32 aAddr);
+<a name="l00067"></a>00067 <span class="keywordtype">void</span> <a class="code" href="class_c_pan_connections.html#46d8bac828d453473cec94a8602468ac">SetFixedRoleL</a>(TSide aSide, TUint aRole);
+<a name="l00068"></a>00068 <span class="keywordtype">void</span> <a class="code" href="class_c_pan_connections.html#0ce9d37dc00e0572bb5c7f0b5befa07b">PrintConns</a>();
+<a name="l00069"></a>00069 TInt <a class="code" href="class_c_pan_connections.html#0cab5de7e4afe736c2469735640ec1ba">TcpIpBindAndListen</a>();
+<a name="l00070"></a>00070 TInt <a class="code" href="class_c_pan_connections.html#acbdae817598b72658b6b93833ee0975">TcpIpBindAndConnect</a>();
+<a name="l00071"></a>00071 <span class="keywordtype">void</span> <a class="code" href="class_c_pan_connections.html#514cfbe2ba7d674954dbc60c85ab7018">ListenDoCancel</a>();
+<a name="l00072"></a>00072 <span class="keywordtype">void</span> <a class="code" href="class_c_pan_connections.html#070d37e1361be12f2dc44fee0653597b">ConnectDoCancel</a>();
+<a name="l00073"></a>00073 TInt <a class="code" href="class_c_pan_connections.html#1c722de1ae920eb3160284c18c6bed99">CloseTcpIpSocketConnect</a>();
+<a name="l00074"></a>00074 TUint32 <a class="code" href="class_c_pan_connections.html#1f0cd7f4bcfd821937b31c7daaf9af62">GetRemoteIpAddr</a>() <span class="keyword">const</span>;
+<a name="l00075"></a>00075 <span class="keywordtype">void</span> <a class="code" href="class_c_pan_connections.html#99afb06bc3e1614ec86be77da414e054">SetRemoteIpAddr</a>(TUint32 aAddr);
+<a name="l00076"></a>00076 TInt <a class="code" href="class_c_pan_connections.html#2487d17afe967008336124ab48a744ff">AcceptNewSocket</a>();
+<a name="l00077"></a>00077 <span class="keywordtype">void</span> <a class="code" href="class_c_pan_connections.html#f50cb29f97f35de684d03bf5211671f2">PrintTcpSocketConnections</a>();
+<a name="l00078"></a>00078 TInt <a class="code" href="class_c_pan_connections.html#f113f2b06e495b97ab788e3f0030b617">GetLocalRole</a>() <span class="keyword">const</span>;
+<a name="l00079"></a>00079 <span class="keywordtype">void</span> <a class="code" href="class_c_pan_connections.html#f442c51cea29f54570235995428a7bcb">CancelIap</a>();
+<a name="l00080"></a>00080 TInt <a class="code" href="class_c_pan_connections.html#526bf1de502ce10fcd0630e39aabc52e">StopIAP</a>();
+<a name="l00081"></a>00081 TInt <a class="code" href="class_c_pan_connections.html#36b2c2c4943f29420aa4ee6208e7c266">CloseAllTcpIpSockets</a>();
+<a name="l00082"></a>00082 TInt <a class="code" href="class_c_pan_connections.html#28a3b8b1bc3dcd590e6899e8ac08ce53">CloseCurrentTcpIpSocket</a>();
+<a name="l00083"></a>00083 TInt <a class="code" href="class_c_pan_connections.html#6c2066f03c9d53e73206cff1dae7aa5b">ActiveConnCount</a>();
+<a name="l00084"></a>00084 <span class="keywordtype">void</span> <a class="code" href="class_c_pan_connections.html#fe4f439df6bed9bce936292e6b87d098">CancelAllOperations</a>();
+<a name="l00085"></a>00085 TInt <a class="code" href="class_c_pan_connections.html#1f957a9c996254f7d243f3157497e3a8">UdpBind</a>();
+<a name="l00086"></a>00086 <span class="keywordtype">void</span> <a class="code" href="class_c_pan_connections.html#d3dc3627a7c944f0ffa82caa9f024166">RunL</a>();
+<a name="l00087"></a>00087 <span class="keywordtype">void</span> <a class="code" href="class_c_pan_connections.html#2451289abf1a401dc5d343afa4eeaf86">DoCancel</a>();
+<a name="l00088"></a>00088
+<a name="l00089"></a>00089 RArray<TInetAddr>& <a class="code" href="class_c_pan_connections.html#bb1b1dc6e61cc3a4860e5480b2bd6c37">RemoteNames</a>();
+<a name="l00090"></a>00090 RSocket& <a class="code" href="class_c_pan_connections.html#9d82cc28dec893b9513dfac3b3f047c0">GetSocket</a>();
+<a name="l00091"></a>00091 RArray<RSocket>& <a class="code" href="class_c_pan_connections.html#71cac88a9f4c5b7338f0a9124bf44926">GetSocketArray</a>();
+<a name="l00092"></a>00092
+<a name="l00093"></a>00093 <span class="keyword">private</span>:
+<a name="l00094"></a>00094 <a class="code" href="class_c_pan_connections.html">CPanConnections</a>(CConsoleBase & aConsole);
+<a name="l00095"></a>00095 <span class="keywordtype">void</span> SetTransportLayerProtocol(TUint aProtocol);
+<a name="l00096"></a>00096 <span class="keywordtype">void</span> IapStarted();
+<a name="l00097"></a>00097 <span class="keywordtype">void</span> TcpIpConnectionComplete();
+<a name="l00098"></a>00098 <span class="keywordtype">void</span> TcpIpListenComplete();
+<a name="l00099"></a>00099 TInt StartIAP();
+<a name="l00100"></a>00100 <span class="keywordtype">void</span> PrintIAPL();
+<a name="l00101"></a>00101 TInt UpdateCurrentConnections();
+<a name="l00102"></a>00102 TInt Initialise();
+<a name="l00103"></a>00103 TUint32 GetLocalIpAddr();
+<a name="l00104"></a>00104 <span class="keywordtype">void</span> ConfigureIAPL(TBool aIsListening, TBTDevAddr* aDevAddr, TBool aUsePANNotifier);
+<a name="l00105"></a>00105 <span class="keywordtype">void</span> RecvTcpIpPacket();
+<a name="l00106"></a>00106 <span class="keywordtype">void</span> RegisterSdpL();
+<a name="l00107"></a>00107 <span class="keywordtype">void</span> ReceiveRemoteName();
+<a name="l00108"></a>00108
+<a name="l00109"></a>00109 <span class="keyword">public</span>:
+<a name="l00110"></a><a class="code" href="class_c_pan_connections.html#418dc0f90e99ec9637d9c1831044af04">00110</a> TBool <a class="code" href="class_c_pan_connections.html#418dc0f90e99ec9637d9c1831044af04">iIapStarted</a>;
+<a name="l00111"></a><a class="code" href="class_c_pan_connections.html#16aec88b4b1dc3032457bb71b4534b5d">00111</a> TBool <a class="code" href="class_c_pan_connections.html#16aec88b4b1dc3032457bb71b4534b5d">iIapLoading</a>;
+<a name="l00112"></a><a class="code" href="class_c_pan_connections.html#08eeb95689dc6653b48bf55b9cd14381">00112</a> TBool <a class="code" href="class_c_pan_connections.html#08eeb95689dc6653b48bf55b9cd14381">iListening</a>;
+<a name="l00113"></a>00113
+<a name="l00114"></a>00114 <span class="keyword">private</span>:
+<a name="l00115"></a>00115 <span class="keyword">enum</span> TActiveMode
+<a name="l00116"></a>00116 {
+<a name="l00117"></a>00117 EIAPStart,
+<a name="l00118"></a>00118 ESocketAccept,
+<a name="l00119"></a>00119 ESocketConnect,
+<a name="l00120"></a>00120 EUdpReceive
+<a name="l00121"></a>00121 };
+<a name="l00122"></a>00122
+<a name="l00123"></a>00123 <span class="comment">// Used to select different IAPs from commdb</span>
+<a name="l00124"></a>00124 <span class="keyword">enum</span> PanProfileIAPs
+<a name="l00125"></a>00125 {
+<a name="l00126"></a>00126 EGeneralIAP = 1,
+<a name="l00127"></a>00127 EUnknownConnUnknownRolesListen,
+<a name="l00128"></a>00128 EUnknownConnUnknownRoles,
+<a name="l00129"></a>00129 EKnownConnUnknownRolesListen
+<a name="l00130"></a>00130 };
+<a name="l00131"></a>00131
+<a name="l00132"></a>00132 RSocket iSocket;
+<a name="l00133"></a>00133 RArray<RSocket> iSocketArray;
+<a name="l00134"></a>00134 TInt iActiveTcpSocket;
+<a name="l00135"></a>00135 TPckgBuf<TInt> iBuff;
+<a name="l00136"></a>00136 TInetAddr iSrcAddr;
+<a name="l00137"></a>00137 TInetAddr iDstAddr;
+<a name="l00138"></a>00138 TUint iLocalRole;
+<a name="l00139"></a>00139 TUint iPeerRole;
+<a name="l00140"></a>00140 TBool iUseTcpTransport;
+<a name="l00141"></a>00141 TActiveMode iActiveMode;
+<a name="l00142"></a>00142 TBTDevAddr iControlAddr;
+<a name="l00143"></a>00143 TInt iActivePanConn;
+<a name="l00144"></a>00144 RConnection iConnection;
+<a name="l00145"></a>00145 RSocketServ iSockSvr;
+<a name="l00146"></a>00146 CConsoleBase& iConsole;
+<a name="l00147"></a>00147 RBTDevAddrArray iActiveConnections;<span class="comment">// array of TBTDevAddrs on PAN</span>
+<a name="l00148"></a>00148 TUint32 iRemoteIpAddr;
+<a name="l00149"></a>00149 TUint32 iLocalIpAddr;
+<a name="l00150"></a>00150 RSdp iSdp;
+<a name="l00151"></a>00151 RSdpDatabase iSdpdb;
+<a name="l00152"></a>00152 TInetAddr iRemoteName;
+<a name="l00153"></a>00153 RArray<TInetAddr> iRemoteNames;
+<a name="l00154"></a>00154
+<a name="l00155"></a>00155 };
+<a name="l00156"></a>00156
+<a name="l00157"></a>00157
+<a name="l00158"></a>00158 <span class="preprocessor">#endif // PANCONNECTION_H</span>
+</pre></div><hr size="1"><address style="text-align: right;"><small>Generated on Thu Jan 21 10:32:57 2010 for TB10.1 Example Applications by
+<a href="http://www.doxygen.org/index.html">
+<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.3 </small></address>
+</body>
+</html>