www.pudn.com > Example_BluetoothChat.rar > BluetoothServiceSearcher.h
#ifndef __BLUETOOTHSERVICESEARCHER_H__ #define __BLUETOOTHSERVICESEARCHER_H__ // System includes #include// User defined includes #include "TBluetoothAttributeParser.h" #include "BluetoothAttributeObserver.h" // Forward declaration class CAknWaitDialog; // CLASS DECLARATION /** * * @class CBluetoothServiceSearcher BluetoothServiceSearcher.h * @brief This class performs the donkey work in searching for services on remote devices. * * It requires a TBTDevAddr (the address of the device to talk to) and then queries the remote device's * Service Discovery Database looking for a specific service. * * Copyright (c) EMCC Software Ltd 2003 * @version 1.0 * */ class CBluetoothServiceSearcher : public CBase, public MSdpAgentNotifier, public MBluetoothAttributeObserver { public: // Constructors static CBluetoothServiceSearcher* NewL(TInt& aPort); static CBluetoothServiceSearcher* NewLC(TInt& aPort); ~CBluetoothServiceSearcher(); private: // Constructors - Symbian 2nd stage CBluetoothServiceSearcher(TInt& aPort); void ConstructL(); public: // Member functions - Functionality void CloseL(); TInt FindServiceL(const TBTDevAddr& aDeviceAddress); void SetPort(TInt aPort); public: // Member functions - From MSdpAgentNotifier virtual void NextRecordRequestComplete(TInt aError, TSdpServRecordHandle aHandle, TInt aTotalRecordsCount); virtual void AttributeRequestResult(TSdpServRecordHandle aHandle, TSdpAttributeID aAttrID, CSdpAttrValue* aAttrValue); virtual void AttributeRequestComplete(TSdpServRecordHandle aHandle, TInt aError); void NextRecordRequestCompleteL(TInt aError, TSdpServRecordHandle aHandle, TInt aTotalRecordsCount); void AttributeRequestResultL(TSdpServRecordHandle aHandle, TSdpAttributeID aAttrID, CSdpAttrValue* aAttrValue); void AttributeRequestCompleteL(TSdpServRecordHandle aHandle, TInt aError); private: // Member functions - utility functions void DisplayProgressDialogL(); void RemoveProgressDialogL(); private: // Member Data CSdpAgent* iAgent; CSdpSearchPattern* iSdpSearchPattern; CSdpAttrIdMatchList* iMatchList; CAknWaitDialog* iWaitDialog; TInt& iPort; TInt iSearcherState; TBool iContinueSearching; TBool iAvailable; }; #endif // __BLUETOOTHSERVICESEARCHER_H__ // End of file