|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Implementation of "Idle" state of Composite Cable Status FSM. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #include <e32def.h> |
|
21 #include <e32cmn.h> |
|
22 |
|
23 |
|
24 #include "pdeconstants.h" |
|
25 #include "compositecablestatusfsm.h" |
|
26 #include "compositecablestateidle.h" |
|
27 #include "trace.h" |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 // ======== LOCAL FUNCTIONS ======== |
|
33 |
|
34 |
|
35 // ======== MEMBER FUNCTIONS ======== |
|
36 |
|
37 |
|
38 // --------------------------------------------------------------------------- |
|
39 //Symbian two-phased constructor |
|
40 // --------------------------------------------------------------------------- |
|
41 // |
|
42 CCompositeCableStateIdle* CCompositeCableStateIdle::NewL( |
|
43 MFSMForState& aFSMForState ) |
|
44 { |
|
45 FUNC_LOG; |
|
46 CCompositeCableStateIdle* self = new ( ELeave ) CCompositeCableStateIdle( |
|
47 aFSMForState ); |
|
48 CleanupStack::PushL( self ); |
|
49 self->ConstructL(); |
|
50 CleanupStack::Pop( self ); |
|
51 return self; |
|
52 } |
|
53 |
|
54 |
|
55 // --------------------------------------------------------------------------- |
|
56 // Destructor |
|
57 // --------------------------------------------------------------------------- |
|
58 // |
|
59 CCompositeCableStateIdle::~CCompositeCableStateIdle() |
|
60 { |
|
61 FUNC_LOG; |
|
62 } |
|
63 |
|
64 |
|
65 // --------------------------------------------------------------------------- |
|
66 // From MFSMState. |
|
67 // --------------------------------------------------------------------------- |
|
68 // |
|
69 void CCompositeCableStateIdle::Enter( ) |
|
70 { |
|
71 FUNC_LOG; |
|
72 } |
|
73 |
|
74 |
|
75 // --------------------------------------------------------------------------- |
|
76 // From MFSMState. |
|
77 // --------------------------------------------------------------------------- |
|
78 // |
|
79 void CCompositeCableStateIdle::Input( |
|
80 TFSMInterfaceId aInterfaceId , |
|
81 TFSMEventId aEvent ) |
|
82 { |
|
83 FUNC_LOG; |
|
84 switch ( aInterfaceId ) |
|
85 { |
|
86 case EPDEIfAccessoryConnection: |
|
87 { |
|
88 INFO( "Interface: EPDEIfAccessoryConnection" ); |
|
89 if ( EPDEIfAccessoryConnectionEventCableConnected == aEvent ) |
|
90 { |
|
91 INFO( "Event: EPDEIfAccessoryConnectionEventCableConnected" ); |
|
92 iFSMForState.Transit( ECompositeCableStateConnected ); |
|
93 } |
|
94 else if ( EPDEIfAccessoryConnectionEventCableDisconnected == aEvent ) |
|
95 { |
|
96 INFO( "Event: EPDEIfAccessoryConnectionEventCableDisconnected" ); |
|
97 // Do nothing already in Idle == Disconnected |
|
98 } |
|
99 else |
|
100 { |
|
101 INFO_1( "Unknown Event Id: %i", aEvent ); |
|
102 } |
|
103 break; |
|
104 } |
|
105 default: |
|
106 { |
|
107 INFO_1( "Unknown Interface Id: %i", aInterfaceId ); |
|
108 break; |
|
109 } |
|
110 } |
|
111 |
|
112 } |
|
113 |
|
114 |
|
115 // --------------------------------------------------------------------------- |
|
116 // From MFSMState. |
|
117 // --------------------------------------------------------------------------- |
|
118 // |
|
119 TFSMState CCompositeCableStateIdle::Id() |
|
120 { |
|
121 FUNC_LOG; |
|
122 TFSMState tempStateId( ECompositeCableStateIdle ); |
|
123 INFO_1( "State's id: %i", tempStateId ); |
|
124 return tempStateId; |
|
125 } |
|
126 |
|
127 // --------------------------------------------------------------------------- |
|
128 // From MFSMState. |
|
129 // --------------------------------------------------------------------------- |
|
130 // |
|
131 TPtrC CCompositeCableStateIdle::Name() |
|
132 { |
|
133 FUNC_LOG; |
|
134 TPtrC temp( KCompositeCableStateIdle ); |
|
135 INFO_1( "State's name: %s", temp.Ptr() ); |
|
136 return temp; |
|
137 } |
|
138 |
|
139 // --------------------------------------------------------------------------- |
|
140 // From MFSMState. |
|
141 // --------------------------------------------------------------------------- |
|
142 // |
|
143 TFSMState CCompositeCableStateIdle::SubId() |
|
144 { |
|
145 FUNC_LOG; |
|
146 TFSMState tempSubstateId( 0 ); |
|
147 INFO_1( "Substate's id: %i", tempSubstateId ); |
|
148 return tempSubstateId; |
|
149 } |
|
150 |
|
151 |
|
152 // --------------------------------------------------------------------------- |
|
153 // ConstructL |
|
154 // --------------------------------------------------------------------------- |
|
155 // |
|
156 void CCompositeCableStateIdle::ConstructL() |
|
157 { |
|
158 FUNC_LOG; |
|
159 } |
|
160 |
|
161 |
|
162 // --------------------------------------------------------------------------- |
|
163 // C++ constructor |
|
164 // --------------------------------------------------------------------------- |
|
165 // |
|
166 CCompositeCableStateIdle::CCompositeCableStateIdle( |
|
167 MFSMForState& aFSMForState ) |
|
168 : iFSMForState( aFSMForState ) |
|
169 { |
|
170 FUNC_LOG; |
|
171 } |
|
172 |
|
173 |
|
174 // ======== GLOBAL FUNCTIONS ======== |
|
175 |