|
1 // Copyright (c) 2004-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 // Proxy methods for RPdpFsmInterface class |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalComponent |
|
21 */ |
|
22 |
|
23 |
|
24 #include "rpdpfsminterface.h" |
|
25 |
|
26 |
|
27 RPdpFsmInterface::RPdpFsmInterface() |
|
28 : iFsmImpl(NULL) |
|
29 { |
|
30 } |
|
31 |
|
32 RPdpFsmInterface::~RPdpFsmInterface() |
|
33 { |
|
34 } |
|
35 |
|
36 void RPdpFsmInterface::OpenL(MSpudManInterface* aSpudManInterface, TName& aName) |
|
37 { |
|
38 __ASSERT_DEBUG (iFsmImpl != NULL, User::Panic( KNullDesC, KErrNotReady )); |
|
39 iFsmImpl->OpenL (aSpudManInterface, aName); |
|
40 } |
|
41 |
|
42 void RPdpFsmInterface::Close() |
|
43 { |
|
44 if (iFsmImpl) |
|
45 { |
|
46 // Clear the member first to avoid ping-ponging Close() messages |
|
47 // between the PdpFsmInterface and SpudManInterface |
|
48 MPdpFsmInterface* fsmImpl = iFsmImpl; |
|
49 iFsmImpl = NULL; |
|
50 fsmImpl->Close (); |
|
51 } |
|
52 } |
|
53 |
|
54 |
|
55 TInt RPdpFsmInterface::Input (TContextId aPdpId, const TInt aOperation, const TInt aParam /* =KErrNone */) |
|
56 { |
|
57 if (iFsmImpl) |
|
58 { |
|
59 return iFsmImpl->Input (aPdpId, aOperation, aParam); |
|
60 } |
|
61 |
|
62 // let whoever know we can't do what they ask |
|
63 return KErrNotReady; |
|
64 } |
|
65 |
|
66 |
|
67 #ifdef SYMBIAN_NETWORKING_UMTSR5 |
|
68 |
|
69 void RPdpFsmInterface::SetIMCNSignalling(TBool aImCnSignalling) |
|
70 /** |
|
71 Set the status of IM CN Signalling Flag in UmtsGprsScpr |
|
72 |
|
73 @param aImCnSignalling IMCN signalling Status |
|
74 */ |
|
75 { |
|
76 __ASSERT_DEBUG (iFsmImpl != NULL, User::Panic( KDescNullPdpFsm, KErrNotReady )); |
|
77 iFsmImpl->SetIMCNSignalling(aImCnSignalling); |
|
78 } |
|
79 |
|
80 TInt RPdpFsmInterface::Set(TContextId aPdpId, const RPacketQoS::TQoSR5Requested& aParam) |
|
81 { |
|
82 __ASSERT_DEBUG (iFsmImpl != NULL, User::Panic( KDescNullPdpFsm, KErrNotReady )); |
|
83 return iFsmImpl->Set (aPdpId, aParam); |
|
84 } |
|
85 |
|
86 TInt RPdpFsmInterface::Set(TContextId aPdpId, const RPacketQoS::TQoSR5Negotiated& aParam) |
|
87 { |
|
88 __ASSERT_DEBUG (iFsmImpl != NULL, User::Panic( KDescNullPdpFsm, KErrNotReady )); |
|
89 return iFsmImpl->Set (aPdpId, aParam); |
|
90 } |
|
91 |
|
92 #else |
|
93 // !SYMBIAN_NETWORKING_UMTSR5 |
|
94 |
|
95 TInt RPdpFsmInterface::Set(TContextId aPdpId, const RPacketQoS::TQoSR99_R4Requested& aParam) |
|
96 { |
|
97 __ASSERT_DEBUG (iFsmImpl != NULL, User::Panic( KNullDesC, KErrGeneral )); |
|
98 return iFsmImpl->Set (aPdpId, aParam); |
|
99 } |
|
100 |
|
101 TInt RPdpFsmInterface::Set(TContextId aPdpId, const RPacketQoS::TQoSR99_R4Negotiated& aParam) |
|
102 { |
|
103 __ASSERT_DEBUG (iFsmImpl != NULL, User::Panic( KNullDesC, KErrGeneral )); |
|
104 return iFsmImpl->Set (aPdpId, aParam); |
|
105 } |
|
106 |
|
107 #endif |
|
108 // SYMBIAN_NETWORKING_UMTSR5 |
|
109 |
|
110 |
|
111 |
|
112 TInt RPdpFsmInterface::Set(TContextId aPdpId, const TTFTInfo& aParam) |
|
113 { |
|
114 __ASSERT_DEBUG (iFsmImpl != NULL, User::Panic( KNullDesC, KErrGeneral )); |
|
115 return iFsmImpl->Set (aPdpId, aParam); |
|
116 } |
|
117 |
|
118 TInt RPdpFsmInterface::Set(TContextId aPdpId, const TTFTOperationCode& aParam) |
|
119 { |
|
120 __ASSERT_DEBUG (iFsmImpl != NULL, User::Panic( KNullDesC, KErrGeneral )); |
|
121 return iFsmImpl->Set (aPdpId, aParam); |
|
122 } |
|
123 |
|
124 TInt RPdpFsmInterface::Set(TContextId aPdpId, const RPacketContext::TDataChannelV2& aParam) |
|
125 { |
|
126 __ASSERT_DEBUG (iFsmImpl != NULL, User::Panic( KNullDesC, KErrGeneral )); |
|
127 return iFsmImpl->Set (aPdpId, aParam); |
|
128 } |
|
129 |
|
130 TInt RPdpFsmInterface::Set(TContextId aPdpId, const RPacketContext::TContextConfigGPRS& aParam) |
|
131 { |
|
132 __ASSERT_DEBUG (iFsmImpl != NULL, User::Panic( KNullDesC, KErrGeneral )); |
|
133 return iFsmImpl->Set (aPdpId, aParam); |
|
134 } |
|
135 |
|
136 TInt RPdpFsmInterface::Set(TContextId aPdpId, const RPacketContext::TContextStatus& aParam) |
|
137 { |
|
138 __ASSERT_DEBUG (iFsmImpl != NULL, User::Panic( KNullDesC, KErrGeneral )); |
|
139 return iFsmImpl->Set (aPdpId, aParam); |
|
140 } |
|
141 |
|
142 |
|
143 #ifdef SYMBIAN_NETWORKING_UMTSR5 |
|
144 TInt RPdpFsmInterface::Get(TContextId aPdpId, RPacketQoS::TQoSR5Requested& aParam) const |
|
145 { |
|
146 __ASSERT_DEBUG (iFsmImpl != NULL, User::Panic( KDescNullPdpFsm, KErrNotReady )); |
|
147 return iFsmImpl->Get (aPdpId, aParam); |
|
148 } |
|
149 |
|
150 TInt RPdpFsmInterface::Get(TContextId aPdpId, RPacketQoS::TQoSR5Negotiated& aParam) const |
|
151 { |
|
152 __ASSERT_DEBUG (iFsmImpl != NULL, User::Panic( KDescNullPdpFsm, KErrNotReady )); |
|
153 return iFsmImpl->Get (aPdpId, aParam); |
|
154 } |
|
155 |
|
156 #else |
|
157 // !SYMBIAN_NETWORKING_UMTSR5 |
|
158 |
|
159 TInt RPdpFsmInterface::Get(TContextId aPdpId, RPacketQoS::TQoSR99_R4Requested& aParam) const |
|
160 { |
|
161 __ASSERT_DEBUG (iFsmImpl != NULL, User::Panic( KNullDesC, KErrGeneral )); |
|
162 return iFsmImpl->Get (aPdpId, aParam); |
|
163 } |
|
164 |
|
165 TInt RPdpFsmInterface::Get(TContextId aPdpId, RPacketQoS::TQoSR99_R4Negotiated& aParam) const |
|
166 { |
|
167 __ASSERT_DEBUG (iFsmImpl != NULL, User::Panic( KNullDesC, KErrGeneral )); |
|
168 return iFsmImpl->Get (aPdpId, aParam); |
|
169 } |
|
170 |
|
171 #endif |
|
172 // SYMBIAN_NETWORKING_UMTSR5 |
|
173 |
|
174 |
|
175 TInt RPdpFsmInterface::Get(TContextId aPdpId, TTFTInfo& aParam) const |
|
176 { |
|
177 __ASSERT_DEBUG (iFsmImpl != NULL, User::Panic( KNullDesC, KErrGeneral )); |
|
178 return iFsmImpl->Get (aPdpId, aParam); |
|
179 } |
|
180 |
|
181 TInt RPdpFsmInterface::Get(TContextId aPdpId, TTFTOperationCode& aParam) const |
|
182 { |
|
183 __ASSERT_DEBUG (iFsmImpl != NULL, User::Panic( KNullDesC, KErrGeneral )); |
|
184 return iFsmImpl->Get (aPdpId, aParam); |
|
185 } |
|
186 |
|
187 TInt RPdpFsmInterface::Get(TContextId aPdpId, RPacketContext::TDataChannelV2& aParam) const |
|
188 { |
|
189 if (iFsmImpl == NULL) |
|
190 { |
|
191 // Since the RPdpFsmInterface implementation hasn't been initialised yet we need to provide |
|
192 // a response. This is only going to happen as lower nifs are being created and before the |
|
193 // UmtsGprsSCPR has had a chance to initialise our iFsmImpl pointer, and only if they do a |
|
194 // ReadDes() for ModemBearer\CSYName, or ModemBearer\PortName. Luckily for us at this |
|
195 // early stage Etel always response with an empty TDataChannelV2 structure. |
|
196 aParam.iChannelId = KNullDesC; |
|
197 aParam.iCsy = KNullDesC; |
|
198 aParam.iPort = KNullDesC; |
|
199 return KErrNone; |
|
200 } |
|
201 else |
|
202 { |
|
203 return iFsmImpl->Get (aPdpId, aParam); |
|
204 } |
|
205 } |
|
206 |
|
207 TInt RPdpFsmInterface::Get(TContextId aPdpId, RPacketContext::TContextConfigGPRS& aParam) const |
|
208 { |
|
209 __ASSERT_DEBUG (iFsmImpl != NULL, User::Panic( KNullDesC, KErrGeneral )); |
|
210 return iFsmImpl->Get (aPdpId, aParam); |
|
211 } |
|
212 |
|
213 TInt RPdpFsmInterface::Get(TContextId aPdpId, RPacketContext::TContextStatus& aParam) const |
|
214 { |
|
215 if (iFsmImpl) |
|
216 { |
|
217 return iFsmImpl->Get (aPdpId, aParam); |
|
218 } |
|
219 |
|
220 return KErrNotReady; |
|
221 } |
|
222 |
|
223 void RPdpFsmInterface::Set(const RPacketService::TStatus aParam) |
|
224 { |
|
225 __ASSERT_DEBUG (iFsmImpl != NULL, User::Panic( KNullDesC, KErrGeneral )); |
|
226 iFsmImpl->Set (aParam); |
|
227 } |
|
228 |
|
229 void RPdpFsmInterface::Get(RPacketService::TStatus& aParam) |
|
230 { |
|
231 __ASSERT_DEBUG (iFsmImpl != NULL, User::Panic( KNullDesC, KErrGeneral )); |
|
232 iFsmImpl->Get (aParam); |
|
233 } |
|
234 |
|
235 TInt RPdpFsmInterface::GetLastErrorCause(TContextId aPdpId, TInt& aLastErrorCause) const |
|
236 { |
|
237 if (iFsmImpl) |
|
238 { |
|
239 return iFsmImpl->GetLastErrorCause (aPdpId, aLastErrorCause); |
|
240 } |
|
241 |
|
242 return KErrNone; |
|
243 } |
|
244 |
|
245 const TName& RPdpFsmInterface::TsyName(void) |
|
246 { |
|
247 __ASSERT_DEBUG (iFsmImpl != NULL, User::Panic( KNullDesC, KErrGeneral )); |
|
248 return iFsmImpl->TsyName (); |
|
249 } |
|
250 |
|
251 void RPdpFsmInterface::SetContextTerminationErrorAndStop(TContextId aPdpId, TInt aErrorCode) |
|
252 { |
|
253 if (iFsmImpl) |
|
254 { |
|
255 iFsmImpl->SetContextTerminationErrorAndStop (aPdpId, aErrorCode); |
|
256 } |
|
257 } |
|
258 |
|
259 |
|
260 void RPdpFsmInterface::Init (const MPdpFsmInterface* aSpudMan) |
|
261 { |
|
262 // This should only be getting set the once, but so long as its the same instance we'll let it slip |
|
263 ASSERT (iFsmImpl == NULL || aSpudMan == iFsmImpl); |
|
264 iFsmImpl = const_cast<MPdpFsmInterface*>(aSpudMan); |
|
265 } |
|
266 |
|
267 |
|
268 |
|
269 |
|
270 |