sl@0: /* sl@0: * Copyright (c) 2003-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: * e32test\personality\example\ifcldd.h sl@0: * Test code for example RTOS personality. sl@0: * sl@0: * sl@0: */ sl@0: sl@0: sl@0: sl@0: #if !defined(__IFCLDD_H__) sl@0: #define __IFCLDD_H__ sl@0: #include sl@0: #ifndef __KERNEL_MODE__ sl@0: #include sl@0: #endif sl@0: sl@0: _LIT(KRtosIfcLddName,"RtosIfc"); sl@0: sl@0: class TCapsRtosIfcV01 sl@0: { sl@0: public: sl@0: TVersion iVersion; sl@0: }; sl@0: sl@0: struct SRxData sl@0: { sl@0: TInt iLength; sl@0: TUint8 iChecksum; sl@0: TUint8 iData[1]; sl@0: }; sl@0: sl@0: struct SReport sl@0: { sl@0: enum TType {ESem=8, ERcv=9, ETm=10}; sl@0: TInt iType; sl@0: TUint iCount; sl@0: TUint iOkCount; sl@0: TUint iBadCount; sl@0: }; sl@0: sl@0: class RRtosIfc : public RBusLogicalChannel sl@0: { sl@0: public: sl@0: enum TRequest sl@0: { sl@0: ERequestWaitInitialTests, sl@0: ERequestReceive, sl@0: ERequestReport, sl@0: }; sl@0: sl@0: enum TRequestCancel sl@0: { sl@0: ECancelWaitInitialTests=1, sl@0: ECancelReceive=2, sl@0: ECancelReport=4, sl@0: }; sl@0: sl@0: enum TControl sl@0: { sl@0: EControlInit, sl@0: EControlSend, sl@0: EControlFlush, sl@0: EControlFinish, sl@0: }; sl@0: public: sl@0: #ifndef __KERNEL_MODE__ sl@0: inline TInt Open() sl@0: { return DoCreate(KRtosIfcLddName(),TVersion(0,1,1),KNullUnit,NULL,NULL); } sl@0: inline void Init() sl@0: { DoControl(EControlInit); } sl@0: inline void WaitInitialTests(TRequestStatus& aStatus) sl@0: { DoRequest(ERequestWaitInitialTests, aStatus); } sl@0: inline void Receive(TRequestStatus& aStatus, SRxData& aData) sl@0: { DoRequest(ERequestReceive, aStatus, &aData); } sl@0: inline void Report(TRequestStatus& aStatus, SReport& aData) sl@0: { DoRequest(ERequestReport, aStatus, &aData); } sl@0: inline TInt SendData(const TDesC8& aData) sl@0: { return DoControl(EControlSend, (TAny*)&aData); } sl@0: inline void FlushData() sl@0: { DoControl(EControlFlush); } sl@0: inline void Finish() sl@0: { DoControl(EControlFinish); } sl@0: inline void Cancel(TUint aMask) sl@0: { DoCancel(aMask); } sl@0: #endif sl@0: }; sl@0: sl@0: #endif