|
1 // Copyright (c) 2007-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 // Mobility Meta Connection Provider States |
|
15 // |
|
16 // |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalComponent |
|
21 */ |
|
22 |
|
23 |
|
24 #ifndef MOBILITYMCPRSTATES_H |
|
25 #define MOBILITYMCPRSTATES_H |
|
26 |
|
27 #include <elements/mm_states.h> |
|
28 #include <comms-infras/mobilitymcpr.h> |
|
29 #include <comms-infras/coremcprstates.h> |
|
30 |
|
31 namespace MobilityMCprStates |
|
32 { |
|
33 |
|
34 typedef MeshMachine::TNodeContext<CMobilityMetaConnectionProvider, MCprStates::TContext> TContext; |
|
35 |
|
36 //-========================================================= |
|
37 // |
|
38 //Core Mobile Meta Connection Provider Transition Ids 10000..11000 |
|
39 // |
|
40 //-========================================================= |
|
41 |
|
42 const TInt KStartMobilityHandshake = 10000; |
|
43 const TInt KAwaitMobility = 10001; |
|
44 const TInt KReConnect = 10002; |
|
45 |
|
46 //-========================================================= |
|
47 // |
|
48 //Mutexes |
|
49 // |
|
50 //-========================================================= |
|
51 |
|
52 //This mutex blocks when the mobility is handshaking on the node |
|
53 class THandshakingMobilityMutex |
|
54 { |
|
55 public: |
|
56 static TBool IsBlocked(MeshMachine::TNodeContextBase& aContext); |
|
57 }; |
|
58 |
|
59 //-========================================================= |
|
60 // |
|
61 //States |
|
62 // |
|
63 //-========================================================= |
|
64 |
|
65 DECLARE_SMELEMENT_HEADER(TAwaitingStartMobility, MeshMachine::TState<TContext>, NetStateMachine::MState, TContext) |
|
66 virtual TBool Accept(); |
|
67 DECLARE_SMELEMENT_FOOTER(TAwaitingStartMobility) |
|
68 |
|
69 /** |
|
70 Mobility base state implementing generic cancellation behaviour. |
|
71 */ |
|
72 class TStateBase : public MeshMachine::TState<TContext> |
|
73 { |
|
74 public: |
|
75 explicit TStateBase(TContext& aContext) : MeshMachine::TState<TContext>(aContext) |
|
76 { |
|
77 } |
|
78 virtual void Cancel(); |
|
79 }; |
|
80 |
|
81 DECLARE_SMELEMENT_HEADER(TAwaitingMigrationRequestedOrRejected, MobilityMCprStates::TStateBase, NetStateMachine::MState, TContext) |
|
82 virtual TBool Accept(); |
|
83 DECLARE_SMELEMENT_FOOTER(TAwaitingMigrationRequestedOrRejected) |
|
84 |
|
85 DECLARE_SMELEMENT_HEADER(TAwaitingMigrationAcceptedOrRejected, MobilityMCprStates::TStateBase, NetStateMachine::MState, TContext) |
|
86 virtual TBool Accept(); |
|
87 DECLARE_SMELEMENT_FOOTER(TAwaitingMigrationAcceptedOrRejected) |
|
88 |
|
89 //-========================================================= |
|
90 // |
|
91 //State Forks |
|
92 // |
|
93 //-========================================================= |
|
94 DECLARE_SMELEMENT_HEADER(TNoTagOrErrorTagIfMobilityRunning, MeshMachine::TStateFork<TContext>, NetStateMachine::MStateFork, TContext) |
|
95 virtual TInt TransitionTag(); |
|
96 DECLARE_SMELEMENT_FOOTER(TNoTagOrErrorTagIfMobilityRunning) |
|
97 |
|
98 DECLARE_SERIALIZABLE_STATE( |
|
99 TNoTagBlockedByMobilityHandshaking, |
|
100 THandshakingMobilityMutex, |
|
101 MeshMachine::TNoTag |
|
102 ) |
|
103 |
|
104 //-========================================================= |
|
105 // |
|
106 //Transitions |
|
107 // |
|
108 //-========================================================= |
|
109 |
|
110 DECLARE_SMELEMENT_HEADER(TReplyMobilityStarted, MeshMachine::TStateTransition<TContext>, NetStateMachine::MStateTransition, TContext) |
|
111 virtual void DoL(); |
|
112 DECLARE_SMELEMENT_FOOTER(TReplyMobilityStarted) |
|
113 |
|
114 } //namespace MobilityMCprStates |
|
115 |
|
116 #endif // MOBILITYMCPRSTATES_H |
|
117 |