|
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 factory header |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalComponent |
|
21 */ |
|
22 |
|
23 #ifndef CPDPFSMFACTORY_H |
|
24 #define CPDPFSMFACTORY_H |
|
25 |
|
26 #include <networking\UMTSNifControlIf.h> |
|
27 #include "rpdpfsminterface.h" |
|
28 #include "reteldriverinput.h" |
|
29 #include "cpdpfsm.h" |
|
30 #include "spudmanif.h" |
|
31 #include "tpdpstates.h" |
|
32 |
|
33 /** factory (and owner) of FSM objects */ |
|
34 class CPdpFsmFactory : public CBase |
|
35 { |
|
36 friend class CPdpFsm; |
|
37 friend class TPdpState; |
|
38 friend class TPdpStateInitialised; // Needs iEtelOpened |
|
39 friend class TPdpStateOpeningPhone; // Needs iEtelOpened |
|
40 public: |
|
41 static CPdpFsmFactory * NewL(); |
|
42 |
|
43 virtual ~CPdpFsmFactory(); |
|
44 void InitL(MSpudManInterface * aSpudManInterface, TName& aTsyName, RPdpFsmInterface * aPdpFsmInterface); |
|
45 |
|
46 CPdpFsm * GetContext (TContextId aPdpId); |
|
47 |
|
48 void Close (void); |
|
49 |
|
50 void SpudInput (TContextId aPdpId, TInt aNotification, TInt aParam); |
|
51 void SetContextTerminationErrorAndStop(TContextId aPdpId, TInt aErrorCode); |
|
52 |
|
53 const TName& TsyName(void); |
|
54 |
|
55 protected: |
|
56 private: |
|
57 CPdpFsmFactory(); |
|
58 |
|
59 public: |
|
60 protected: |
|
61 private: |
|
62 TFixedArray<CPdpFsm, KMaxPdpContexts> iContexts; |
|
63 |
|
64 // the states |
|
65 TPdpStateInitialised iStateInitialised; |
|
66 TPdpStateOpeningPhone iStateOpeningPhone; |
|
67 TPdpStateCreatingPrimary iStateCreatingPrimary; |
|
68 TPdpStateActivatingPrimary iStateActivatingPrimary; |
|
69 TPdpStateCreatingSecondary iStateCreatingSecondary; |
|
70 TPdpStateCreatedSecondary iStateCreatedSecondary; |
|
71 TPdpStateSettingQoS iStateSettingQoS; |
|
72 TPdpStateSettingTFT iStateSettingTFT; |
|
73 TPdpStateActivatingSecondary iStateActivatingSecondary; |
|
74 TPdpStateOpen iStateOpen; |
|
75 TPdpStateChangingQoS iStateChangingQoS; |
|
76 TPdpStateChangingTFT iStateChangingTFT; |
|
77 TPdpStateModifyingActive iStateModifyingActive; |
|
78 TPdpStateSuspended iStateSuspended; |
|
79 TPdpStateClosing iStateClosing; |
|
80 TPdpStateStopping iStateStopping; |
|
81 |
|
82 MSpudManInterface * iSpudManInterface; |
|
83 RPdpFsmInterface * iPdpFsmInterface; |
|
84 REtelDriverInput * iEtelDriverInput; |
|
85 |
|
86 TBool iEtelOpened; |
|
87 |
|
88 TName iTsyName; |
|
89 }; |
|
90 |
|
91 inline void CPdpFsmFactory::SpudInput (TContextId aPdpId, TInt aNotification, TInt aParam) |
|
92 { |
|
93 iSpudManInterface->Input (aPdpId, aNotification, aParam); |
|
94 } |
|
95 |
|
96 inline void CPdpFsmFactory::SetContextTerminationErrorAndStop(TContextId aPdpId, TInt aErrorCode) |
|
97 { |
|
98 iSpudManInterface->SetContextTerminationErrorAndStop(aPdpId, aErrorCode); |
|
99 } |
|
100 |
|
101 #endif // CPDPFSMFACTORY_H |