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 "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: // sl@0: sl@0: /** sl@0: @file sl@0: @internalComponent sl@0: @prototype sl@0: */ sl@0: sl@0: #ifndef DVBHHAITESTUTIL_H sl@0: #define DVBHHAITESTUTIL_H sl@0: sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: sl@0: /** sl@0: * Constants for expected values sl@0: */ sl@0: const TInt KDvbhTestFilterId = 977; sl@0: const TIp6Addr KDvbhTestIpV6Addr = {{{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,1}}}; sl@0: const TInt KDvbhTestCustomCommand = 0; sl@0: _LIT8(KDvbhTestCustomCommandInput, "DvbhTestCustomCommandInput"); sl@0: _LIT8(KDvbhTestCustomCommandOutput, "DvbhTestCustomCommandOutput"); sl@0: _LIT8(KDvbhTestHardwareInfo, "Example Hardware Info;Version 1.0"); sl@0: sl@0: const TInt KInitialState = EDvbhStateInactive; sl@0: const TInt KExpectedState = EDvbhStateReady; sl@0: sl@0: const TInt KInitialSignalQuality = EDvbhSignalQualityFair; sl@0: const TInt KExpectedSignalQuality = EDvbhSignalQualityExcellent; sl@0: sl@0: const TInt KInitialFrequency = 1500000; sl@0: const TInt KExpectedFrequency = 3600000; sl@0: sl@0: const TInt KInitialCellId = 1006; sl@0: const TInt KExpectedCellId = 756; sl@0: sl@0: const TInt KInitialNetworkId = 9993; sl@0: const TInt KExpectedNetworkId = 3726; sl@0: sl@0: const TUint32 KDvbhTestTerminalTimeStamp = 987654321; sl@0: sl@0: const TInt KNoVerdict = -1; sl@0: sl@0: const TInt KInitialPlatformId = 123456789; sl@0: _LIT8(KInitialPlatformName, "DvbhTestInitialPlatform"); sl@0: sl@0: const TInt KExpectedPlatformId = 987654321; sl@0: _LIT8(KExpectedPlatformName, "DvbhTestExpectedPlatform"); sl@0: sl@0: /** sl@0: * @internalComponent sl@0: * @prototype sl@0: * sl@0: * Publish & Subscribe variables used for implementation to API communication. sl@0: * sl@0: * This must be kept identical to the ones defined in the non-exported header sl@0: * file dvbhimplcommon.h sl@0: */ sl@0: enum TDvbhPropertyKey sl@0: { sl@0: EDvbhPropertyKeyState = 0, // integer (TDvbhState) sl@0: EDvbhPropertyKeyPlatform = 1, // byte array (TDvbhPlatform + TIp6Addr + TInt16) sl@0: EDvbhPropertyKeyNetworkTime = 2, // byte array (TDvbhNetworkTime) sl@0: EDvbhPropertyKeyPerformanceData = 3, // byte array (TDvbhPerformanceData) sl@0: EDvbhPropertyKeyFrequency = 4, // byte array (TDvbhFrequency) sl@0: EDvbhPropertyKeyNetworkId = 5, // byte array (TDvbhNetworkId) sl@0: EDvbhPropertyKeySignalQuality = 6, // byte array (TDvbhSignalQuality) sl@0: EDvbhPropertyKeyCellId = 7 // byte array (TDvbhCellId) sl@0: }; sl@0: sl@0: struct TDvbhPlatformProperty sl@0: { sl@0: TDvbhPlatform iPlatform; sl@0: TIp6Addr iEsgRoot; sl@0: }; sl@0: sl@0: /** sl@0: * Interface to enable CDvbhTestUtil to log test data & messages. sl@0: */ sl@0: class MDvbhHaiTestLoggerInterface sl@0: { sl@0: public: sl@0: virtual void InfoPrintf3(const TDesC16& aString, TInt aInt1, TInt aInt2) = 0; sl@0: virtual void InfoPrintf4(const TDesC16& aString, TInt aInt1, TInt aInt2, TInt aInt3) = 0; sl@0: }; sl@0: sl@0: class RTestStep; sl@0: sl@0: /** sl@0: * @internalComponent sl@0: * @prototype sl@0: * sl@0: * A class of utility methods to help the DVB-H HAI test steps. sl@0: */ sl@0: class CDvbhTestUtil : public CBase sl@0: { sl@0: public: sl@0: enum sl@0: { sl@0: ENoInitialState = -1 sl@0: }; sl@0: sl@0: enum sl@0: { sl@0: ENumDvbhProperties = 8 sl@0: }; sl@0: public: sl@0: static CDvbhTestUtil* NewL(MDvbhHaiTestLoggerInterface& aTestStepLogger); sl@0: sl@0: TInt DefineDvbhProperty(TInt aPropertyKey, TInt aType = RProperty::EInt) const; sl@0: TInt DefineDvbhProperty(TInt aPropertyKey, TInt aType, const TDesC8& aInitialValue) const; sl@0: TInt DefineDvbhStateProperty(TInt aInitialState = ENoInitialState); sl@0: TInt DefineDvbhIntegerProperty(TInt aPropertyKey, TInt aInitialValue) const; sl@0: TInt DeleteDvbhProperty(TInt aPropertyKey); sl@0: TInt SetStateProperty(TInt aValue); sl@0: TInt SetByteArrayProperty(TInt aPropertyKey, const TDesC8& aValue) const; sl@0: TInt SetIntegerProperty(TInt aPropertyKey, TInt aValue) const; sl@0: TInt DefineAllDvbhProperties(); sl@0: TInt DeleteAllDvbhProperties(); sl@0: public: sl@0: static TInt GetKey(TDvbhPropertyKey aKey); sl@0: static TInt GetType(TDvbhPropertyKey aKey); sl@0: static TBool CompareVersions(const TVersion& aVersion1, const TVersion& aVersion2); sl@0: static TBool ComparePlatforms(const TDvbhPlatform& aPlatform1, const TDvbhPlatform& aPlatform2); sl@0: static TBool ComparePerformanceDatas(const TDvbhPerformanceData& aData1, const TDvbhPerformanceData& aData2); sl@0: static TBool CompareScanConfigurations(const TDvbhScanConfiguration& aConfig1, const TDvbhScanConfiguration& aConfig2); sl@0: private: sl@0: CDvbhTestUtil(MDvbhHaiTestLoggerInterface& aTestStepLogger); sl@0: private: sl@0: MDvbhHaiTestLoggerInterface& iTestStepLogger; sl@0: }; sl@0: sl@0: #endif // DVBHHAITESTUTIL_H