1 // Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). |
1 // Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies). |
2 // All rights reserved. |
2 // All rights reserved. |
3 // This component and the accompanying materials are made available |
3 // This component and the accompanying materials are made available |
4 // under the terms of "Eclipse Public License v1.0" |
4 // under the terms of "Eclipse Public License v1.0" |
5 // which accompanies this distribution, and is available |
5 // which accompanies this distribution, and is available |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
17 |
17 |
18 /** |
18 /** |
19 @file Nd_bases.cpp |
19 @file Nd_bases.cpp |
20 */ |
20 */ |
21 |
21 |
|
22 |
|
23 |
|
24 #include "OstTraceDefinitions.h" |
|
25 #ifdef OST_TRACE_COMPILER_IN_USE |
|
26 #include "Nd_BasesTraces.h" |
|
27 #endif |
|
28 |
22 #include "Nd_Bases.h" |
29 #include "Nd_Bases.h" |
23 #include "SLOGGER.H" |
|
24 #include <comms-infras/eventlogger.h> |
30 #include <comms-infras/eventlogger.h> |
25 #include "ND_ETEL.H" |
31 #include "ND_ETEL.H" |
26 #include "ND_DBACC.H" |
32 #include "ND_DBACC.H" |
27 #include "ND_SCR.H" |
33 #include "ND_SCR.H" |
28 |
34 |
29 // Netdial SM base class |
35 // Netdial SM base class |
30 |
36 |
31 CNetdialSM::CNetdialSM(MAgentNotify& aControllerObserver, CDialogProcessor* aDlgPrc, CCommsDbAccess& aDbAccess) |
37 CNetdialSM::CNetdialSM(MAgentNotify& aControllerObserver, CDialogProcessor* aDlgPrc, CCommsDbAccess& aDbAccess) |
32 : CAgentSMBase(aControllerObserver,aDlgPrc,aDbAccess) |
38 : CAgentSMBase(aControllerObserver,aDlgPrc,aDbAccess), |
|
39 iNdScript(NULL) |
33 /** |
40 /** |
34 Constructor. |
41 Constructor. |
35 |
42 |
36 @param aControllerObserver a reference to the observer. |
43 @param aControllerObserver a reference to the observer. |
37 @param aDlgPrc a reference to the dialog processor. |
44 @param aDlgPrc a reference to the dialog processor. |
84 Determine if a script needs to be used. |
91 Determine if a script needs to be used. |
85 @see CNetdialSM::UseScript. |
92 @see CNetdialSM::UseScript. |
86 */ |
93 */ |
87 { |
94 { |
88 TInt len = 0; |
95 TInt len = 0; |
89 __FLOG_STMT(_LIT8(logString0,"Netdial:\tGetUseScriptL");) |
96 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CNETDIALSM_GETUSESCRIPTL_1, "Netdial:\tGetUseScriptL"); |
90 __FLOG_STATIC(KNetDialLogFolder(), KNetDialLogFile(), logString0); |
|
91 iDbAccess->GetScriptDetailsL(iUseScript, len); |
97 iDbAccess->GetScriptDetailsL(iUseScript, len); |
92 __FLOG_STMT(_LIT8(logString1,"Netdial:\tGetUseScriptL. iUseScript [%d]");) |
98 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CNETDIALSM_GETUSESCRIPTL_2, "Netdial:\tGetUseScriptL. iUseScript [%d]",iUseScript); |
93 __FLOG_STATIC1(KNetDialLogFolder(), KNetDialLogFile(), logString1, iUseScript); |
|
94 } |
99 } |
95 #endif // SYMBIAN_NETWORKING_CSDAGENT_BCA_SUPPORT |
100 #endif // SYMBIAN_NETWORKING_CSDAGENT_BCA_SUPPORT |
96 TInt CNetdialSM::GetExcessData(TDes8& aBuffer) |
101 TInt CNetdialSM::GetExcessData(TDes8& aBuffer) |
97 /** |
102 /** |
98 Get excess data buffer from script engine. |
103 Get excess data buffer from script engine. |
99 |
104 |
100 @param aBuffer a reference to the observer. |
105 @param aBuffer a reference to the observer. |
101 @return KErrNotFound if script is not found. |
106 @return KErrNotFound if script is not found. |
102 */ |
107 */ |
103 { |
108 { |
104 __FLOG_STMT(_LIT8(logString,"NetDial:\tGetting Excess Data");) |
109 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CNETDIALSM_GETEXCESSDATA_1,"NetDial:\tGetting Excess Data"); |
105 __FLOG_STATIC(KNetDialLogFolder(),KNetDialLogFile(),logString()); |
|
106 if (iNdScript!=NULL) |
110 if (iNdScript!=NULL) |
107 return iNdScript->GetExcessData(aBuffer); |
111 return iNdScript->GetExcessData(aBuffer); |
108 else |
112 else |
109 { |
113 { |
110 aBuffer.Zero(); |
114 aBuffer.Zero(); |
198 to script executor, otherwise advance phase to and call ServiceStarted() |
202 to script executor, otherwise advance phase to and call ServiceStarted() |
199 */ |
203 */ |
200 { |
204 { |
201 if(iStatus!=KErrNone) |
205 if(iStatus!=KErrNone) |
202 { |
206 { |
203 __FLOG_STMT(_LIT(logString3,"Get Login Info");) |
207 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CGETLOGININFO_RUNL_1,"NetDial:\tCompleted Phase 'Get Login Info' with Error %d", iStatus.Int()); |
204 __FLOG_STATIC2(KNetDialLogFolder(),KNetDialLogFile(),TRefByValue<const TDesC>(KCompletedPhaseLogString()), &logString3(), iStatus.Int()); |
|
205 if (iNdEnv->Script()!=NULL) |
208 if (iNdEnv->Script()!=NULL) |
206 iNdEnv->Script()->CloseScript(); |
209 iNdEnv->Script()->CloseScript(); |
207 iSMObserver->ConnectionComplete(ECsdGotLoginInfo,iStatus.Int()); |
210 iSMObserver->ConnectionComplete(ECsdGotLoginInfo,iStatus.Int()); |
208 return; |
211 return; |
209 } |
212 } |
210 iSMObserver->UpdateProgress(ECsdGotLoginInfo,KErrNone); |
213 iSMObserver->UpdateProgress(ECsdGotLoginInfo,KErrNone); |
211 |
214 |
212 if (!(iNdEnv->BaseEnv())->IsReconnect()) |
215 if (!(iNdEnv->BaseEnv())->IsReconnect()) |
213 { |
216 { |
214 __FLOG_STATIC(KNetDialLogFolder(),KNetDialLogFile(),KServiceStartedLogString()); |
217 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CGETLOGININFO_RUNL_2,"NetDial:\tService Started"); |
215 } |
218 } |
216 else |
219 else |
217 { |
220 { |
218 __FLOG_STATIC(KNetDialLogFolder(),KNetDialLogFile(),KServiceStartedReconnLogString()); |
221 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CGETLOGININFO_RUNL_3, "NetDial:\tService Started On Reconnection"); |
219 } |
222 } |
220 iSMObserver->ServiceStarted(); |
223 iSMObserver->ServiceStarted(); |
221 (iNdEnv->BaseEnv())->CompleteState(KErrNone); |
224 (iNdEnv->BaseEnv())->CompleteState(KErrNone); |
222 } |
225 } |
223 |
226 |