Symbian3/Examples/guid-6013a680-57f9-415b-8851-c4fa63356636/btdiscoverer_8h_source.html
<!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>TB9.2 Example Applications: examples/ForumNokia/ThreadAndActiveObjectsEx/inc/btdiscoverer.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 -->
<h1>examples/ForumNokia/ThreadAndActiveObjectsEx/inc/btdiscoverer.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright © 2008 Nokia Corporation.</span>
<a name="l00003"></a>00003 <span class="comment"> */</span>
<a name="l00004"></a>00004
<a name="l00005"></a>00005
<a name="l00006"></a>00006 <span class="preprocessor">#ifndef __BT_DISCOVERER_H__</span>
<a name="l00007"></a>00007 <span class="preprocessor"></span><span class="preprocessor">#define __BT_DISCOVERER_H__</span>
<a name="l00008"></a>00008 <span class="preprocessor"></span>
<a name="l00009"></a>00009 <span class="comment">//INCLUDES</span>
<a name="l00010"></a>00010 <span class="preprocessor">#include <e32base.h></span>
<a name="l00011"></a>00011 <span class="preprocessor">#include <btsdp.h></span>
<a name="l00012"></a>00012 <span class="preprocessor">#include <e32std.h></span>
<a name="l00013"></a>00013 <span class="preprocessor">#include <btextnotifiers.h></span> <span class="comment">// TBTDeviceResponseParamsPckg</span>
<a name="l00014"></a>00014 <span class="preprocessor">#include <bt_sock.h></span>
<a name="l00015"></a>00015 <span class="preprocessor">#include <BTDevice.h></span>
<a name="l00016"></a>00016 <span class="preprocessor">#include <es_sock.h></span> <span class="comment">//RHostResolver</span>
<a name="l00017"></a>00017 <span class="preprocessor">#include <badesca.h></span>
<a name="l00018"></a>00018
<a name="l00019"></a>00019
<a name="l00020"></a>00020 <span class="keyword">const</span> TInt KBTDeviceLength = 40;
<a name="l00021"></a>00021 <span class="keyword">const</span> TInt KBTDeviceAddress = 40;
<a name="l00022"></a>00022
<a name="l00023"></a>00023 <span class="comment">// FORWARD DECLARATIONS</span>
<a name="l00024"></a>00024 <span class="keyword">class </span><a class="code" href="class_c_shared_intermediator.html">CSharedIntermediator</a>;
<a name="l00025"></a>00025
<a name="l00026"></a>00026 <span class="comment">// CLASS DECLARATION</span>
<a name="l00027"></a>00027
<a name="l00031"></a><a class="code" href="class_c_b_t_discoverer.html">00031</a> <span class="keyword">class </span><a class="code" href="class_c_b_t_discoverer.html">CBTDiscoverer</a>: <span class="keyword">public</span> CActive
<a name="l00032"></a>00032 {
<a name="l00033"></a>00033 <span class="keyword">public</span>:
<a name="l00034"></a>00034
<a name="l00042"></a>00042 <span class="keyword">static</span> <a class="code" href="class_c_b_t_discoverer.html">CBTDiscoverer</a>* <a class="code" href="class_c_b_t_discoverer.html#aeb9e85e706210e0cb6a570d6c02e38b1">NewL</a>(<a class="code" href="class_c_shared_intermediator.html">CSharedIntermediator</a>* aSMediator);
<a name="l00043"></a>00043
<a name="l00047"></a>00047 <span class="keyword">static</span> <a class="code" href="class_c_b_t_discoverer.html">CBTDiscoverer</a>* <a class="code" href="class_c_b_t_discoverer.html#a58071dd68fb5238804af2680639d0ede">NewLC</a>(<a class="code" href="class_c_shared_intermediator.html">CSharedIntermediator</a>* aSMediator);
<a name="l00048"></a>00048
<a name="l00054"></a>00054 <a class="code" href="class_c_b_t_discoverer.html#af86425f13d92e3ac8a57cc345dd29f0b">~CBTDiscoverer</a>();
<a name="l00055"></a>00055
<a name="l00056"></a>00056 <span class="comment">// From CActive</span>
<a name="l00057"></a>00057 <span class="keywordtype">void</span> RunL();
<a name="l00058"></a>00058 TInt RunError(TInt aError);
<a name="l00059"></a>00059 <span class="keywordtype">void</span> DoCancel();
<a name="l00060"></a>00060
<a name="l00066"></a>00066 <span class="keywordtype">void</span> <a class="code" href="class_c_b_t_discoverer.html#a883d57ae3cd27e92a2c90a5d304f38e6">StartDiscoveringDevicesL</a>();
<a name="l00067"></a>00067
<a name="l00073"></a>00073 <span class="keywordtype">void</span> <a class="code" href="class_c_b_t_discoverer.html#a025caeff179e22d835296e10b3387e6d">RefreshDevices</a>();
<a name="l00074"></a>00074
<a name="l00081"></a>00081 CArrayPtrFlat< HBufC >* <a class="code" href="class_c_b_t_discoverer.html#a0dc7ee9d24b57d97b6825eeaa2d08d59">GetNames</a>();
<a name="l00082"></a>00082
<a name="l00089"></a>00089 CArrayPtrFlat< HBufC >* <a class="code" href="class_c_b_t_discoverer.html#ace1adacff37ad877f1f5a1f87f617b1c">GetDeviceAddress</a>();
<a name="l00090"></a>00090
<a name="l00091"></a>00091 <span class="keyword">private</span>: <span class="comment">// Basic two-phase Symbian OS constructors</span>
<a name="l00092"></a>00092
<a name="l00098"></a>00098 <a class="code" href="class_c_b_t_discoverer.html">CBTDiscoverer</a>(<a class="code" href="class_c_shared_intermediator.html">CSharedIntermediator</a>* aSMediator);
<a name="l00099"></a>00099
<a name="l00103"></a>00103 <span class="keywordtype">void</span> ConstructL();
<a name="l00104"></a>00104
<a name="l00105"></a>00105 <span class="keyword">private</span>: <span class="comment">//functions</span>
<a name="l00106"></a>00106
<a name="l00113"></a>00113 <span class="keywordtype">void</span> PushListL(TNameEntry& aNameEntry);
<a name="l00114"></a>00114
<a name="l00121"></a>00121 <span class="keywordtype">void</span> TransformSockAddressL(TInquirySockAddr& aInquirySockAddr);
<a name="l00122"></a>00122
<a name="l00123"></a>00123 <span class="keyword">private</span>: <span class="comment">// member data</span>
<a name="l00124"></a>00124
<a name="l00125"></a>00125 <span class="comment">// Socket addresses</span>
<a name="l00126"></a>00126 RArray<TInquirySockAddr> iInqSockAddrArray;
<a name="l00127"></a>00127
<a name="l00128"></a>00128 <span class="comment">// BT addresses in format XX-XX-XX-XX-XX-XX </span>
<a name="l00129"></a>00129 CArrayPtrFlat< HBufC >* iDeviceAddress;
<a name="l00130"></a>00130
<a name="l00131"></a>00131 <span class="comment">// Device names</span>
<a name="l00132"></a>00132 CArrayPtrFlat< HBufC >* iDeviceNames;
<a name="l00133"></a>00133
<a name="l00134"></a>00134 <span class="comment">// Handle to the socket server </span>
<a name="l00135"></a>00135 RSocketServ iSocketServer;
<a name="l00136"></a>00136
<a name="l00137"></a>00137 <span class="comment">// Provides an interface to host name resolution services</span>
<a name="l00138"></a>00138 RHostResolver iHostResolver;
<a name="l00139"></a>00139
<a name="l00140"></a>00140 <span class="comment">// Socket address class used for remote device inquiries</span>
<a name="l00141"></a>00141 TInquirySockAddr iSockAddr;
<a name="l00142"></a>00142
<a name="l00143"></a>00143 <span class="comment">// Contains the results of name queries.</span>
<a name="l00144"></a>00144 TNameEntry iNameEntry;
<a name="l00145"></a>00145
<a name="l00146"></a>00146 <span class="comment">// Shared class that transmits data between main thread and thread one</span>
<a name="l00147"></a>00147 <a class="code" href="class_c_shared_intermediator.html">CSharedIntermediator</a>* iSMediator;
<a name="l00148"></a>00148 };
<a name="l00149"></a>00149
<a name="l00150"></a>00150 <span class="preprocessor">#endif // __BT_DISCOVERER_H__ </span>
</pre></div></div>
<hr size="1"/><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 </small></address>
</body>
</html>