telephonyserverplugins/simtsy/inc/CSimPacketQoS.h
changeset 0 3553901f7fa8
equal deleted inserted replaced
-1:000000000000 0:3553901f7fa8
       
     1 // Copyright (c) 2002-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 // This file contains the definitions of the Simulator TSY Packet Quality of Service class.
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file
       
    20  @internalAll
       
    21 */
       
    22 
       
    23 #ifndef __CSIMPACKETQOS_H__
       
    24 #define __CSIMPACKETQOS_H__
       
    25 
       
    26 #include <et_phone.h>
       
    27 #include <etelqos.h>
       
    28 #include "utils.h"
       
    29 #include "csimtimer.h"
       
    30 #include "CSimPubSubChange.h"
       
    31 
       
    32 struct TProfileConfig	//< Used for holding the GPRS Requested and Minimum Profile parameters 
       
    33 	{					//< read from the configuration file.
       
    34 	TUint8 iMinPrecedence;
       
    35 	TUint8 iReqPrecedence;
       
    36 	TUint8 iMinDelay;
       
    37 	TUint8 iReqDelay;
       
    38 	TUint8 iMinReliability;
       
    39 	TUint8 iReqReliability;
       
    40 	TUint8 iMinPeekThroughput;
       
    41 	TUint8 iReqPeekThroughput;
       
    42 	TUint8 iMinMeanThroughput;
       
    43 	TUint8 iReqMeanThroughput;
       
    44 	};
       
    45 
       
    46 struct TNegProfileConfig	//< Used for holding the GPRS Negotiated Profile Parameters
       
    47 	{						//< read from the configuration file.
       
    48 	TUint8 iNegPrecedence;
       
    49 	TUint8 iNegDelay;
       
    50 	TUint8 iNegReliability;
       
    51 	TUint8 iNegPeekThroughput;
       
    52 	TUint8 iNegMeanThroughput;
       
    53 	};
       
    54 
       
    55 struct TProfileCapsGPRS	//< Used for holding the GPRS Capability Profile Parameters
       
    56 	{		
       
    57 	TUint8 iPrecedence;
       
    58 	TUint8 iDelay;
       
    59 	TUint8 iReliability;
       
    60 	TUint8 iPeak;
       
    61 	TUint8 iMean;
       
    62 	};
       
    63 
       
    64 
       
    65 struct TProfileReqR99			//< Used for holding the Rel99 Release Profile parameters
       
    66 	{
       
    67 		TName iContextName;
       
    68 		TUint8 iReqTraffic;
       
    69 		TUint8 iMinTraffic;
       
    70 		TUint8 iReqDeliveryOrder;
       
    71 		TUint8 iMinDeliveryOrder;
       
    72 		TUint8 iReqErroneousSDU;
       
    73 		TUint8 iMinErroneousSDU;
       
    74 		TInt   iMaxSDUSize;
       
    75 		TInt   iMinSDUSize;
       
    76 		TInt   iReqUpLinkTBitRate;
       
    77 		TInt   iReqDownLinkTBitRate;
       
    78 		TInt   iMinUpLinkTBitRate;
       
    79 		TInt   iMinDownLinkTBitRate;
       
    80 		TUint8 iReqTBitErrorRatio;
       
    81 		TUint8 iMinTBitErrorRatio;
       
    82 		TUint8 iReqTSDUErrorRatio;
       
    83 		TUint8 iMinTSDUErrorRatio;
       
    84 		TUint8 iReqTTrafficHandlingPriority;
       
    85 		TUint8 iMinTTrafficHandlingPriority;
       
    86 		TInt   iReqTransferDelay;
       
    87 		TInt   iMinTransferDelay;
       
    88 		TInt   iReqGuaranteedUpLinkTBitRate;
       
    89 		TInt   iReqGuaranteedDownLinkTBitRate;
       
    90 		TInt   iMinGuaranteedUpLinkTBitRate;
       
    91 		TInt   iMinGuaranteedDownLinkTBitRate;
       
    92 	};
       
    93 
       
    94 struct TProfileNegR99				//< Used for holding the Neg99 Negotiated Profile parameters
       
    95 	{
       
    96 		TName iContextName;
       
    97 		TUint8 iDuration;
       
    98 		TUint8 iNegTraffic;
       
    99 		TUint8 iNegDeliveryOrder;
       
   100 		TUint8 iNegErroneousSDUDelivery;
       
   101 		TInt iNegMaxSDUSize;
       
   102 		TUint8 iNegTBitErrorRatio;
       
   103 		TUint8 iNegTSDUErrorRatio;
       
   104 		TUint8 iNegTrafficHandlingPriority;
       
   105 		TInt   iNegTransferDelay;
       
   106 		TInt   iNegGuaranteedUpLinkBitRate;
       
   107 		TInt   iNegGuaranteedDownLinkBitRate;
       
   108 		TInt   iNegMaxUpLinkRate;
       
   109 		TInt   iNegMaxDownLinkRate;
       
   110 	};
       
   111 
       
   112 struct TProfileCapsR99				//< Used for holding the Rel99 Capability Profile parameters
       
   113 	{
       
   114 		TUint8 iTraffic;
       
   115 		TUint8 iDeliveryOrderReq;
       
   116 		TUint8 iDeliverErroneousSDU;
       
   117 		TUint8 iBER;
       
   118 		TUint8 iSDUErrorRatio;
       
   119 		TUint8 iTrafficHandlingPriority;
       
   120 	};
       
   121 	
       
   122 struct TProfileCapsR5 : TProfileCapsR99	//< Used for holding the Rel5 Capability Profile parameters
       
   123 	{
       
   124 		TBool  iSignallingIndication;
       
   125 		TUint8 iNegTSourceStatisticsDescriptor;
       
   126 	};
       
   127 
       
   128 struct TSetProfileFail			// struct to SetProfile() call to fail
       
   129 	{
       
   130 		TInt iNumberOfTimes;
       
   131 		TInt iFailErrorCode;
       
   132 	};
       
   133 	
       
   134 struct TProfileReqR5 : TProfileReqR99	//< Used for holding the Rel5 Release Profile parameters
       
   135 	{
       
   136 		TBool  iSignallingIndication;
       
   137 		TUint8 iReqTSourceStatisticsDescriptor;
       
   138 	};
       
   139 
       
   140 struct TProfileNegR5 : 	TProfileNegR99	//< Used for holding the Neg5 Negotiated Profile parameters
       
   141 	{
       
   142 		TBool  iSignallingIndication;
       
   143 		TUint8 iNegTSourceStatisticsDescriptor;
       
   144 	};
       
   145 
       
   146 
       
   147 class CSimPacketContext;
       
   148 class CSimPacketQoS : public CSubSessionExtBase, public MTimerCallBack, public MPubSubChangeCallback
       
   149 	{
       
   150 public:
       
   151 	static CSimPacketQoS* NewL(CSimPhone* aPhone, CSimPacketContext* aPacketContext);
       
   152 	CSimPacketQoS(CSimPhone* aPhone, CSimPacketContext* aPacketContext);
       
   153 	void ConstructL();
       
   154 	~CSimPacketQoS();
       
   155 public:
       
   156 	virtual TInt ExtFunc(const TTsyReqHandle aTsyReqHandle,const TInt aIpc,const TDataPackage& aPackage);
       
   157 	virtual TReqMode ReqModeL(const TInt aIpc);
       
   158 	virtual CTelObject* OpenNewObjectByNameL(const TDesC& aName);
       
   159 	virtual CTelObject* OpenNewObjectL(TDes& aNewName);
       
   160 	virtual TInt CancelService(const TInt aIpc, const TTsyReqHandle aTsyReqHandle);
       
   161 	virtual void Init();
       
   162 	virtual TInt RegisterNotification(const TInt aIpc);
       
   163 	virtual TInt DeregisterNotification(const TInt aIpc);
       
   164 	virtual TInt NumberOfSlotsL(const TInt aIpc);
       
   165 
       
   166 	TInt PerformProfileChange();
       
   167 	void ClearChangeQoSPending();
       
   168 
       
   169 private:
       
   170 	TInt SetProfile(const TTsyReqHandle aTsyReqHandle,const TDesC8* aConfig);
       
   171 	TInt SetProfileCancel(const TTsyReqHandle aTsyReqHandle);
       
   172 
       
   173 	TInt GetProfile(const TTsyReqHandle aTsyReqHandle,TDes8* aConfig);
       
   174 	TInt GetProfileCancel(const TTsyReqHandle aTsyReqHandle);
       
   175 
       
   176 	TInt GetProfileCaps(const TTsyReqHandle aTsyReqHandle, TDes8* aConfig);
       
   177 	TInt GetProfileCapsCancel(const TTsyReqHandle aTsyReqHandle);
       
   178 
       
   179 	TInt NotifyProfileChanged(const TTsyReqHandle aTsyReqHandle, TDes8* aConfig);
       
   180 	TInt NotifyProfileChangedCancel(const TTsyReqHandle aTsyReqHandle);
       
   181 
       
   182 	TInt MatchContext(TProfileNegR99& R99NegProfile);
       
   183 	TInt MatchContext(TProfileReqR99& R99ReqProfile);
       
   184 	
       
   185 	TInt MatchContext(TProfileNegR5& R5NegProfile);
       
   186 	TInt MatchContext(TProfileReqR5& R5ReqProfile);
       
   187 	
       
   188 	void CompleteNotifications(TProfileNegR99& aProfile);
       
   189 	void CompleteNotifications(TProfileNegR5& aProfile);
       
   190 
       
   191 	void PubSubCallback(TInt aRegStat);
       
   192 
       
   193 	// methods to retrieve config file settings
       
   194 	void GetGPRSReqProfilesL();
       
   195 	void GetGPRSNegProfilesL();
       
   196 	void GetR99ReqProfilesL();
       
   197 	void GetR99NegProfilesL();
       
   198 	void GetR99NetworkNotificationsL();
       
   199 	void GetGPRSQosProfileCaps();
       
   200 	void GetR99QosProfileCaps();
       
   201 	void GetProfileFailSettings();
       
   202 	void GetR5ReqProfilesL();
       
   203 	void GetR5NegProfilesL();
       
   204 	void GetR5NetworkNotificationsL();
       
   205 	void GetR5QosProfileCaps();
       
   206 	void GetSetQoSSettings();
       
   207 	
       
   208 
       
   209 private: //Data
       
   210 	CSimPhone* iPhone;
       
   211 	CSimPacketContext* iPacketContext;				//< pointer to the parent class CSimPacketContext
       
   212 	CArrayFixFlat<TProfileConfig>* iProfiles;		//< Holds a list of requested GPRS profiles read from the config file
       
   213 	CArrayFixFlat<TNegProfileConfig>* iNegProfiles;	//< Holds a list of Negotiated GPRS profiles read from the config file
       
   214 		
       
   215 	CArrayFixFlat<TProfileReqR99>* iReqR99Profiles;
       
   216 	CArrayFixFlat<TProfileNegR99>* iNegR99Profiles;
       
   217 	CArrayFixFlat<TProfileCapsR99>* iCapsR99Profiles;
       
   218 
       
   219 	CArrayFixFlat<TProfileReqR5>* iReqR5Profiles;
       
   220 	CArrayFixFlat<TProfileNegR5>* iNegR5Profiles;
       
   221 		
       
   222 	TNotificationType iNetworkNotificationType;
       
   223 	CArrayFixFlat<TProfileNegR99>* iQosNetworkNotifications;
       
   224 	CArrayFixFlat<TProfileNegR5>* iQosR5NetworkNotifications;
       
   225 
       
   226 	TInt iCurrentNeg;			//< index for the iNegProfiles.  indicates the next profile to use.
       
   227 	TInt iCurrentNeg99;
       
   228 	TInt iCurrentNegR5;
       
   229 	TBool iSetProfilePending;
       
   230 	
       
   231 	TInt iCurrentProfileRel;	//< Release format used to set this QoS (only used for R99_R4 and R5 formats)
       
   232 	
       
   233 	TNotifyData	iNotifyProfileGPRS;		//< Holds the notification data (a flag, TsyReqHandle and any raw data) 
       
   234 	TNotifyData	iNotifyProfileR99;		//< Holds the notification data (a flag, TsyReqHandle and any raw data) 
       
   235 	TNotifyData	iNotifyProfileR5;		//< Holds the notification data (a flag, TsyReqHandle and any raw data) 
       
   236 	TProfileCapsGPRS iCapsGPRS;	//< holds the GPRS Profile capabilities parameters
       
   237 		
       
   238 	TProfileReqR99 iReq99;
       
   239 	TProfileNegR99 iNegR99;
       
   240 	TProfileCapsR99 iCapsR99;
       
   241 	TProfileCapsR5 iCapsR5;
       
   242 
       
   243 	TProfileNegR99 iQosNetworkNotification; 
       
   244 	TSetProfileFail iSetProfileFail;
       
   245 	/******/
       
   246 
       
   247 	TInt iSetProfileCallCount;
       
   248 	TInt iQosNetworkNotificationCount;
       
   249 	TInt iQosR5NetworkNotificationCount;
       
   250 	TBool iUseNetworkNotificationBool;
       
   251 	virtual void TimerCallBack(TInt aId);
       
   252 
       
   253 	CSimTimer* iTimer;					//< pointer to the timer object
       
   254 	CSimTimer* iSetQoSTimer;			//< pointer to the timer object used for set qos delay
       
   255 
       
   256 	TBool iTimerStartedBool;
       
   257 
       
   258 	CSimPubSubChange* iSimQoSChange;
       
   259 	
       
   260  	TInt iSetQoSDelay;	//< Used to hold the delay before setting qos
       
   261  	TInt iSetQoSDelayAt; //< Which set qos operation should the delay be introduced
       
   262  	
       
   263  	class TSetQoSData	//< Class used to construct an array of qos data 
       
   264  		{
       
   265  		public:
       
   266  		static TInt Find(CArrayFixFlat<TSetQoSData>* aSetQoSArray, TTsyReqHandle aTsyReqHandle, TInt& aIndex);
       
   267  		TTsyReqHandle iTsyReqHandle;
       
   268  		TDesC8* iData;
       
   269  		};
       
   270  	CArrayFixFlat<TSetQoSData> *iSetQoSData; //< array used to store qos data prior to set qos delay	
       
   271 	
       
   272 	};
       
   273 
       
   274 #endif