cbsref/telephonyrefplugins/atltsy/handler/src/cltsyphonehandler.cpp
branchRCL_3
changeset 20 07a122eea281
parent 19 630d2f34d719
child 21 4814c5a49428
equal deleted inserted replaced
19:630d2f34d719 20:07a122eea281
     1 // Copyright (c) 2009 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 // CLtsyPhoneHandler
       
    15 
       
    16 #include <ctsy/ltsy/cctsydispatchercallback.h>
       
    17 #include <mmtsy_ipcdefs.h>
       
    18 #include <etelmm.h>
       
    19 #include <ctsy/ltsy/ltsylogger.h>
       
    20 #include <ctsy/ltsy/mltsydispatchphoneinterface.h>
       
    21 
       
    22 #include "cltsyphonehandler.h"
       
    23 #include "ltsymacros.h"
       
    24 #include "atgetmodemstatus.h"
       
    25 #include "atgetnetworkregistrationstatus.h"
       
    26 #include "atgetsimstatusready.h"
       
    27 #include "atgetnetworkinfo.h"
       
    28 #include "atgetsignalstrength.h"
       
    29 #include "atgetbatteryinfo.h"
       
    30 #include "atdetectnetwork.h"
       
    31 #include "getphoneid.h"
       
    32 #include "initializephone.h"
       
    33 #include "mslogger.h"
       
    34 #include "athangup.h"
       
    35 #include "getoperatorname.h"
       
    36 #include "atselectnetworkmode.h"
       
    37 #include "atselectnetwork.h"
       
    38 #include "atgetphonecellinfo.h"
       
    39 #include "atgetcellinfo.h"
       
    40 #include "atsetnotifycell.h"
       
    41 #include "asynchelperrequest.h"
       
    42 #include "atnetworkregstatuschange.h"
       
    43 #include "atnotifycellinfo.h"
       
    44 #include "notifybatteryandsignal.h"
       
    45 #include "getfdnstatus.h"
       
    46 #include "getcurrentnetworkinfo.h"
       
    47 #include "atgetphonecellinfo.h"
       
    48 
       
    49 CLtsyPhoneHandler::CLtsyPhoneHandler(
       
    50 	CCtsyDispatcherCallback& aCtsyDispatcherCallback,CGlobalPhonemanager* aGloblePhone)
       
    51 	: iCtsyDispatcherCallback(aCtsyDispatcherCallback),iGloblePhone(aGloblePhone)
       
    52 	{
       
    53 	}
       
    54 
       
    55 	
       
    56 CLtsyPhoneHandler::~CLtsyPhoneHandler()
       
    57 	{
       
    58 	if(iAsyncHelperRequest)
       
    59 		{
       
    60 		delete iAsyncHelperRequest;
       
    61 		iAsyncHelperRequest = NULL;
       
    62 		}	
       
    63 	if(iNetworkRegStatusChange)
       
    64 		{
       
    65 		delete iNetworkRegStatusChange;
       
    66 		iNetworkRegStatusChange = NULL;
       
    67 		}
       
    68 	if(iNotifyCellInfo)
       
    69 		{
       
    70 		delete iNotifyCellInfo;
       
    71 		iNotifyCellInfo = NULL;
       
    72 		}
       
    73 	if(iNotifyBatteryAndSignal)
       
    74 		{
       
    75 		delete iNotifyBatteryAndSignal;
       
    76 		iNotifyBatteryAndSignal = NULL;
       
    77 		}
       
    78 	if(iInitializePhone)
       
    79 		{
       
    80 		delete iInitializePhone;
       
    81 		iInitializePhone = NULL;
       
    82 		}
       
    83 	if(iATDetectNetwork)
       
    84 		{
       
    85 		delete iATDetectNetwork;
       
    86 		iATDetectNetwork = NULL;
       
    87 		}
       
    88 	}
       
    89 
       
    90 
       
    91 CLtsyPhoneHandler* CLtsyPhoneHandler::NewLC(
       
    92 	CCtsyDispatcherCallback& aCtsyDispatcherCallback,CGlobalPhonemanager* aGloblePhone)
       
    93 	{
       
    94 	TSYLOGENTRYEXIT;
       
    95 	CLtsyPhoneHandler* self = new (ELeave) CLtsyPhoneHandler(aCtsyDispatcherCallback,aGloblePhone);
       
    96 	CleanupStack::PushL(self);
       
    97 	self->ConstructL();
       
    98 	return self;
       
    99 	}
       
   100 
       
   101 
       
   102 CLtsyPhoneHandler* CLtsyPhoneHandler::NewL(CCtsyDispatcherCallback& aCtsyDispatcherCallback,
       
   103 		CGlobalPhonemanager* aGloblePhone)
       
   104 	{
       
   105 	TSYLOGENTRYEXIT;
       
   106 	CLtsyPhoneHandler* self=
       
   107 			CLtsyPhoneHandler::NewLC(aCtsyDispatcherCallback,aGloblePhone);
       
   108 	CleanupStack::Pop(self);
       
   109 	return self;
       
   110 	}
       
   111 
       
   112 
       
   113 void CLtsyPhoneHandler::ConstructL()
       
   114 /**
       
   115  * Second phase constructor.
       
   116  */
       
   117 	{
       
   118 	TSYLOGENTRYEXIT;
       
   119 	
       
   120 	//for temp
       
   121 	iNetworkRegStatusChange = CATNetworkRegStatusChange::NewL((*iGloblePhone), iCtsyDispatcherCallback);
       
   122 	iAsyncHelperRequest = CAsyncHelperRequest::NewL((*iGloblePhone), iCtsyDispatcherCallback);
       
   123 	iNotifyCellInfo = CATNotifyCellInfo::NewL((*iGloblePhone), iCtsyDispatcherCallback);
       
   124 	iNotifyBatteryAndSignal = CNotifyBatteryAndSignal::NewL((*iGloblePhone), iCtsyDispatcherCallback);
       
   125 	iInitializePhone = CInitializePhone::NewL(*iGloblePhone,
       
   126 			                                  iCtsyDispatcherCallback,
       
   127 			                                  *iNetworkRegStatusChange,
       
   128 			                                  *iNotifyBatteryAndSignal);
       
   129 	iATDetectNetwork  = CATDetectNetwork::NewL(*iGloblePhone,iCtsyDispatcherCallback);
       
   130 	iATSelectNetwork  = CATSelectNetwork::NewL(*iGloblePhone,iCtsyDispatcherCallback);
       
   131 	} // CLtsyPhoneHandler::ConstructL
       
   132 
       
   133 TBool CLtsyPhoneHandler::IsInterfaceSupported(TLtsyDispatchInterfaceApiId aDispatchApiId)
       
   134 /**
       
   135  * Returns whether a Dispatch Interface APi is supported or not.
       
   136  * 
       
   137  * @param aDispatchApiId Id of Dispatch interface being queried
       
   138  * @return indication whether interface is supported or not
       
   139  */
       
   140 	{
       
   141 	switch(aDispatchApiId)
       
   142 		{
       
   143 		// Insert ApiIds when support is provided in LTSY e.g.
       
   144 		case KLtsyDispatchPhoneBootNotifyModemStatusReadyApiId: 
       
   145 			return ETrue;
       
   146 		case KLtsyDispatchPhoneBootNotifySimStatusReadyApiId: 
       
   147 			return ETrue;
       
   148 		case KLtsyDispatchPhoneGetFdnStatusApiId: 
       
   149 			return ETrue; 
       
   150 		case KLtsyDispatchPhoneGetHomeNetworkApiId: 
       
   151 			return ETrue;	
       
   152 		case KLtsyDispatchPhoneGetNetworkRegistrationStatusApiId: 
       
   153 			return ETrue;
       
   154 		case KLtsyDispatchPhoneSimRefreshRegisterApiId: 
       
   155 			return ETrue;
       
   156 		case KLtsyDispatchPhoneGetServiceProviderNameApiId: 
       
   157 			return ETrue; //Not finished
       
   158 		case KLtsyDispatchPhoneGetPhoneIdApiId: 
       
   159 			return ETrue;
       
   160 		case KLtsyDispatchPhoneGetDetectedNetworksApiId: 
       
   161 			return ETrue;
       
   162 		case KLtsyDispatchPhoneGetDetectedNetworksCancelApiId: 
       
   163 			return ETrue; //
       
   164 		case KLtsyDispatchPhoneSelectNetworkApiId: 
       
   165 			return ETrue;
       
   166 		case KLtsyDispatchPhoneSelectNetworkCancelApiId: 
       
   167 			return ETrue; //KErrNotSupported
       
   168 		case KLtsyDispatchPhoneSetNetworkSelectionSettingApiId: 
       
   169 			return ETrue;
       
   170 		case KLtsyDispatchPhoneGetCurrentNetworkInfoApiId: 
       
   171 			return ETrue; //Finished ?
       
   172 		case KLtsyDispatchPhoneGetNetworkModeApiId: 
       
   173 			return ETrue;
       
   174 		case KLtsyDispatchPhoneGetNitzInfoApiId: 
       
   175 			return ETrue; 
       
   176 		case KLtsyDispatchPhoneGetSignalStrengthApiId: 
       
   177 			return ETrue;
       
   178 		case KLtsyDispatchPhoneGetBatteryInfoApiId: 
       
   179 			return ETrue;
       
   180 		case KLtsyDispatchPhoneNspsWakeupApiId: 
       
   181 			return EFalse;
       
   182 		case KLtsyDispatchPhoneSetSystemNetworkModeApiId: 
       
   183 			return EFalse;
       
   184 		case KLtsyDispatchPhoneGetCurrentSystemNetworkModesApiId: 
       
   185 			return ETrue;
       
   186 		case KLtsyDispatchPhoneResetNetServerApiId: 
       
   187 			return EFalse;
       
   188 		case KLtsyDispatchPhoneSetAlwaysOnModeApiId: 
       
   189 			return EFalse;
       
   190 		case KLtsyDispatchPhoneSetDriveModeApiId: 
       
   191 			return EFalse;
       
   192 		case KLtsyDispatchPhoneGetHspaStatusApiId: 
       
   193 			return EFalse;
       
   194 		case KLtsyDispatchPhoneSetHspaStatusApiId: 
       
   195 			return EFalse;
       
   196 		case KLtsyDispatchPhoneGetNetworkProviderNameApiId: 
       
   197 			return ETrue;  
       
   198 		case KLtsyDispatchPhoneGetOperatorNameApiId: 
       
   199 			return ETrue;
       
   200 		case KLtsyDispatchPhoneGetCellInfoApiId: 
       
   201 			return ETrue;  
       
   202 		case KLtsyDispatchPhoneRegisterCellInfoChangeNotificationApiId: 
       
   203 			return ETrue;
       
   204 		case KLtsyDispatchPhoneGetPhoneCellInfoApiId: 
       
   205 			return ETrue;
       
   206 		case KLtsyDispatchPhoneGetUsimServiceSupportApiId: 
       
   207 			return EFalse;
       
   208 		case KLtsyDispatchPhoneGetCurrentActiveUsimApplicationApiId: 
       
   209 			return EFalse;
       
   210 		case KLtsyDispatchPhoneTerminateAllCallsApiId: 
       
   211 			return ETrue;
       
   212 		case KLtsyDispatchPhoneGetSystemNetworkBandApiId: 
       
   213 			return EFalse;
       
   214 		case KLtsyDispatchPhoneSetSystemNetworkBandApiId: 
       
   215 			return EFalse;
       
   216 		default:
       
   217 			return EFalse;
       
   218 		}
       
   219 	}
       
   220 
       
   221 void CLtsyPhoneHandler::IsCallbackIndicatorSupported(TLtsyDispatchIndIdGroup aIdGroup, TUint32& aIndIdBitMask)
       
   222 /**
       
   223  * Returns the set of callback indicators that are supported.
       
   224  * 
       
   225 * @param aIdGroup ID of group that is being queried e.g. aIdGroup=EIndIdGroup1.
       
   226 * @param aIndIdBitMask [out] argument that should return a bitmask indicating which indicator callbacks are supported.
       
   227  */
       
   228 	{
       
   229 	//Create bitmask with bitset for each indicator ID that is supported. E.g.
       
   230 	if(aIdGroup == EIndIdGroup1)
       
   231 		aIndIdBitMask =   KLtsyDispatchPhoneNotifyNetworkModeChangeIndId |
       
   232 						  KLtsyDispatchPhoneNotifyEgprsInfoChangeIndId |
       
   233 						  KLtsyDispatchPhoneNotifySignalStrengthChangeIndId |
       
   234 						  KLtsyDispatchPhoneNotifyNetworkRegistrationStatusChangeIndId |
       
   235 						  KLtsyDispatchPhoneNotifyNitzInfoChangeIndId |
       
   236 						  KLtsyDispatchPhoneNotifyBatteryInfoChangeIndId |
       
   237 						  KLtsyDispatchPhoneNotifyCurrentNetworkChangeIndId |
       
   238 						  KLtsyDispatchPhoneNotifyRfStatusChangeIndId |
       
   239 						  KLtsyDispatchPhoneNotifyCellInfoChangeIndId ;
       
   240 	else
       
   241 		aIndIdBitMask = 0; //no indicators from other groups supported
       
   242 	
       
   243 	}
       
   244 
       
   245 TInt CLtsyPhoneHandler::HandleGetFdnStatusReqL()
       
   246 /**
       
   247  * This request is completed by invoking
       
   248  * CCtsyDispatcherCallback::CallbackPhoneGetFdnStatusComp()
       
   249  *
       
   250  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
   251  * or another error code to indicate the failure otherwise.
       
   252  */
       
   253 	{
       
   254 	TSYLOGENTRYEXIT;
       
   255 	TInt ret = KErrNotSupported;
       
   256 	ret = iGloblePhone->CheckGlobalPhoneStatus();
       
   257 	if(ret == KErrNone)
       
   258 		{
       
   259 		CGetFdnStatus* GetFdnStatus  = CGetFdnStatus::NewL(*iGloblePhone,iCtsyDispatcherCallback);
       
   260 		iGloblePhone->iEventSignalActive = ETrue;
       
   261 		iGloblePhone->SetActiveRequest(GetFdnStatus);
       
   262 		GetFdnStatus->StartRequest();
       
   263 		}
       
   264 	return TSYLOGSETEXITERR(ret);
       
   265 	} // CLtsyPhoneHandler::HandleGetFdnStatusReqL
       
   266 
       
   267 
       
   268 TInt CLtsyPhoneHandler::HandleGetNetworkRegistrationStatusReqL()
       
   269 /**
       
   270  * This request is completed by invoking
       
   271  * CCtsyDispatcherCallback::CallbackPhoneGetNetworkRegistrationStatusComp()
       
   272  *
       
   273  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
   274  * or another error code to indicate the failure otherwise.
       
   275  */
       
   276 	{
       
   277 	TSYLOGENTRYEXIT;
       
   278 	TInt ret = KErrNone;
       
   279 	ret = iGloblePhone->CheckGlobalPhoneStatus();
       
   280 	if(ret == EPhoneInitialising)
       
   281 		{
       
   282 		iInitializePhone->AppendIpcRequestToPendingListL(KLtsyDispatchPhoneGetNetworkRegistrationStatusApiId);
       
   283 		iInitializePhone->ExecutePendingRequest();   
       
   284 		ret = KErrNone;
       
   285 		}
       
   286 	else if(ret == KErrNone)
       
   287 		{
       
   288 		CATNetworkRegistration* atNetworkRegStatus  = CATNetworkRegistration::NewL(*iGloblePhone,
       
   289 				                                                                   iCtsyDispatcherCallback);
       
   290 		iGloblePhone->iEventSignalActive = ETrue;
       
   291 		iGloblePhone->SetActiveRequest(atNetworkRegStatus);
       
   292 		atNetworkRegStatus->SetIpcRequestCompleteObserver(this);
       
   293 		atNetworkRegStatus->SetIpcId(KLtsyDispatchPhoneGetNetworkRegistrationStatusApiId);
       
   294 		iNetworkRegStatusChange->Disable();
       
   295 		atNetworkRegStatus->StartRequest();
       
   296 		}
       
   297 	 
       
   298 	return TSYLOGSETEXITERR(ret);
       
   299 	} // CLtsyPhoneHandler::HandleGetNetworkRegistrationStatusReqL
       
   300 
       
   301 
       
   302 TInt CLtsyPhoneHandler::HandleGetHomeNetworkReqL()
       
   303 /**
       
   304  * This request is completed by invoking
       
   305  * CCtsyDispatcherCallback::CallbackPhoneGetHomeNetworkComp()
       
   306  *
       
   307  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
   308  * or another error code to indicate the failure otherwise. 
       
   309  */
       
   310 	{
       
   311 	TSYLOGENTRYEXIT;
       
   312 	TInt ret = KErrNotSupported;
       
   313 	ret = iGloblePhone->CheckGlobalPhoneStatus();
       
   314 	if(ret == EPhoneInitialising)
       
   315 		{
       
   316 		iInitializePhone->AppendIpcRequestToPendingListL(KLtsyDispatchPhoneGetHomeNetworkApiId);
       
   317         iInitializePhone->ExecutePendingRequest();   
       
   318 		ret = KErrNone;
       
   319 		}
       
   320 	else if(ret == KErrNone)
       
   321 		{
       
   322 		CATNetworkInfo* ATNetworkInfo  = CATNetworkInfo::NewL(*iGloblePhone,iCtsyDispatcherCallback);
       
   323 		iGloblePhone->iEventSignalActive = ETrue;
       
   324 		iGloblePhone->SetActiveRequest(ATNetworkInfo);
       
   325 		ATNetworkInfo->SetToGetHomeNwk();
       
   326 		ATNetworkInfo->StartRequest();
       
   327 		}
       
   328 	return TSYLOGSETEXITERR(ret);
       
   329 	} // CLtsyPhoneHandler::HandleGetHomeNetworkReqL
       
   330 
       
   331 
       
   332 TInt CLtsyPhoneHandler::HandleBootNotifyModemStatusReadyReqL()
       
   333 /**
       
   334  * This request is completed by invoking
       
   335  * CCtsyDispatcherCallback::CallbackPhoneBootNotifyModemStatusReadyComp()
       
   336  *
       
   337  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
   338  * or another error code to indicate the failure otherwise. 
       
   339  */
       
   340 	{
       
   341 	TSYLOGENTRYEXIT;
       
   342     // This function is the entry of phone bootup
       
   343 	// Let's get the phone bootup
       
   344 	TInt ret = KErrNone;
       
   345 	ret = iGloblePhone->CheckGlobalPhoneStatus();
       
   346 	if(ret == EPhoneNotInitialised)
       
   347 		{
       
   348 		iGloblePhone->iPhoneStatus.iInitStatus = EPhoneInitialising;
       
   349 		iGloblePhone->iEventSignalActive = ETrue;
       
   350 		iInitializePhone->StartRequest();
       
   351 		ret = KErrNone;
       
   352 		}
       
   353 	else if(ret == KErrNone)
       
   354 		{
       
   355 		CATGetModemStatus* ATGetModemStatus = CATGetModemStatus::NewL(*iGloblePhone,iCtsyDispatcherCallback);
       
   356 		iGloblePhone->iEventSignalActive = ETrue;
       
   357 		iGloblePhone->SetActiveRequest(ATGetModemStatus);
       
   358 		ATGetModemStatus->StartRequest();
       
   359 		}	
       
   360 	return TSYLOGSETEXITERR(ret);
       
   361 	} // CLtsyPhoneHandler::HandleBootNotifyModemStatusReadyReqL
       
   362 
       
   363 
       
   364 TInt CLtsyPhoneHandler::HandleBootNotifySimStatusReadyReqL()
       
   365 /**
       
   366  * This request is completed by invoking
       
   367  * CCtsyDispatcherCallback::CallbackPhoneBootNotifySimStatusReadyComp()
       
   368  * 
       
   369  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
   370  * or another error code to indicate the failure otherwise. 
       
   371  */
       
   372 	{
       
   373 	TSYLOGENTRYEXIT;
       
   374 	
       
   375 	TInt ret = KErrNone;
       
   376 	ret = iGloblePhone->CheckGlobalPhoneStatus();
       
   377 	if(ret == EPhoneInitialising)
       
   378 		{
       
   379 		iInitializePhone->AppendIpcRequestToPendingListL(KLtsyDispatchPhoneBootNotifySimStatusReadyApiId);
       
   380         iInitializePhone->ExecutePendingRequest();   
       
   381 		ret = KErrNone;
       
   382 		}
       
   383 	else if(ret == KErrNone)
       
   384 		{
       
   385 		CATSIMCard* ATSIMCard  = CATSIMCard::NewL(*iGloblePhone,iCtsyDispatcherCallback);
       
   386 		iGloblePhone->iEventSignalActive = ETrue;
       
   387 		iGloblePhone->SetActiveRequest(ATSIMCard);
       
   388 		ATSIMCard->StartRequest();
       
   389 		}
       
   390 
       
   391 	return TSYLOGSETEXITERR(ret);
       
   392 	} // CLtsyPhoneHandler::HandleBootNotifySimStatusReadyReqL
       
   393 
       
   394 TInt CLtsyPhoneHandler::HandleSimRefreshRegisterReqL(TUint16 /*aFilesToRegister*/)
       
   395 /**
       
   396  * @param aFilesToRegister  Bitmask containing list of files to register for refresh indications.
       
   397  * The list of possible files is specified in TCacheFileTypes.
       
   398  * 
       
   399  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
   400  * or another error code to indicate the failure otherwise. 
       
   401  */
       
   402 	{
       
   403 	TSYLOGENTRYEXIT;
       
   404 	
       
   405 	TInt ret = KErrNotSupported;
       
   406 	ret = iGloblePhone->CheckGlobalPhoneStatus();
       
   407 	if(ret == EPhoneInitialising)
       
   408 		{
       
   409 		iInitializePhone->AppendIpcRequestToPendingListL(KLtsyDispatchPhoneSimRefreshRegisterApiId);
       
   410         iInitializePhone->ExecutePendingRequest();   
       
   411         ret = KErrNone;
       
   412 		}
       
   413 	else if(ret == EPhoneInitialised)
       
   414 		{
       
   415 		iAsyncHelperRequest->SetRequestId(KLtsyDispatchPhoneSimRefreshRegisterApiId);
       
   416 		}
       
   417 	return TSYLOGSETEXITERR(ret);
       
   418 	} // CLtsyPhoneHandler::HandleSimRefreshRegisterReqL
       
   419 
       
   420 TInt CLtsyPhoneHandler::HandleGetServiceProviderNameReqL()
       
   421 /**
       
   422  * This request is completed by invoking
       
   423  * CCtsyDispatcherCallback::CallbackPhoneGetServiceProviderNameComp()
       
   424  *
       
   425  = * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
   426  * or another error code to indicate the failure otherwise.
       
   427  */
       
   428 	{
       
   429 	TSYLOGENTRYEXIT;
       
   430 
       
   431 	//TInt ret = KErrNotSupported;
       
   432 	TInt ret = 0;
       
   433 	ret = iGloblePhone->CheckGlobalPhoneStatus();
       
   434 	if(ret == KErrNone)
       
   435 		{
       
   436 		CGetOperatorNmae* GetOperatorName  = CGetOperatorNmae::NewL(*iGloblePhone,iCtsyDispatcherCallback);
       
   437 		iGloblePhone->iEventSignalActive = ETrue;
       
   438 		GetOperatorName->SetRequestTypeL(KLtsyDispatchPhoneGetServiceProviderNameApiId);
       
   439 		iGloblePhone->SetActiveRequest(GetOperatorName);
       
   440 		GetOperatorName->StartRequest();
       
   441 		}
       
   442 
       
   443 	return TSYLOGSETEXITERR(ret);
       
   444 	} // CLtsyPhoneHandler::HandleGetServiceProviderNameReqL
       
   445 
       
   446 
       
   447 TInt CLtsyPhoneHandler::HandleGetPhoneIdReqL()
       
   448 /**
       
   449  * This request is completed by invoking
       
   450  * CCtsyDispatcherCallback::CallbackPhoneGetPhoneIdComp()
       
   451  *
       
   452  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
   453  * or another error code to indicate the failure otherwise.
       
   454  */
       
   455 	{
       
   456 	TSYLOGENTRYEXIT;
       
   457 
       
   458 	//TInt ret = KErrNotSupported;
       
   459 	TInt ret = KErrNone;
       
   460 	ret = iGloblePhone->CheckGlobalPhoneStatus();
       
   461 	if(ret == KErrNone)
       
   462 		{
       
   463 		CGetPhoneID* GetPhoneID  = CGetPhoneID::NewL(*iGloblePhone,iCtsyDispatcherCallback);
       
   464 		iGloblePhone->iEventSignalActive = ETrue;
       
   465 		iGloblePhone->SetActiveRequest(GetPhoneID);
       
   466 		GetPhoneID->StartRequest();
       
   467 		}
       
   468 	return TSYLOGSETEXITERR(ret);
       
   469 	} // CLtsyPhoneHandler::HandleGetPhoneIdReqL
       
   470 
       
   471 
       
   472 TInt CLtsyPhoneHandler::HandleGetDetectedNetworksReqL()
       
   473 /**
       
   474  * This request is completed by invoking
       
   475  * CCtsyDispatcherCallback::CallbackPhoneGetDetectedNetworksComp()
       
   476  *
       
   477  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
   478  * or another error code to indicate the failure otherwise.
       
   479  */
       
   480 	{
       
   481 	TSYLOGENTRYEXIT;
       
   482 
       
   483 	//TInt ret = KErrNotSupported;
       
   484 	TInt ret = 0;
       
   485 	
       
   486 	ret = KErrNone;
       
   487 	ret = iGloblePhone->CheckGlobalPhoneStatus();
       
   488 	if(ret == KErrNone)
       
   489 		{
       
   490 		iGloblePhone->iEventSignalActive = ETrue;
       
   491 		iATDetectNetwork->StartRequest();
       
   492 		}
       
   493 	
       
   494 	return TSYLOGSETEXITERR(ret);
       
   495 	
       
   496 	} // CLtsyPhoneHandler::HandleGetDetectedNetworksReqL
       
   497 
       
   498 
       
   499 TInt CLtsyPhoneHandler::HandleGetDetectedNetworksCancelReqL()
       
   500 /**
       
   501  * This request is completed by invoking
       
   502  * CCtsyDispatcherCallback::CallbackPhoneGetDetectedNetworksCancelComp()
       
   503  *
       
   504  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
   505  * or another error code to indicate the failure otherwise.
       
   506  */
       
   507 	{
       
   508 	TSYLOGENTRYEXIT;
       
   509 
       
   510 	//TInt ret = KErrNotSupported;
       
   511 	TInt ret = 0;
       
   512 	ret = iGloblePhone->CheckGlobalPhoneStatus();
       
   513 	if((ret == KErrInUse)&&(iATDetectNetwork->iCommandRunning))
       
   514 		{
       
   515 		if(iATDetectNetwork->iCommandCancel)
       
   516 			{
       
   517 			ret = KErrNotSupported;
       
   518 			}
       
   519 		else
       
   520 			{
       
   521 		    iATDetectNetwork->CancelCommand();
       
   522 		    ret = KErrNone;
       
   523 			}
       
   524 		}
       
   525 	else if(ret == KErrNone)
       
   526 		{
       
   527 		iAsyncHelperRequest->SetRequestId(KLtsyDispatchPhoneGetDetectedNetworksCancelApiId);
       
   528 		}
       
   529 	return TSYLOGSETEXITERR(ret);
       
   530 	} // CLtsyPhoneHandler::HandleGetDetectedNetworksCancelReqL
       
   531 
       
   532 
       
   533 TInt CLtsyPhoneHandler::HandleSelectNetworkReqL(TBool aIsManual, const RMobilePhone::TMobilePhoneNetworkManualSelection& aNetworkManualSelection)
       
   534 /**
       
   535  * This request is completed by invoking
       
   536  * CCtsyDispatcherCallback::CallbackPhoneSelectNetworkComp()
       
   537  *
       
   538  * @param aIsManual Specifies whether phone should use a manual or automatic network selection method.
       
   539  * @param aNetworkManualSelection If aIsManual==ETrue, then this parameter contain the user's manually selected network.
       
   540  *
       
   541  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
   542  * or another error code to indicate the failure otherwise.
       
   543  */
       
   544 	{
       
   545 	TSYLOGENTRYEXIT;
       
   546 	TInt ret = KErrNotSupported;
       
   547 	if(!aIsManual)
       
   548 		{
       
   549 		return KErrNotSupported;
       
   550 		}
       
   551 	ret = iGloblePhone->CheckGlobalPhoneStatus();
       
   552 	if(ret == KErrNone)
       
   553 		{
       
   554 		iGloblePhone->iEventSignalActive = ETrue;
       
   555 		iATSelectNetwork->SetNetworkSelection(aNetworkManualSelection);
       
   556 		iATSelectNetwork->StartRequest();
       
   557 		}
       
   558 
       
   559 	return TSYLOGSETEXITERR(ret);
       
   560 	} // CLtsyPhoneHandler::HandleSelectNetworkReqL
       
   561 
       
   562 
       
   563 TInt CLtsyPhoneHandler::HandleSelectNetworkCancelReqL()
       
   564 /**
       
   565  * This request is completed by invoking
       
   566  * CCtsyDispatcherCallback::CallbackPhoneSelectNetworkCancelComp()
       
   567  *
       
   568  *
       
   569  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
   570  * or another error code to indicate the failure otherwise.
       
   571  */
       
   572 	{
       
   573 	TSYLOGENTRYEXIT;
       
   574 	TInt ret = 0;
       
   575 	ret = iGloblePhone->CheckGlobalPhoneStatus();
       
   576 	if((ret == KErrInUse)&&(iATSelectNetwork->iCommandRunning))
       
   577 		{
       
   578 		if(iATSelectNetwork->iCommandCancel)
       
   579 			{
       
   580 			ret = KErrNotSupported;
       
   581 			}
       
   582 		else
       
   583 			{
       
   584 			iATSelectNetwork->CancelCommand();
       
   585 		    ret = KErrNone;
       
   586 			}
       
   587 		}
       
   588 	else if(ret == KErrNone)
       
   589 		{
       
   590 		iAsyncHelperRequest->SetRequestId(KLtsyDispatchPhoneSelectNetworkCancelApiId);
       
   591 		}
       
   592 	return TSYLOGSETEXITERR(ret);
       
   593 	} // CLtsyPhoneHandler::HandleSelectNetworkCancelReqL
       
   594 
       
   595 
       
   596 TInt CLtsyPhoneHandler::HandleSetNetworkSelectionSettingReqL(const RMobilePhone::TMobilePhoneNetworkSelectionV1& aPhoneNetworkSelection)
       
   597 /**
       
   598  * This request is completed by invoking
       
   599  * CCtsyDispatcherCallback::CallbackPhoneSetNetworkSelectionSettingComp()
       
   600  *
       
   601  * @param aPhoneNetworkSelection The network selection to be set.
       
   602  *
       
   603  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
   604  * or another error code to indicate the failure otherwise.
       
   605  */
       
   606 	{
       
   607 	TSYLOGENTRYEXIT;
       
   608 
       
   609 	TInt ret = KErrNotSupported;
       
   610 	TInt networkSelection = -1;
       
   611 	switch (aPhoneNetworkSelection.iMethod)
       
   612 		{
       
   613 	case RMobilePhone::ENetworkSelectionAutomatic:
       
   614 	    networkSelection = 0;
       
   615 		break;
       
   616 	case RMobilePhone::ENetworkSelectionManual:
       
   617 	    networkSelection = 1;
       
   618 		break;
       
   619 	default:
       
   620 	    networkSelection = 0;
       
   621 		break;
       
   622 		}
       
   623 	
       
   624 	if(networkSelection != -1)
       
   625 		{
       
   626 		ret = iGloblePhone->CheckGlobalPhoneStatus();
       
   627 		if(ret == KErrNone)
       
   628 			{
       
   629 			CATSelectNetworkMode* ATSelectNetworkMode  = CATSelectNetworkMode::NewL(*iGloblePhone,iCtsyDispatcherCallback);
       
   630 			iGloblePhone->iEventSignalActive = ETrue;
       
   631 			iGloblePhone->SetActiveRequest(ATSelectNetworkMode);
       
   632 			ATSelectNetworkMode->SetNetworkSelection(networkSelection);
       
   633 			ATSelectNetworkMode->StartRequest();
       
   634 			ret = KErrNone;
       
   635 			}
       
   636 		}
       
   637 
       
   638 	return TSYLOGSETEXITERR(ret);
       
   639 	} // CLtsyPhoneHandler::HandleSetNetworkSelectionSettingReqL
       
   640 
       
   641 
       
   642 TInt CLtsyPhoneHandler::HandleGetCurrentNetworkInfoReqL()
       
   643 /**
       
   644  * This request is completed by invoking
       
   645  * CCtsyDispatcherCallback::CallbackPhoneGetCurrentNetworkInfoComp()
       
   646  *
       
   647  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
   648  * or another error code to indicate the failure otherwise.
       
   649  */
       
   650 	{
       
   651 	TSYLOGENTRYEXIT;
       
   652 
       
   653 	TInt ret = KErrNone;
       
   654 	ret = iGloblePhone->CheckGlobalPhoneStatus();
       
   655 	if(ret == EPhoneInitialising)
       
   656 		{
       
   657 		iInitializePhone->AppendIpcRequestToPendingListL(KLtsyDispatchPhoneGetCurrentNetworkInfoApiId);
       
   658         iInitializePhone->ExecutePendingRequest();   
       
   659 		ret = KErrNone;
       
   660 		}
       
   661 	else if(ret == KErrNone)
       
   662 		{
       
   663 		CGetCurrentNetworkInfo* ATNetworkInfo  = CGetCurrentNetworkInfo::NewL(*iGloblePhone,iCtsyDispatcherCallback);
       
   664 		iGloblePhone->iEventSignalActive = ETrue;
       
   665 		iGloblePhone->SetActiveRequest(ATNetworkInfo);
       
   666 		ATNetworkInfo->StartRequest();
       
   667 		}
       
   668 	return TSYLOGSETEXITERR(ret);
       
   669 	} // CLtsyPhoneHandler::HandleGetCurrentNetworkInfoReqL
       
   670 
       
   671 
       
   672 TInt CLtsyPhoneHandler::HandleGetNetworkModeReqL()
       
   673 /**
       
   674  * This request is completed by invoking
       
   675  * CCtsyDispatcherCallback::CallbackPhoneGetNetworkModeComp()
       
   676  *
       
   677  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
   678  * or another error code to indicate the failure otherwise.
       
   679  */
       
   680 	{
       
   681 	TSYLOGENTRYEXIT;
       
   682 
       
   683 	TInt ret = KErrNotSupported;
       
   684 	ret = iGloblePhone->CheckGlobalPhoneStatus();
       
   685 	if(ret == EPhoneInitialising)
       
   686 		{
       
   687 		iInitializePhone->AppendIpcRequestToPendingListL(KLtsyDispatchPhoneGetNetworkModeApiId);
       
   688         iInitializePhone->ExecutePendingRequest();   	
       
   689 		ret = KErrNone;
       
   690 		}
       
   691 	else if(ret == EPhoneInitialised)
       
   692 		{
       
   693 		iAsyncHelperRequest->SetRequestId(KLtsyDispatchPhoneGetNetworkModeApiId);
       
   694 		}
       
   695 	return TSYLOGSETEXITERR(ret);
       
   696 	} // CLtsyPhoneHandler::HandleGetNetworkModeReqL
       
   697 
       
   698 
       
   699 TInt CLtsyPhoneHandler::HandleGetNitzInfoReqL()
       
   700 /**
       
   701  * This request is completed by invoking
       
   702  * CCtsyDispatcherCallback::CallbackPhoneGetNitzInfoComp()
       
   703  *
       
   704  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
   705  * or another error code to indicate the failure otherwise.
       
   706  */
       
   707 	{
       
   708 	TSYLOGENTRYEXIT;
       
   709 	TInt ret = KErrNotSupported;
       
   710 	ret = iGloblePhone->CheckGlobalPhoneStatus();
       
   711 	if(ret == EPhoneInitialising)
       
   712 		{
       
   713 		iInitializePhone->AppendIpcRequestToPendingListL(KLtsyDispatchPhoneGetNitzInfoApiId);
       
   714         iInitializePhone->ExecutePendingRequest();   
       
   715 		ret = KErrNone;
       
   716 		}
       
   717 	else if(ret == EPhoneInitialised)
       
   718 		{
       
   719 		iAsyncHelperRequest->SetRequestId(KLtsyDispatchPhoneGetNitzInfoApiId);
       
   720 		}
       
   721 	return TSYLOGSETEXITERR(ret);
       
   722 	} // CLtsyPhoneHandler::HandleGetNITZInfoReqL()
       
   723 
       
   724 
       
   725 TInt CLtsyPhoneHandler::HandleGetSignalStrengthReqL()
       
   726 /**
       
   727  * This request is completed by invoking
       
   728  * CCtsyDispatcherCallback::CallbackPhoneGetSignalStrengthComp()
       
   729  *
       
   730  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
   731  * or another error code to indicate the failure otherwise.
       
   732  */
       
   733 	{
       
   734 	TSYLOGENTRYEXIT;
       
   735 
       
   736 	TInt ret = KErrNone;
       
   737 	ret = iGloblePhone->CheckGlobalPhoneStatus();
       
   738 	if(ret == EPhoneInitialising)
       
   739 		{
       
   740 		iInitializePhone->AppendIpcRequestToPendingListL(KLtsyDispatchPhoneGetSignalStrengthApiId);
       
   741         iInitializePhone->ExecutePendingRequest();   
       
   742 		ret = KErrNone;
       
   743 		}
       
   744 	else if(ret == KErrNone)
       
   745 		{
       
   746 		CATGetSignal* ATGetSignal  = CATGetSignal::NewL(*iGloblePhone,iCtsyDispatcherCallback);
       
   747 		iGloblePhone->iEventSignalActive = ETrue;
       
   748 		iGloblePhone->SetActiveRequest(ATGetSignal);
       
   749 		ATGetSignal->StartRequest();
       
   750 		}
       
   751 	return TSYLOGSETEXITERR(ret);
       
   752 	} // CLtsyPhoneHandler::HandleGetSignalStrengthReqL()
       
   753 
       
   754 
       
   755 TInt CLtsyPhoneHandler::HandleGetBatteryInfoReqL()
       
   756 /**
       
   757  * This request is completed by invoking
       
   758  * CCtsyDispatcherCallback::CallbackPhoneGetBatteryInfoComp()
       
   759  *
       
   760  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
   761  * or another error code to indicate the failure otherwise.
       
   762  */
       
   763 	{
       
   764 	TSYLOGENTRYEXIT;
       
   765 
       
   766 	TInt ret = KErrNone;
       
   767 	ret = iGloblePhone->CheckGlobalPhoneStatus();
       
   768 	if(ret == EPhoneInitialising)
       
   769 		{
       
   770 		iInitializePhone->AppendIpcRequestToPendingListL(KLtsyDispatchPhoneGetBatteryInfoApiId);
       
   771         iInitializePhone->ExecutePendingRequest();   
       
   772 		ret = KErrNone;
       
   773 		}
       
   774 	else if(ret == KErrNone)
       
   775 		{
       
   776 		CATGetBattery* ATGetBattery  = CATGetBattery::NewL(*iGloblePhone,iCtsyDispatcherCallback);
       
   777 		iGloblePhone->iEventSignalActive = ETrue;
       
   778 		iGloblePhone->SetActiveRequest(ATGetBattery);
       
   779 		ATGetBattery->StartRequest();
       
   780 		}
       
   781 	
       
   782 	return TSYLOGSETEXITERR(ret);
       
   783 	} // CLtsyPhoneHandler::HandleGetBatteryInfoReqL
       
   784 
       
   785 
       
   786 TInt CLtsyPhoneHandler::HandleNspsWakeupReqL()
       
   787 /**
       
   788  * This request is completed by invoking
       
   789  * CCtsyDispatcherCallback::CallbackPhoneNspsWakeupComp()
       
   790  *
       
   791  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
   792  * or another error code to indicate the failure otherwise. 
       
   793  */
       
   794 	{
       
   795 	TSYLOGENTRYEXIT;
       
   796 
       
   797 	TInt ret = KErrNotSupported;
       
   798 	return TSYLOGSETEXITERR(ret);
       
   799 	} // CLtsyPhoneHandler::HandleNspsWakeupReqL
       
   800 
       
   801 
       
   802 TInt CLtsyPhoneHandler::HandleSetSystemNetworkModeReqL(RMmCustomAPI::TNetworkModeCaps /*aMode*/)
       
   803 /**
       
   804  * This request is completed by invoking
       
   805  * CCtsyDispatcherCallback::CallbackPhoneSetSystemNetworkModeComp()
       
   806  *
       
   807  * @param aMode Specifies the mode to set the system network to.
       
   808  *
       
   809  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
   810  * or another error code to indicate the failure otherwise. 
       
   811  */
       
   812 	{
       
   813 	TSYLOGENTRYEXIT;
       
   814 
       
   815 	TInt ret = KErrNotSupported;
       
   816 	return TSYLOGSETEXITERR(ret);
       
   817 	} // CLtsyPhoneHandler::HandleSetSystemNetworkModeReqL
       
   818 
       
   819 
       
   820 TInt CLtsyPhoneHandler::HandleGetCurrentSystemNetworkModesReqL()
       
   821 /**
       
   822  * This request is completed by invoking
       
   823  * CCtsyDispatcherCallback::CallbackPhoneGetCurrentSystemNetworkModesComp()
       
   824  *
       
   825  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
   826  * or another error code to indicate the failure otherwise. 
       
   827  */
       
   828 	{
       
   829 	TSYLOGENTRYEXIT;
       
   830 
       
   831 	TInt ret = 0;
       
   832 	iAsyncHelperRequest->SetRequestId(KLtsyDispatchPhoneGetCurrentSystemNetworkModesApiId);
       
   833 	return TSYLOGSETEXITERR(ret);
       
   834 	} // CLtsyPhoneHandler::HandleGetCurrentSystemNetworkModesReqL
       
   835 
       
   836 
       
   837 TInt CLtsyPhoneHandler::HandleResetNetServerReqL()
       
   838 /**
       
   839  * This request is completed by invoking
       
   840  * CCtsyDispatcherCallback::CallbackPhoneResetNetServerComp()
       
   841  *
       
   842  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
   843  * or another error code to indicate the failure otherwise. 
       
   844  */
       
   845 	{
       
   846 	TSYLOGENTRYEXIT;
       
   847 
       
   848 	TInt ret = KErrNotSupported;
       
   849 	return TSYLOGSETEXITERR(ret);
       
   850 	} // CLtsyPhoneHandler::HandleResetNetServerReqL
       
   851 
       
   852 
       
   853 TInt CLtsyPhoneHandler::HandleSetAlwaysOnModeReqL(RMmCustomAPI::TSetAlwaysOnMode /*aMode*/)
       
   854 /**
       
   855  * This request is completed by invoking
       
   856  * CCtsyDispatcherCallback::CallbackPhoneSetAlwaysOnModeComp()
       
   857  *
       
   858  * @param aMode The new "always on" mode to set, can be
       
   859  *               RMmCustomAPI::EAlwaysModeVPLMN for VPLMN (Visited Public Land Mobile Network) always on,
       
   860  *               RMmCustomAPI::EAlwaysModeHPLMN for HPLMN (Home Public Land Mobile Network) always on,
       
   861  *               RMmCustomAPI::EAlwaysModeBoth for VPLMN and HPLMN always on,
       
   862  *               RMmCustomAPI::EAlwaysModeNeither for neither VPLMN mor HPLMN always on.
       
   863  *
       
   864  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
   865  * or another error code to indicate the failure otherwise. 
       
   866  */
       
   867 	{
       
   868 	TSYLOGENTRYEXIT;
       
   869 
       
   870 	TInt ret = KErrNotSupported;
       
   871 	return TSYLOGSETEXITERR(ret);
       
   872 	} // CLtsyPhoneHandler::HandleSetAlwaysOnModeReqL
       
   873 
       
   874 
       
   875 TInt CLtsyPhoneHandler::HandleSetDriveModeReqL(RMmCustomAPI::TSetDriveMode /*aMode*/)
       
   876 /**
       
   877  * This request is completed by invoking
       
   878  * CCtsyDispatcherCallback::CallbackPhoneSetDriveModeComp()
       
   879  *
       
   880  * @param aMode The new mode to set (RMmCustomAPI::EDeactivateDriveMode for deactivate drive mode
       
   881  *               or RMmCustomAPI::EActivateDriveMode to activate drive mode).
       
   882  *
       
   883  *
       
   884  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
   885  * or another error code to indicate the failure otherwise. 
       
   886  */
       
   887 	{
       
   888 	TSYLOGENTRYEXIT;
       
   889 
       
   890 	TInt ret = KErrNotSupported;
       
   891 	return TSYLOGSETEXITERR(ret);
       
   892 	} // CLtsyPhoneHandler::HandleSetDriveModeReqL
       
   893 
       
   894 
       
   895 TInt CLtsyPhoneHandler::HandleGetHspaStatusReqL()
       
   896 /**
       
   897  * This request is completed by invoking
       
   898  * CCtsyDispatcherCallback::CallbackPhoneGetHspaStatusComp()
       
   899  *
       
   900  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
   901  * or another error code to indicate the failure otherwise. 
       
   902  */
       
   903 	{
       
   904 	TSYLOGENTRYEXIT;
       
   905 
       
   906 	TInt ret = KErrNotSupported;
       
   907 	return TSYLOGSETEXITERR(ret);
       
   908 	} // CLtsyPhoneHandler::HandleGetHspaStatusReqL
       
   909 
       
   910 
       
   911 TInt CLtsyPhoneHandler::HandleSetHspaStatusReqL(RMmCustomAPI::THSxPAStatus /*aStatus*/)
       
   912 /**
       
   913  * This request is completed by invoking
       
   914  * CCtsyDispatcherCallback::CallbackPhoneSetHspaStatusComp()
       
   915  *
       
   916  * @param aStatus The new HSxPA status (enable or disable).
       
   917  *
       
   918  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
   919  * or another error code to indicate the failure otherwise. 
       
   920  */
       
   921 	{
       
   922 	TSYLOGENTRYEXIT;
       
   923 
       
   924 	TInt ret = KErrNotSupported;
       
   925 	return TSYLOGSETEXITERR(ret);
       
   926 	} // CLtsyPhoneHandler::HandleSetHspaStatusReqL
       
   927 
       
   928 
       
   929 TInt CLtsyPhoneHandler::HandleGetNetworkProviderNameReqL()
       
   930 /**
       
   931  * This request is completed by invoking
       
   932  * CCtsyDispatcherCallback::CallbackPhoneGetNetworkProviderNameComp()
       
   933  *
       
   934  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
   935  * or another error code to indicate the failure otherwise. 
       
   936  */
       
   937 	{
       
   938 	TSYLOGENTRYEXIT;
       
   939 
       
   940 	TInt ret = KErrNotSupported;
       
   941 	ret = iGloblePhone->CheckGlobalPhoneStatus();
       
   942 	if(ret == KErrNone)
       
   943 		{
       
   944 		CGetOperatorNmae* GetOperatorName  = CGetOperatorNmae::NewL(*iGloblePhone,iCtsyDispatcherCallback);
       
   945 		iGloblePhone->iEventSignalActive = ETrue;
       
   946 		GetOperatorName->SetRequestTypeL(KLtsyDispatchPhoneGetNetworkProviderNameApiId);
       
   947 		iGloblePhone->SetActiveRequest(GetOperatorName);
       
   948 		GetOperatorName->StartRequest();
       
   949 		}
       
   950 	return TSYLOGSETEXITERR(ret);
       
   951 	} // CLtsyPhoneHandler::HandleGetNetworkProviderNameReqL
       
   952 
       
   953 
       
   954 TInt CLtsyPhoneHandler::HandleGetOperatorNameReqL()
       
   955 /**
       
   956  * This request is completed by invoking
       
   957  * CCtsyDispatcherCallback::CallbackPhoneGetOperatorNameComp()
       
   958  *
       
   959  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
   960  * or another error code to indicate the failure otherwise. 
       
   961  */
       
   962 	{
       
   963 	TSYLOGENTRYEXIT;
       
   964 
       
   965 	TInt ret = KErrNotSupported;
       
   966 	ret = iGloblePhone->CheckGlobalPhoneStatus();
       
   967 	if(ret == KErrNone)
       
   968 		{
       
   969 		CGetOperatorNmae* GetOperatorName  = CGetOperatorNmae::NewL(*iGloblePhone,iCtsyDispatcherCallback);
       
   970 		iGloblePhone->iEventSignalActive = ETrue;
       
   971 		GetOperatorName->SetRequestTypeL(KLtsyDispatchPhoneGetOperatorNameApiId);
       
   972 		iGloblePhone->SetActiveRequest(GetOperatorName);
       
   973 		GetOperatorName->StartRequest();
       
   974 		}
       
   975 
       
   976 	return TSYLOGSETEXITERR(ret);
       
   977 	} // CLtsyPhoneHandler::HandleGetOperatorNameReqL
       
   978 
       
   979 
       
   980 TInt CLtsyPhoneHandler::HandleGetCellInfoReqL()
       
   981 /**
       
   982  * This request is completed by invoking one of the 
       
   983  * CCtsyDispatcherCallback::CallbackPhoneGetCellInfoComp().
       
   984  *
       
   985  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
   986  * or another error code to indicate the failure otherwise. 
       
   987  */
       
   988 	{
       
   989 	TSYLOGENTRYEXIT;
       
   990 
       
   991 	TInt ret = KErrNotSupported;
       
   992 	ret = iGloblePhone->CheckGlobalPhoneStatus();
       
   993 	if(ret == KErrNone)
       
   994 		{
       
   995 		CATGetCellInfo* atGetCellInfo  = CATGetCellInfo::NewL(*iGloblePhone,
       
   996 				                                              iCtsyDispatcherCallback);
       
   997 		iGloblePhone->iEventSignalActive = ETrue;
       
   998 		iGloblePhone->SetActiveRequest(atGetCellInfo);
       
   999 		atGetCellInfo->SetIpcId(KLtsyDispatchPhoneGetCellInfoApiId);
       
  1000 		atGetCellInfo->SetIpcRequestCompleteObserver(this);
       
  1001 		iNotifyCellInfo->Disable();
       
  1002 		atGetCellInfo->StartRequest();
       
  1003 		}
       
  1004 	return TSYLOGSETEXITERR(ret);
       
  1005 	} // CLtsyPhoneHandler::HandleGetCellInfoReqL
       
  1006 
       
  1007 TInt CLtsyPhoneHandler::HandleRegisterCellInfoChangeNotificationReqL()
       
  1008 /**
       
  1009  * This request is completed by invoking
       
  1010  * CCtsyDispatcherCallback::CallbackPhoneRegisterCellInfoChangeNotificationComp()
       
  1011  *
       
  1012  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
  1013  * or another error code to indicate the failure otherwise.
       
  1014  */
       
  1015 	{
       
  1016 	TSYLOGENTRYEXIT;
       
  1017 
       
  1018 	//TInt ret = KErrNotSupported;
       
  1019 	TInt ret = KErrNone;
       
  1020 	ret = iGloblePhone->CheckGlobalPhoneStatus();
       
  1021 	if(ret == KErrNone)
       
  1022 		{
       
  1023 		CATSetNotifyCellInfo* atSetNotifyCellInfo  = CATSetNotifyCellInfo::NewL(*iGloblePhone,
       
  1024 				                                                                iCtsyDispatcherCallback);
       
  1025 		iGloblePhone->iEventSignalActive = ETrue;
       
  1026 		iGloblePhone->SetActiveRequest(atSetNotifyCellInfo);
       
  1027 		atSetNotifyCellInfo->SetIpcId(KLtsyDispatchPhoneRegisterCellInfoChangeNotificationApiId);
       
  1028 		atSetNotifyCellInfo->SetIpcRequestCompleteObserver(this);
       
  1029 		atSetNotifyCellInfo->StartRequest();
       
  1030 		}
       
  1031 	return TSYLOGSETEXITERR(ret);
       
  1032 	} // CLtsyPhoneHandler::HandleRegisterCellInfoChangeNotificationReqL 
       
  1033 
       
  1034 TInt CLtsyPhoneHandler::HandleGetPhoneCellInfoReqL()
       
  1035 /**
       
  1036  * This request is completed by invoking
       
  1037  * CCtsyDispatcherCallback::CallbackPhoneGetPhoneCellInfoComp()
       
  1038  *
       
  1039  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
  1040  * or another error code to indicate the failure otherwise.
       
  1041  */
       
  1042 	{
       
  1043 	TSYLOGENTRYEXIT;
       
  1044 
       
  1045 	TInt ret = KErrNotSupported;
       
  1046 	ret = iGloblePhone->CheckGlobalPhoneStatus();
       
  1047 	if(ret == KErrNone)
       
  1048 		{
       
  1049 		CATGetPhoneCellInfo* atGetPhoneCellInfo  = CATGetPhoneCellInfo::NewL(*iGloblePhone,
       
  1050 				                                                             iCtsyDispatcherCallback);
       
  1051 		iGloblePhone->iEventSignalActive = ETrue;
       
  1052 		iGloblePhone->SetActiveRequest(atGetPhoneCellInfo);
       
  1053 		atGetPhoneCellInfo->SetIpcRequestCompleteObserver(this);
       
  1054 		atGetPhoneCellInfo->SetIpcId(KLtsyDispatchPhoneGetPhoneCellInfoApiId);
       
  1055 		// disable to get the notification as we may get the incorrect response after CATGetPhoneCellInfo command was issued
       
  1056 		iNotifyCellInfo->Disable();
       
  1057 		atGetPhoneCellInfo->StartRequest();
       
  1058 		}
       
  1059 	else if (ret == KErrInUse)
       
  1060 		{
       
  1061 		// as dispather will post two IPC requests(KLtsyDispatchPhoneRegisterCellInfoChangeNotificationApiId and KLtsyDispatchPhoneGetPhoneCellInfoApiId)
       
  1062 		// together, so we need store one and then execute this AT command after previous one was complete
       
  1063 		iPendingIpcId = KLtsyDispatchPhoneGetPhoneCellInfoApiId;
       
  1064 		CRequestBase* activeReq = iGloblePhone->CurrentActiveRequest();
       
  1065 		if(activeReq)
       
  1066 		    {
       
  1067 		    if(activeReq->IpcId() == KLtsyDispatchPhoneRegisterCellInfoChangeNotificationApiId)
       
  1068 		        {
       
  1069 		        ret = KErrNone;
       
  1070 		        }
       
  1071 		    }
       
  1072 		}
       
  1073 	return TSYLOGSETEXITERR(ret);
       
  1074 	} // CLtsyPhoneHandler::HandleGetPhoneCellInfoReqL
       
  1075 
       
  1076 TInt CLtsyPhoneHandler::HandleGetGetUsimServiceSupportReqL(TInt /*aApplicationNumber*/)
       
  1077 /**
       
  1078  * This request is completed by invoking
       
  1079  * CCtsyDispatcherCallback::CallbackPhoneGetUsimServiceSupportComp()
       
  1080  * 
       
  1081  * @param aApplicationNumber The application number to check support for in the USIM.
       
  1082  * 
       
  1083  * 
       
  1084  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
  1085  * or another error code to indicate the failure otherwise.
       
  1086  */
       
  1087 	{
       
  1088 	TSYLOGENTRYEXIT;
       
  1089 
       
  1090 	TInt ret = KErrNotSupported;
       
  1091 	return TSYLOGSETEXITERR(ret);
       
  1092 	} // CLtsyPhoneHandler::HandleGetGetUsimServiceSupportReqL
       
  1093 
       
  1094 TInt CLtsyPhoneHandler::HandleGetCurrentActiveUsimApplicationReqL()
       
  1095 /**
       
  1096  * This request is completed by invoking
       
  1097  * CCtsyDispatcherCallback::CallbackPhoneGetCurrentActiveUsimApplicationComp()
       
  1098  * 
       
  1099  * 
       
  1100  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
  1101  * or another error code to indicate the failure otherwise.
       
  1102  */
       
  1103 	{
       
  1104 	TSYLOGENTRYEXIT;
       
  1105 
       
  1106 	TInt ret = KErrNotSupported;
       
  1107 	return TSYLOGSETEXITERR(ret);
       
  1108 	} // CLtsyPhoneHandler::HandleGetCurrentActiveUsimApplicationReqL
       
  1109   
       
  1110 TInt CLtsyPhoneHandler::HandleTerminateAllCallsReqL(TInt /*aCallId*/)
       
  1111 /**
       
  1112  * This request is completed by invoking
       
  1113  * CCtsyDispatcherCallback::CallbackPhoneTerminateAllCallsComp()
       
  1114  * 
       
  1115  * @param aCallId if a call is in the connecting state then this parameter will contain the id of that call, else 0.
       
  1116  * 
       
  1117  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
  1118  * or another error code to indicate the failure otherwise.
       
  1119  */
       
  1120 	{
       
  1121 	LOGTEXT(_L8("[Ltsy Phone]  Starting CLtsyPhoneHandler::HandleTerminateAllCallsReqL()"));
       
  1122 	
       
  1123 	TInt ret = KErrNotSupported;
       
  1124 	ret = iGloblePhone->CheckGlobalPhoneStatus();
       
  1125 	if(ret == KErrNone)
       
  1126 		{
       
  1127 		CATHangUp* cHangUp = CATHangUp::NewL((*iGloblePhone), iCtsyDispatcherCallback);
       
  1128 		iGloblePhone->iEventSignalActive = ETrue;
       
  1129 		iGloblePhone->SetActiveRequest(cHangUp);
       
  1130 		cHangUp->SetHangupOperator(CATHangUp::ERMobilePhoneAPI);
       
  1131 		cHangUp->StartRequest();
       
  1132 		}
       
  1133 	return ret;
       
  1134 	} // CLtsyPhoneHandler::HandleTerminateAllCallsReqL
       
  1135 
       
  1136 TInt CLtsyPhoneHandler::HandleGetSystemNetworkBandReqL()
       
  1137 /**
       
  1138  * This request is completed by invoking
       
  1139  * CCtsyDispatcherCallback::CallbackPhoneGetSystemNetworkBandComp()
       
  1140  * 
       
  1141  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
  1142  * or another error code to indicate the failure otherwise.
       
  1143  */
       
  1144 	{
       
  1145 	TSYLOGENTRYEXIT;
       
  1146 
       
  1147 	TInt ret = KErrNotSupported;
       
  1148 	return TSYLOGSETEXITERR(ret);
       
  1149 	} // CLtsyPhoneHandler::HandleGetSystemNetworkBandReqL
       
  1150 
       
  1151 TInt CLtsyPhoneHandler::HandleSetSystemNetworkBandReqL(RMmCustomAPI::TBandSelection /*aBand*/, RMmCustomAPI::TNetworkModeCaps /*aMode*/)
       
  1152 /**
       
  1153  * This request is completed by invoking
       
  1154  * CCtsyDispatcherCallback::CallbackPhoneSetSystemNetworkBandComp()
       
  1155  * 
       
  1156  * @param aBand the requested band
       
  1157  * @param aMode the requested mode
       
  1158  * 
       
  1159  * @return KErrNone on success, KErrNotSupported if this request is not supported,
       
  1160  * or another error code to indicate the failure otherwise.
       
  1161  */
       
  1162 	{
       
  1163 	TSYLOGENTRYEXIT;
       
  1164 
       
  1165 	TInt ret = KErrNotSupported;
       
  1166 	return TSYLOGSETEXITERR(ret);
       
  1167 	} // CLtsyPhoneHandler::HandleGetSystemNetworkBandReqL
       
  1168 
       
  1169 void CLtsyPhoneHandler::NotifyIpcRequestComplete(TInt aIpcId)
       
  1170 /**
       
  1171  * This function was called by some IPC request after it complete the request 
       
  1172  * 
       
  1173  * If there are one more AT commands which need some interactions among them, the logic control should be put here.
       
  1174  * 
       
  1175  * @param aIpcId The IPC request Id
       
  1176  * 
       
  1177  * @return void
       
  1178  */
       
  1179     {
       
  1180     if(aIpcId == KLtsyDispatchPhoneRegisterCellInfoChangeNotificationApiId)
       
  1181         {
       
  1182         if(iPendingIpcId == KLtsyDispatchPhoneGetPhoneCellInfoApiId)
       
  1183             {
       
  1184             iGloblePhone->DeleteLastActiveRequest();
       
  1185             CATGetPhoneCellInfo* getPhoneCellInfo = NULL;
       
  1186             TRAPD(err,getPhoneCellInfo  = CATGetPhoneCellInfo::NewL(*iGloblePhone,iCtsyDispatcherCallback));
       
  1187             if(err != KErrNone)
       
  1188                 {
       
  1189                 RMobilePhone::TMobilePhoneCellInfoV9 cellInfo; 
       
  1190                 iCtsyDispatcherCallback.CallbackPhoneGetPhoneCellInfoComp(err,cellInfo);
       
  1191                 }
       
  1192             else
       
  1193                 {
       
  1194                 iGloblePhone->iEventSignalActive = ETrue;
       
  1195                 iGloblePhone->SetActiveRequest(getPhoneCellInfo);
       
  1196                 getPhoneCellInfo->SetIpcRequestCompleteObserver(this);
       
  1197                 getPhoneCellInfo->SetIpcId(KLtsyDispatchPhoneGetPhoneCellInfoApiId);
       
  1198                 getPhoneCellInfo->StartRequest();
       
  1199                 iPendingIpcId = -1;
       
  1200                 }
       
  1201             }
       
  1202         }
       
  1203     else if(aIpcId == KLtsyDispatchPhoneGetPhoneCellInfoApiId)
       
  1204         {
       
  1205         // enable to receive the notificaiton of cell info changed
       
  1206         iNotifyCellInfo->Enable();
       
  1207         }
       
  1208     else if(aIpcId == KLtsyDispatchPhoneGetCellInfoApiId)
       
  1209         {
       
  1210         iNotifyCellInfo->Enable();
       
  1211         }
       
  1212     else if(aIpcId == KLtsyDispatchPhoneGetNetworkRegistrationStatusApiId)
       
  1213         {
       
  1214         iNetworkRegStatusChange->Enable();
       
  1215         }
       
  1216     }
       
  1217 
       
  1218 // End of file