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