equal
deleted
inserted
replaced
91 switch (aTimerId) |
91 switch (aTimerId) |
92 { |
92 { |
93 case EDeviceAttachmentTimer: |
93 case EDeviceAttachmentTimer: |
94 { |
94 { |
95 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostAInitiateBase::TimerElapsedL - AttachmentTimer" ) ); |
95 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostAInitiateBase::TimerElapsedL - AttachmentTimer" ) ); |
96 HandleL(EUsbWatcherErrDandlingCable); |
96 HandleL(EUsbWatcherErrDandlingCable, EUsbStateHostHandle); |
97 break; |
97 break; |
98 } |
98 } |
99 default: |
99 default: |
100 { |
100 { |
101 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostAInitiateBase::TimerElapsedL - Unknown timer" ) ); |
101 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostAInitiateBase::TimerElapsedL - Unknown timer" ) ); |
175 FTRACE( FPrint(_L( "[USBOTGWATCHER]\tCUsbStateHostAInitiateBase::DeviceAttachedL GetOtgDescriptor err = %d, HNP supported = %d, SRP supported = %d" ), err, hnpSupported, srpSupported)); |
175 FTRACE( FPrint(_L( "[USBOTGWATCHER]\tCUsbStateHostAInitiateBase::DeviceAttachedL GetOtgDescriptor err = %d, HNP supported = %d, SRP supported = %d" ), err, hnpSupported, srpSupported)); |
176 |
176 |
177 // OTG device supports both hnp and srp |
177 // OTG device supports both hnp and srp |
178 if(hnpSupported && srpSupported) |
178 if(hnpSupported && srpSupported) |
179 { |
179 { |
180 HandleL(EUsbWatcherConnectedToOTG); |
180 |
|
181 HandleL(EUsbWatcherConnectedToOTG, EUsbStateHostHandle); |
181 return; |
182 return; |
182 } |
183 } |
183 |
184 |
184 if (KErrNone != aTdi.iError) |
185 if (KErrNone != aTdi.iError) |
185 { |
186 { |
187 // error in attachement |
188 // error in attachement |
188 { |
189 { |
189 case KErrBadPower: |
190 case KErrBadPower: |
190 { |
191 { |
191 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostAInitiateBase::DeviceAttachedL TooMuchPower" ) ); |
192 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostAInitiateBase::DeviceAttachedL TooMuchPower" ) ); |
192 HandleL(EUsbWatcherErrDeviceRequiresTooMuchPowerOnEnumeration); |
193 HandleL(EUsbWatcherErrDeviceRequiresTooMuchPowerOnEnumeration, EUsbStateHostDelayHandle); |
193 break; |
194 break; |
194 } |
195 } |
195 default: |
196 default: |
196 { |
197 { |
197 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostAInitiateBase::DeviceAttachedL AttachmentError" ) ); |
198 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostAInitiateBase::DeviceAttachedL AttachmentError" ) ); |
198 HandleL(EUsbWatcherErrUnsupportedDevice); |
199 HandleL(EUsbWatcherErrUnsupportedDevice, EUsbStateHostHandle); |
199 break; |
200 break; |
200 } |
201 } |
201 |
202 |
202 } |
203 } |
203 |
204 |
241 |
242 |
242 // try initiate to switch to mass storage |
243 // try initiate to switch to mass storage |
243 /* if (KErrNone != iUsbPersonalitySwitch->SwitchPersonalityL(aDei.iDeviceId, |
244 /* if (KErrNone != iUsbPersonalitySwitch->SwitchPersonalityL(aDei.iDeviceId, |
244 KUsbPersonalityIdMS )) |
245 KUsbPersonalityIdMS )) |
245 {*/ |
246 {*/ |
246 HandleL(EUsbWatcherErrDriversNotFound); |
247 HandleL(EUsbWatcherErrDriversNotFound, EUsbStateHostDelayHandle); |
247 // } |
248 // } |
248 } |
249 } |
249 |
250 |
250 // --------------------------------------------------------------------------- |
251 // --------------------------------------------------------------------------- |
251 // |
252 // |
258 { |
259 { |
259 TInt err = iWatcher->Usb().BusRespondSrp(); |
260 TInt err = iWatcher->Usb().BusRespondSrp(); |
260 if (KErrNone != err) |
261 if (KErrNone != err) |
261 { |
262 { |
262 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostAInitiateBase::SrpReceivedL BusRespondSrp error" ) ); |
263 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostAInitiateBase::SrpReceivedL BusRespondSrp error" ) ); |
263 iWatcher->HandleHostProblemL(EUsbWatcherErrorInConnection); |
264 iWatcher->HandleHostProblemL(EUsbWatcherErrorInConnection, EUsbStateHostHandle); |
264 } |
265 } |
265 } |
266 } |
266 } |
267 } |
267 |
268 |
268 void CUsbStateHostAInitiateBase::UsbPersonalitySwitchStateChangedL( |
269 void CUsbStateHostAInitiateBase::UsbPersonalitySwitchStateChangedL( |
286 { |
287 { |
287 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostAInitiateBase::UsbPersonalitySwitchStateChangedL EGetAllPersonalitiesCompleted" ) ); |
288 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostAInitiateBase::UsbPersonalitySwitchStateChangedL EGetAllPersonalitiesCompleted" ) ); |
288 if (KErrNotFound == aData) |
289 if (KErrNotFound == aData) |
289 { |
290 { |
290 // no supported or needed personality/ies in the peripheral |
291 // no supported or needed personality/ies in the peripheral |
291 HandleL(EUsbWatcherErrDriversNotFound); |
292 HandleL(EUsbWatcherErrDriversNotFound, EUsbStateHostDelayHandle); |
292 } |
293 } |
293 break; |
294 break; |
294 } |
295 } |
295 case ESetPersonalityCompleted: |
296 case ESetPersonalityCompleted: |
296 { |
297 { |
304 break; |
305 break; |
305 } |
306 } |
306 case ERequestFailed: |
307 case ERequestFailed: |
307 { |
308 { |
308 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostAInitiateBase::UsbPersonalitySwitchStateChangedL ERequestFailed" ) ); |
309 FLOG( _L( "[USBOTGWATCHER]\tCUsbStateHostAInitiateBase::UsbPersonalitySwitchStateChangedL ERequestFailed" ) ); |
309 HandleL(EUsbWatcherErrDriversNotFound); |
310 HandleL(EUsbWatcherErrDriversNotFound, EUsbStateHostDelayHandle); |
310 break; |
311 break; |
311 } |
312 } |
312 default: |
313 default: |
313 { |
314 { |
314 Panic(EUnexpectedUsbSwitchPersonalityState); |
315 Panic(EUnexpectedUsbSwitchPersonalityState); |