68 iStateStopping (this), |
67 iStateStopping (this), |
69 iStateCreatingMbms(this), |
68 iStateCreatingMbms(this), |
70 iStateActivatingMbms(this), |
69 iStateActivatingMbms(this), |
71 iStateCreatedMbms(this) |
70 iStateCreatedMbms(this) |
72 { |
71 { |
73 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPFSMFACTORY_CTOR_1, ">>CPdpFsmFactory::CPdpFsmFactory()"); |
72 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPFSMFACTORY_CTOR_1, " Constructor"); |
74 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPFSMFACTORY_CTOR_2, "<<CPdpFsmFactory::CPdpFsmFactory()"); |
|
75 } |
73 } |
76 |
74 |
77 |
75 |
78 CPdpFsmFactory::~CPdpFsmFactory() |
76 CPdpFsmFactory::~CPdpFsmFactory() |
79 { |
77 { |
80 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPFSMFACTORY_DTOR_1, ">>CPdpFsmFactory::~CPdpFsmFactory()"); |
78 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPFSMFACTORY_DTOR_1, " Destructor"); |
81 |
79 |
82 iContexts.DeleteAll(); |
80 iContexts.DeleteAll(); |
83 iContexts.Reset(); |
81 iContexts.Reset(); |
84 |
82 |
85 delete iEtelDriverInput; |
83 delete iEtelDriverInput; |
86 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPFSMFACTORY_DTOR_2, "<<CPdpFsmFactory::~CPdpFsmFactory()"); |
|
87 } |
84 } |
88 |
85 |
89 |
86 |
90 void CPdpFsmFactory::InitL(const TName& aTsyName, CPdpFsmInterface * aPdpFsmInterface) |
87 void CPdpFsmFactory::InitL(const TName& aTsyName, CPdpFsmInterface * aPdpFsmInterface) |
91 { |
88 { |
92 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPFSMFACTORY_INITL_1, ">>CPdpFsmFactory::InitL()"); |
89 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPFSMFACTORY_INITL_1, " Tsy Name [%S]", aTsyName); |
93 |
90 |
94 iPdpFsmInterface = aPdpFsmInterface; |
91 iPdpFsmInterface = aPdpFsmInterface; |
95 |
|
96 iTsyName = aTsyName; |
92 iTsyName = aTsyName; |
97 |
93 |
98 // lets kick off the ETelDriver first then we only alloc FSMs if it works |
94 // lets kick off the ETelDriver first then we only alloc FSMs if it works |
99 // |
95 // |
100 iEtelDriverInput = new (ELeave) REtelDriverInput; |
96 iEtelDriverInput = new (ELeave) REtelDriverInput; |
101 |
|
102 iEtelDriverInput->OpenL (*iPdpFsmInterface); |
97 iEtelDriverInput->OpenL (*iPdpFsmInterface); |
103 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPFSMFACTORY_INITL_2, "<<CPdpFsmFactory::InitL()"); |
|
104 // Only create PDP contexts if specifically requested. |
98 // Only create PDP contexts if specifically requested. |
105 } |
99 } |
106 |
100 |
107 |
101 |
108 void CPdpFsmFactory::Close (void) |
102 void CPdpFsmFactory::Close (void) |
109 { |
103 { |
110 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPFSMFACTORY_CLOSE_1, ">>CPdpFsmFactory::Close()"); |
104 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPFSMFACTORY_CLOSE_1, " Close()"); |
111 // in OOM conditions iEtelDriveInput may not have successfully |
105 // in OOM conditions iEtelDriveInput may not have successfully |
112 // been created, check here for safety. |
106 // been created, check here for safety. |
113 if (iEtelDriverInput != NULL) |
107 if (iEtelDriverInput != NULL) |
114 { |
108 { |
115 iEtelDriverInput->Close(); |
109 iEtelDriverInput->Close(); |
116 } |
110 } |
117 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPFSMFACTORY_CLOSE_2, "<<CPdpFsmFactory::Close()"); |
|
118 } |
111 } |
119 |
112 |
120 |
113 |
121 /** |
114 /** |
122 @return may return NULL if there is no PDP context with that Id |
115 @return may return NULL if there is no PDP context with that Id |
123 */ |
116 */ |
124 CPdpFsm* CPdpFsmFactory::GetFsmContext (TContextId aPdpId) |
117 CPdpFsm* CPdpFsmFactory::GetFsmContext (TContextId aPdpId) |
125 { |
118 { |
126 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPFSMFACTORY_GETFSMCONTEXT_1, ">>CPdpFsmFactory::GetContext()"); |
119 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPFSMFACTORY_GETFSMCONTEXT_1, " for context id [%d]", aPdpId); |
127 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPFSMFACTORY_GETFSMCONTEXT_2, "<<CPdpFsmFactory::GetContext()"); |
|
128 return iContexts[aPdpId]; |
120 return iContexts[aPdpId]; |
129 } |
121 } |
130 |
122 |
131 |
123 |
132 const TName& CPdpFsmFactory::TsyName(void) |
124 const TName& CPdpFsmFactory::TsyName(void) |
166 { |
158 { |
167 CPdpFsm* p = CPdpFsm::NewL(i, this, iEtelDriverInput, aPdpFsmEventHandler, aContextType); |
159 CPdpFsm* p = CPdpFsm::NewL(i, this, iEtelDriverInput, aPdpFsmEventHandler, aContextType); |
168 iContexts[i] = p; |
160 iContexts[i] = p; |
169 iEtelDriverInput->CreatePdpL(i, aContextType); |
161 iEtelDriverInput->CreatePdpL(i, aContextType); |
170 } |
162 } |
171 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPFSMFACTORY_NEWFSMCONTEXTL_3, "<<CPdpFsmFactory::NewFsmContext()"); |
163 |
|
164 OstTraceDef1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPFSMFACTORY_NEWFSMCONTEXTL_3, " Return Context Id [%d]", i); |
172 return i; |
165 return i; |
173 #endif |
166 #endif |
174 } |
167 } |
175 |
168 |
176 TInt CPdpFsmFactory::DeleteFsmContext(TContextId aPdpId) |
169 TInt CPdpFsmFactory::DeleteFsmContext(TContextId aPdpId) |
177 { |
170 { |
178 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPFSMFACTORY_DELETEFSMCONTEXT_1, ">>CPdpFsmFactory::DeleteFsmContext()"); |
|
179 ASSERT(ContextIsValid(aPdpId)); |
171 ASSERT(ContextIsValid(aPdpId)); |
|
172 OstTraceDefExt1(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPFSMFACTORY_DELETEFSMCONTEXT_1, " for context name [%S]", iContexts[aPdpId]->GetDataChannelV2().iChannelId); |
180 |
173 |
181 delete iContexts[aPdpId]; |
174 delete iContexts[aPdpId]; |
182 iContexts[aPdpId] = NULL; |
175 iContexts[aPdpId] = NULL; |
183 OstTraceDef0(OST_TRACE_CATEGORY_DEBUG, TRACE_INTERNALS, CPDPFSMFACTORY_DELETEFSMCONTEXT_2, "<<CPdpFsmFactory::DeleteFsmContext()"); |
|
184 return KErrNone; |
176 return KErrNone; |
185 } |
177 } |
186 |
178 |