sl@0: #ifndef __USB_TEST_DEVICES_H sl@0: #define __USB_TEST_DEVICES_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 modelleddevices.h sl@0: * @internalComponent sl@0: * sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: #include "testdevicebase.h" sl@0: sl@0: namespace NUnitTesting_USBDI sl@0: { sl@0: sl@0: _LIT(KVendorDevice,"VendorDevice"); sl@0: _LIT(KTestDeviceB, "TestDeviceB"); sl@0: _LIT(KManufacturer,"Symbian"); sl@0: _LIT(KConfigurationString,"Test Configuration"); sl@0: sl@0: /** sl@0: This class models a simple test device which has one default interface with the default interface setting sl@0: i.e. a test device that can only connect and disconnect with some basic vendor sl@0: and product information. There are no extra endpoints for this device sl@0: */ sl@0: class RUsbDeviceVendor : public RUsbTestDevice sl@0: { sl@0: public: sl@0: /** sl@0: Constructor, build a default vendor device sl@0: @param aStatus the pointer to the status object for error reporting sl@0: @param aSerialNumber the serial number of the vendor device sl@0: */ sl@0: sl@0: RUsbDeviceVendor(); sl@0: sl@0: // ctor sl@0: RUsbDeviceVendor(CBaseTestCase* aTestCase); sl@0: sl@0: /** sl@0: Destructor sl@0: */ sl@0: sl@0: virtual ~RUsbDeviceVendor(); sl@0: sl@0: /** sl@0: Configuration sl@0: Interface0 [setting0] sl@0: */ sl@0: sl@0: void OpenL(const TDesC16& aSerialNumber); sl@0: sl@0: public: sl@0: /** sl@0: Overidden sl@0: */ sl@0: virtual void OnStateChangeL(TUsbcDeviceState aNewState); sl@0: sl@0: private: sl@0: /** sl@0: The serial number for the vendor device sl@0: */ sl@0: TBuf16<64> iSerialNumber; sl@0: }; sl@0: sl@0: sl@0: sl@0: /** sl@0: Describe a device that models this configuration: sl@0: sl@0: Configuration sl@0: Interface0 [setting0] sl@0: Interface1 [setting0] sl@0: [endpoint1] Bulk out sl@0: [endpoint2] Bulk in sl@0: [setting1] sl@0: [endpoint1] Interrupt in sl@0: [endpoint2] Bulk out sl@0: [endpoint3] Bulk in sl@0: */ sl@0: class RUsbDeviceA : public RUsbDeviceVendor sl@0: { sl@0: public: sl@0: sl@0: /** sl@0: */ sl@0: RUsbDeviceA(); sl@0: sl@0: /** sl@0: */ sl@0: RUsbDeviceA(CBaseTestCase* aTestCase); sl@0: sl@0: /** sl@0: Destructor sl@0: */ sl@0: virtual ~RUsbDeviceA(); sl@0: sl@0: /** sl@0: */ sl@0: void OpenL(const TDesC& aSerialNumber); sl@0: sl@0: sl@0: public: sl@0: /** sl@0: Overidden sl@0: */ sl@0: virtual void OnStateChangeL(TUsbcDeviceState aNewState); sl@0: }; sl@0: sl@0: sl@0: /** sl@0: Describe a device that models this configuration: sl@0: sl@0: Configuration sl@0: Interface0 [setting0] sl@0: [CS Interface] sl@0: [endpoint1] Bulk out sl@0: [CS Endpoint] sl@0: [endpoint2] Bulk out sl@0: [CS Endpoint] sl@0: [endpoint3] Bulk out sl@0: [CS Endpoint] sl@0: Interface0 [setting1] sl@0: [CS Interface] sl@0: [endpoint1] Bulk out sl@0: [CS Endpoint] sl@0: [endpoint2] Bulk out sl@0: [CS Endpoint] sl@0: [endpoint3] Bulk out sl@0: [CS Endpoint] sl@0: Interface0 [setting2] sl@0: [CS Interface] sl@0: [endpoint1] Bulk out sl@0: [CS Endpoint] sl@0: [endpoint2] Bulk out sl@0: [CS Endpoint] sl@0: [endpoint3] Bulk out sl@0: [CS Endpoint] sl@0: sl@0: */ sl@0: class RUsbDeviceB : public RUsbTestDevice sl@0: { sl@0: public: sl@0: /** sl@0: */ sl@0: RUsbDeviceB(); sl@0: sl@0: /** sl@0: */ sl@0: RUsbDeviceB(CBaseTestCase* aTestCase); sl@0: sl@0: /** sl@0: */ sl@0: virtual ~RUsbDeviceB(); sl@0: sl@0: /** sl@0: */ sl@0: void OpenL(const TDesC& aSerialNumber); sl@0: sl@0: public: sl@0: /** sl@0: Overidden sl@0: */ sl@0: virtual void OnStateChangeL(TUsbcDeviceState aNewState); sl@0: sl@0: private: sl@0: /** sl@0: The serial number for the vendor device sl@0: */ sl@0: TBuf16<64> iSerialNumber; sl@0: }; sl@0: sl@0: sl@0: /** sl@0: Describe a device that models this configuration: sl@0: sl@0: Configuration sl@0: Interface0 [setting0] sl@0: Interface1 [setting0] sl@0: [endpoint1] Bulk out sl@0: [endpoint2] Bulk in sl@0: [setting1] sl@0: [endpoint1] Interrupt in sl@0: [endpoint2] Bulk out sl@0: [endpoint3] Bulk in sl@0: */ sl@0: class RUsbDeviceC : public RUsbDeviceVendor sl@0: { sl@0: public: sl@0: /** sl@0: */ sl@0: RUsbDeviceC(); sl@0: sl@0: RUsbDeviceC(CBaseTestCase* aTestCase); sl@0: sl@0: /** sl@0: Destructor sl@0: */ sl@0: virtual ~RUsbDeviceC(); sl@0: sl@0: /** sl@0: */ sl@0: void OpenL(const TDesC& aSerialNumber); sl@0: sl@0: sl@0: public: sl@0: /** sl@0: Overidden sl@0: */ sl@0: virtual void OnStateChangeL(TUsbcDeviceState aNewState); sl@0: }; sl@0: sl@0: sl@0: /** sl@0: Describe a device that models this configuration: sl@0: sl@0: Configuration sl@0: Interface0 [setting0] sl@0: Interface1 [setting0] sl@0: [endpoint1] Bulk out sl@0: [endpoint2] Bulk in sl@0: [setting1] sl@0: [endpoint1] Interrupt in sl@0: [endpoint2] Bulk out sl@0: [endpoint3] Bulk in sl@0: Interface2 [setting0] sl@0: [endpoint1] Bulk out sl@0: [endpoint2] Bulk in sl@0: [setting1] sl@0: [endpoint1] Bulk out sl@0: [endpoint2] Bulk out sl@0: [endpoint3] Bulk in sl@0: */ sl@0: class RUsbDeviceD : public RUsbDeviceVendor sl@0: { sl@0: public: sl@0: sl@0: /** sl@0: */ sl@0: RUsbDeviceD(); sl@0: sl@0: /** sl@0: */ sl@0: RUsbDeviceD(CBaseTestCase* aTestCase); sl@0: sl@0: /** sl@0: Destructor sl@0: */ sl@0: virtual ~RUsbDeviceD(); sl@0: sl@0: /** sl@0: */ sl@0: void OpenL(const TDesC& aSerialNumber); sl@0: sl@0: sl@0: public: sl@0: /** sl@0: Overidden sl@0: */ sl@0: virtual void OnStateChangeL(TUsbcDeviceState aNewState); sl@0: }; sl@0: sl@0: } sl@0: sl@0: #endif