|
1 /* |
|
2 * Copyright (c) 2007 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #include <e32base.h> |
|
21 #include <e32debug.h> |
|
22 |
|
23 #include "iceteststubs.h" |
|
24 #include "natfwcandidate.h" |
|
25 #include "natfwcandidatepair.h" |
|
26 #include "iceteststubsobserver.h" |
|
27 |
|
28 |
|
29 // --------------------------------------------------------------------------- |
|
30 // CICETestStubs::NewL |
|
31 // --------------------------------------------------------------------------- |
|
32 // |
|
33 CICETestStubs* CICETestStubs::NewL( CConsoleBase& aConsole ) |
|
34 { |
|
35 CICETestStubs* self = new (ELeave) CICETestStubs( aConsole ); |
|
36 CleanupStack::PushL( self ); |
|
37 self->ConstructL(); |
|
38 CleanupStack::Pop( self ); |
|
39 return self; |
|
40 } |
|
41 |
|
42 |
|
43 // --------------------------------------------------------------------------- |
|
44 // CICETestStubs::CICETestStubs |
|
45 // --------------------------------------------------------------------------- |
|
46 // |
|
47 CICETestStubs::CICETestStubs( CConsoleBase& aConsole ) : |
|
48 CNATConnFWTestConsoleStubs( aConsole ) |
|
49 { |
|
50 } |
|
51 |
|
52 |
|
53 // --------------------------------------------------------------------------- |
|
54 // CICETestStubs::~CICETestStubs |
|
55 // --------------------------------------------------------------------------- |
|
56 // |
|
57 CICETestStubs::~CICETestStubs() |
|
58 { |
|
59 } |
|
60 |
|
61 |
|
62 // --------------------------------------------------------------------------- |
|
63 // CICETestStubs::SetObserver |
|
64 // --------------------------------------------------------------------------- |
|
65 // |
|
66 void CICETestStubs::SetObserver( MICETestStubsObserver* aObserver ) |
|
67 { |
|
68 iObserver = aObserver; |
|
69 } |
|
70 |
|
71 |
|
72 // --------------------------------------------------------------------------- |
|
73 // CICETestStubs::NewLocalCandidateFound |
|
74 // --------------------------------------------------------------------------- |
|
75 // |
|
76 void CICETestStubs::NewLocalCandidateFound( |
|
77 CNATFWCandidate* aLocalCandidate ) |
|
78 { |
|
79 TInetAddr localAddr = aLocalCandidate->TransportAddr(); |
|
80 |
|
81 TBuf<40> buffer; |
|
82 localAddr.Output( buffer ); |
|
83 RDebug::Print( _L("CICETestStubs::NewLocalCandidateFound ADDRESS: %S "), |
|
84 &buffer ); |
|
85 |
|
86 if( iObserver ) |
|
87 { |
|
88 iObserver->LocalCandidateFound( *aLocalCandidate ); |
|
89 } |
|
90 else |
|
91 { |
|
92 delete aLocalCandidate; |
|
93 } |
|
94 /* |
|
95 CActiveScheduler::Stop(); |
|
96 iActive = EFalse; |
|
97 */ |
|
98 } |
|
99 |
|
100 |
|
101 // --------------------------------------------------------------------------- |
|
102 // CICETestStubs::NewLocalCandidateFound |
|
103 // --------------------------------------------------------------------------- |
|
104 // |
|
105 void CICETestStubs::NewCandidatePairFound( |
|
106 CNATFWCandidatePair* aCandidatePair ) |
|
107 { |
|
108 if( iObserver ) |
|
109 { |
|
110 iObserver->NewCandidatePairFound( aCandidatePair ); |
|
111 } |
|
112 else |
|
113 { |
|
114 delete aCandidatePair; |
|
115 } |
|
116 if ( iActive ) |
|
117 { |
|
118 CActiveScheduler::Stop(); |
|
119 iActive = EFalse; |
|
120 } |
|
121 } |
|
122 |
|
123 |