|
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 |
|
28 #include <networking/pdpdef.h> |
|
29 #include "PDPFSM.h" |
|
30 #include "reteldriverinput.h" |
|
31 #include "cpdpfsm.h" |
|
32 #include "tpdpstates.h" |
|
33 |
|
34 /** factory (and owner) of FSM objects */ |
|
35 class CPdpFsmFactory : public CBase |
|
36 { |
|
37 friend class CPdpFsm; |
|
38 friend class TPdpState; |
|
39 friend class TPdpStateInitialised; // Needs iEtelOpened |
|
40 friend class TPdpStateOpeningPhone; // Needs iEtelOpened |
|
41 public: |
|
42 static CPdpFsmFactory * NewL(); |
|
43 |
|
44 virtual ~CPdpFsmFactory(); |
|
45 void InitL(const TName& aTsyName, CPdpFsmInterface * aPdpFsmInterface); |
|
46 |
|
47 #ifndef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY |
|
48 TInt NewFsmContext(TContextId aPdpId); |
|
49 #else |
|
50 TContextId NewFsmContextL(MPdpFsmEventHandler& aPdpFsmEventHandler,SpudMan::TPdpContextType aContextType); |
|
51 #endif |
|
52 |
|
53 TInt DeleteFsmContext(TContextId aPdpId); |
|
54 CPdpFsm* GetFsmContext(TContextId aPdpId); |
|
55 |
|
56 inline TBool HaveFsmContext(TContextId aPdpId) const; |
|
57 inline TBool ContextIdIsValid(TContextId aPdpId) const; |
|
58 inline TBool ContextIsValid(TContextId aPdpId) const; |
|
59 |
|
60 void Close (void); |
|
61 #ifndef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY |
|
62 void SpudInput (TContextId aPdpId, TInt aNotification, TInt aParam); |
|
63 #endif |
|
64 const TName& TsyName(void); |
|
65 |
|
66 protected: |
|
67 private: |
|
68 CPdpFsmFactory(); |
|
69 |
|
70 public: |
|
71 protected: |
|
72 private: |
|
73 TFixedArray<CPdpFsm*, KMaxPdpContexts> iContexts; |
|
74 // the states |
|
75 TPdpStateInitialised iStateInitialised; |
|
76 TPdpStateOpeningPhone iStateOpeningPhone; |
|
77 TPdpStateCreatingPrimary iStateCreatingPrimary; |
|
78 TPdpStateActivatingPrimary iStateActivatingPrimary; |
|
79 TPdpStateCreatingSecondary iStateCreatingSecondary; |
|
80 TPdpStateCreatedSecondary iStateCreatedSecondary; |
|
81 TPdpStateSettingQoS iStateSettingQoS; |
|
82 TPdpStateSettingTFT iStateSettingTFT; |
|
83 TPdpStateActivatingSecondary iStateActivatingSecondary; |
|
84 TPdpStateOpen iStateOpen; |
|
85 TPdpStateChangingQoS iStateChangingQoS; |
|
86 TPdpStateChangingTFT iStateChangingTFT; |
|
87 TPdpStateGettingNegQoS iStateGettingNegQoS; |
|
88 TPdpStateModifyingActive iStateModifyingActive; |
|
89 TPdpStateSuspended iStateSuspended; |
|
90 TPdpStateClosing iStateClosing; |
|
91 TPdpStateStopping iStateStopping; |
|
92 TPdpStateCreatingMbms iStateCreatingMbms; |
|
93 TPdpStateActivatingMbms iStateActivatingMbms; |
|
94 TPdpStateCreatedMbms iStateCreatedMbms; |
|
95 |
|
96 |
|
97 CPdpFsmInterface * iPdpFsmInterface; |
|
98 REtelDriverInput * iEtelDriverInput; |
|
99 |
|
100 TBool iEtelOpened; |
|
101 |
|
102 TName iTsyName; |
|
103 }; |
|
104 |
|
105 #ifndef SYMBIAN_NON_SEAMLESS_NETWORK_BEARER_MOBILITY |
|
106 inline void CPdpFsmFactory::SpudInput (TContextId aPdpId, TInt aNotification, TInt aParam) |
|
107 { |
|
108 iPdpFsmInterface->SpudInput (aPdpId, aNotification, aParam); |
|
109 } |
|
110 #endif |
|
111 |
|
112 inline TBool CPdpFsmFactory::HaveFsmContext(TContextId aPdpId) const |
|
113 { |
|
114 return (iContexts[aPdpId] != NULL); |
|
115 } |
|
116 |
|
117 |
|
118 inline TBool CPdpFsmFactory::ContextIdIsValid(TContextId aPdpId) const |
|
119 { |
|
120 return (aPdpId >= 0 && aPdpId < KMaxPdpContexts); |
|
121 } |
|
122 |
|
123 |
|
124 inline TBool CPdpFsmFactory::ContextIsValid(TContextId aPdpId) const |
|
125 { |
|
126 return (ContextIdIsValid(aPdpId) && HaveFsmContext(aPdpId)); |
|
127 } |
|
128 |
|
129 #endif // CPDPFSMFACTORY_H |