|
1 // Copyright (c) 2007-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 // btgpsdiscovery.h |
|
15 // |
|
16 // |
|
17 |
|
18 #ifndef BTGPSDISCOVERY_H |
|
19 #define BTGPSDISCOVERY_H |
|
20 |
|
21 #include <e32base.h> // For CActive, link against: euser.lib |
|
22 #include <btdevice.h> // For CBTDevice |
|
23 #include <btsdp.h> // For KSerialPortUUID |
|
24 |
|
25 class CSdpAgentSim; |
|
26 |
|
27 /** |
|
28 * MBTGPSSdpResultReceiver |
|
29 * |
|
30 */ |
|
31 class MBTGPSSdpResultReceiver |
|
32 { |
|
33 public: |
|
34 /** |
|
35 * |
|
36 */ |
|
37 virtual void ServiceAttributeSearchComplete(TInt aErr ) = 0; |
|
38 }; |
|
39 |
|
40 class CBTGPSDiscovery : public CBase, MSdpAgentNotifier, MSdpAttributeValueVisitor |
|
41 { |
|
42 public: |
|
43 // Cancel and destroy |
|
44 ~CBTGPSDiscovery (); |
|
45 |
|
46 // Two-phased constructor. |
|
47 |
|
48 // Two-phased constructor. |
|
49 static CBTGPSDiscovery* NewL (MBTGPSSdpResultReceiver* aBTEngSdpResultReceiver); |
|
50 |
|
51 // Two-phased constructor. |
|
52 static CBTGPSDiscovery* NewLC (MBTGPSSdpResultReceiver* aBTEngSdpResultReceiver); |
|
53 |
|
54 public: |
|
55 // New functions |
|
56 TInt RemoteProtocolChannelQueryL(const TBTDevAddr& aAddr, TInt aService); |
|
57 TInt ParseRfcommChannel(TInt& aType); |
|
58 |
|
59 private: |
|
60 // C++ constructor |
|
61 CBTGPSDiscovery (MBTGPSSdpResultReceiver* aBTEngSdpResultReceiver); |
|
62 |
|
63 private: |
|
64 // MSdpAgentNotifier methods |
|
65 void NextRecordRequestComplete(TInt aError, TSdpServRecordHandle aHandle, TInt aTotalRecordsCount); |
|
66 void AttributeRequestResult(TSdpServRecordHandle aHandle, TSdpAttributeID aAttrID, CSdpAttrValue* aAttrValue); |
|
67 void AttributeRequestComplete(TSdpServRecordHandle, TInt /*aError*/); |
|
68 |
|
69 // MSdpAttributeValueVisitor methods |
|
70 void VisitAttributeValueL(CSdpAttrValue &aValue, TSdpElementType aType); |
|
71 void StartListL(CSdpAttrValueList& /*aList*/){}; |
|
72 void EndListL(){}; |
|
73 |
|
74 private: |
|
75 MBTGPSSdpResultReceiver* iBTSdpResultReceiver; |
|
76 TSdpServRecordHandle* iHandle; |
|
77 CSdpAgent* iSdpAgent; |
|
78 TInt iChannel; |
|
79 TBool iValid; |
|
80 TInt iMatchesFound; |
|
81 |
|
82 #ifdef LBS_BTGPSPSY_SIM |
|
83 // Simulated CSdpAgent, used for simulated devices |
|
84 CSdpAgentSim* iSdpAgentSim; |
|
85 #endif |
|
86 }; |
|
87 |
|
88 #endif // BTGPSDISCOVERY_H |