First public contribution.
1 #ifndef __USB_DEVICE_WATCHER_H__
2 #define __USB_DEVICE_WATCHER_H__
5 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
7 * This component and the accompanying materials are made available
8 * under the terms of the License "Eclipse Public License v1.0"
9 * which accompanies this distribution, and is available
10 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
12 * Initial Contributors:
13 * Nokia Corporation - initial contribution.
23 @file UsbDeviceWatcher.h
28 // Forward declarations
32 namespace NUnitTesting_USBDI
35 // Forward declarations
41 class MUsbDeviceObserver
45 Called when a USB device has been connected to the host
46 @param aError an error code relating to USB device attachment from the Hub driver
48 virtual void UsbDeviceAttachedL(TInt aError) = 0;
52 This class represents a watcher for USB devices inserted into the host
54 class CUsbDeviceWatcher : public CActive
58 Symbian factory construction
59 @return a pointer to an instance of a Usb device watcher
61 static CUsbDeviceWatcher* NewL(RUsbHubDriver& aUsbHubDriver,MUsbDeviceObserver& aUsbDeviceObserver);
70 void StartWatchingL(CUsbHostDevice* aUsbDevice);
74 Cancel watching for new USB devices
86 TInt RunError(TInt aError);
91 @param aUsbHubDriver the Host USB Hub driver
93 CUsbDeviceWatcher(RUsbHubDriver& aUsbHubDriver,MUsbDeviceObserver& aUsbDeviceObserver);
102 The Usb hub driver (uses-a)
104 RUsbHubDriver& iUsbHubDriver;
107 The usb device resource (uses-a)
109 CUsbHostDevice* iUsbHostDevice;
112 The observer for USB device connection
114 MUsbDeviceObserver& iUsbDeviceObserver;