--- a/kerneltest/e32test/usbho/t_usbdi/src/BasicWatcher.cpp Mon Sep 13 15:16:07 2010 +0100
+++ b/kerneltest/e32test/usbho/t_usbdi/src/BasicWatcher.cpp Wed Sep 22 10:53:45 2010 +0100
@@ -86,5 +86,47 @@
return KErrNone;
}
+
+CInterfaceWatcher::CInterfaceWatcher(RUsbInterface& aInterface,const TCallBack& aCallBack)
+: CActive(EPriorityUserInput),
+ iUsbInterface(aInterface),
+ iResumeCallBack(aCallBack),
+ iCompletionCode(KErrNone)
+ {
+ CActiveScheduler::Add(this);
+ }
+
+CInterfaceWatcher::~CInterfaceWatcher()
+ {
+ Cancel();
+ }
+
+void CInterfaceWatcher::SuspendAndWatch()
+ {
+ iUsbInterface.PermitSuspendAndWaitForResume(iStatus);
+ SetActive();
+ }
+
+TInt CInterfaceWatcher::CompletionCode() const
+ {
+ return iCompletionCode;
+ }
+
+void CInterfaceWatcher::DoCancel()
+ {
+ iUsbInterface.CancelPermitSuspend();
+ }
+
+void CInterfaceWatcher::RunL()
+ {
+ iCompletionCode = iStatus.Int();
+ User::LeaveIfError(iResumeCallBack.CallBack());
}
+TInt CInterfaceWatcher::RunError()
+ {
+ return KErrNone;
+ }
+
+ }
+