linklayercontrol/networkinterfacemgr/agentprcore/src/CAgentAdapter.cpp
branchRCL_3
changeset 58 8d540f55e491
parent 57 abbed5a4b42a
child 75 c1029e558ef5
equal deleted inserted replaced
57:abbed5a4b42a 58:8d540f55e491
    69 */
    69 */
    70 CAgentAdapter::CAgentAdapter(CAgentSubConnectionProvider& aAgentScpr)
    70 CAgentAdapter::CAgentAdapter(CAgentSubConnectionProvider& aAgentScpr)
    71     : iAgentScpr(aAgentScpr),
    71     : iAgentScpr(aAgentScpr),
    72     iAgentState(EDisconnected),
    72     iAgentState(EDisconnected),
    73     iAgentConnectType(EAgentNone),
    73     iAgentConnectType(EAgentNone),
    74     iLastProgress(KFinishedSelection,KErrNone)
    74     iLastProgress(KFinishedSelection,KErrNone),iAgentErrorState(EFalse)
    75     {
    75     {
    76     }
    76     }
    77 
    77 
    78 
    78 
    79 /**
    79 /**
   146 Begins the disconnection of the Agent
   146 Begins the disconnection of the Agent
   147 */
   147 */
   148 void CAgentAdapter::DisconnectAgent(TInt aReason)
   148 void CAgentAdapter::DisconnectAgent(TInt aReason)
   149     {
   149     {
   150     if (iAgentState == EConnecting)
   150     if (iAgentState == EConnecting)
   151         {
   151         {    
   152         iAgent->CancelConnect();
   152         iAgent->CancelConnect();
   153         }
   153         }
   154     else if (iAgentState == EReconnecting)
   154     else if (iAgentState == EReconnecting)
   155         {
   155         {
   156         iAgent->CancelReconnect();
   156         iAgent->CancelReconnect();
   157         }
   157         }
   158     iAgentState = EDisconnecting;
   158     if (iAgentState != EDisconnecting)
   159     iAgent->Disconnect(aReason);
   159         {        
       
   160         iAgentState = EDisconnecting;
       
   161     	iAgent->Disconnect(aReason);
       
   162         }
   160     }
   163     }
   161 
   164 
   162 
   165 
   163 /**
   166 /**
   164 Starts the process of obtaining authentication information via the Agent
   167 Starts the process of obtaining authentication information via the Agent
   305 #endif
   308 #endif
   306             }
   309             }
   307         else
   310         else
   308             {
   311             {
   309             iLastProgress.iError = aStatus;
   312             iLastProgress.iError = aStatus;
       
   313             // set the agent state to EDisconnecting
       
   314             iAgentState = EDisconnecting;
   310             iAgent->Disconnect(aStatus);
   315             iAgent->Disconnect(aStatus);
   311             }
   316             }
   312         }
   317         }
   313    }
   318    }
   314 
   319 
   346         }
   351         }
   347     else
   352     else
   348         {
   353         {
   349 #ifdef __CFLOG_ACTIVE
   354 #ifdef __CFLOG_ACTIVE
   350     	TRAPD(err,
   355     	TRAPD(err,
   351     		//iAgentScpr.ProgressL(KConnectionUninitialised);
       
   352     		iAgentState = EDisconnected;
   356     		iAgentState = EDisconnected;
   353     		iAgentScpr.ConnectionDownL();
   357     		iAgentScpr.ConnectionDownL();
       
   358     	//	iAgentScpr.ProgressL(KConnectionUninitialised);
   354     		);
   359     		);
   355             if (err != KErrNone)
   360             if (err != KErrNone)
   356                 {
   361                 {
   357                 __CFLOG_VAR((KAgentSCprTag, KAgentSCprSubTag, _L8("CAgentAdapter::DisconnectComplete() - Trapped [err=%d]"), err));
   362                 __CFLOG_VAR((KAgentSCprTag, KAgentSCprSubTag, _L8("CAgentAdapter::DisconnectComplete() - Trapped [err=%d]"), err));
   358                 __ASSERT_DEBUG(EFalse, User::Panic(KSpecAssert_NifManAgtPrCCAgn, 3));
   363                 __ASSERT_DEBUG(EFalse, User::Panic(KSpecAssert_NifManAgtPrCCAgn, 3));
   359                 }
   364                 }
   360 #else
   365 #else
   361     	TRAP_IGNORE(
   366     	TRAP_IGNORE(
   362             //iAgentScpr.ProgressL(KConnectionUninitialised);
       
   363     		iAgentState = EDisconnected;
   367     		iAgentState = EDisconnected;
   364     		iAgentScpr.ConnectionDownL();
   368     		iAgentScpr.ConnectionDownL();
       
   369             //iAgentScpr.ProgressL(KConnectionUninitialised);
   365     		);
   370     		);
   366 #endif
   371 #endif
   367         }
   372         }
   368    }
   373    }
   369 
   374 
   389 #endif
   394 #endif
   390         }
   395         }
   391     else
   396     else
   392         {
   397         {
   393         iAgentScpr.Error(iLastProgress);
   398         iAgentScpr.Error(iLastProgress);
       
   399         iAgentErrorState = ETrue;
   394         }
   400         }
   395     }
   401     }
   396 
   402 
   397 
   403 
   398 /**
   404 /**