|
1 /* |
|
2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: IrDA device and service searcher |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CIRDAOBEXSEARCHER_H |
|
21 #define CIRDAOBEXSEARCHER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <ObexSearcherBase.h> |
|
25 #ifndef TEST_HARNESS |
|
26 #include <es_sock.h> //for RSocketServ & RHostResolver |
|
27 #else |
|
28 #include "es_sock_stub.h" |
|
29 #endif |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class CObexClient; |
|
33 |
|
34 // CLASS DECLARATION |
|
35 |
|
36 class CIrDAObexSearcher : public CObexSearcherBase |
|
37 { |
|
38 public: // Constructors and destructor |
|
39 |
|
40 /** |
|
41 * Two-phased constructor. |
|
42 */ |
|
43 static CIrDAObexSearcher* NewL(); |
|
44 |
|
45 /** |
|
46 * Destructor. |
|
47 */ |
|
48 virtual ~CIrDAObexSearcher(); |
|
49 |
|
50 private: |
|
51 |
|
52 /** |
|
53 * C++ default constructor. |
|
54 */ |
|
55 CIrDAObexSearcher(); |
|
56 |
|
57 /** |
|
58 * By default Symbian 2nd phase constructor is private. |
|
59 */ |
|
60 void ConstructL(); |
|
61 |
|
62 protected: // Functions from base classes |
|
63 |
|
64 void RunL(); |
|
65 |
|
66 void DoCancel(); |
|
67 |
|
68 /** |
|
69 * Search for IrDA device |
|
70 */ |
|
71 void SearchDeviceL(); |
|
72 |
|
73 /** |
|
74 * Search for IrDA service |
|
75 */ |
|
76 void SearchServiceL(); |
|
77 |
|
78 /** |
|
79 * Create an OBEX client |
|
80 */ |
|
81 CObexClient* CreateObexClientL(); |
|
82 |
|
83 |
|
84 private: //Data |
|
85 |
|
86 // For IrDA connection |
|
87 RSocketServ iSocketServer; |
|
88 TProtocolDesc iProtocolInfo; |
|
89 RHostResolver iHostResolver; |
|
90 RSocket iSocket; |
|
91 TNameEntry iLog; |
|
92 |
|
93 // How many times we try to reconnect if connection fails |
|
94 TInt iConnectionRetry; |
|
95 |
|
96 // How long are we going to wait between retries |
|
97 RTimer iRetryTimer; |
|
98 |
|
99 // The connection error (not timeout) that will be passed to |
|
100 // NotifyDeviceErrorL |
|
101 TInt iInitialErr; |
|
102 TBool iRetryConn; |
|
103 }; |
|
104 |
|
105 #endif // CIRDAOBEXSEARCHER_H |
|
106 |
|
107 // End of File |