|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 #ifndef BTEXCHANGE_H |
|
17 #define BTEXCHANGE_H |
|
18 |
|
19 class CBluetoothSeeker : public CActive, private MSdpAgentNotifier |
|
20 { |
|
21 public: |
|
22 static CBluetoothSeeker* NewL(RSocketServ &aSession, const TUUID &aUUID); |
|
23 static CBluetoothSeeker* NewLC(RSocketServ &aSession, const TUUID &aUUID); |
|
24 ~CBluetoothSeeker(); |
|
25 void BeginUpdateL(TRequestStatus &aStatus); |
|
26 CArrayFixFlat<TNameEntry>& Names(); |
|
27 private: |
|
28 CBluetoothSeeker(RSocketServ &aSession); |
|
29 void ConstructL(const TUUID &aUUID); |
|
30 void HandleInquiryResultL(); |
|
31 void SDPQueryL(); |
|
32 //virtual overrides from CActive |
|
33 virtual void RunL(); |
|
34 virtual TInt RunError(TInt aErr); |
|
35 virtual void DoCancel(); |
|
36 //virtual overrides from MSdpAgentNotifier |
|
37 virtual void NextRecordRequestComplete(TInt aError, TSdpServRecordHandle aHandle, TInt aTotalRecordsCount); |
|
38 virtual void AttributeRequestResult(TSdpServRecordHandle aHandle, TSdpAttributeID aAttrID, CSdpAttrValue* aAttrValue); |
|
39 virtual void AttributeRequestComplete(TSdpServRecordHandle, TInt aError); |
|
40 //member data |
|
41 RHostResolver iResolver; |
|
42 RSocketServ &iSession; |
|
43 TNameEntry iNameEntry; |
|
44 enum {EIdle, EInquiring, EServiceRequest} iState; |
|
45 CArrayFixFlat<TNameEntry> iNames; |
|
46 TRequestStatus* iUpdateStatus; |
|
47 TInt iDeviceIndex; |
|
48 CSdpAgent *iSdpAgent; |
|
49 CSdpSearchPattern* iSdpSearchPattern; |
|
50 TInquirySockAddr iInquiryAddress; |
|
51 }; |
|
52 |
|
53 #endif |