1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/personality/example/ifcldd.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,101 @@
1.4 +/*
1.5 +* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of the License "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +* e32test\personality\example\ifcldd.h
1.19 +* Test code for example RTOS personality.
1.20 +*
1.21 +*
1.22 +*/
1.23 +
1.24 +
1.25 +
1.26 +#if !defined(__IFCLDD_H__)
1.27 +#define __IFCLDD_H__
1.28 +#include <e32cmn.h>
1.29 +#ifndef __KERNEL_MODE__
1.30 +#include <e32std.h>
1.31 +#endif
1.32 +
1.33 +_LIT(KRtosIfcLddName,"RtosIfc");
1.34 +
1.35 +class TCapsRtosIfcV01
1.36 + {
1.37 +public:
1.38 + TVersion iVersion;
1.39 + };
1.40 +
1.41 +struct SRxData
1.42 + {
1.43 + TInt iLength;
1.44 + TUint8 iChecksum;
1.45 + TUint8 iData[1];
1.46 + };
1.47 +
1.48 +struct SReport
1.49 + {
1.50 + enum TType {ESem=8, ERcv=9, ETm=10};
1.51 + TInt iType;
1.52 + TUint iCount;
1.53 + TUint iOkCount;
1.54 + TUint iBadCount;
1.55 + };
1.56 +
1.57 +class RRtosIfc : public RBusLogicalChannel
1.58 + {
1.59 +public:
1.60 + enum TRequest
1.61 + {
1.62 + ERequestWaitInitialTests,
1.63 + ERequestReceive,
1.64 + ERequestReport,
1.65 + };
1.66 +
1.67 + enum TRequestCancel
1.68 + {
1.69 + ECancelWaitInitialTests=1,
1.70 + ECancelReceive=2,
1.71 + ECancelReport=4,
1.72 + };
1.73 +
1.74 + enum TControl
1.75 + {
1.76 + EControlInit,
1.77 + EControlSend,
1.78 + EControlFlush,
1.79 + EControlFinish,
1.80 + };
1.81 +public:
1.82 +#ifndef __KERNEL_MODE__
1.83 + inline TInt Open()
1.84 + { return DoCreate(KRtosIfcLddName(),TVersion(0,1,1),KNullUnit,NULL,NULL); }
1.85 + inline void Init()
1.86 + { DoControl(EControlInit); }
1.87 + inline void WaitInitialTests(TRequestStatus& aStatus)
1.88 + { DoRequest(ERequestWaitInitialTests, aStatus); }
1.89 + inline void Receive(TRequestStatus& aStatus, SRxData& aData)
1.90 + { DoRequest(ERequestReceive, aStatus, &aData); }
1.91 + inline void Report(TRequestStatus& aStatus, SReport& aData)
1.92 + { DoRequest(ERequestReport, aStatus, &aData); }
1.93 + inline TInt SendData(const TDesC8& aData)
1.94 + { return DoControl(EControlSend, (TAny*)&aData); }
1.95 + inline void FlushData()
1.96 + { DoControl(EControlFlush); }
1.97 + inline void Finish()
1.98 + { DoControl(EControlFinish); }
1.99 + inline void Cancel(TUint aMask)
1.100 + { DoCancel(aMask); }
1.101 +#endif
1.102 + };
1.103 +
1.104 +#endif