supl/locationomasuplprotocolhandler/protocolhandlerver1/inc/epos_rsuplmmcustomapi.h
changeset 0 667063e416a2
equal deleted inserted replaced
-1:000000000000 0:667063e416a2
       
     1 /*
       
     2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   RMmCustomAPI contains multimode API's vendor specific
       
    15 *                functionality.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef RMMCUSTOMAPI_H
       
    21 #define RMMCUSTOMAPI_H
       
    22 
       
    23 //  INCLUDES
       
    24 
       
    25 #include <etelmm.h>
       
    26 #include <et_clsvr.h>
       
    27 #include <etelpckt.h>
       
    28 #include <e32cmn.h> 
       
    29 #include <f32file.h> 
       
    30 
       
    31 // Cell info ant
       
    32 const TInt KMaxTimeSlotIscpAmount		= 14;
       
    33 const TInt KMaxCellMeasuredResults		= 32;
       
    34 const TInt KMaxNetworkMeasureReports	= 8;
       
    35 const TInt KMaxNmrAmount				= 15;
       
    36 
       
    37 // CLASS DECLARATION
       
    38 
       
    39 /**
       
    40 *  RMmCustomAPI contains multimode API's vendor specific functionality.
       
    41 *  RMmCustomAPI is a subsession extension i.e. it derives 
       
    42 *  from RtelSubSessionBase class.
       
    43 
       
    44 *  Notice that Custom TSY is able to handle only one instance of each Custom API
       
    45 *  Set-method call at a time. Overlapping Set-method calls occurs if same 
       
    46 *  Set-method is called from an other instance of  RMmCustomAPI object. Through
       
    47 *  one RMmCustomAPI object overlapping calls are not allowed - trying this will
       
    48 *  panic Etel Server. For each overlapping request to the client is returned 
       
    49 *  error code KErrServerBusy either as a return value in case of synchronous
       
    50 *  call or in a variable of type TRequestStatus in case of an asynchronous call.
       
    51 *  This rule applies also in a situation where previous identical request has 
       
    52 *  been cancelled by client but the triggered operation on DOS side has not been 
       
    53 *  completed yet.
       
    54 *
       
    55 *  On the other hand Custom TSY is able to handle several instances of each
       
    56 *  Get-method call at a time. Again overlapping Get-method call can be activated
       
    57 *  only from an other instance of  RMmCustomAPI object.
       
    58 *
       
    59 *  Consider carefully consequences and implications of request cancellations.
       
    60 *  If a request has triggered an operation on DOS side, the subsequent
       
    61 *  calcellation of the request will not undo the operation on DOS side. It is
       
    62 *  the responsibility of the Custom API's client to undo the operation if
       
    63 *  necessary. Cancel request completes only when awaited DOS side response
       
    64 *  arrives. Then if it is an OK-response, the request is completed normally with
       
    65 *  error code KErrNone. . Or if the response is a FAILURE, the request is
       
    66 *  completed with error code KErrCancel. 
       
    67 *
       
    68 *  APDU functionality:
       
    69 *  Etel Server and Custom TSY are able to handle multiple SendAPDUReq calls
       
    70 *  simultaneously. 
       
    71 *  However each RMmCustoAPI instance can have only one request active at a time.
       
    72 *
       
    73 *  Packet data related functionality:
       
    74 *  Custom TSY implements functionality that is not supported by the packet API.
       
    75 *
       
    76 *  Call realted functionality:
       
    77 *  Custom TSY implements functionality that is not supported by the MM ETEL API.
       
    78 *
       
    79 *  @lib CustomAPI.lib
       
    80 *  @since Series 60 2.0
       
    81 */
       
    82 enum TSUPLNwMode
       
    83 	{
       
    84 		ESUPLGSM = 0,
       
    85 		ESUPLWCDMA					
       
    86 	};
       
    87 
       
    88 enum TSUPLFrequecyMode
       
    89 	{
       
    90 		EFDD,
       
    91 		ETDD
       
    92 	};
       
    93 
       
    94 class RMmCustomAPI //: public RTelSubSessionBase
       
    95     {
       
    96     public:
       
    97 
       
    98         /**
       
    99         *   C++ default ructor.
       
   100         */
       
   101          RMmCustomAPI();
       
   102 
       
   103 public:    
       
   104 
       
   105 	class TMmCellInfo
       
   106 	        {
       
   107 	        public:
       
   108 	   		struct TFrequencyInfo
       
   109 		   		{
       
   110 				TInt	iFddUL;		// 0..16383		In case of fdd( iFddUL, iFddDL),
       
   111 				TInt	iFddDL;		// 0..16383 	iFddUL is optional while iFddDL is mandatory. 
       
   112 				TInt	iTddNt;		// 0..16383		
       
   113 		   		};
       
   114 	   
       
   115 	   		struct TFddInfo
       
   116 		   		{
       
   117 				TInt16				iPrimaryCPICH;	//(0..127)
       
   118 				TInt8				iCpichEcN0;		//(0..63), max=49      
       
   119 				TInt8				iCichRscp; 		//(0..127, max=91      
       
   120 				TInt				iPathloss; 		//(46..173), max=58
       
   121 		   		};
       
   122 		   		
       
   123 	   		struct TTddInfo
       
   124 		   		{
       
   125 		   		TInt8				iCellParamID;	//(0..127)
       
   126 		   		TInt8				iProposedTGSN;	//(0..14)
       
   127 		   		TInt8				iPrimaryCcpchRscp;//(0..127)
       
   128 		   		TInt				iPathloss; 		//(46..173), max=58
       
   129 		   		TInt8				iTimeslotISCP[ KMaxTimeSlotIscpAmount ];//(0..127)), max. 91
       
   130 		   		};
       
   131 		   
       
   132 	   		struct TCellMeasuredResult
       
   133 		   		{
       
   134 		   		TInt32				iCID;	//cellIdentity (0..268435455)
       
   135 		   		TFddInfo			iFddInfo;
       
   136 		   		TTddInfo			iTddInfo;
       
   137 		   		};
       
   138 	   
       
   139 			struct TNetworkMeasureReport
       
   140 				{
       
   141 				TFrequencyInfo		iFrequencyInfo;
       
   142 				TInt8				iCarrierRSSI;	//	UTRA-CarrierRSSI (0..127), max=76
       
   143 				TCellMeasuredResult	iCellMeasuredResult[ KMaxCellMeasuredResults ];//1..32
       
   144 				};
       
   145 				
       
   146 			struct TNmr
       
   147 				{
       
   148 				TInt iARFCN;
       
   149 				TInt iBSIC;   
       
   150 				TInt RxLEV;
       
   151 				};
       
   152 				
       
   153 		   	struct TGSMCellInfo
       
   154 				{
       
   155 				TNmr 		iNmr[ KMaxNmrAmount ];												
       
   156 				TInt16  	iTA;	// Timing advance(0..255)							
       
   157 				};
       
   158 				
       
   159 	   		struct TWCDMACellInfo
       
   160 		   		{
       
   161 		   		TFrequencyInfo			iFrequencyInfo;	
       
   162 				TInt				 	iPrimaryScrambilingCode;	//0..511 
       
   163 				TNetworkMeasureReport 	iNwkMeasureReport[ KMaxNetworkMeasureReports ];	//1..8
       
   164 				};	
       
   165 			
       
   166             enum TNwMode
       
   167                 {
       
   168                 EUnknown,
       
   169                 EGSM,
       
   170                 EWCDMA                    
       
   171                 };
       
   172 				
       
   173 			public: //Methods			   	
       
   174 	            
       
   175 	            // ructor
       
   176 	           
       
   177 	             TMmCellInfo();
       
   178 	             ~TMmCellInfo();
       
   179 	             
       
   180 	        
       
   181 	        public:  // Data
       
   182 	        
       
   183                 /*
       
   184                 * Network mode
       
   185                 */
       
   186                 TNwMode iMode; // used for identifying mode. 
       
   187             
       
   188                 /*
       
   189                 * GSM cell info
       
   190                 */
       
   191                 TGSMCellInfo iGsmCellInfo;
       
   192             
       
   193                 /*
       
   194                 * WCDMA cell info
       
   195                 */
       
   196                 TWCDMACellInfo iWcdmaCellInfo;  
       
   197                 
       
   198 	        };
       
   199 	        
       
   200 	       typedef TPckg<TMmCellInfo> TMmCellInfoPckg;
       
   201     public: // New functions
       
   202 
       
   203         /**
       
   204         * Opens a subsession.
       
   205         * @since Series 60 2.0
       
   206         * @param aPhone reference to a Mobile Phone object
       
   207         * @return KErrNone if successfuls
       
   208         */
       
   209          TInt Open(RMobilePhone& aPhone);
       
   210 
       
   211         /**
       
   212         * Closes the subsession.
       
   213         * @since Series 60 2.0
       
   214         */
       
   215          void Close();
       
   216 		
       
   217 		 TInt GetCellInfo( TMmCellInfo& aCellInfo ) ;
       
   218 		 
       
   219 		 void GetCellInfo( TRequestStatus& aStatus, TDes8& aCellInfo  ) ;   
       
   220 		 
       
   221 		 void CancelAsyncRequest();     
       
   222         
       
   223     private:
       
   224 
       
   225         /**
       
   226         * Copy ructor
       
   227         * @since Series 60 2.0
       
   228         * @param aCustomAPI Custom API handle 
       
   229         */
       
   230         RMmCustomAPI(  RMmCustomAPI& aCustomAPI );
       
   231 
       
   232     protected:
       
   233 
       
   234         /**
       
   235         * By default Symbian 2nd phase ructor is private.
       
   236         */
       
   237          void ConstructL();
       
   238 
       
   239         /**
       
   240         * Destructor
       
   241         */
       
   242 		void Destruct();
       
   243 		void FillGSMCellInfo(TMmCellInfo& aCellInfo ) ;
       
   244 		void FillWCDMACellInfo(TMmCellInfo& aCellInfo ) ;
       
   245 		TMmCellInfo::TNmr GetTNmr();
       
   246 		void FillMeasureRequestList(TMmCellInfo::TWCDMACellInfo& aWcdmaCellInfo) ;
       
   247 		TMmCellInfo::TNetworkMeasureReport GetMeasureRequest(TInt aReadIndex) ;
       
   248 		void FillCellMeasuredResultsList(TMmCellInfo::TNetworkMeasureReport& aMeasureReport) ;
       
   249 		TMmCellInfo::TCellMeasuredResult GetCellMeasuredResults(TInt aReadIndex) ;
       
   250 		void FillFDDSpecificFrequencyMode(TMmCellInfo::TCellMeasuredResult& aCellMeasuredResult,TInt aOption,TInt aReadIndex) ;
       
   251 		void FillTDDSpecificFrequencyMode(TMmCellInfo::TCellMeasuredResult& aCellMeasuredResult,TInt aOption,TInt aReadIndex) ;
       
   252 		void FillFrequencyMode(TMmCellInfo::TFrequencyInfo& aFrequencyInfo,TInt aUsedFor,TInt aInnerOuter) ;
       
   253 		
       
   254 		TInt GetParameterValue(TInt aLineNumber,TInt aIndex = -1) ;
       
   255     private:    // Data
       
   256     
       
   257     		RTimer iRTimer;
       
   258     		
       
   259     		TSUPLNwMode iSUPLNwMode;
       
   260     		
       
   261     		TInt iInitialTNmr; 
       
   262     		
       
   263     		TSUPLFrequecyMode iSUPLFrequecyMode;
       
   264     		
       
   265     		TRequestStatus* iStatus;
       
   266     		
       
   267     		TFileText  iFileText;
       
   268     		
       
   269     		TBuf8<1500> iLineBuffer;
       
   270     		TInt iNoOfCells;
       
   271     		TInt iTotalCellCount ;
       
   272 			TInt iCellMeasuredResults ;
       
   273 			TInt iCount;
       
   274 			RFs iFs;
       
   275 			TInt iFileError ;
       
   276 			
       
   277     };
       
   278 
       
   279 #endif      // RMMCUSTOMAPI_H
       
   280 
       
   281 
       
   282 //  End of File