sl@0: #ifndef __SOFTWARE_CONNECT_TIMER_H sl@0: #define __SOFTWARE_CONNECT_TIMER_H sl@0: sl@0: /* sl@0: * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: * All rights reserved. sl@0: * This component and the accompanying materials are made available sl@0: * under the terms of the License "Eclipse Public License v1.0" sl@0: * which accompanies this distribution, and is available sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: * sl@0: * Initial Contributors: sl@0: * Nokia Corporation - initial contribution. sl@0: * sl@0: * Contributors: sl@0: * sl@0: * Description: sl@0: * @file softwareconnecttimer.h sl@0: * @internalComponent sl@0: * sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: #include sl@0: #include "testdevicebase.h" sl@0: sl@0: namespace NUnitTesting_USBDI sl@0: { sl@0: sl@0: /** sl@0: This class represents a timer for performing USB connection and disconnection sl@0: in software. i.e. the D+/- pull-ups sl@0: */ sl@0: sl@0: class CSoftwareConnectTimer : public CTimer sl@0: { sl@0: private: sl@0: // The type of connection to be performed sl@0: enum TConnectionType sl@0: { sl@0: EUnknown, sl@0: EConnect, sl@0: EDisconnect sl@0: }; sl@0: sl@0: public: sl@0: sl@0: /** sl@0: 2 phase construction sl@0: @param aTestDevice a client usb test device sl@0: */ sl@0: sl@0: static CSoftwareConnectTimer* NewL(RUsbTestDevice& aTestDevice); sl@0: sl@0: /** sl@0: Destructor sl@0: */ sl@0: sl@0: ~CSoftwareConnectTimer(); sl@0: sl@0: /** sl@0: Perform software connection after the specified interval has elapsed sl@0: @param aInterval the time gap before connecting in seconds sl@0: */ sl@0: sl@0: void SoftwareConnect(TInt aInterval); sl@0: sl@0: /** sl@0: Perform software disconnection after the specified interval has elapsed sl@0: @param aInterval the time gap before disconnecting in seconds sl@0: */ sl@0: sl@0: void SoftwareDisconnect(TInt aInterval); sl@0: sl@0: /** sl@0: Peform a software disconnection and then after the specified interval, perform a software connection. sl@0: @param aInterval the time gap between disconnecting and connecting in a reconnect step in seconds sl@0: */ sl@0: sl@0: void SoftwareReConnect(TInt aInterval); sl@0: sl@0: private: sl@0: sl@0: /** sl@0: Constructor, build a timer for performing software usb connection and disconnection sl@0: */ sl@0: sl@0: CSoftwareConnectTimer(RUsbTestDevice& aTestDevice); sl@0: sl@0: /** sl@0: */ sl@0: void RunL(); sl@0: sl@0: private: sl@0: /** sl@0: The test device object to instruct to connect of disonnect sl@0: */ sl@0: sl@0: RUsbTestDevice& iTestDevice; sl@0: sl@0: /** sl@0: The type of connection to be performed sl@0: */ sl@0: sl@0: TConnectionType iConnectType; sl@0: }; sl@0: sl@0: sl@0: sl@0: } sl@0: sl@0: sl@0: #endif sl@0: sl@0: sl@0: