telephonyprotocols/umtsgprsscpr/spudfsm/src/cpdpfsm.h
changeset 68 d0d9cc530d21
parent 62 8ef833fbf5aa
child 75 f45cd1ad4667
equal deleted inserted replaced
62:8ef833fbf5aa 68:d0d9cc530d21
     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 // PDP FSM header
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file 
       
    20  @internalComponent
       
    21 */
       
    22 
       
    23 #ifndef CPDPFSM_H
       
    24 #define CPDPFSM_H
       
    25 
       
    26 #include <e32base.h>
       
    27 #include <etelmm.h>
       
    28 #include <etelqos.h>
       
    29 #include <networking/umtsnifcontrolif.h>
       
    30 #include "reteldriverinput.h"
       
    31 #include "pdpfsmnmspace.h"
       
    32 
       
    33 #include "tpdpstates.h"
       
    34 
       
    35 class CPdpFsmFactory;
       
    36 class RPacketQoS;
       
    37 
       
    38 #ifdef SYMBIAN_NETWORKING_UMTSR5
       
    39 class TQoSR5Requested;
       
    40 class TQoSR5Negotiated; 
       
    41 #else
       
    42 class TQoSR99_R4Requested;
       
    43 class TQoSR99_R4Negotiated;
       
    44 
       
    45 #endif 
       
    46 // SYMBIAN_NETWORKING_UMTSR5
       
    47 class TFTInfo;
       
    48 class TFTOperationCode;
       
    49 
       
    50 class CPdpFsm : public CBase
       
    51 {
       
    52 	friend class TPdpState;
       
    53 	friend class TPdpStateInitialised;
       
    54 	friend class TPdpStateOpeningPhone;
       
    55 	friend class TPdpStateCreatingPrimary;
       
    56 	friend class TPdpStateActivatingPrimary;
       
    57 	friend class TPdpStateCreatingSecondary;
       
    58 	friend class TPdpStateCreatedSecondary;
       
    59 	friend class TPdpStateSettingQoS;
       
    60 	friend class TPdpStateSettingTFT;
       
    61 	friend class TPdpStateActivatingSecondary;
       
    62 	friend class TPdpStateOpen;
       
    63 	friend class TPdpStateChangingQoS;
       
    64 	friend class TPdpStateChangingTFT;
       
    65 	friend class TPdpStateGettingNegQoS;
       
    66 	friend class TPdpStateModifyingActive;
       
    67 	friend class TPdpStateSuspended;
       
    68 	friend class TPdpStateClosing;
       
    69 	friend class TPdpStateStopping;
       
    70 	
       
    71 public:
       
    72 	static CPdpFsm* NewL(TContextId aPdpId, CPdpFsmFactory * aPdpFsmFactory, REtelDriverInput * aEtelDriverInput);
       
    73 	void ConstructL();
       
    74 	~CPdpFsm();
       
    75 	
       
    76 	TInt Input (const TInt aOperation, const TInt aParam);
       
    77 	
       
    78 
       
    79 #ifdef SYMBIAN_NETWORKING_UMTSR5
       
    80 	void Get(RPacketQoS::TQoSR5Requested& aParam);
       
    81 	void Get(RPacketQoS::TQoSR5Negotiated& aParam);
       
    82 	void Set(const RPacketQoS::TQoSR5Requested& aParam);
       
    83 	void Set(const RPacketQoS::TQoSR5Negotiated& aParam);
       
    84 	
       
    85 #else
       
    86 	void Get(RPacketQoS::TQoSR99_R4Requested& aParam);
       
    87 	void Get(RPacketQoS::TQoSR99_R4Negotiated& aParam);
       
    88 	void Set(const RPacketQoS::TQoSR99_R4Requested& aParam);
       
    89 	void Set(const RPacketQoS::TQoSR99_R4Negotiated& aParam);
       
    90 #endif 
       
    91 // SYMBIAN_NETWORKING_UMTSR5
       
    92 
       
    93 	void Get(TTFTInfo& aParam);
       
    94 	void Get(TTFTOperationCode& aParam);
       
    95 	void Get(RPacketContext::TDataChannelV2& aParam);
       
    96 	void Get(RPacketContext::TContextConfigGPRS& aParam);
       
    97 	void Get(RPacketContext::TContextStatus& aParam);
       
    98 
       
    99 	void GetLastErrorCause(TInt& aLastErrorCause);
       
   100  	
       
   101 	void Set(const TTFTInfo& aParam);
       
   102 	void Set(const TTFTOperationCode& aParam);
       
   103 	void Set(const RPacketContext::TDataChannelV2& aParam);
       
   104 	void Set(const RPacketContext::TContextConfigGPRS& aParam);
       
   105 
       
   106 	void Set(const RPacketContext::TContextStatus& aParam);
       
   107 
       
   108     void EtelInput (EtelDriver::TEtelInput aOperation);
       
   109 	void EtelCancel (void);
       
   110     void SpudInput (TInt aNotification, TInt aParam);
       
   111     
       
   112 protected:
       
   113 	CPdpFsm(TContextId aPdpId, CPdpFsmFactory * aPdpFsmFactory, REtelDriverInput * aEtelDriverInput);
       
   114 	
       
   115 private:
       
   116 	void ChangeStateToInitialised(void);
       
   117 	void ChangeStateToOpeningPhone(void);
       
   118 	void ChangeStateToCreatingPrimary(void);
       
   119 	void ChangeStateToActivatingPrimary(void);
       
   120 	void ChangeStateToCreatingSecondary(void);
       
   121 	void ChangeStateToCreatedSecondary(void);
       
   122 	void ChangeStateToSettingQoS(void);
       
   123 	void ChangeStateToSettingTFT(void);
       
   124 	void ChangeStateToActivatingSecondary(void);
       
   125 	void ChangeStateToOpen(void);
       
   126 	void ChangeStateToChangingQoS(void);
       
   127 	void ChangeStateToChangingTFT(void);
       
   128 	void ChangeStateToGettingNegQoS(void);
       
   129 	void ChangeStateToModifingActive(void);
       
   130 	void ChangeStateToSuspended(void);
       
   131 	void ChangeStateToClosing(void);
       
   132 	void ChangeStateToStopping(void);
       
   133 
       
   134 	
       
   135 public:
       
   136 protected:
       
   137 private:
       
   138 	
       
   139 	// local data cache for this context
       
   140 	TRequestedProfileBuffer iQosRequested;
       
   141 	TNegotiatedProfileBuffer iQosNegotiated;
       
   142 
       
   143 	RPacketContext::TDataChannelV2     iDataChannelV2;
       
   144 	RPacketContext::TContextStatus     iContextStatus;
       
   145 	TTFTInfo 						   iTFT;
       
   146 	TTFTOperationCode				   iTFTOperationCode;
       
   147 	RPacketContext::TContextConfigGPRS iGPRS;
       
   148 
       
   149 	CPdpFsmFactory   * iPdpFsmFactory; // need stuff from  factory
       
   150 	REtelDriverInput * iEtelDriverInput;
       
   151 	
       
   152 	TPdpState * iState; // current state
       
   153 	
       
   154 	TContextId  iPdpId; // our instance PDP context id - fixed when allocateed
       
   155 
       
   156 	enum TContextType
       
   157 	{
       
   158 		ENone,
       
   159 		EPrimary,
       
   160 		ESecondary
       
   161 	} iContextType;
       
   162 	
       
   163 
       
   164 };
       
   165 
       
   166 
       
   167 
       
   168 #endif // CPDPFSM_H
       
   169 
       
   170 
       
   171