|
1 // Copyright (c) 2004-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 PANHELPERREMOTESDP_H |
|
17 #define PANHELPERREMOTESDP_H |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <e32std.h> |
|
21 #include <btsdp.h> |
|
22 #include <es_sock.h> |
|
23 #include <bt_sock.h> |
|
24 #include "panroles.h" |
|
25 #include "panhelper.h" |
|
26 |
|
27 namespace PanHelper |
|
28 { |
|
29 |
|
30 NONSHARABLE_CLASS(CPanHelperRemoteSdpQuerier) : public CBase, private MSdpAgentNotifier, private MSdpAttributeValueVisitor |
|
31 /** |
|
32 Perform SDP queries on remote devices |
|
33 @internalTechnology |
|
34 */ |
|
35 { |
|
36 |
|
37 public: |
|
38 static CPanHelperRemoteSdpQuerier* NewL(); |
|
39 virtual ~CPanHelperRemoteSdpQuerier(); |
|
40 |
|
41 void QueryL(const TBTDevAddr& aAddr, TDes8& aSupportedRemoteRoles, TRequestStatus& aStatus); |
|
42 void CancelQuery(); |
|
43 private: |
|
44 CPanHelperRemoteSdpQuerier(); |
|
45 TInt ServiceName(TBluetoothPanRole aRole, TDes8& aServiceName); |
|
46 TInt ServiceDescription(TBluetoothPanRole aRole, TDes8& aServiceDescription); |
|
47 TInt NetworkType(TBluetoothPanRole aRole, TPanNapNetworkType& aNetworkType); |
|
48 // TInt PanSecurityMode(TBluetoothPanRole aRole, TPanSecurityMode& aSecurityMode); |
|
49 TUint8 LoadFactor(TBluetoothPanRole aRole); |
|
50 |
|
51 // MSdpAgentNotifier methods |
|
52 virtual void NextRecordRequestComplete(TInt aError, TSdpServRecordHandle aHandle, TInt aTotalRecordsCount); |
|
53 virtual void AttributeRequestResult(TSdpServRecordHandle aHandle, TSdpAttributeID aAttrID, CSdpAttrValue* aAttrValue); |
|
54 virtual void AttributeRequestComplete(TSdpServRecordHandle, TInt aError); |
|
55 |
|
56 // MSdpAttributeValueVisitor methods |
|
57 virtual void VisitAttributeValueL(CSdpAttrValue &aValue, TSdpElementType aType); |
|
58 virtual void StartListL(CSdpAttrValueList &aList); |
|
59 virtual void EndListL(); |
|
60 |
|
61 public: |
|
62 |
|
63 private: |
|
64 CSdpAgent* iSdpAgent; //< For doing the SDP queries on the remote device |
|
65 PanHelper::TPanDeviceRolesList* iSupportedRemoteRoles; |
|
66 TRequestStatus* iClientStatus; |
|
67 TBool iMatchesFound; |
|
68 }; |
|
69 |
|
70 } |
|
71 #endif //PANHELPERREMOTESDP_H |