os/kernelhwsrv/kerneltest/e32test/usbho/t_usbdi/inc/SoftwareConnectTimer.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
#ifndef __SOFTWARE_CONNECT_TIMER_H
sl@0
     2
#define __SOFTWARE_CONNECT_TIMER_H
sl@0
     3
sl@0
     4
/*
sl@0
     5
* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     6
* All rights reserved.
sl@0
     7
* This component and the accompanying materials are made available
sl@0
     8
* under the terms of the License "Eclipse Public License v1.0"
sl@0
     9
* which accompanies this distribution, and is available
sl@0
    10
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
    11
*
sl@0
    12
* Initial Contributors:
sl@0
    13
* Nokia Corporation - initial contribution.
sl@0
    14
*
sl@0
    15
* Contributors:
sl@0
    16
*
sl@0
    17
* Description:
sl@0
    18
* @file softwareconnecttimer.h
sl@0
    19
* @internalComponent
sl@0
    20
* 
sl@0
    21
*
sl@0
    22
*/
sl@0
    23
sl@0
    24
sl@0
    25
sl@0
    26
#include <e32base.h>
sl@0
    27
#include "testdevicebase.h"
sl@0
    28
sl@0
    29
namespace NUnitTesting_USBDI
sl@0
    30
	{
sl@0
    31
	
sl@0
    32
/**
sl@0
    33
This class represents a timer for performing USB connection and disconnection
sl@0
    34
in software. i.e. the D+/- pull-ups
sl@0
    35
*/
sl@0
    36
	
sl@0
    37
class CSoftwareConnectTimer : public CTimer
sl@0
    38
	{
sl@0
    39
private:
sl@0
    40
	// The type of connection to be performed
sl@0
    41
	enum TConnectionType
sl@0
    42
		{
sl@0
    43
		EUnknown,
sl@0
    44
		EConnect,
sl@0
    45
		EDisconnect
sl@0
    46
		};
sl@0
    47
		
sl@0
    48
public:
sl@0
    49
sl@0
    50
	/**
sl@0
    51
	2 phase construction
sl@0
    52
	@param aTestDevice a client usb test device
sl@0
    53
	*/
sl@0
    54
	
sl@0
    55
	static CSoftwareConnectTimer* NewL(RUsbTestDevice& aTestDevice);
sl@0
    56
	
sl@0
    57
	/**
sl@0
    58
	Destructor
sl@0
    59
	*/
sl@0
    60
	
sl@0
    61
	~CSoftwareConnectTimer();
sl@0
    62
	
sl@0
    63
	/**
sl@0
    64
	Perform software connection after the specified interval has elapsed
sl@0
    65
	@param aInterval the time gap before connecting in seconds
sl@0
    66
	*/
sl@0
    67
	
sl@0
    68
	void SoftwareConnect(TInt aInterval);
sl@0
    69
	
sl@0
    70
	/**
sl@0
    71
	Perform software disconnection after the specified interval has elapsed
sl@0
    72
	@param aInterval the time gap before disconnecting in seconds
sl@0
    73
	*/	
sl@0
    74
	
sl@0
    75
	void SoftwareDisconnect(TInt aInterval);
sl@0
    76
sl@0
    77
	/**
sl@0
    78
	Peform a software disconnection and then after the specified interval, perform a software connection.
sl@0
    79
	@param aInterval the time gap between disconnecting and connecting in a reconnect step in seconds
sl@0
    80
	*/
sl@0
    81
	
sl@0
    82
	void SoftwareReConnect(TInt aInterval);
sl@0
    83
	
sl@0
    84
private:
sl@0
    85
sl@0
    86
	/**
sl@0
    87
	Constructor, build a timer for performing software usb connection and disconnection
sl@0
    88
	*/
sl@0
    89
	
sl@0
    90
	CSoftwareConnectTimer(RUsbTestDevice& aTestDevice);
sl@0
    91
sl@0
    92
	/**
sl@0
    93
	*/
sl@0
    94
	void RunL();	
sl@0
    95
sl@0
    96
private:
sl@0
    97
	/**
sl@0
    98
	The test device object to instruct to connect of disonnect
sl@0
    99
	*/
sl@0
   100
	
sl@0
   101
	RUsbTestDevice& iTestDevice;
sl@0
   102
	
sl@0
   103
	/**
sl@0
   104
	The type of connection to be performed
sl@0
   105
	*/
sl@0
   106
	
sl@0
   107
	TConnectionType iConnectType;	
sl@0
   108
	};
sl@0
   109
	
sl@0
   110
	
sl@0
   111
	
sl@0
   112
	}
sl@0
   113
	
sl@0
   114
	
sl@0
   115
#endif
sl@0
   116
sl@0
   117
	
sl@0
   118