|
1 // Copyright (c) 1999-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 SDPCLIENT_H__ |
|
17 #define SDPCLIENT_H__ |
|
18 |
|
19 #include <e32std.h> |
|
20 #include <e32base.h> |
|
21 #include <bt_sock.h> |
|
22 #include <btsdp.h> |
|
23 |
|
24 enum TSDPParsePanics |
|
25 { |
|
26 EGetUintBadDescriptorLength, |
|
27 EFrameOverrun, |
|
28 EListOverrun |
|
29 }; |
|
30 |
|
31 static const TInt KSDPRFCommUUID=0x03; |
|
32 static const TInt KCsySearchUUID=0x1102;// 1102 = LAN, 1103 = DUN |
|
33 |
|
34 class CRFCommPortAttrib; |
|
35 |
|
36 /** |
|
37 SDP Query RFCommm specific attributes class. |
|
38 This class will be used for the first BT implementation to retrieve |
|
39 the RFComm specific attributes only, from the parsed SDP attributes query. |
|
40 */ |
|
41 NONSHARABLE_CLASS(CRFCommAttribs) : public CBase, public MSdpElementBuilder |
|
42 { |
|
43 public: |
|
44 static CRFCommAttribs* NewL(MSdpElementBuilder *aParent); |
|
45 ~CRFCommAttribs(); |
|
46 MSdpElementBuilder* BuildUintL(const TDesC8& aUint); |
|
47 MSdpElementBuilder* BuildUUIDL(const TUUID& aUUID); |
|
48 MSdpElementBuilder* StartListL(/*TBuilderListType aType*/); |
|
49 MSdpElementBuilder* EndListL(); |
|
50 MSdpElementBuilder* BuildDESL(); |
|
51 MSdpElementBuilder* BuildDEA(); |
|
52 void Print(TUint aIndent); |
|
53 TInt GetRFCommPort(TUint8& aServerChannel); |
|
54 private: |
|
55 CRFCommAttribs(); |
|
56 private: |
|
57 CRFCommPortAttrib* iPortAttrib; // this is also an MSdpElementBuilder |
|
58 TUUID iRfcommUUID; |
|
59 }; |
|
60 |
|
61 /** |
|
62 CRFCommPortAttrib holds the attrinute that shows the port on which RFComm is bound. |
|
63 This object will be hanged of the CRFCommAttribs object when the correct |
|
64 UUID has been received (by the latter). |
|
65 */ |
|
66 NONSHARABLE_CLASS(CRFCommPortAttrib) : public CBase, public MSdpElementBuilder |
|
67 { |
|
68 public: |
|
69 static CRFCommPortAttrib* NewL(MSdpElementBuilder *aParent); |
|
70 virtual ~CRFCommPortAttrib(); |
|
71 MSdpElementBuilder* BuildUintL(const TDesC8& aUint); |
|
72 TUint8 GetRFCommPort(); |
|
73 private: |
|
74 CRFCommPortAttrib(MSdpElementBuilder* aParent); |
|
75 TUint GetUint(const TDesC8& aData); |
|
76 private: |
|
77 MSdpElementBuilder* iParent; |
|
78 TUint8 iPort; |
|
79 TBool iGotThePortNo; |
|
80 }; |
|
81 |
|
82 /** |
|
83 SDP Query service class list attributes |
|
84 find the KCsySearchUUID in the list |
|
85 */ |
|
86 NONSHARABLE_CLASS(CRFCommClass) : public CBase, public MSdpElementBuilder |
|
87 { |
|
88 public: |
|
89 static CRFCommClass* NewL(const TUUID& aUUID); |
|
90 ~CRFCommClass(); |
|
91 MSdpElementBuilder* BuildUintL(const TDesC8& aUint); |
|
92 MSdpElementBuilder* BuildUUIDL(const TUUID& aUUID); |
|
93 MSdpElementBuilder* StartListL(/*TBuilderListType aType*/); |
|
94 MSdpElementBuilder* EndListL(); |
|
95 MSdpElementBuilder* BuildDESL(); |
|
96 MSdpElementBuilder* BuildDEA(); |
|
97 TBool InService(); |
|
98 private: |
|
99 CRFCommClass(const TUUID& aUUID); |
|
100 private: |
|
101 const TUUID& iUUID; |
|
102 TBool iNService; |
|
103 }; |
|
104 |
|
105 |
|
106 #endif |