os/kernelhwsrv/kerneltest/e32test/usbho/t_usbdi/inc/modelleddevices.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
#ifndef __USB_TEST_DEVICES_H
sl@0
     2
#define __USB_TEST_DEVICES_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 modelleddevices.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 "testdevicebase.h"
sl@0
    27
sl@0
    28
namespace NUnitTesting_USBDI
sl@0
    29
	{
sl@0
    30
	
sl@0
    31
_LIT(KVendorDevice,"VendorDevice");
sl@0
    32
_LIT(KTestDeviceB, "TestDeviceB");
sl@0
    33
_LIT(KManufacturer,"Symbian");
sl@0
    34
_LIT(KConfigurationString,"Test Configuration");
sl@0
    35
			 
sl@0
    36
/**
sl@0
    37
This class models a simple test device which has one default interface with the default interface setting
sl@0
    38
i.e. a test device that can only connect and disconnect with some basic vendor
sl@0
    39
and product information.  There are no extra endpoints for this device
sl@0
    40
*/
sl@0
    41
class RUsbDeviceVendor : public RUsbTestDevice
sl@0
    42
	{
sl@0
    43
public:
sl@0
    44
	/**
sl@0
    45
	Constructor, build a default vendor device
sl@0
    46
	@param aStatus the pointer to the status object for error reporting
sl@0
    47
	@param aSerialNumber the serial number of the vendor device
sl@0
    48
	*/
sl@0
    49
	
sl@0
    50
	RUsbDeviceVendor();
sl@0
    51
	
sl@0
    52
	// ctor
sl@0
    53
	RUsbDeviceVendor(CBaseTestCase* aTestCase);
sl@0
    54
	
sl@0
    55
	/**
sl@0
    56
	Destructor
sl@0
    57
	*/
sl@0
    58
	
sl@0
    59
	virtual ~RUsbDeviceVendor();
sl@0
    60
sl@0
    61
	/**
sl@0
    62
	Configuration
sl@0
    63
		Interface0  [setting0]
sl@0
    64
	*/
sl@0
    65
	
sl@0
    66
	void OpenL(const TDesC16& aSerialNumber);
sl@0
    67
sl@0
    68
public:
sl@0
    69
	/**
sl@0
    70
	Overidden
sl@0
    71
	*/
sl@0
    72
	virtual void OnStateChangeL(TUsbcDeviceState aNewState);
sl@0
    73
sl@0
    74
private:
sl@0
    75
	/**
sl@0
    76
	The serial number for the vendor device
sl@0
    77
	*/
sl@0
    78
	TBuf16<64> iSerialNumber;
sl@0
    79
	};	
sl@0
    80
	
sl@0
    81
sl@0
    82
sl@0
    83
/**
sl@0
    84
Describe a device that models this configuration:
sl@0
    85
sl@0
    86
Configuration
sl@0
    87
	Interface0	[setting0]
sl@0
    88
	Interface1	[setting0]
sl@0
    89
					[endpoint1] Bulk out
sl@0
    90
					[endpoint2] Bulk in
sl@0
    91
				[setting1]			
sl@0
    92
					[endpoint1] Interrupt in
sl@0
    93
					[endpoint2] Bulk out
sl@0
    94
					[endpoint3] Bulk in
sl@0
    95
*/
sl@0
    96
class RUsbDeviceA : public RUsbDeviceVendor
sl@0
    97
	{
sl@0
    98
public:
sl@0
    99
sl@0
   100
	/**
sl@0
   101
	*/
sl@0
   102
	RUsbDeviceA();
sl@0
   103
	
sl@0
   104
	/**
sl@0
   105
	*/
sl@0
   106
	RUsbDeviceA(CBaseTestCase* aTestCase);
sl@0
   107
sl@0
   108
	/**
sl@0
   109
	Destructor
sl@0
   110
	*/
sl@0
   111
	virtual ~RUsbDeviceA();
sl@0
   112
sl@0
   113
	/**
sl@0
   114
	*/
sl@0
   115
	void OpenL(const TDesC& aSerialNumber);		
sl@0
   116
sl@0
   117
	
sl@0
   118
public:
sl@0
   119
	/**
sl@0
   120
	Overidden
sl@0
   121
	*/
sl@0
   122
	virtual void OnStateChangeL(TUsbcDeviceState aNewState);
sl@0
   123
	};
sl@0
   124
	
sl@0
   125
	
sl@0
   126
/**
sl@0
   127
Describe a device that models this configuration:
sl@0
   128
sl@0
   129
Configuration	
sl@0
   130
	Interface0	[setting0]	
sl@0
   131
					[CS Interface]
sl@0
   132
					[endpoint1] Bulk out
sl@0
   133
						[CS Endpoint]
sl@0
   134
					[endpoint2] Bulk out
sl@0
   135
						[CS Endpoint]
sl@0
   136
					[endpoint3] Bulk out
sl@0
   137
						[CS Endpoint]
sl@0
   138
	Interface0	[setting1]				
sl@0
   139
					[CS Interface]
sl@0
   140
					[endpoint1] Bulk out
sl@0
   141
						[CS Endpoint]
sl@0
   142
					[endpoint2] Bulk out
sl@0
   143
						[CS Endpoint]
sl@0
   144
					[endpoint3] Bulk out
sl@0
   145
						[CS Endpoint]
sl@0
   146
	Interface0	[setting2]				
sl@0
   147
					[CS Interface]
sl@0
   148
					[endpoint1] Bulk out
sl@0
   149
						[CS Endpoint]
sl@0
   150
					[endpoint2] Bulk out
sl@0
   151
						[CS Endpoint]
sl@0
   152
					[endpoint3] Bulk out
sl@0
   153
						[CS Endpoint] 
sl@0
   154
sl@0
   155
*/
sl@0
   156
class RUsbDeviceB : public RUsbTestDevice
sl@0
   157
	{
sl@0
   158
public:
sl@0
   159
	/**
sl@0
   160
	*/
sl@0
   161
	RUsbDeviceB();
sl@0
   162
sl@0
   163
	/**
sl@0
   164
	*/
sl@0
   165
	RUsbDeviceB(CBaseTestCase* aTestCase);
sl@0
   166
sl@0
   167
	/**
sl@0
   168
	*/
sl@0
   169
	virtual ~RUsbDeviceB();
sl@0
   170
	
sl@0
   171
	/**
sl@0
   172
	*/
sl@0
   173
	void OpenL(const TDesC& aSerialNumber);
sl@0
   174
	
sl@0
   175
public:
sl@0
   176
	/**
sl@0
   177
	Overidden
sl@0
   178
	*/
sl@0
   179
	virtual void OnStateChangeL(TUsbcDeviceState aNewState);	
sl@0
   180
	
sl@0
   181
private:
sl@0
   182
	/**
sl@0
   183
	The serial number for the vendor device
sl@0
   184
	*/
sl@0
   185
	TBuf16<64> iSerialNumber;
sl@0
   186
	};
sl@0
   187
sl@0
   188
	
sl@0
   189
/**
sl@0
   190
Describe a device that models this configuration:
sl@0
   191
sl@0
   192
Configuration
sl@0
   193
	Interface0	[setting0]
sl@0
   194
	Interface1	[setting0]
sl@0
   195
					[endpoint1] Bulk out
sl@0
   196
					[endpoint2] Bulk in
sl@0
   197
				[setting1]			
sl@0
   198
					[endpoint1] Interrupt in
sl@0
   199
					[endpoint2] Bulk out
sl@0
   200
					[endpoint3] Bulk in
sl@0
   201
*/
sl@0
   202
class RUsbDeviceC : public RUsbDeviceVendor
sl@0
   203
	{
sl@0
   204
public:
sl@0
   205
	/**
sl@0
   206
	*/
sl@0
   207
	RUsbDeviceC();
sl@0
   208
	
sl@0
   209
	RUsbDeviceC(CBaseTestCase* aTestCase);
sl@0
   210
sl@0
   211
	/**
sl@0
   212
	Destructor
sl@0
   213
	*/
sl@0
   214
	virtual ~RUsbDeviceC();
sl@0
   215
sl@0
   216
	/**
sl@0
   217
	*/
sl@0
   218
	void OpenL(const TDesC& aSerialNumber);		
sl@0
   219
sl@0
   220
	
sl@0
   221
public:
sl@0
   222
	/**
sl@0
   223
	Overidden
sl@0
   224
	*/
sl@0
   225
	virtual void OnStateChangeL(TUsbcDeviceState aNewState);
sl@0
   226
	};
sl@0
   227
sl@0
   228
sl@0
   229
/**
sl@0
   230
Describe a device that models this configuration:
sl@0
   231
sl@0
   232
Configuration
sl@0
   233
	Interface0	[setting0]
sl@0
   234
	Interface1	[setting0]
sl@0
   235
					[endpoint1] Bulk out
sl@0
   236
					[endpoint2] Bulk in
sl@0
   237
				[setting1]			
sl@0
   238
					[endpoint1] Interrupt in
sl@0
   239
					[endpoint2] Bulk out
sl@0
   240
					[endpoint3] Bulk in
sl@0
   241
	Interface2	[setting0]
sl@0
   242
					[endpoint1] Bulk out
sl@0
   243
					[endpoint2] Bulk in
sl@0
   244
				[setting1]			
sl@0
   245
					[endpoint1] Bulk out
sl@0
   246
					[endpoint2] Bulk out
sl@0
   247
					[endpoint3] Bulk in
sl@0
   248
*/
sl@0
   249
class RUsbDeviceD : public RUsbDeviceVendor
sl@0
   250
	{
sl@0
   251
public:
sl@0
   252
sl@0
   253
	/**
sl@0
   254
	*/
sl@0
   255
	RUsbDeviceD();
sl@0
   256
	
sl@0
   257
	/**
sl@0
   258
	*/
sl@0
   259
	RUsbDeviceD(CBaseTestCase* aTestCase);
sl@0
   260
sl@0
   261
	/**
sl@0
   262
	Destructor
sl@0
   263
	*/
sl@0
   264
	virtual ~RUsbDeviceD();
sl@0
   265
sl@0
   266
	/**
sl@0
   267
	*/
sl@0
   268
	void OpenL(const TDesC& aSerialNumber);		
sl@0
   269
sl@0
   270
	
sl@0
   271
public:
sl@0
   272
	/**
sl@0
   273
	Overidden
sl@0
   274
	*/
sl@0
   275
	virtual void OnStateChangeL(TUsbcDeviceState aNewState);
sl@0
   276
	};
sl@0
   277
sl@0
   278
	}
sl@0
   279
sl@0
   280
#endif