1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/kerneltest/e32test/device/t_fir.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,135 @@
1.4 +// Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +// e32test\device\t_fir.h
1.18 +//
1.19 +//
1.20 +
1.21 +//#include <es_sock.h>
1.22 +#include <e32test.h>
1.23 +#include <e32cons.h>
1.24 +#include <d32comm.h>
1.25 +#include <d32fir.h>
1.26 +
1.27 +#ifndef __T_FIR__
1.28 +#define __T_FIR__
1.29 +
1.30 +#define PDD_NAME _L("difiba")
1.31 +#define LDD_NAME _L("efir")
1.32 +
1.33 +
1.34 +class CActiveWriter;
1.35 +class CActiveReader;
1.36 +class CActiveConsole : public CActive
1.37 +//-----------------------------------
1.38 + {
1.39 +public:
1.40 + // Construction
1.41 + CActiveConsole(CConsoleBase* aConsole);
1.42 + static CActiveConsole* NewLC(CConsoleBase* aConsole);
1.43 + void ConstructL();
1.44 +
1.45 + // Destruction
1.46 + ~CActiveConsole();
1.47 +
1.48 + // Issue request
1.49 + void RequestCharacter();
1.50 +
1.51 + // Cancel request.
1.52 + // Defined as pure virtual by CActive;
1.53 + // implementation provided by this class.
1.54 + void DoCancel();
1.55 +
1.56 + // Service completed request.
1.57 + // Defined as pure virtual by CActive;
1.58 + // implementation provided by this class,
1.59 + void RunL();
1.60 +
1.61 + void ProcessKeyPressL(TChar aChar);
1.62 +
1.63 + void GetFirRegs();
1.64 + void GetDmaReaderRegs();
1.65 + void GetDmaWriterRegs();
1.66 + void GetReadBufInfo();
1.67 + void GetWriteBufInfo();
1.68 + void GetChunkInfo();
1.69 + void GetMiscInfo();
1.70 + void SetUpBuffers();
1.71 + void Options1();
1.72 + void Options2();
1.73 + void Options3();
1.74 +public:
1.75 + // Data members defined by this class
1.76 + CConsoleBase* iConsole; // A console for reading from
1.77 + CActiveWriter* iWriter; // Client wrapper for CObexClient
1.78 + CActiveReader* iReader; // Client wrapper for CObexServer
1.79 + RDevFir iPort;
1.80 + TBool iInit1;
1.81 + TBool iInit2;
1.82 + TBool iInit3;
1.83 + TBps iBaudRate;
1.84 + };
1.85 +
1.86 +
1.87 +class CActiveWriter : public CActive
1.88 +//-----------------------------------------------------------
1.89 + {
1.90 +public:
1.91 + // Construction
1.92 + CActiveWriter(CConsoleBase* aConsole,RDevFir* aPort);
1.93 + static CActiveWriter* NewL(CConsoleBase* aConsole,RDevFir* aPort);
1.94 + void ConstructL();
1.95 +
1.96 + ~CActiveWriter();
1.97 +
1.98 + void Start();
1.99 + void Stop();
1.100 +private:
1.101 + void RunL ();
1.102 + void DoCancel ();
1.103 +
1.104 +
1.105 +private:
1.106 + CConsoleBase* iConsole;
1.107 + RDevFir* iPort;
1.108 + TInt iLength;
1.109 + };
1.110 +
1.111 +
1.112 +class CActiveReader : public CActive
1.113 +//-----------------------------------------------------------
1.114 + {
1.115 +public:
1.116 + // Construction
1.117 + CActiveReader(CConsoleBase* aConsole,RDevFir* aPort);
1.118 + static CActiveReader* NewL(CConsoleBase* aConsole,RDevFir* aPort);
1.119 + void ConstructL();
1.120 +
1.121 + virtual ~CActiveReader();
1.122 +
1.123 + void Start();
1.124 + void Stop();
1.125 +private:
1.126 + void RunL ();
1.127 + void DoCancel ();
1.128 +
1.129 + void ResetReadBuffer();
1.130 + TBool CompareBuffers(TInt aLen);
1.131 +
1.132 +private:
1.133 + CConsoleBase* iConsole;
1.134 + RDevFir* iPort;
1.135 +
1.136 + };
1.137 +
1.138 +#endif // __T_FIR__