telephonyprotocols/umtsgprsscpr/spudfsm/inc/pdpfsmnmspace.h
changeset 64 b34bb05ac869
parent 56 ab72d5c1d770
equal deleted inserted replaced
56:ab72d5c1d770 64:b34bb05ac869
     1 // Copyright (c) 2004-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 // Common header for pdp FSM
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file 
       
    20  @internalComponent
       
    21 */
       
    22 
       
    23 #ifndef PDPFSMNMSPACE_H
       
    24 #define PDPFSMNMSPACE_H
       
    25 
       
    26 #include <etelqos.h>
       
    27 
       
    28 namespace PdpFsm
       
    29 {
       
    30 
       
    31 /** completion and notification signals */
       
    32 enum TEtelSignal
       
    33 	{
       
    34 	EPhoneOpened,
       
    35 	EPhoneOpenedFailed,
       
    36 	
       
    37 	EQoSSet,
       
    38 	EQoSSetFailed,
       
    39 	ETftSet,
       
    40 	ETftSetFailed,
       
    41 	ETftChanged,
       
    42 	ETftChangedFailed,
       
    43 	
       
    44 	E1ryPdpContextCreated,
       
    45 	E1ryPdpContextCreatedFailed,
       
    46 	E2ryPdpContextCreated,
       
    47 	E2ryPdpContextCreatedFailed,
       
    48 	
       
    49 	EPdpNegQoSRetrieved,
       
    50 	EPdpNegQoSRetrievedFailed,
       
    51 	EPdpContextModified,
       
    52 	EPdpContextModifiedFailed,
       
    53 	EPdpActivated,
       
    54 	EPdpActivatedFailed,
       
    55 	EContextDeleted,
       
    56 	EContextDeletedFailed,
       
    57 	// add new signals here
       
    58 	
       
    59 	// network signals
       
    60 	EQoSProfileChangeNetwork,
       
    61 	EConfigGPRSChangeNetwork,
       
    62 	EContextStatusChangeNetwork,
       
    63 	EServiceStatusChangeNetwork,
       
    64 	EPacketStatusChangeNetwork,
       
    65 	// add new signals here
       
    66 	
       
    67 	ESentinelSignal
       
    68 	};
       
    69 } // namespace PdpFsm
       
    70 
       
    71 
       
    72 
       
    73 
       
    74 /**
       
    75 A buffer to potentially hold one of the following:
       
    76 Unfortuntely can't use a union for these since they have default ctors.
       
    77 
       
    78 RPacketQoS::TQoSR99_R4Negotiated
       
    79 RPacketQoS::TQoSR5Negotiated
       
    80 
       
    81 @internalComponent
       
    82 */
       
    83 struct TNegotiatedProfileBuffer
       
    84     {
       
    85 private:    
       
    86 #ifdef SYMBIAN_NETWORKING_UMTSR5
       
    87     RPacketQoS::TQoSR5Negotiated iNegotiatedBuffer;
       
    88 #else
       
    89     RPacketQoS::TQoSR99_R4Negotiated iNegotiatedBuffer;
       
    90 #endif    
       
    91     
       
    92 public:
       
    93     inline TInt ExtensionId();
       
    94 
       
    95     inline const RPacketQoS::TQoSR99_R4Negotiated& NegotiatedQoSR99_R4();
       
    96     inline TNegotiatedProfileBuffer& operator=(const RPacketQoS::TQoSR99_R4Negotiated& aParam);
       
    97     
       
    98 #ifdef SYMBIAN_NETWORKING_UMTSR5    
       
    99     inline const RPacketQoS::TQoSR5Negotiated& NegotiatedQoSR5();
       
   100     inline TNegotiatedProfileBuffer& operator=(const RPacketQoS::TQoSR5Negotiated& aParam);
       
   101 #endif    
       
   102     };
       
   103     
       
   104 
       
   105 struct TRequestedProfileBuffer
       
   106     {
       
   107 private:
       
   108     // Use R5 since its the largest
       
   109 #ifdef SYMBIAN_NETWORKING_UMTSR5
       
   110     RPacketQoS::TQoSR5Requested iRequestedBuffer;
       
   111 #else
       
   112     RPacketQoS::TQoSR99_R4Requested iRequestedBuffer;
       
   113 #endif  
       
   114 
       
   115 public:
       
   116     inline TInt ExtensionId();
       
   117 
       
   118     inline const RPacketQoS::TQoSR99_R4Requested& RequestedQoSR99_R4();
       
   119     inline TRequestedProfileBuffer& operator=(const RPacketQoS::TQoSR99_R4Requested& aParam);
       
   120 
       
   121 #ifdef SYMBIAN_NETWORKING_UMTSR5
       
   122     inline const RPacketQoS::TQoSR5Requested& RequestedQoSR5();
       
   123     inline TRequestedProfileBuffer& operator=(const RPacketQoS::TQoSR5Requested& aParam);
       
   124 #endif    
       
   125     };
       
   126 
       
   127 
       
   128 inline TInt TNegotiatedProfileBuffer::ExtensionId()
       
   129     {
       
   130     return (reinterpret_cast<TPacketDataConfigBase&>(iNegotiatedBuffer)).ExtensionId();
       
   131     }
       
   132 
       
   133 
       
   134 inline const RPacketQoS::TQoSR99_R4Negotiated& TNegotiatedProfileBuffer::NegotiatedQoSR99_R4()
       
   135     {
       
   136     return reinterpret_cast<RPacketQoS::TQoSR99_R4Negotiated&>(iNegotiatedBuffer);
       
   137     }
       
   138 
       
   139 
       
   140 inline TNegotiatedProfileBuffer& TNegotiatedProfileBuffer::operator=(const RPacketQoS::TQoSR99_R4Negotiated& aParam)
       
   141     {
       
   142     // Use this tmp value, since its ExtensionId is set when it is constructed.
       
   143     // Can't trust the ExtensionId of struct passed in.
       
   144 
       
   145 #ifdef SYMBIAN_NETWORKING_UMTSR5
       
   146     // If we support R5 then store as R5
       
   147     RPacketQoS::TQoSR5Negotiated tmp; 
       
   148     tmp.iSignallingIndication = EFalse;
       
   149     tmp.iSourceStatisticsDescriptor = RPacketQoS::ESourceStatisticsDescriptorUnknown;
       
   150 
       
   151 #else
       
   152     RPacketQoS::TQoSR99_R4Negotiated tmp; 
       
   153 #endif
       
   154 
       
   155     tmp.iBER = aParam.iBER;
       
   156     tmp.iDeliverErroneousSDU = aParam.iDeliverErroneousSDU;
       
   157     tmp.iDeliveryOrderReqd = aParam.iDeliveryOrderReqd;
       
   158     tmp.iGuaranteedRate = aParam.iGuaranteedRate;
       
   159     tmp.iMaxRate = aParam.iMaxRate;
       
   160     tmp.iMaxSDUSize = aParam.iMaxSDUSize;
       
   161     tmp.iSDUErrorRatio = aParam.iSDUErrorRatio;
       
   162     tmp.iTrafficClass = aParam.iTrafficClass;
       
   163     tmp.iTrafficHandlingPriority = aParam.iTrafficHandlingPriority;
       
   164     tmp.iTransferDelay = aParam.iTransferDelay;
       
   165     
       
   166     iNegotiatedBuffer = tmp;
       
   167 
       
   168     return *this;
       
   169     }
       
   170 
       
   171 
       
   172 #ifdef SYMBIAN_NETWORKING_UMTSR5
       
   173 inline const RPacketQoS::TQoSR5Negotiated& TNegotiatedProfileBuffer::NegotiatedQoSR5()
       
   174     {
       
   175     return iNegotiatedBuffer;
       
   176     }
       
   177 
       
   178 
       
   179 inline TNegotiatedProfileBuffer& TNegotiatedProfileBuffer::operator=(const RPacketQoS::TQoSR5Negotiated& aParam)
       
   180     {
       
   181     // Use this tmp value, since its ExtensionId is set when it is constructed.
       
   182     // Can't trust the ExtensionId of struct passed in.
       
   183     RPacketQoS::TQoSR5Negotiated tmp;
       
   184 
       
   185     tmp.iBER = aParam.iBER;
       
   186     tmp.iDeliverErroneousSDU = aParam.iDeliverErroneousSDU;
       
   187     tmp.iDeliveryOrderReqd = aParam.iDeliveryOrderReqd;
       
   188     tmp.iGuaranteedRate = aParam.iGuaranteedRate;
       
   189     tmp.iMaxRate = aParam.iMaxRate;
       
   190     tmp.iMaxSDUSize = aParam.iMaxSDUSize;
       
   191     tmp.iSDUErrorRatio = aParam.iSDUErrorRatio;
       
   192     tmp.iTrafficClass = aParam.iTrafficClass;
       
   193     tmp.iTrafficHandlingPriority = aParam.iTrafficHandlingPriority;
       
   194     tmp.iTransferDelay = aParam.iTransferDelay;
       
   195     tmp.iSignallingIndication = aParam.iSignallingIndication;
       
   196     tmp.iSourceStatisticsDescriptor = aParam.iSourceStatisticsDescriptor;
       
   197  
       
   198     iNegotiatedBuffer = tmp;
       
   199 
       
   200     return *this;
       
   201     }
       
   202 #endif
       
   203 
       
   204     
       
   205 
       
   206 
       
   207 inline TInt TRequestedProfileBuffer::ExtensionId()
       
   208     {
       
   209     return (reinterpret_cast<TPacketDataConfigBase&>(iRequestedBuffer)).ExtensionId();
       
   210     }
       
   211 
       
   212     
       
   213 inline const RPacketQoS::TQoSR99_R4Requested& TRequestedProfileBuffer::RequestedQoSR99_R4()
       
   214     {
       
   215     return reinterpret_cast<RPacketQoS::TQoSR99_R4Requested&>(iRequestedBuffer);
       
   216     }
       
   217 
       
   218     
       
   219 inline TRequestedProfileBuffer& TRequestedProfileBuffer::operator=(const RPacketQoS::TQoSR99_R4Requested& aParam)
       
   220     {
       
   221     // Use this tmp value, since its ExtensionId is set when it is constructed.
       
   222     // Can't trust the ExtensionId of struct passed in.
       
   223 #ifdef SYMBIAN_NETWORKING_UMTSR5
       
   224     // If we support R5 then store as R5
       
   225     RPacketQoS::TQoSR5Requested tmp;
       
   226     tmp.iSignallingIndication = EFalse;
       
   227     tmp.iSourceStatisticsDescriptor = RPacketQoS::ESourceStatisticsDescriptorUnknown;
       
   228 
       
   229 #else
       
   230     // If we don't support R5 then store as R4/R99
       
   231     RPacketQoS::TQoSR99_R4Requested tmp;
       
   232 #endif
       
   233 
       
   234     tmp.iReqTrafficClass = aParam.iReqTrafficClass;
       
   235     tmp.iMinTrafficClass = aParam.iMinTrafficClass;
       
   236     tmp.iReqDeliveryOrderReqd = aParam.iReqDeliveryOrderReqd;
       
   237     tmp.iMinDeliveryOrderReqd = aParam.iMinDeliveryOrderReqd;
       
   238     tmp.iReqDeliverErroneousSDU = aParam.iReqDeliverErroneousSDU;
       
   239     tmp.iMinDeliverErroneousSDU = aParam.iMinDeliverErroneousSDU;
       
   240     tmp.iReqMaxSDUSize = aParam.iReqMaxSDUSize;
       
   241     tmp.iMinAcceptableMaxSDUSize = aParam.iMinAcceptableMaxSDUSize;
       
   242     tmp.iReqMaxRate = aParam.iReqMaxRate;
       
   243     tmp.iMinAcceptableMaxRate = aParam.iMinAcceptableMaxRate;
       
   244     tmp.iReqBER = aParam.iReqBER;
       
   245     tmp.iMaxBER = aParam.iMaxBER;
       
   246     tmp.iReqSDUErrorRatio = aParam.iReqSDUErrorRatio;
       
   247     tmp.iMaxSDUErrorRatio = aParam.iMaxSDUErrorRatio;
       
   248     tmp.iReqTrafficHandlingPriority = aParam.iReqTrafficHandlingPriority;
       
   249     tmp.iMinTrafficHandlingPriority = aParam.iMinTrafficHandlingPriority;
       
   250     tmp.iReqTransferDelay = aParam.iReqTransferDelay;
       
   251     tmp.iMaxTransferDelay = aParam.iMaxTransferDelay;
       
   252     tmp.iReqGuaranteedRate = aParam.iReqGuaranteedRate;
       
   253     tmp.iMinGuaranteedRate = aParam.iMinGuaranteedRate;
       
   254  
       
   255     iRequestedBuffer = tmp;
       
   256 
       
   257     return *this;
       
   258     }
       
   259 
       
   260 
       
   261 #ifdef SYMBIAN_NETWORKING_UMTSR5
       
   262 inline const RPacketQoS::TQoSR5Requested& TRequestedProfileBuffer::RequestedQoSR5()
       
   263     {
       
   264     return iRequestedBuffer;
       
   265     }
       
   266     
       
   267     
       
   268 inline TRequestedProfileBuffer& TRequestedProfileBuffer::operator=(const RPacketQoS::TQoSR5Requested& aParam)
       
   269     {
       
   270     // Use this tmp value, since its ExtensionId is set when it is constructed.
       
   271     // Can't trust the ExtensionId of struct passed in.
       
   272     RPacketQoS::TQoSR5Requested tmp; 
       
   273 
       
   274     tmp.iReqTrafficClass = aParam.iReqTrafficClass;
       
   275     tmp.iMinTrafficClass = aParam.iMinTrafficClass;
       
   276     tmp.iReqDeliveryOrderReqd = aParam.iReqDeliveryOrderReqd;
       
   277     tmp.iMinDeliveryOrderReqd = aParam.iMinDeliveryOrderReqd;
       
   278     tmp.iReqDeliverErroneousSDU = aParam.iReqDeliverErroneousSDU;
       
   279     tmp.iMinDeliverErroneousSDU = aParam.iMinDeliverErroneousSDU;
       
   280     tmp.iReqMaxSDUSize = aParam.iReqMaxSDUSize;
       
   281     tmp.iMinAcceptableMaxSDUSize = aParam.iMinAcceptableMaxSDUSize;
       
   282     tmp.iReqMaxRate = aParam.iReqMaxRate;
       
   283     tmp.iMinAcceptableMaxRate = aParam.iMinAcceptableMaxRate;
       
   284     tmp.iReqBER = aParam.iReqBER;
       
   285     tmp.iMaxBER = aParam.iMaxBER;
       
   286     tmp.iReqSDUErrorRatio = aParam.iReqSDUErrorRatio;
       
   287     tmp.iMaxSDUErrorRatio = aParam.iMaxSDUErrorRatio;
       
   288     tmp.iReqTrafficHandlingPriority = aParam.iReqTrafficHandlingPriority;
       
   289     tmp.iMinTrafficHandlingPriority = aParam.iMinTrafficHandlingPriority;
       
   290     tmp.iReqTransferDelay = aParam.iReqTransferDelay;
       
   291     tmp.iMaxTransferDelay = aParam.iMaxTransferDelay;
       
   292     tmp.iReqGuaranteedRate = aParam.iReqGuaranteedRate;
       
   293     tmp.iMinGuaranteedRate = aParam.iMinGuaranteedRate;
       
   294     tmp.iSignallingIndication = aParam.iSignallingIndication;
       
   295     tmp.iSourceStatisticsDescriptor = aParam.iSourceStatisticsDescriptor;
       
   296 
       
   297     iRequestedBuffer = tmp; 
       
   298     
       
   299     return *this;
       
   300     }
       
   301 #endif    
       
   302 
       
   303 
       
   304 typedef TPckg<TNegotiatedProfileBuffer> TNegotiatedProfileBufferPckg;
       
   305 typedef TPckg<TRequestedProfileBuffer>  TRequestedProfileBufferPckg;
       
   306 
       
   307 	
       
   308 #endif
       
   309 // PDPFSMNMSPACE_H