os/kernelhwsrv/kerneltest/e32test/personality/example/ifcldd.h
author sl
Tue, 10 Jun 2014 14:32:02 +0200
changeset 1 260cb5ec6c19
permissions -rw-r--r--
Update contrib.
sl@0
     1
/*
sl@0
     2
* Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     3
* All rights reserved.
sl@0
     4
* This component and the accompanying materials are made available
sl@0
     5
* under the terms of the License "Eclipse Public License v1.0"
sl@0
     6
* which accompanies this distribution, and is available
sl@0
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     8
*
sl@0
     9
* Initial Contributors:
sl@0
    10
* Nokia Corporation - initial contribution.
sl@0
    11
*
sl@0
    12
* Contributors:
sl@0
    13
*
sl@0
    14
* Description:
sl@0
    15
* e32test\personality\example\ifcldd.h
sl@0
    16
* Test code for example RTOS personality.
sl@0
    17
* 
sl@0
    18
*
sl@0
    19
*/
sl@0
    20
sl@0
    21
sl@0
    22
sl@0
    23
#if !defined(__IFCLDD_H__)
sl@0
    24
#define __IFCLDD_H__
sl@0
    25
#include <e32cmn.h>
sl@0
    26
#ifndef __KERNEL_MODE__
sl@0
    27
#include <e32std.h>
sl@0
    28
#endif
sl@0
    29
sl@0
    30
_LIT(KRtosIfcLddName,"RtosIfc");
sl@0
    31
sl@0
    32
class TCapsRtosIfcV01
sl@0
    33
	{
sl@0
    34
public:
sl@0
    35
	TVersion	iVersion;
sl@0
    36
	};
sl@0
    37
sl@0
    38
struct SRxData
sl@0
    39
	{
sl@0
    40
	TInt iLength;
sl@0
    41
	TUint8 iChecksum;
sl@0
    42
	TUint8 iData[1];
sl@0
    43
	};
sl@0
    44
sl@0
    45
struct SReport
sl@0
    46
	{
sl@0
    47
	enum TType {ESem=8, ERcv=9, ETm=10};
sl@0
    48
	TInt iType;
sl@0
    49
	TUint iCount;
sl@0
    50
	TUint iOkCount;
sl@0
    51
	TUint iBadCount;
sl@0
    52
	};
sl@0
    53
sl@0
    54
class RRtosIfc : public RBusLogicalChannel
sl@0
    55
	{
sl@0
    56
public:
sl@0
    57
	enum TRequest
sl@0
    58
		{
sl@0
    59
		ERequestWaitInitialTests,
sl@0
    60
		ERequestReceive,
sl@0
    61
		ERequestReport,
sl@0
    62
		};
sl@0
    63
sl@0
    64
	enum TRequestCancel
sl@0
    65
		{
sl@0
    66
		ECancelWaitInitialTests=1,
sl@0
    67
		ECancelReceive=2,
sl@0
    68
		ECancelReport=4,
sl@0
    69
		};
sl@0
    70
sl@0
    71
	enum TControl
sl@0
    72
		{
sl@0
    73
		EControlInit,
sl@0
    74
		EControlSend,
sl@0
    75
		EControlFlush,
sl@0
    76
		EControlFinish,
sl@0
    77
		};
sl@0
    78
public:
sl@0
    79
#ifndef __KERNEL_MODE__
sl@0
    80
	inline TInt Open()
sl@0
    81
		{ return DoCreate(KRtosIfcLddName(),TVersion(0,1,1),KNullUnit,NULL,NULL); }
sl@0
    82
	inline void Init()
sl@0
    83
		{ DoControl(EControlInit); }
sl@0
    84
	inline void WaitInitialTests(TRequestStatus& aStatus)
sl@0
    85
		{ DoRequest(ERequestWaitInitialTests, aStatus); }
sl@0
    86
	inline void Receive(TRequestStatus& aStatus, SRxData& aData)
sl@0
    87
		{ DoRequest(ERequestReceive, aStatus, &aData); }
sl@0
    88
	inline void Report(TRequestStatus& aStatus, SReport& aData)
sl@0
    89
		{ DoRequest(ERequestReport, aStatus, &aData); }
sl@0
    90
	inline TInt SendData(const TDesC8& aData)
sl@0
    91
		{ return DoControl(EControlSend, (TAny*)&aData); }
sl@0
    92
	inline void FlushData()
sl@0
    93
		{ DoControl(EControlFlush); }
sl@0
    94
	inline void Finish()
sl@0
    95
		{ DoControl(EControlFinish); }
sl@0
    96
	inline void Cancel(TUint aMask)
sl@0
    97
		{ DoCancel(aMask); }
sl@0
    98
#endif
sl@0
    99
	};
sl@0
   100
sl@0
   101
#endif