Update contrib.
1 // Copyright (c) 2006-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32test/usb/t_usb_device/include/usblib.h
22 // --- Little USB Test Helpers ---
25 // Returns ETrue if the testing platform is not in the list of platforms which
26 // are known NOT to have any USB support. In other words, assume that licensee
27 // platforms which aren't in this list WILL support USB.
29 inline TBool SupportsUsb()
32 const TInt r = HAL::Get(HAL::EMachineUid, muid);
33 if (r != KErrNone) return EFalse;;
34 return ((muid != HAL::EMachineUid_Series5mx) &&
35 (muid != HAL::EMachineUid_Cogent) &&
36 (muid != HAL::EMachineUid_Win32Emulator) &&
37 (muid != HAL::EMachineUid_WinC) &&
38 (muid != HAL::EMachineUid_CL7211_Eval) &&
39 (muid != HAL::EMachineUid_LinkUp) &&
40 (muid != HAL::EMachineUid_IQ80310) &&
41 (muid != HAL::EMachineUid_Integrator) &&
42 (muid != HAL::EMachineUid_Helen) &&
43 (muid != HAL::EMachineUid_X86PC));
48 // Returns ETrue if the testing platform is not in the list of platforms which
49 // are known NOT to support alternate interface settings.
51 inline TBool SupportsAlternateInterfaces()
54 const TInt r = HAL::Get(HAL::EMachineUid, muid);
55 if (r != KErrNone) return EFalse;;
56 return ((muid != HAL::EMachineUid_Brutus) &&
57 (muid != HAL::EMachineUid_Assabet) &&
58 (muid != HAL::EMachineUid_Lubbock));
63 // Returns ETrue if the testing platform is not in the list of platforms which
64 // are known NOT to support stalling of endpoints in an unconfigured state.
65 // (Some UDCs don't permit endpoint stall operations until a SET_CONFIGURATION
66 // request has been received.)
68 inline TBool SupportsEndpointStall()
71 const TInt r = HAL::Get(HAL::EMachineUid, muid);
72 if (r != KErrNone) return EFalse;;
73 return ((muid != HAL::EMachineUid_OmapH2) &&
74 (muid != HAL::EMachineUid_OmapH4));
79 // Calculates a 16-bit value out of two single bytes.
81 inline TUint16 EpSize(TUint8 aLowByte, TUint8 aHighByte)
83 TUint16 size = aLowByte;
84 size |= (aHighByte << 8);
89 #endif // __USBLIB_H__