telephonyserverplugins/simtsy/inc/CSimNetworkStatus.h
changeset 0 3553901f7fa8
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2001-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 // Contains definitions for classes that implement network orientated functionality.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalAll
       
    21 */
       
    22 
       
    23 #ifndef CSIMNETWORKSTATUS_H__
       
    24 #define CSIMNETWORKSTATUS_H__
       
    25 
       
    26 #include <etelmm.h>
       
    27 #include <et_phone.h>
       
    28 #include "csimtimer.h"
       
    29 #include "CSimPubSubChange.h"
       
    30 
       
    31 class CSimPhone;
       
    32 class CTestConfigSection;
       
    33 
       
    34 /**
       
    35  * Implements the RMobilePhone based functions that constitute the network orientated
       
    36  * functionality provided by the SIM TSY.
       
    37  */
       
    38 class CSimNetworkStatus : public CBase, MTimerCallBack, MPubSubChangeCallback
       
    39 	{
       
    40 public:
       
    41 	static CSimNetworkStatus* NewL(CSimPhone* aPhone);
       
    42 	CSimNetworkStatus(CSimPhone* aPhone);
       
    43 	~CSimNetworkStatus();
       
    44 	TInt GetNetworkCaps(TTsyReqHandle aReqHandle,TDes8* aPckg1);
       
    45 	TInt GetHomeNetwork(TTsyReqHandle aReqHandle,TDes8* aPckg1);
       
    46 	TInt GetCurrentNetwork(TTsyReqHandle aReqHandle,TDes8* aPckg1, TDes8* aPckg2);
       
    47 	TInt GetCurrentNetworkNoLocation(TTsyReqHandle aReqHandle,TDes8* aPckg1);
       
    48 	TInt GetNetworkRegistrationStatus(TTsyReqHandle aReqHandle,TDes8* aPckg);
       
    49 	TInt NotifyNetworkRegistrationStatusChange(TTsyReqHandle aReqHandle,TDes8* aPckg);
       
    50 	void NotifyNetworkRegistrationStatusChangeCancel();
       
    51 	TInt NotifyCurrentNetworkChange(TTsyReqHandle aReqHandle,TDes8* aPckg1,TDes8* aPckg2);
       
    52 	void NotifyCurrentNetworkChangeCancel(const TTsyReqHandle aTsyReqHandle);
       
    53 	TInt NotifyCurrentNetworkNoLocationChange(TTsyReqHandle aReqHandle,TDes8* aPckg1);
       
    54 	void NotifyCurrentNetworkNoLocationChangeCancel(const TTsyReqHandle aTsyReqHandle);	
       
    55 	
       
    56 	TInt GetNITZInfo(TTsyReqHandle aReqHandle,TDes8* aPckg1);
       
    57 	TInt NotifyNITZInfoChange(TTsyReqHandle aReqHandle,TDes8* aPckg);
       
    58 	void NotifyNITZInfoChangeCancel();
       
    59 	TInt GetCurrentServiceProvider(TTsyReqHandle aReqHandle,TDes8* aPckg);
       
    60 	TInt GetCurrentNetworkName(TTsyReqHandle aReqHandle,TDes8* aNetworkName, TDes8* aLocInfo);
       
    61 
       
    62 	TInt GetCellInfo(TTsyReqHandle aReqHandle,TDes8* aPckg);
       
    63 	TInt NotifyCellInfoChange(TTsyReqHandle aReqHandle,TDes8* aPckg);
       
    64 	void NotifyCellInfoChangeCancel(TTsyReqHandle aTsyReqHandle);
       
    65 	
       
    66 	const CTestConfigSection* CfgFile();
       
    67 	RMobilePhone::TMobilePhoneNetworkStatus NetWorkStatus();
       
    68 	inline RMobilePhone::TMobilePhoneRegistrationStatus RegistrationStatus() { return static_cast<RMobilePhone::TMobilePhoneRegistrationStatus>(iCurrentRegStatus);};
       
    69 
       
    70 private:
       
    71 	void ConstructL();
       
    72 	void TimerCallBack(TInt aId);
       
    73 	void TimerCallBackRegStat();
       
    74 	void PubSubCallback(TInt aRegStat);
       
    75 	void TimerCallBackNitz();
       
    76 	void TimerCallBackCellInfo();
       
    77 	void TimerCallBackRadioModeL();
       
    78 	void PopulateNetworkInfoV1(TInt aIndex,RMobilePhone::TMobilePhoneNetworkInfoV1& aNetInfo);
       
    79 	void PopulateEtel3rdPartyNetworkInfoV1(TInt aIndex,RMobilePhone::TEtel3rdPartyMobileNetworkInfoV1& aNetInfo);
       
    80 	void PopulateNitzNetworkNames(RMobilePhone::TMobilePhoneNITZ& aNitz);
       
    81 
       
    82 private:
       
    83 	CSimPhone* iPhone;			// < Pointer to the parent phone class.
       
    84 	CSimTimer* iRegStatTimer;	// < Pointer to the owned Registration Status timer class.
       
    85 	CSimPubSubChange* iRegStatChange;	// < Object for checking registration status change variable
       
    86 	CSimPubSubChange* iPSRegStatChange;	// < Object for checking registration status change variable using new P&S uids
       
    87 	CSimTimer* iNitzTimer;		// < Pointer to the owned NITZ timer class.
       
    88 	CSimTimer* iRadioModeTimer;	// < Pointer to the owned RadioMode timer class.
       
    89 	CSimTimer* iCellInfoTimer;  // < Pointer to the owned cell info timer class.
       
    90 	
       
    91 	struct TRegStatus
       
    92 		{
       
    93 		TInt iDuration;												// < Duration of Registration Status
       
    94 		RMobilePhone::TMobilePhoneRegistrationStatus iRegStatus;	// < Registration Status that will be maintained through period iDuration
       
    95 		TInt iNetworkInfoIndex;										// < Network index (into iNetworkInfo) that will be maintained through period iDuration (optional)
       
    96 		};
       
    97 
       
    98 	CArrayFixFlat<TRegStatus>* iRegStatusInfo;						// < List of network registration changes.
       
    99 	TInt iRegStatIndex;					// < Current index from the iRegStatInfo array
       
   100 	TInt iCurrentRegStatus;				// < Current Registration Status.
       
   101 	CArrayFixFlat<RMobilePhone::TMobilePhoneNetworkInfoV2>*  iNetworkInfo;	// < List of network information.
       
   102 	CArrayFixFlat<RMobilePhone::TMobilePhoneNetworkInfoV8>*  iNetworkInfoV8;	// < List of network information for V8 class.
       
   103 	CArrayFixFlat<RMobilePhone::TMobilePhoneLocationAreaV1>* iLocationArea;	// < List of location area.
       
   104 	TInt iCurrentNetworkIndex;			// < Current index from the iNetworkInfo array
       
   105 	struct TNitzInfoAndDuration
       
   106 		{
       
   107 		TInt iDuration;							// < Duration when this NITZ information is valid.
       
   108 		RMobilePhone::TMobilePhoneNITZ iNitz;	// < NITZ information valid for above period.
       
   109 		};
       
   110 	CArrayFixFlat<TNitzInfoAndDuration>* iNitzInfo;	// < List of NITZ information.
       
   111 	TInt iNitzIndex;								// < Current index from the iNitzInfo array
       
   112 	RMobilePhone::TMobilePhoneNITZ iCurrentNitzInfo;
       
   113 
       
   114 	TBool iRegStatChangeNotificationPending;			// < Registration Status notification request outstanding
       
   115 	TTsyReqHandle iRegStatChangeNotificationReqHandle;	// < Registration Status notification outstanding request handle
       
   116 	RMobilePhone::TMobilePhoneRegistrationStatus* iRegStatChangeNotificationRegStatus;	// < Registration Status notification pointer
       
   117 
       
   118 	TBool iCurrNetChangeV1NotificationPending;			// < Current network notification request outstanding for V1 paramater class
       
   119 	TTsyReqHandle iCurrNetChangeV1NotificationReqHandle;	// < Current network notification outstanding request handle  for V1 paramater class
       
   120 	RMobilePhone::TMobilePhoneNetworkInfoV1* iCurrNetChangeV1NotificationNetInfo;	// < Current network notification data pointer  for V1 paramater class
       
   121 
       
   122 	TBool iCurrNetChangeV2NotificationPending;			// < Current network notification request outstanding for V2 paramater class
       
   123 	TTsyReqHandle iCurrNetChangeV2NotificationReqHandle;	// < Current network notification outstanding request handle  for V2 paramater class
       
   124 	RMobilePhone::TMobilePhoneNetworkInfoV2* iCurrNetChangeV2NotificationNetInfo;	// < Current network notification data pointer  for V2 paramater class
       
   125 	
       
   126 	TBool iCurrNetChangeV5NotificationPending;			// < Current network notification request outstanding for V5 paramater class
       
   127 	TTsyReqHandle iCurrNetChangeV5NotificationReqHandle;	// < Current network notification outstanding request handle  for V5 paramater class
       
   128 	RMobilePhone::TMobilePhoneNetworkInfoV5* iCurrNetChangeV5NotificationNetInfo;	// < Current network notification data pointer  for V5 paramater class
       
   129 	
       
   130 	TBool iCurrNetChangeV8NotificationPending;			// < Current network notification request outstanding for V8 paramater class
       
   131 	TTsyReqHandle iCurrNetChangeV8NotificationReqHandle;	// < Current network notification outstanding request handle  for V8 paramater class
       
   132 	RMobilePhone::TMobilePhoneNetworkInfoV8* iCurrNetChangeV8NotificationNetInfo;	// < Current network notification data pointer  for V8 paramater class
       
   133 	
       
   134 	TBool iCurrNetChangeNoLocV1NotificationPending;			// < Current network notification request outstanding for V1 paramater class
       
   135 	TTsyReqHandle iCurrNetChangeNoLocV1NotificationReqHandle;	// < Current network notification outstanding request handle  for V1 paramater class
       
   136 	RMobilePhone::TMobilePhoneNetworkInfoV1* iCurrNetChangeNoLocV1NotificationNetInfo;	// < Current network notification data pointer  for V1 paramater class
       
   137 
       
   138 	TBool iCurrNetChangeNoLocV2NotificationPending;			// < Current network notification request outstanding for V2 paramater class
       
   139 	TTsyReqHandle iCurrNetChangeNoLocV2NotificationReqHandle;	// < Current network notification outstanding request handle  for V2 paramater class
       
   140 	RMobilePhone::TMobilePhoneNetworkInfoV2* iCurrNetChangeNoLocV2NotificationNetInfo;	// < Current network notification data pointer  for V2 paramater class
       
   141 	
       
   142 	TBool iCurrNetChangeNoLocV5NotificationPending;			// < Current network notification request outstanding for V5 paramater class
       
   143 	TTsyReqHandle iCurrNetChangeNoLocV5NotificationReqHandle;	// < Current network notification outstanding request handle  for V5 paramater class
       
   144 	RMobilePhone::TMobilePhoneNetworkInfoV5* iCurrNetChangeNoLocV5NotificationNetInfo;	// < Current network notification data pointer  for V5 paramater class
       
   145 	
       
   146 	TBool iCurrNetChangeNoLocV8NotificationPending;			// < Current network notification request outstanding for V8 paramater class
       
   147 	TTsyReqHandle iCurrNetChangeNoLocV8NotificationReqHandle;	// < Current network notification outstanding request handle  for V8 paramater class
       
   148 	RMobilePhone::TMobilePhoneNetworkInfoV8* iCurrNetChangeNoLocV8NotificationNetInfo;	// < Current network notification data pointer  for V8 paramater class
       
   149 	
       
   150 	TBool iCurrNetChangeEtelIsvNotificationPending;			// < Current network notification request outstanding for V2 paramater class
       
   151 	TTsyReqHandle iCurrNetChangeEtelIsvNotificationReqHandle;	// < Current network notification outstanding request handle  for V2 paramater class
       
   152 	RMobilePhone::TEtel3rdPartyMobileNetworkInfoV1* iCurrNetChangeEtelIsvNotificationNetInfo;	// < Current network notification data pointer  for V2 paramater class
       
   153 	
       
   154 	TBool iCurrentNetworkChangeLocationAreaNotificationPending;			// < Current network notification request outstanding for location area class
       
   155 	RMobilePhone::TMobilePhoneLocationAreaV1* iCurrentNetworkChangeLocationArea; // < Current network notification data pointer  for location area class
       
   156 	
       
   157 	TBool iNitzChangeNotificationPending;			// < NITZ notification request outstanding
       
   158 	TTsyReqHandle iNitzChangeNotificationReqHandle;	// < NITZ notification outstanding request handle
       
   159 	RMobilePhone::TMobilePhoneNITZ* iNitzChangeNotificationInfo;	// < NITZ notification data pointer
       
   160 	RMobilePhone::TMobilePhoneServiceProviderNameV2 iServiceProvider;	// < Service provider details
       
   161 	struct TRadioMode
       
   162 		{
       
   163 		TInt iDuration;	// < Duration of Registration Status
       
   164 		TBool iRadioOn;	// < Radio (RF) On or Off 
       
   165 		};
       
   166 	TRadioMode iRadioMode;
       
   167 	CArrayFixFlat<TRadioMode>* iRadioModeInfo;
       
   168 	TInt iRadioModeIndex;								// < Current index from the radioMode array
       
   169 
       
   170 	struct TCellInfoAndDuration
       
   171 		{
       
   172 		TInt iDuration;							    // < Duration when this cell information is valid.
       
   173 		RMobilePhone::TMobilePhoneCellInfoV9 iInfo;	// < cell information valid for above period.
       
   174 		};
       
   175 	CArrayFixFlat<TCellInfoAndDuration>* iCellInfo;	// < List of Cell information.
       
   176 	TInt iCellInfoIndex;	    					// < Current index from the iNitzInfo array
       
   177 	RMobilePhone::TMobilePhoneCellInfoV9 iCurrentCellInfo;
       
   178 	TBool iCellInfoChangeNotificationPending;			// < Cell info notification request outstanding
       
   179 	TTsyReqHandle iCellInfoChangeNotificationReqHandle;	// < Cell info notification outstanding request handle
       
   180 	RMobilePhone::TMobilePhoneCellInfoV9* iCellInfoChangeNotificationInfo;	// < cell Info notification data pointer
       
   181 
       
   182 private:
       
   183 	void SetNetworkMode();
       
   184 
       
   185 	CSimTimer* iRoamStatTimer;	// < Pointer to the owned Roaming Status timer class.
       
   186 	void FindRoamStatSettings();
       
   187 
       
   188 	class TRoamStatClient
       
   189 		{
       
   190 		public:
       
   191 			TTsyReqHandle iReqHandle;
       
   192 			TUint8* iRoamingStatus;
       
   193 		};
       
   194 
       
   195 	TInt iRoamStatGetTimeout;
       
   196 	CArrayFixFlat<TRoamStatClient>* iRoamStatGetClients;
       
   197 	CArrayFixFlat<TRoamStatClient>* iRoamStatNotifyClients;
       
   198 	};
       
   199 
       
   200 #endif