212 error = err.iStateChange.iError; |
212 error = err.iStateChange.iError; |
213 } |
213 } |
214 |
214 |
215 ASSERT( error != KErrNone ); |
215 ASSERT( error != KErrNone ); |
216 |
216 |
|
217 // Special handling for GoneDown errors. In this phase it is necessary |
|
218 // to make sure that we are actually in GoneDown recovery, not in |
|
219 // start recovery. So check activity instead of error code |
|
220 if (iContext.iNodeActivity->ActivityId() == ECFActivityConnectionGoneDownRecovery) |
|
221 { |
|
222 // We are requesting error recovery from MPM for GoneDown error |
|
223 // Set the flag indicating that lower layer is not in a valid state |
|
224 // so that we can discard NoBearer request coming from data clients |
|
225 // for the time being. |
|
226 S60MCPRLOGSTRING1("S60MCPR<%x>::TProcessError::DoL() Setting GoneDown recovery flag",(TInt*)&iContext.Node()) |
|
227 node.SetGoneDownRecoveryOngoing(); |
|
228 } |
|
229 |
217 // Create the callback that will eventually create the message that completes this state. |
230 // Create the callback that will eventually create the message that completes this state. |
218 CProcessErrorCb* cb = new( ELeave ) CProcessErrorCb( node, iContext.iNodeActivity ); // codescanner::leave |
231 CProcessErrorCb* cb = new( ELeave ) CProcessErrorCb( node, iContext.iNodeActivity ); // codescanner::leave |
219 CleanupStack::PushL( cb ); // codescanner::leave |
232 CleanupStack::PushL( cb ); // codescanner::leave |
220 // We always need to ask MPM to handle the error. |
233 // We always need to ask MPM to handle the error. |
221 node.Policy()->ProcessErrorL( error, cb ); // codescanner::leave |
234 node.Policy()->ProcessErrorL( error, cb ); // codescanner::leave |
222 CleanupStack::Pop( cb ); |
235 CleanupStack::Pop( cb ); |
223 // After this we wait for cancellation/error/completion. |
236 // After this we wait for cancellation/error/completion. |
224 } |
237 } |
225 |
238 |
|
239 // ----------------------------------------------------------------------------- |
|
240 // THandleNoBearerDuringGoneDownRecovery::DoL |
|
241 // ----------------------------------------------------------------------------- |
|
242 // |
|
243 DEFINE_SMELEMENT( THandleNoBearerDuringGoneDownRecovery, NetStateMachine::MStateTransition, TContext ) |
|
244 void THandleNoBearerDuringGoneDownRecovery::DoL() // codescanner::leave |
|
245 { |
|
246 // As this is a single triple activity, there is no real activity |
|
247 // instance available. Therefore, we need to live with the info |
|
248 // available in the context. |
|
249 S60MCPRLOGSTRING1("S60MCPR<%x>::THandleNoBearerDuringGoneDownRecovery::DoL() Return error",(TInt*)&iContext.Node()) |
|
250 TEBase::TError errorMsg ( iContext.iMessage.MessageId(), KErrNotReady ); |
|
251 iContext.PostToSender( errorMsg ); |
|
252 } |
226 |
253 |
227 // ----------------------------------------------------------------------------- |
254 // ----------------------------------------------------------------------------- |
228 // TAwaitingSelectNextLayerCompletedOrError::Accept |
255 // TAwaitingSelectNextLayerCompletedOrError::Accept |
229 // ----------------------------------------------------------------------------- |
256 // ----------------------------------------------------------------------------- |
230 // |
257 // |
513 } |
540 } |
514 return EFalse; |
541 return EFalse; |
515 } |
542 } |
516 |
543 |
517 // ----------------------------------------------------------------------------- |
544 // ----------------------------------------------------------------------------- |
|
545 // TAwaitingNoBearerInGoneDownRecovery::Accept |
|
546 // ----------------------------------------------------------------------------- |
|
547 // |
|
548 DEFINE_SMELEMENT( TAwaitingNoBearerInGoneDownRecovery, NetStateMachine::MState, TContext ) |
|
549 TBool TAwaitingNoBearerInGoneDownRecovery::Accept() |
|
550 { |
|
551 if ( iContext.iMessage.IsMessage<TCFControlProvider::TNoBearer>() ) |
|
552 { |
|
553 // Get MCPR to check gone down flag status |
|
554 CS60MetaConnectionProvider& node = (CS60MetaConnectionProvider&)iContext.Node(); |
|
555 if ( node.IsGoneDownRecoveryOngoing() ) |
|
556 { |
|
557 // We have received a NoBearer while recovering from a GoneDown error |
|
558 // Needs special handling -> accept |
|
559 S60MCPRLOGSTRING1("S60MCPR<%x>::TAwaitingNoBearerInGoneDownRecovery::Accept() return true", (TInt*)&iContext.Node()) |
|
560 return ETrue; |
|
561 } |
|
562 } |
|
563 return EFalse; |
|
564 } |
|
565 |
|
566 // ----------------------------------------------------------------------------- |
518 // TRetrieveServiceId::DoL |
567 // TRetrieveServiceId::DoL |
519 // ----------------------------------------------------------------------------- |
568 // ----------------------------------------------------------------------------- |
520 // |
569 // |
521 DEFINE_SMELEMENT( TRetrieveServiceId, NetStateMachine::MStateTransition, TContext ) |
570 DEFINE_SMELEMENT( TRetrieveServiceId, NetStateMachine::MStateTransition, TContext ) |
522 void TRetrieveServiceId::DoL() |
571 void TRetrieveServiceId::DoL() |