os/kernelhwsrv/kerneltest/e32test/usbho/t_usbdi/inc/modelleddevices.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/usbho/t_usbdi/inc/modelleddevices.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,280 @@
     1.4 +#ifndef __USB_TEST_DEVICES_H
     1.5 +#define __USB_TEST_DEVICES_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 modelleddevices.h
    1.22 +* @internalComponent
    1.23 +* 
    1.24 +*
    1.25 +*/
    1.26 +
    1.27 +
    1.28 +
    1.29 +#include "testdevicebase.h"
    1.30 +
    1.31 +namespace NUnitTesting_USBDI
    1.32 +	{
    1.33 +	
    1.34 +_LIT(KVendorDevice,"VendorDevice");
    1.35 +_LIT(KTestDeviceB, "TestDeviceB");
    1.36 +_LIT(KManufacturer,"Symbian");
    1.37 +_LIT(KConfigurationString,"Test Configuration");
    1.38 +			 
    1.39 +/**
    1.40 +This class models a simple test device which has one default interface with the default interface setting
    1.41 +i.e. a test device that can only connect and disconnect with some basic vendor
    1.42 +and product information.  There are no extra endpoints for this device
    1.43 +*/
    1.44 +class RUsbDeviceVendor : public RUsbTestDevice
    1.45 +	{
    1.46 +public:
    1.47 +	/**
    1.48 +	Constructor, build a default vendor device
    1.49 +	@param aStatus the pointer to the status object for error reporting
    1.50 +	@param aSerialNumber the serial number of the vendor device
    1.51 +	*/
    1.52 +	
    1.53 +	RUsbDeviceVendor();
    1.54 +	
    1.55 +	// ctor
    1.56 +	RUsbDeviceVendor(CBaseTestCase* aTestCase);
    1.57 +	
    1.58 +	/**
    1.59 +	Destructor
    1.60 +	*/
    1.61 +	
    1.62 +	virtual ~RUsbDeviceVendor();
    1.63 +
    1.64 +	/**
    1.65 +	Configuration
    1.66 +		Interface0  [setting0]
    1.67 +	*/
    1.68 +	
    1.69 +	void OpenL(const TDesC16& aSerialNumber);
    1.70 +
    1.71 +public:
    1.72 +	/**
    1.73 +	Overidden
    1.74 +	*/
    1.75 +	virtual void OnStateChangeL(TUsbcDeviceState aNewState);
    1.76 +
    1.77 +private:
    1.78 +	/**
    1.79 +	The serial number for the vendor device
    1.80 +	*/
    1.81 +	TBuf16<64> iSerialNumber;
    1.82 +	};	
    1.83 +	
    1.84 +
    1.85 +
    1.86 +/**
    1.87 +Describe a device that models this configuration:
    1.88 +
    1.89 +Configuration
    1.90 +	Interface0	[setting0]
    1.91 +	Interface1	[setting0]
    1.92 +					[endpoint1] Bulk out
    1.93 +					[endpoint2] Bulk in
    1.94 +				[setting1]			
    1.95 +					[endpoint1] Interrupt in
    1.96 +					[endpoint2] Bulk out
    1.97 +					[endpoint3] Bulk in
    1.98 +*/
    1.99 +class RUsbDeviceA : public RUsbDeviceVendor
   1.100 +	{
   1.101 +public:
   1.102 +
   1.103 +	/**
   1.104 +	*/
   1.105 +	RUsbDeviceA();
   1.106 +	
   1.107 +	/**
   1.108 +	*/
   1.109 +	RUsbDeviceA(CBaseTestCase* aTestCase);
   1.110 +
   1.111 +	/**
   1.112 +	Destructor
   1.113 +	*/
   1.114 +	virtual ~RUsbDeviceA();
   1.115 +
   1.116 +	/**
   1.117 +	*/
   1.118 +	void OpenL(const TDesC& aSerialNumber);		
   1.119 +
   1.120 +	
   1.121 +public:
   1.122 +	/**
   1.123 +	Overidden
   1.124 +	*/
   1.125 +	virtual void OnStateChangeL(TUsbcDeviceState aNewState);
   1.126 +	};
   1.127 +	
   1.128 +	
   1.129 +/**
   1.130 +Describe a device that models this configuration:
   1.131 +
   1.132 +Configuration	
   1.133 +	Interface0	[setting0]	
   1.134 +					[CS Interface]
   1.135 +					[endpoint1] Bulk out
   1.136 +						[CS Endpoint]
   1.137 +					[endpoint2] Bulk out
   1.138 +						[CS Endpoint]
   1.139 +					[endpoint3] Bulk out
   1.140 +						[CS Endpoint]
   1.141 +	Interface0	[setting1]				
   1.142 +					[CS Interface]
   1.143 +					[endpoint1] Bulk out
   1.144 +						[CS Endpoint]
   1.145 +					[endpoint2] Bulk out
   1.146 +						[CS Endpoint]
   1.147 +					[endpoint3] Bulk out
   1.148 +						[CS Endpoint]
   1.149 +	Interface0	[setting2]				
   1.150 +					[CS Interface]
   1.151 +					[endpoint1] Bulk out
   1.152 +						[CS Endpoint]
   1.153 +					[endpoint2] Bulk out
   1.154 +						[CS Endpoint]
   1.155 +					[endpoint3] Bulk out
   1.156 +						[CS Endpoint] 
   1.157 +
   1.158 +*/
   1.159 +class RUsbDeviceB : public RUsbTestDevice
   1.160 +	{
   1.161 +public:
   1.162 +	/**
   1.163 +	*/
   1.164 +	RUsbDeviceB();
   1.165 +
   1.166 +	/**
   1.167 +	*/
   1.168 +	RUsbDeviceB(CBaseTestCase* aTestCase);
   1.169 +
   1.170 +	/**
   1.171 +	*/
   1.172 +	virtual ~RUsbDeviceB();
   1.173 +	
   1.174 +	/**
   1.175 +	*/
   1.176 +	void OpenL(const TDesC& aSerialNumber);
   1.177 +	
   1.178 +public:
   1.179 +	/**
   1.180 +	Overidden
   1.181 +	*/
   1.182 +	virtual void OnStateChangeL(TUsbcDeviceState aNewState);	
   1.183 +	
   1.184 +private:
   1.185 +	/**
   1.186 +	The serial number for the vendor device
   1.187 +	*/
   1.188 +	TBuf16<64> iSerialNumber;
   1.189 +	};
   1.190 +
   1.191 +	
   1.192 +/**
   1.193 +Describe a device that models this configuration:
   1.194 +
   1.195 +Configuration
   1.196 +	Interface0	[setting0]
   1.197 +	Interface1	[setting0]
   1.198 +					[endpoint1] Bulk out
   1.199 +					[endpoint2] Bulk in
   1.200 +				[setting1]			
   1.201 +					[endpoint1] Interrupt in
   1.202 +					[endpoint2] Bulk out
   1.203 +					[endpoint3] Bulk in
   1.204 +*/
   1.205 +class RUsbDeviceC : public RUsbDeviceVendor
   1.206 +	{
   1.207 +public:
   1.208 +	/**
   1.209 +	*/
   1.210 +	RUsbDeviceC();
   1.211 +	
   1.212 +	RUsbDeviceC(CBaseTestCase* aTestCase);
   1.213 +
   1.214 +	/**
   1.215 +	Destructor
   1.216 +	*/
   1.217 +	virtual ~RUsbDeviceC();
   1.218 +
   1.219 +	/**
   1.220 +	*/
   1.221 +	void OpenL(const TDesC& aSerialNumber);		
   1.222 +
   1.223 +	
   1.224 +public:
   1.225 +	/**
   1.226 +	Overidden
   1.227 +	*/
   1.228 +	virtual void OnStateChangeL(TUsbcDeviceState aNewState);
   1.229 +	};
   1.230 +
   1.231 +
   1.232 +/**
   1.233 +Describe a device that models this configuration:
   1.234 +
   1.235 +Configuration
   1.236 +	Interface0	[setting0]
   1.237 +	Interface1	[setting0]
   1.238 +					[endpoint1] Bulk out
   1.239 +					[endpoint2] Bulk in
   1.240 +				[setting1]			
   1.241 +					[endpoint1] Interrupt in
   1.242 +					[endpoint2] Bulk out
   1.243 +					[endpoint3] Bulk in
   1.244 +	Interface2	[setting0]
   1.245 +					[endpoint1] Bulk out
   1.246 +					[endpoint2] Bulk in
   1.247 +				[setting1]			
   1.248 +					[endpoint1] Bulk out
   1.249 +					[endpoint2] Bulk out
   1.250 +					[endpoint3] Bulk in
   1.251 +*/
   1.252 +class RUsbDeviceD : public RUsbDeviceVendor
   1.253 +	{
   1.254 +public:
   1.255 +
   1.256 +	/**
   1.257 +	*/
   1.258 +	RUsbDeviceD();
   1.259 +	
   1.260 +	/**
   1.261 +	*/
   1.262 +	RUsbDeviceD(CBaseTestCase* aTestCase);
   1.263 +
   1.264 +	/**
   1.265 +	Destructor
   1.266 +	*/
   1.267 +	virtual ~RUsbDeviceD();
   1.268 +
   1.269 +	/**
   1.270 +	*/
   1.271 +	void OpenL(const TDesC& aSerialNumber);		
   1.272 +
   1.273 +	
   1.274 +public:
   1.275 +	/**
   1.276 +	Overidden
   1.277 +	*/
   1.278 +	virtual void OnStateChangeL(TUsbcDeviceState aNewState);
   1.279 +	};
   1.280 +
   1.281 +	}
   1.282 +
   1.283 +#endif
   1.284 \ No newline at end of file