|
1 // Copyright (c) 2002-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 #include "CReconnectRequest.h" |
|
17 #include <comms-infras/nifagt.h> |
|
18 #include "CNetworkController.h" |
|
19 #include "NetConPanic.h" |
|
20 #include "NetConLog.h" |
|
21 |
|
22 CReconnectRequest* CReconnectRequest::NewL(MNetConEnv* aController, MNetworkControllerObserver* aObserver, CNifAgentBase* aAgent, CStoreableOverrideSettings* aOverrides) |
|
23 { |
|
24 CReconnectRequest* self = new(ELeave) CReconnectRequest(aController, aObserver, aAgent, aOverrides); |
|
25 CleanupStack::PushL(self); |
|
26 self->ConstructL(); |
|
27 CleanupStack::Pop(); // self |
|
28 return self; |
|
29 } |
|
30 |
|
31 CReconnectRequest::CReconnectRequest(MNetConEnv* aController, MNetworkControllerObserver* aObserver, CNifAgentBase* aAgent, CStoreableOverrideSettings* aOverrides) |
|
32 : CNetConRequestBase(aController, aObserver, aOverrides), iAgent(aAgent) |
|
33 { |
|
34 } |
|
35 |
|
36 void CReconnectRequest::ConstructL() |
|
37 { |
|
38 |
|
39 TCallBack callback(AsyncCb, this); |
|
40 iAsyncCb = new(ELeave)CAsyncCallBack(callback, CActive::EPriorityStandard); |
|
41 } |
|
42 |
|
43 CReconnectRequest::~CReconnectRequest() |
|
44 { |
|
45 |
|
46 if(iAsyncCb) |
|
47 delete iAsyncCb; |
|
48 } |
|
49 |
|
50 void CReconnectRequest::StartRequest() |
|
51 { |
|
52 |
|
53 TInt testNo = REINTERPRET_CAST(TInt, iAgent); |
|
54 |
|
55 switch (testNo) |
|
56 { |
|
57 case 300: |
|
58 case 900: |
|
59 case 1000: |
|
60 RequestComplete(KErrNone); |
|
61 break; |
|
62 case 400: |
|
63 RequestComplete(KErrDiskFull); |
|
64 break; |
|
65 case 800: |
|
66 iAsyncCb->CallBack(); |
|
67 break; |
|
68 default: |
|
69 User::Invariant(); |
|
70 } |
|
71 } |
|
72 |
|
73 void CReconnectRequest::StartReconnectL() |
|
74 { |
|
75 } |
|
76 |
|
77 void CReconnectRequest::RequestComplete(TInt aError) |
|
78 { |
|
79 |
|
80 iController->RequestComplete(this, aError); |
|
81 } |
|
82 |
|
83 void CReconnectRequest::CancelRequest() |
|
84 { |
|
85 } |
|
86 |
|
87 void CReconnectRequest::SetAvailableBearers(TUint32) |
|
88 { |
|
89 } |
|
90 |
|
91 void CReconnectRequest::MDPOReconnectComplete(TInt aError) |
|
92 { |
|
93 |
|
94 RequestComplete(aError); |
|
95 } |
|
96 |
|
97 TInt CReconnectRequest::AsyncCb(TAny* aThisPtr) |
|
98 { |
|
99 CReconnectRequest* self = (CReconnectRequest*)aThisPtr; |
|
100 self->RequestComplete(KErrNone); |
|
101 return KErrNone; |
|
102 } |
|
103 |