1 /* |
1 /* |
2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
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 |
|
15 * |
8 * |
16 */ |
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Implementation |
|
15 * |
|
16 */ |
17 |
17 |
18 #include "cusbstatehostundefined.h" |
18 #include "cusbstatehostundefined.h" |
19 |
|
20 #ifndef STIF |
|
21 |
|
22 #else |
|
23 |
|
24 #endif |
|
25 |
19 |
26 #include "definitions.h" |
20 #include "definitions.h" |
27 #include "errors.h" |
21 #include "errors.h" |
28 |
22 |
29 #include "debug.h" |
23 #include "debug.h" |
31 |
25 |
32 // --------------------------------------------------------------------------- |
26 // --------------------------------------------------------------------------- |
33 // |
27 // |
34 // --------------------------------------------------------------------------- |
28 // --------------------------------------------------------------------------- |
35 // |
29 // |
36 CUsbStateHostUndefined::CUsbStateHostUndefined( |
30 CUsbStateHostUndefined::CUsbStateHostUndefined(CUsbOtgWatcher& aWatcher) : |
37 CUsbOtgWatcher* aWatcher) : |
|
38 CUsbStateHostABase(aWatcher) |
31 CUsbStateHostABase(aWatcher) |
39 { |
32 { |
40 } |
33 } |
41 |
34 |
42 // --------------------------------------------------------------------------- |
35 // --------------------------------------------------------------------------- |
43 // |
36 // |
44 // --------------------------------------------------------------------------- |
37 // --------------------------------------------------------------------------- |
45 // |
38 // |
46 CUsbStateHostUndefined* CUsbStateHostUndefined::NewL(CUsbOtgWatcher* aWatcher) |
39 CUsbStateHostUndefined* CUsbStateHostUndefined::NewL(CUsbOtgWatcher& aWatcher) |
47 { |
40 { |
48 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostUndefined::NewL" ) ); |
41 LOG_FUNC |
49 |
42 |
50 CUsbStateHostUndefined* self = new (ELeave) CUsbStateHostUndefined(aWatcher); |
43 CUsbStateHostUndefined* self = new (ELeave) CUsbStateHostUndefined( |
51 CleanupStack::PushL(self); |
44 aWatcher); |
52 self->ConstructL(); |
45 CleanupStack::PushL(self); |
53 CleanupStack::Pop(self); |
46 self->ConstructL(); |
54 return self; |
47 CleanupStack::Pop(self); |
55 } |
48 return self; |
56 |
49 } |
|
50 |
57 // --------------------------------------------------------------------------- |
51 // --------------------------------------------------------------------------- |
58 // |
52 // |
59 // --------------------------------------------------------------------------- |
53 // --------------------------------------------------------------------------- |
60 // |
54 // |
61 void CUsbStateHostUndefined::ConstructL() |
55 void CUsbStateHostUndefined::ConstructL() |
62 { |
56 { |
63 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostUndefined::ConstructL" ) ); |
57 LOG_FUNC |
64 |
58 |
65 CUsbStateHostABase::ConstructL(); |
59 CUsbStateHostABase::ConstructL(); |
66 |
60 |
67 } |
61 } |
68 |
62 |
83 TUsbStateIds CUsbStateHostUndefined::Id() |
76 TUsbStateIds CUsbStateHostUndefined::Id() |
84 { |
77 { |
85 return EUsbStateHostUndefined; |
78 return EUsbStateHostUndefined; |
86 } |
79 } |
87 |
80 |
88 ///////////////////////////////////////////////////////////////////////////////////// |
|
89 // From IdPin observer |
|
90 // --------------------------------------------------------------------------- |
|
91 // |
|
92 // --------------------------------------------------------------------------- |
|
93 // |
|
94 void CUsbStateHostUndefined::IdPinOffL() |
|
95 { |
|
96 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostUndefined::IdPinOffL" ) ); |
|
97 } |
|
98 |
|
99 // --------------------------------------------------------------------------- |
|
100 // |
|
101 // --------------------------------------------------------------------------- |
|
102 // |
|
103 void CUsbStateHostUndefined::IdPinOnL() |
|
104 { |
|
105 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostUndefined::IdPinOnL" ) ); |
|
106 } |
|
107 |
|
108 // From VBus observer |
81 // From VBus observer |
109 // --------------------------------------------------------------------------- |
82 // --------------------------------------------------------------------------- |
110 // |
83 // |
111 // --------------------------------------------------------------------------- |
84 // --------------------------------------------------------------------------- |
112 // |
85 // |
113 void CUsbStateHostUndefined::VBusDownL() |
86 void CUsbStateHostUndefined::VBusDownL() |
114 { |
87 { |
115 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostUndefined::VBusDownL" ) ); |
88 LOG_FUNC |
116 } |
89 } |
117 |
90 |
118 // --------------------------------------------------------------------------- |
91 // --------------------------------------------------------------------------- |
119 // |
92 // |
120 // --------------------------------------------------------------------------- |
93 // --------------------------------------------------------------------------- |
121 // |
94 // |
122 void CUsbStateHostUndefined::VBusUpL() |
95 void CUsbStateHostUndefined::VBusUpL() |
123 { |
96 { |
124 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostUndefined::VBusUpL" ) ); |
97 LOG_FUNC |
125 } |
98 } |
126 |
99 |
127 // --------------------------------------------------------------------------- |
100 // --------------------------------------------------------------------------- |
128 // |
101 // |
129 // --------------------------------------------------------------------------- |
102 // --------------------------------------------------------------------------- |
130 // |
103 // |
131 void CUsbStateHostUndefined::VBusErrorL() |
104 void CUsbStateHostUndefined::VBusErrorL() |
132 { |
105 { |
133 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostUndefined::VBusErrorL" ) ); |
106 LOG_FUNC |
134 iWatcher->Usb().BusClearError(); |
107 iWatcher.Usb().BusClearError(); |
135 HandleL(EUsbWatcherErrorInConnection, EUsbStateHostHandle); |
|
136 } |
108 } |
137 |
109 |
138 // From OTG state observer |
110 // From OTG state observer |
139 // --------------------------------------------------------------------------- |
111 // --------------------------------------------------------------------------- |
140 // |
112 // |
141 // --------------------------------------------------------------------------- |
113 // --------------------------------------------------------------------------- |
142 // |
114 // |
143 void CUsbStateHostUndefined::AIdleL() |
|
144 { |
|
145 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostUndefined::AIdleL" ) ); |
|
146 } |
|
147 |
|
148 // --------------------------------------------------------------------------- |
|
149 // |
|
150 // --------------------------------------------------------------------------- |
|
151 // |
|
152 void CUsbStateHostUndefined::AVBusErrorL() |
115 void CUsbStateHostUndefined::AVBusErrorL() |
153 { |
116 { |
154 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostUndefined::AVBusErrorL" ) ); |
117 LOG_FUNC |
155 iWatcher->Usb().BusClearError(); |
118 iWatcher.Usb().BusClearError(); |
156 HandleL(EUsbWatcherErrorInConnection, EUsbStateHostHandle); |
|
157 } |
119 } |
158 |
120 |
159 // --------------------------------------------------------------------------- |
121 // --------------------------------------------------------------------------- |
160 // |
122 // |
161 // --------------------------------------------------------------------------- |
123 // --------------------------------------------------------------------------- |
162 // |
124 // |
163 void CUsbStateHostUndefined::BIdleL() |
125 void CUsbStateHostUndefined::BIdleL() |
164 { |
126 { |
165 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostUndefined::BIdleL" ) ); |
127 LOG_FUNC |
166 } |
128 } |
167 |
129 |
168 // --------------------------------------------------------------------------- |
130 // --------------------------------------------------------------------------- |
169 // |
131 // |
170 // --------------------------------------------------------------------------- |
132 // --------------------------------------------------------------------------- |
171 // |
133 // |
172 void CUsbStateHostUndefined::BPeripheralL() |
134 void CUsbStateHostUndefined::BPeripheralL() |
173 { |
135 { |
174 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostUndefined::BPeripheralL" ) ); |
136 LOG_FUNC |
175 } |
137 } |
176 |
138 |
177 // From host state observer |
139 // From host state observer |
178 void CUsbStateHostUndefined::DeviceDetachedL(TDeviceEventInformation /*aInfo*/) |
140 void CUsbStateHostUndefined::DeviceDetachedL(TDeviceEventInformation /*aInfo*/) |
179 { |
141 { |
180 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostUndefined::DeviceDetachedL" ) ); |
142 LOG_FUNC |
181 } |
143 } |
|
144 |
|
145 // --------------------------------------------------------------------------- |
|
146 // |
|
147 // --------------------------------------------------------------------------- |
|
148 // |
|
149 void CUsbStateHostUndefined::SrpReceivedL() |
|
150 { |
|
151 LOG_FUNC |
|
152 } |
|
153 |
|
154 // --------------------------------------------------------------------------- |
|
155 // |
|
156 // --------------------------------------------------------------------------- |
|
157 // |
|
158 void CUsbStateHostUndefined::SessionRequestedL() |
|
159 { |
|
160 LOG_FUNC |
|
161 } |
|
162 |
|
163 // From message notification observer |
|
164 // --------------------------------------------------------------------------- |
|
165 // |
|
166 // --------------------------------------------------------------------------- |
|
167 // |
|
168 void CUsbStateHostUndefined::MessageNotificationReceivedL(TInt aMessage) |
|
169 { |
|
170 LOG_FUNC |
|
171 LOG1( "Unhandled message aMessage = %d" , aMessage); |
|
172 } |
|
173 |
|
174 // --------------------------------------------------------------------------- |
|
175 // |
|
176 // --------------------------------------------------------------------------- |
|
177 // |
|
178 void CUsbStateHostUndefined::BadHubPositionL() |
|
179 { |
|
180 LOG_FUNC |
|
181 Panic( EBadHubPositionNotExpected); |
|
182 } |