1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/usbho/t_usbdi/inc/SoftwareConnectTimer.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,118 @@
1.4 +#ifndef __SOFTWARE_CONNECT_TIMER_H
1.5 +#define __SOFTWARE_CONNECT_TIMER_H
1.6 +
1.7 +/*
1.8 +* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
1.9 +* All rights reserved.
1.10 +* This component and the accompanying materials are made available
1.11 +* under the terms of the License "Eclipse Public License v1.0"
1.12 +* which accompanies this distribution, and is available
1.13 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.14 +*
1.15 +* Initial Contributors:
1.16 +* Nokia Corporation - initial contribution.
1.17 +*
1.18 +* Contributors:
1.19 +*
1.20 +* Description:
1.21 +* @file softwareconnecttimer.h
1.22 +* @internalComponent
1.23 +*
1.24 +*
1.25 +*/
1.26 +
1.27 +
1.28 +
1.29 +#include <e32base.h>
1.30 +#include "testdevicebase.h"
1.31 +
1.32 +namespace NUnitTesting_USBDI
1.33 + {
1.34 +
1.35 +/**
1.36 +This class represents a timer for performing USB connection and disconnection
1.37 +in software. i.e. the D+/- pull-ups
1.38 +*/
1.39 +
1.40 +class CSoftwareConnectTimer : public CTimer
1.41 + {
1.42 +private:
1.43 + // The type of connection to be performed
1.44 + enum TConnectionType
1.45 + {
1.46 + EUnknown,
1.47 + EConnect,
1.48 + EDisconnect
1.49 + };
1.50 +
1.51 +public:
1.52 +
1.53 + /**
1.54 + 2 phase construction
1.55 + @param aTestDevice a client usb test device
1.56 + */
1.57 +
1.58 + static CSoftwareConnectTimer* NewL(RUsbTestDevice& aTestDevice);
1.59 +
1.60 + /**
1.61 + Destructor
1.62 + */
1.63 +
1.64 + ~CSoftwareConnectTimer();
1.65 +
1.66 + /**
1.67 + Perform software connection after the specified interval has elapsed
1.68 + @param aInterval the time gap before connecting in seconds
1.69 + */
1.70 +
1.71 + void SoftwareConnect(TInt aInterval);
1.72 +
1.73 + /**
1.74 + Perform software disconnection after the specified interval has elapsed
1.75 + @param aInterval the time gap before disconnecting in seconds
1.76 + */
1.77 +
1.78 + void SoftwareDisconnect(TInt aInterval);
1.79 +
1.80 + /**
1.81 + Peform a software disconnection and then after the specified interval, perform a software connection.
1.82 + @param aInterval the time gap between disconnecting and connecting in a reconnect step in seconds
1.83 + */
1.84 +
1.85 + void SoftwareReConnect(TInt aInterval);
1.86 +
1.87 +private:
1.88 +
1.89 + /**
1.90 + Constructor, build a timer for performing software usb connection and disconnection
1.91 + */
1.92 +
1.93 + CSoftwareConnectTimer(RUsbTestDevice& aTestDevice);
1.94 +
1.95 + /**
1.96 + */
1.97 + void RunL();
1.98 +
1.99 +private:
1.100 + /**
1.101 + The test device object to instruct to connect of disonnect
1.102 + */
1.103 +
1.104 + RUsbTestDevice& iTestDevice;
1.105 +
1.106 + /**
1.107 + The type of connection to be performed
1.108 + */
1.109 +
1.110 + TConnectionType iConnectType;
1.111 + };
1.112 +
1.113 +
1.114 +
1.115 + }
1.116 +
1.117 +
1.118 +#endif
1.119 +
1.120 +
1.121 +
1.122 \ No newline at end of file