24
|
1 |
// Copyright (c) 2006-2010 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 |
// PDP SubConnection Provider implementation
|
|
15 |
//
|
|
16 |
//
|
|
17 |
|
|
18 |
/**
|
|
19 |
@file
|
|
20 |
@internalComponent
|
|
21 |
*/
|
|
22 |
|
|
23 |
#include <comms-infras/corescpractivities.h>
|
|
24 |
#include "PDPDeftSCPR.h"
|
|
25 |
#include "PDPSCPRStates.h"
|
|
26 |
#include "PDPSCPRFactory.h"
|
|
27 |
#include <comms-infras/ss_log.h>
|
|
28 |
#include <comms-infras/commsdebugutility.h>
|
|
29 |
#include <elements/nm_signatures.h>
|
|
30 |
|
|
31 |
#if defined(__CFLOG_ACTIVE) || defined(SYMBIAN_TRACE_ENABLE)
|
|
32 |
#define KPDPSCprTag KESockSubConnectionTag
|
|
33 |
_LIT8(KPDPSCprSubTag, "pdpscpr");
|
|
34 |
#endif
|
|
35 |
|
|
36 |
using namespace Messages;
|
|
37 |
using namespace MeshMachine;
|
|
38 |
using namespace ESock;
|
|
39 |
using namespace NetStateMachine;
|
|
40 |
|
|
41 |
|
|
42 |
//-=========================================================
|
|
43 |
//
|
|
44 |
// Activities
|
|
45 |
//
|
|
46 |
//-=========================================================
|
|
47 |
|
|
48 |
namespace PDPDeftSCprDataClientStartActivity
|
|
49 |
{
|
|
50 |
typedef MeshMachine::TAcceptErrorState<CoreNetStates::TAwaitingDataClientStarted> TAwaitingDataClientStartedOrError;
|
|
51 |
|
|
52 |
DECLARE_DEFINE_CUSTOM_NODEACTIVITY(ECFActivityStartDataClient, PDPDeftDataClientStart, TCFDataClient::TStart, PDPSCprStates::CStartActivity::NewL)
|
|
53 |
FIRST_NODEACTIVITY_ENTRY(CoreNetStates::TAwaitingDataClientStart, PDPSCprStates::TNoTagOrUserAuthenticateOrAlreadyStarted)
|
|
54 |
LAST_NODEACTIVITY_ENTRY(CoreNetStates::KAlreadyStarted, PRStates::TSendDataClientStarted)
|
|
55 |
|
|
56 |
NODEACTIVITY_ENTRY(PDPSCprStates::KUserAuthenticate, PDPSCprStates::TSendAuthenticate, PDPSCprStates::TAwaitingAuthenticateComplete, MeshMachine::TNoTagOrErrorTag)
|
|
57 |
NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::TCreatePrimaryPDPCtx, PDPSCprStates::TAwaitingPrimaryPDPCtxCreated, PDPSCprStates::TNoTagOrSendErrorRecoveryRequestOrError)
|
|
58 |
NODEACTIVITY_ENTRY(PDPSCprStates::KSendErrorRecoveryRequest, PDPSCprStates::TSendErrorRecoveryRequest, MeshMachine::TAwaitingErrorRecoveryResponseOrError, PDPSCprStates::TNoTagBackwardOrErrorTag)
|
|
59 |
THROUGH_NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::TFillInGrantedParamsAndImsExtParams, MeshMachine::TNoTag)
|
|
60 |
NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::TOverrideProvisionAndStartDataClient, TAwaitingDataClientStartedOrError, MeshMachine::TNoTagOrErrorTag)
|
|
61 |
LAST_NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::TSendDataClientStarted)
|
|
62 |
|
|
63 |
// Cleanup if error occurred
|
|
64 |
THROUGH_NODEACTIVITY_ENTRY(KErrorTag, MeshMachine::TDoNothing, CoreNetStates::TNoTagOrNoDataClientsToStop)
|
|
65 |
NODEACTIVITY_ENTRY(KNoTag, SCprStates::TStopYourFlows, CoreNetStates::TAwaitingDataClientStopped, MeshMachine::TTag<CoreNetStates::KNoDataClientsToStop>)
|
|
66 |
THROUGH_NODEACTIVITY_ENTRY(CoreNetStates::KNoDataClientsToStop, MeshMachine::TDoNothing, PDPSCprStates::TNoTagOrProviderStopped)
|
|
67 |
NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::TDestroyPDPContext, PDPSCprStates::TAwaitingPDPContextDestroyed, MeshMachine::TTag<CoreNetStates::KProviderStopped>)
|
|
68 |
THROUGH_NODEACTIVITY_ENTRY(CoreNetStates::KProviderStopped, PDPSCprStates::TCleanupFSMAndDataClients, MeshMachine::TTag<CoreNetStates::KProviderStopped>)
|
|
69 |
LAST_NODEACTIVITY_ENTRY(CoreNetStates::KProviderStopped, MeshMachine::TRaiseActivityError)
|
|
70 |
NODEACTIVITY_END()
|
|
71 |
}
|
|
72 |
|
|
73 |
namespace PDPSCprNetworkStatusEventActivity
|
|
74 |
{
|
|
75 |
DECLARE_DEFINE_NODEACTIVITY(ECFActivityNotification, subConnStatusEvent, TPDPMessages::TPDPFSMMessage)
|
|
76 |
FIRST_NODEACTIVITY_ENTRY(PDPSCprStates::TAwaitingNetworkStatusEvent, PDPSCprStates::TNetworkStatusEventTypeTag)
|
|
77 |
LAST_NODEACTIVITY_ENTRY(KNoTag, MeshMachine::TDoNothing)
|
|
78 |
|
|
79 |
// Assume that anything other than EStatusUnattached means the network
|
|
80 |
// is still up, so just ignore this event.
|
|
81 |
LAST_NODEACTIVITY_ENTRY(RPacketService::EStatusAttached, MeshMachine::TDoNothing)
|
|
82 |
LAST_NODEACTIVITY_ENTRY(RPacketService::EStatusActive, MeshMachine::TDoNothing)
|
|
83 |
LAST_NODEACTIVITY_ENTRY(RPacketService::EStatusSuspended, MeshMachine::TDoNothing)
|
|
84 |
|
|
85 |
NODEACTIVITY_ENTRY(RPacketService::EStatusUnattached, CoreNetStates::TStopSelf, CoreNetStates::TAwaitingDataClientStopped, MeshMachine::TNoTag)
|
|
86 |
LAST_NODEACTIVITY_ENTRY(KNoTag, SCprStates::TSendDataClientGoneDown)
|
|
87 |
NODEACTIVITY_END()
|
|
88 |
}
|
|
89 |
|
|
90 |
namespace PDPDeftSCprGoneDownActivity
|
|
91 |
{
|
|
92 |
//TODO perhaps get this from a header file since its used in a number of places - see ss_subconn.cpp
|
|
93 |
typedef MeshMachine::TAcceptErrorState<CoreNetStates::TAwaitingApplyResponse> TAwaitingApplyResponseOrError;
|
|
94 |
|
|
95 |
//mandated by 3GPP TS 23.107 Annex C, the default going down needs to select a new default
|
|
96 |
//among the non-defaults and swap the datapath. Swapping datapath is now done
|
|
97 |
//transparently, i.e.: without the upper layer knowing (binders are kept, flows are swapped).
|
|
98 |
//This arguably isn't pretty and could be changed to something more explicit, i.e.:
|
|
99 |
//sending TBindToRequest to the upper layer SCPR so that it does an explit rebind.
|
|
100 |
//[401TODO]: the swap only works for rawIp, doesn't for PPP.
|
|
101 |
//[401TODO]: if we stick to the transpartent swap, we need to change the message
|
|
102 |
// this scpr sends to the flow. The flow responds with a full swap
|
|
103 |
// to TRejoin, whereas TRejoin doesn't mean swap - suggesting to
|
|
104 |
// introduce PDP level msg: TRejoinAndSwap.
|
|
105 |
DECLARE_DEFINE_CUSTOM_NODEACTIVITY(ECFActivityGoneDown, PDPDeftSCprGoneDown, TPDPMessages::TPDPFSMMessage, PDPSCprStates::CPrimaryPDPGoneDownActivity::NewL)
|
|
106 |
FIRST_NODEACTIVITY_ENTRY(PDPSCprStates::TAwaitingPDPContextGoneDown, MeshMachine::TActiveOrNoTag<ECFActivityStartDataClient>)
|
|
107 |
THROUGH_NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::TCleanupFSM, PDPSCprStates::CPrimaryPDPGoneDownActivity::TNoTagOrProviderStopped)
|
|
108 |
THROUGH_NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::CPrimaryPDPGoneDownActivity::TStoreOriginalDataClient, MeshMachine::TNoTag)
|
|
109 |
NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::CPrimaryPDPGoneDownActivity::TRejoinDataClient, CoreNetStates::TAwaitingRejoinDataClientComplete, MeshMachine::TNoTag)
|
|
110 |
NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::CPrimaryPDPGoneDownActivity::TApplyNewDefault, TAwaitingApplyResponseOrError, MeshMachine::TNoTag)
|
|
111 |
THROUGH_NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::CPrimaryPDPGoneDownActivity::TSwitchToNewDefault, MeshMachine::TNoTag)
|
|
112 |
NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::CPrimaryPDPGoneDownActivity::TStopOriginalDataClient, CoreNetStates::TAwaitingDataClientStopped, MeshMachine::TNoTag)
|
|
113 |
|
|
114 |
LAST_NODEACTIVITY_ENTRY(KNoTag, MeshMachine::TClearError)
|
|
115 |
THROUGH_NODEACTIVITY_ENTRY(KActiveTag, MeshMachine::TDoNothing, PDPSCprStates::TNoTagOrContentionTag)
|
|
116 |
//Awaiting for contention result, do not stop the start activity.
|
|
117 |
LAST_NODEACTIVITY_ENTRY(PDPSCprStates::KContentionTag, MeshMachine::TDoNothing)
|
|
118 |
|
|
119 |
LAST_NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::TCancelDataClientStartInPDP)
|
|
120 |
|
|
121 |
NODEACTIVITY_ENTRY(CoreNetStates::KProviderStopped, CoreNetStates::TStopSelf, CoreNetStates::TAwaitingDataClientStopped, MeshMachine::TTag<CoreNetStates::KProviderStopped>)
|
|
122 |
LAST_NODEACTIVITY_ENTRY(CoreNetStates::KProviderStopped, PDPSCprStates::TSendGoneDown)
|
|
123 |
NODEACTIVITY_END()
|
|
124 |
}
|
|
125 |
|
|
126 |
namespace PDPDeftSCprClientLeaveActivity
|
|
127 |
{ //This activity will wait for ECFActivityBinderRequest to complete
|
|
128 |
DECLARE_DEFINE_CUSTOM_NODEACTIVITY(ECFActivityClientLeave, PDPDeftSCprClientLeave, TNodeSignal::TNullMessageId, MeshMachine::CNodeRetryActivity::NewL) //May be waiting for both messages
|
|
129 |
NODEACTIVITY_ENTRY(KNoTag, PRStates::TRemoveClientAndSendLeaveCompleteIfRequest, CoreStates::TAwaitingClientLeave, CoreNetStates::TNoTagBlockedByBindToAndNoClients)
|
|
130 |
LAST_NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::TSendDataClientIdleIfNoSubconnsAndNoClients)
|
|
131 |
NODEACTIVITY_END()
|
|
132 |
}
|
|
133 |
|
|
134 |
namespace PDPDeftSCprIoctlActivity
|
|
135 |
{
|
|
136 |
DECLARE_DEFINE_CUSTOM_NODEACTIVITY(ECFActivityIoctl, PDPDeftSCprIoctl, TNodeSignal::TNullMessageId, MeshMachine::CNodeParallelMessageStoreActivityBase::NewL)
|
|
137 |
FIRST_NODEACTIVITY_ENTRY(PDPSCprStates::TAwaitingIoctlMessage, MeshMachine::TNoTag)
|
|
138 |
NODEACTIVITY_ENTRY(KNoTag, PDPSCprStates::TRetrieveSipAddr, CoreNetStates::TAwaitingRMessage2Processed, MeshMachine::TNoTag)
|
|
139 |
LAST_NODEACTIVITY_ENTRY(KNoTag, CoreStates::TPostToOriginators)
|
|
140 |
NODEACTIVITY_END()
|
|
141 |
}
|
|
142 |
|
|
143 |
namespace PDPDefSCprActivities
|
|
144 |
{
|
|
145 |
DECLARE_DEFINE_ACTIVITY_MAP(activityMap)
|
|
146 |
ACTIVITY_MAP_ENTRY(PDPDeftSCprDataClientStartActivity, PDPDeftDataClientStart)
|
|
147 |
ACTIVITY_MAP_ENTRY(PDPSCprNetworkStatusEventActivity, subConnStatusEvent)
|
|
148 |
ACTIVITY_MAP_ENTRY(PDPDeftSCprGoneDownActivity, PDPDeftSCprGoneDown)
|
|
149 |
ACTIVITY_MAP_ENTRY(PDPDeftSCprClientLeaveActivity, PDPDeftSCprClientLeave)
|
|
150 |
ACTIVITY_MAP_ENTRY(PDPDeftSCprIoctlActivity, PDPDeftSCprIoctl)
|
|
151 |
ACTIVITY_MAP_END_BASE(PDPSCprActivities, activityMap)
|
|
152 |
}
|
|
153 |
|
|
154 |
//-=========================================================
|
|
155 |
//
|
|
156 |
// CPDPDefaultSubConnectionProvider methods
|
|
157 |
//
|
|
158 |
//-=========================================================
|
|
159 |
|
|
160 |
CPDPDefaultSubConnectionProvider::CPDPDefaultSubConnectionProvider(ESock::CSubConnectionProviderFactoryBase& aFactory)
|
|
161 |
: CPDPSubConnectionProvider(aFactory, PDPDefSCprActivities::activityMap::Self()),
|
|
162 |
iAuthDialog(NULL)
|
|
163 |
{
|
|
164 |
LOG_NODE_CREATE1(KPDPSCprSubTag, CPDPDefaultSubConnectionProvider, " [factory=%08x]", &aFactory)
|
|
165 |
__FLOG_OPEN(KCFNodeTag, KPDPSCprSubTag);
|
|
166 |
}
|
|
167 |
|
|
168 |
CPDPDefaultSubConnectionProvider::~CPDPDefaultSubConnectionProvider()
|
|
169 |
{
|
|
170 |
LOG_NODE_DESTROY(KPDPSCprSubTag, CPDPDefaultSubConnectionProvider)
|
|
171 |
__FLOG_CLOSE;
|
|
172 |
delete iAuthDialog;
|
|
173 |
}
|
|
174 |
|
|
175 |
CPDPDefaultSubConnectionProvider* CPDPDefaultSubConnectionProvider::NewL(CPDPSubConnectionProviderFactory& aFactory)
|
|
176 |
/**
|
|
177 |
Construct a new PDP SubConnection Provider Object
|
|
178 |
|
|
179 |
@params aFactory factory that create this object
|
|
180 |
@param aConnProvider Connection Provider associated with this object
|
|
181 |
*/
|
|
182 |
{
|
|
183 |
CPDPDefaultSubConnectionProvider* ptr = new (ELeave) CPDPDefaultSubConnectionProvider(aFactory);
|
|
184 |
CleanupStack::PushL(ptr);
|
|
185 |
ptr->ConstructL();
|
|
186 |
CleanupStack::Pop();
|
|
187 |
return ptr;
|
|
188 |
}
|
|
189 |
|
|
190 |
void CPDPDefaultSubConnectionProvider::ConstructL()
|
|
191 |
{
|
|
192 |
CPDPSubConnectionProvider::ConstructL();
|
|
193 |
iPdpFsmInterface = new (ELeave) CPdpFsmInterface(*this);
|
|
194 |
}
|
|
195 |
|
|
196 |
void CPDPDefaultSubConnectionProvider::PdpFsmAllContextEvent(TInt aNotification, TInt /*aParam*/)
|
|
197 |
{
|
|
198 |
if (aNotification == KNetworkStatusEvent)
|
|
199 |
{
|
|
200 |
TPDPMessages::TPDPFSMMessage statusMsg(KNetworkStatusEvent, KErrNone);
|
|
201 |
TRAP_IGNORE(ReceivedL(TNodeId(Id()), TNodeCtxId(0, Id()), statusMsg)); //TODO - use trap assert?
|
|
202 |
}
|
|
203 |
}
|
|
204 |
|
|
205 |
void CPDPDefaultSubConnectionProvider::LinkUp()
|
|
206 |
{
|
|
207 |
if (iLinkUps++ == 0)
|
|
208 |
{
|
|
209 |
TCFMessage::TStateChange msg(Elements::TStateChange(KLinkLayerOpen, KErrNone));
|
|
210 |
//Forward to control clients if there are any
|
|
211 |
TInt ctrlClientCount = PostToClients<TDefaultClientMatchPolicy>(Id(), msg, TClientType(TCFClientType::ECtrl));
|
|
212 |
if (0==ctrlClientCount)
|
|
213 |
{ //If there are no control clients any more, forward to the control provider
|
|
214 |
PostToClients<TDefaultClientMatchPolicy>(Id(), msg, TClientType(TCFClientType::ECtrlProvider));
|
|
215 |
}
|
|
216 |
}
|
|
217 |
}
|
|
218 |
|
|
219 |
void CPDPDefaultSubConnectionProvider::LinkDown(TInt aCause)
|
|
220 |
{
|
|
221 |
if (++iLinkDowns-iLinkUps == 0 || iLinkUps == 0)
|
|
222 |
{
|
|
223 |
ControlProvider()->PostMessage(Id(),
|
|
224 |
TCFMessage::TStateChange(Elements::TStateChange(KLinkLayerClosed, aCause)).CRef());
|
|
225 |
}
|
|
226 |
SendDataClientIdleIfNoSubconnsAndNoClientsL();
|
|
227 |
}
|
|
228 |
|
|
229 |
void CPDPDefaultSubConnectionProvider::SendDataClientIdleIfNoSubconnsAndNoClientsL()
|
|
230 |
{
|
|
231 |
// linkDowns is called more places than linkup, so it may in fact be higher, would be nice if something was
|
|
232 |
// done in the future to make iLinkDowns and iLinkUps are symettrical
|
|
233 |
if (iLinkDowns-iLinkUps >= 0 || iLinkUps == 0)
|
|
234 |
{
|
|
235 |
if (GetFirstClient<TDefaultClientMatchPolicy>(TClientType(TCFClientType::ECtrl|TCFClientType::EAux))==NULL
|
|
236 |
&& GetFirstClient<TDefaultClientMatchPolicy>(TClientType(TCFClientType::EData, TCFClientType::EActive)) == NULL)
|
|
237 |
{
|
|
238 |
RNodeInterface* cp = ControlProvider();
|
|
239 |
if (cp)
|
|
240 |
{ //If there is no Control Provider we probably are an MCPR/Tier Manager/etc
|
|
241 |
cp->PostMessage(Id(), TCFControlProvider::TIdle().CRef());
|
|
242 |
}
|
|
243 |
return;
|
|
244 |
}
|
|
245 |
|
|
246 |
RNodeInterface* cc = GetFirstClient<TDefaultClientMatchPolicy>(TClientType(TCFClientType::ECtrl));
|
|
247 |
if (cc==NULL)
|
|
248 |
{
|
|
249 |
TClientIter<TDefaultClientMatchPolicy> dciter = GetClientIter<TDefaultClientMatchPolicy>(
|
|
250 |
TClientType(
|
|
251 |
TCFClientType::EData,
|
|
252 |
TCFClientType::EActive
|
|
253 |
|TCFClientType::EActivating
|
|
254 |
|TCFClientType::EStarted
|
|
255 |
|TCFClientType::EStarting
|
|
256 |
|TCFClientType::ELeaving
|
|
257 |
)
|
|
258 |
);
|
|
259 |
|
|
260 |
TInt i = 0;
|
|
261 |
RNodeInterface* dc;
|
|
262 |
while ((dc = dciter[i++]) != NULL)
|
|
263 |
{
|
|
264 |
dc->PostMessage(Id(), TCFControlProvider::TIdle().CRef());
|
|
265 |
}
|
|
266 |
}
|
|
267 |
}
|
|
268 |
}
|
|
269 |
|
|
270 |
void CPDPDefaultSubConnectionProvider::AuthenticateL()
|
|
271 |
{
|
|
272 |
__ASSERT_DEBUG(iAuthDialog == NULL, User::Invariant());
|
|
273 |
|
|
274 |
//Update & send user name, password from commsdat; it is upto dialog server to decide which information to show to the user
|
|
275 |
RPacketContext::TProtocolConfigOptionV2* configOption = ProtocolConfigOptionL();
|
|
276 |
|
|
277 |
iUsername.Copy(configOption->iAuthInfo.iUsername);
|
|
278 |
iPassword.Copy(configOption->iAuthInfo.iPassword);
|
|
279 |
|
|
280 |
__CFLOG_VAR((KPDPSCprTag, KPDPSCprSubTag, _L8("CPDPSubConnectionProvider [this=%08x]::AuthenticationCompleteL() KCDTIdWCDMAIfAuthName [%S] "), this, &iUsername));
|
|
281 |
__CFLOG_VAR((KPDPSCprTag, KPDPSCprSubTag, _L8("CPDPSubConnectionProvider [this=%08x]::AuthenticationCompleteL() KCDTIdWCDMAIfAuthName [%S] "), this, &iPassword));
|
|
282 |
|
|
283 |
iAuthDialog = CAuthenticationDialog::NewL();
|
|
284 |
iAuthDialog->Authenticate(*this, iUsername, iPassword);
|
|
285 |
}
|
|
286 |
|
|
287 |
void CPDPDefaultSubConnectionProvider::AuthenticationCompleteL(TInt aError)
|
|
288 |
{
|
|
289 |
//Update user name & password
|
|
290 |
if (aError == KErrNone)
|
|
291 |
{
|
|
292 |
RPacketContext::TProtocolConfigOptionV2* configOption = ProtocolConfigOptionL();
|
|
293 |
|
|
294 |
configOption->iAuthInfo.iUsername.Copy(iUsername);
|
|
295 |
configOption->iAuthInfo.iPassword.Copy(iPassword);
|
|
296 |
|
|
297 |
__CFLOG_VAR((KPDPSCprTag, KPDPSCprSubTag, _L8("CPDPSubConnectionProvider [this=%08x]::AuthenticationCompleteL() KCDTIdWCDMAIfAuthName [%S] "), this, &configOption->iAuthInfo.iUsername));
|
|
298 |
__CFLOG_VAR((KPDPSCprTag, KPDPSCprSubTag, _L8("CPDPSubConnectionProvider [this=%08x]::AuthenticationCompleteL() KCDTIdWCDMAIfAuthName [%S] "), this, &configOption->iAuthInfo.iPassword));
|
|
299 |
}
|
|
300 |
|
|
301 |
//Send AuthenticateComplete message
|
|
302 |
RClientInterface::OpenPostMessageClose(Id(), Id(),
|
|
303 |
TPDPMessages::TAuthenticateComplete(aError).CRef());
|
|
304 |
|
|
305 |
delete iAuthDialog;
|
|
306 |
iAuthDialog = NULL;
|
|
307 |
}
|
|
308 |
|
|
309 |
RPacketContext::TProtocolConfigOptionV2* CPDPDefaultSubConnectionProvider::ProtocolConfigOptionL()
|
|
310 |
/**
|
|
311 |
* This function returns the pointer to TProtocolConfigOptionV2 parameter of ContextConfig.
|
|
312 |
*/
|
|
313 |
{
|
|
314 |
CGPRSProvision* gprsProvision = const_cast<CGPRSProvision*>(static_cast<const CGPRSProvision*>(
|
|
315 |
AccessPointConfig().FindExtension(STypeId::CreateSTypeId(CGPRSProvision::EUid,CGPRSProvision::ETypeId))));
|
|
316 |
|
|
317 |
if (gprsProvision == NULL)
|
|
318 |
{
|
|
319 |
User::Leave(KErrCorrupt);
|
|
320 |
}
|
|
321 |
|
|
322 |
RPacketContext::TProtocolConfigOptionV2* configOption=NULL;
|
|
323 |
|
|
324 |
switch (gprsProvision->UmtsGprsRelease())
|
|
325 |
{
|
|
326 |
case TPacketDataConfigBase::KConfigGPRS:
|
|
327 |
{
|
|
328 |
RPacketContext::TContextConfigGPRS& contextGPRS = gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigGPRS>();
|
|
329 |
configOption = &contextGPRS.iProtocolConfigOption;
|
|
330 |
}
|
|
331 |
break;
|
|
332 |
case TPacketDataConfigBase::KConfigRel99Rel4:
|
|
333 |
{
|
|
334 |
RPacketContext::TContextConfigR99_R4& contextUMTS = gprsProvision->GetScratchContextAs<RPacketContext::TContextConfigR99_R4>();
|
|
335 |
configOption = &contextUMTS.iProtocolConfigOption;
|
|
336 |
}
|
|
337 |
break;
|
|
338 |
case TPacketDataConfigBase::KConfigRel5:
|
|
339 |
{
|
|
340 |
RPacketContext::TContextConfig_R5& contextR5 = gprsProvision->GetScratchContextAs<RPacketContext::TContextConfig_R5>();
|
|
341 |
configOption = &contextR5.iProtocolConfigOption;
|
|
342 |
}
|
|
343 |
break;
|
|
344 |
default:
|
|
345 |
User::Leave(KErrNotSupported);
|
|
346 |
break;
|
|
347 |
}
|
|
348 |
return configOption;
|
|
349 |
}
|