|
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: Waiter class implementation |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include "BTSBPPServerWait.h" |
|
22 #include "BTServiceUtils.h" |
|
23 #include "BTSUDebug.h" |
|
24 |
|
25 // CONSTANTS |
|
26 const TInt KBTSBPPWaitTime = 120000000; // 2 minutes |
|
27 |
|
28 |
|
29 // ============================ MEMBER FUNCTIONS =============================== |
|
30 |
|
31 // ----------------------------------------------------------------------------- |
|
32 // CBTSBPPServerWait::CBTSBPPServerWait |
|
33 // C++ default constructor can NOT contain any code, that |
|
34 // might leave. |
|
35 // ----------------------------------------------------------------------------- |
|
36 // |
|
37 CBTSBPPServerWait::CBTSBPPServerWait( MBTSBPPServerWaitObserver* aObserver ) : |
|
38 CTimer( EPriorityStandard ), iObserver( aObserver ) |
|
39 |
|
40 { |
|
41 CActiveScheduler::Add( this ); |
|
42 } |
|
43 |
|
44 // ----------------------------------------------------------------------------- |
|
45 // CBTSBPPServerWait::ConstructL |
|
46 // Symbian 2nd phase constructor can leave. |
|
47 // ----------------------------------------------------------------------------- |
|
48 // |
|
49 void CBTSBPPServerWait::ConstructL() |
|
50 { |
|
51 FLOG(_L("[BTSU]\t CBTSBPPServerWait::ConstructL()")); |
|
52 |
|
53 CTimer::ConstructL(); |
|
54 After( TTimeIntervalMicroSeconds32( KBTSBPPWaitTime ) ); |
|
55 |
|
56 FLOG(_L("[BTSU]\t CBTSBPPServerWait::ConstructL() completed")); |
|
57 } |
|
58 |
|
59 // ----------------------------------------------------------------------------- |
|
60 // CBTSBPPServerWait::NewL |
|
61 // Two-phased constructor. |
|
62 // ----------------------------------------------------------------------------- |
|
63 // |
|
64 CBTSBPPServerWait* CBTSBPPServerWait::NewL( MBTSBPPServerWaitObserver* aObserver ) |
|
65 { |
|
66 CBTSBPPServerWait* self = new( ELeave ) CBTSBPPServerWait( aObserver ); |
|
67 CleanupStack::PushL( self ); |
|
68 self->ConstructL(); |
|
69 CleanupStack::Pop(); |
|
70 return self; |
|
71 } |
|
72 |
|
73 |
|
74 // Destructor |
|
75 CBTSBPPServerWait::~CBTSBPPServerWait() |
|
76 { |
|
77 Cancel(); |
|
78 } |
|
79 |
|
80 // ----------------------------------------------------------------------------- |
|
81 // CBTSBPPServerWait::RunL |
|
82 // ----------------------------------------------------------------------------- |
|
83 // |
|
84 void CBTSBPPServerWait::RunL() |
|
85 { |
|
86 FTRACE(FPrint(_L("[BTSU]\t CBTSBPPServerWait::RunL() status %d"), iStatus.Int() ) ); |
|
87 __ASSERT_DEBUG( iObserver != NULL, BTSUPanic( EBTSUPanicNullPointer ) ); |
|
88 |
|
89 iObserver->WaitComplete(); |
|
90 |
|
91 FLOG(_L("[BTSU]\t CBTSBPPServerWait::RunL() completed")); |
|
92 } |
|
93 |
|
94 // End of File |