00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef DEVICEDISCOVERER_H
00031 #define DEVICEDISCOVERER_H
00032
00033
00034 #include <e32base.h>
00035 #include <aknviewappui.h>
00036
00037 #include <coecntrl.h>
00038 #include <es_sock.h>
00039 #include <btdevice.h>
00040 #include <bt_sock.h>
00041 #include <btsdp.h>
00042
00043 #include "Common.h"
00044
00045
00046 class MDeviceDiscoObserver
00047 {
00048
00049 public:
00055 virtual void HandleDeviceDiscoveryComplete(TInt aError)=0;
00056
00062 virtual void DeviceDiscovered(const TDeviceData& aDevice)=0;
00063 };
00064
00065
00066 class CDeviceDiscoverer : public CActive
00067 {
00068 public:
00069
00076 static CDeviceDiscoverer* NewL(RSocketServ& aSocketServ,
00077 MDeviceDiscoObserver& aObserver);
00078
00083 static CDeviceDiscoverer* NewLC(RSocketServ& aSocketServ,
00084 MDeviceDiscoObserver& aObserver);
00085
00091 ~CDeviceDiscoverer();
00092
00100 void DiscoverDevicesL(TDeviceDataList* aDevDataList);
00101
00109 TBool HasDevices();
00110
00111
00112 #ifdef ENABLE_LIAC
00113
00119 void SetLIAC( TBool aState );
00120 #endif
00121
00128 void StopDiscovery();
00129
00130 protected:
00131
00137 void RunL();
00138
00144 void DoCancel();
00145
00146
00147 private:
00148
00156 CDeviceDiscoverer(RSocketServ& aSocketServ,
00157 MDeviceDiscoObserver& aObserver);
00158
00163 void ConstructL();
00164
00165 private:
00166
00167
00168 RSocketServ& iSocketServ;
00169
00170 MDeviceDiscoObserver& iObserver;
00171
00172 TDeviceDataList *iDevDataList;
00173
00174 RHostResolver iResolver;
00175 TInquirySockAddr iAddr;
00176 TNameEntry iEntry;
00177
00178 #ifdef ENABLE_LIAC
00179 TBool iLIAC;
00180 #endif
00181
00182 };
00183
00184 #endif