equal
deleted
inserted
replaced
20 #include "VRUSBStateHanlder.h" |
20 #include "VRUSBStateHanlder.h" |
21 #include "CVRRecView.h" |
21 #include "CVRRecView.h" |
22 |
22 |
23 CVRUSBStateHanlder::CVRUSBStateHanlder(MVRUSBStateObserver* aObserver) : |
23 CVRUSBStateHanlder::CVRUSBStateHanlder(MVRUSBStateObserver* aObserver) : |
24 CActive(EPriorityStandard), // Standard priority |
24 CActive(EPriorityStandard), // Standard priority |
25 iObserver(aObserver) |
25 iObserver(aObserver), |
|
26 iConnectionStatus(EStateUninitialized) |
26 { |
27 { |
27 } |
28 } |
28 |
29 |
29 EXPORT_C CVRUSBStateHanlder* CVRUSBStateHanlder::NewL( |
30 EXPORT_C CVRUSBStateHanlder* CVRUSBStateHanlder::NewL( |
30 MVRUSBStateObserver* aObserver) |
31 MVRUSBStateObserver* aObserver) |
81 |
82 |
82 void CVRUSBStateHanlder::RunL() |
83 void CVRUSBStateHanlder::RunL() |
83 { |
84 { |
84 #ifdef DUMMY_USB_TESTING |
85 #ifdef DUMMY_USB_TESTING |
85 CDummyUSBState::HandleUSBEventL(); |
86 CDummyUSBState::HandleUSBEventL(); |
|
87 #else |
|
88 StartL(); |
86 #endif |
89 #endif |
87 if (IsUsbActive()) |
90 |
|
91 |
|
92 TBool isUsbActive (IsUsbActive()); |
|
93 |
|
94 if (isUsbActive) |
88 { |
95 { |
89 iObserver->HandleUsbPlugInL(); |
96 if(iConnectionStatus != EStateConnected) |
|
97 { |
|
98 iObserver->HandleUsbPlugInL(); |
|
99 iConnectionStatus = EStateConnected; |
|
100 } |
90 } |
101 } |
91 else |
102 else |
92 { |
103 { |
93 iObserver->HandleUsbPlugOutL(); |
104 if(iConnectionStatus != EStateDisConnected) |
|
105 { |
|
106 iObserver->HandleUsbPlugOutL(); |
|
107 iConnectionStatus = EStateDisConnected; |
|
108 } |
94 } |
109 } |
|
110 |
95 #ifdef DUMMY_USB_TESTING |
111 #ifdef DUMMY_USB_TESTING |
96 // iStatus = KRequestPending; |
112 // iStatus = KRequestPending; |
97 SetActive(); // Tell scheduler a request is active |
113 SetActive(); // Tell scheduler a request is active |
98 iTimer.After(iStatus, 10000000); // Set for later |
114 iTimer.After(iStatus, 10000000); // Set for later |
99 #else |
115 |
100 StartL(); |
116 |
101 #endif |
117 #endif |
|
118 |
|
119 |
102 } |
120 } |
103 |
121 |
104 TInt CVRUSBStateHanlder::RunError(TInt aError) |
122 TInt CVRUSBStateHanlder::RunError(TInt aError) |
105 { |
123 { |
106 return aError; |
124 return aError; |