sl@0: // Copyright (c) 1997-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\device\t_fir.h sl@0: // sl@0: // sl@0: sl@0: //#include sl@0: #include sl@0: #include sl@0: #include sl@0: #include sl@0: sl@0: #ifndef __T_FIR__ sl@0: #define __T_FIR__ sl@0: sl@0: #define PDD_NAME _L("difiba") sl@0: #define LDD_NAME _L("efir") sl@0: sl@0: sl@0: class CActiveWriter; sl@0: class CActiveReader; sl@0: class CActiveConsole : public CActive sl@0: //----------------------------------- sl@0: { sl@0: public: sl@0: // Construction sl@0: CActiveConsole(CConsoleBase* aConsole); sl@0: static CActiveConsole* NewLC(CConsoleBase* aConsole); sl@0: void ConstructL(); sl@0: sl@0: // Destruction sl@0: ~CActiveConsole(); sl@0: sl@0: // Issue request sl@0: void RequestCharacter(); sl@0: sl@0: // Cancel request. sl@0: // Defined as pure virtual by CActive; sl@0: // implementation provided by this class. sl@0: void DoCancel(); sl@0: sl@0: // Service completed request. sl@0: // Defined as pure virtual by CActive; sl@0: // implementation provided by this class, sl@0: void RunL(); sl@0: sl@0: void ProcessKeyPressL(TChar aChar); sl@0: sl@0: void GetFirRegs(); sl@0: void GetDmaReaderRegs(); sl@0: void GetDmaWriterRegs(); sl@0: void GetReadBufInfo(); sl@0: void GetWriteBufInfo(); sl@0: void GetChunkInfo(); sl@0: void GetMiscInfo(); sl@0: void SetUpBuffers(); sl@0: void Options1(); sl@0: void Options2(); sl@0: void Options3(); sl@0: public: sl@0: // Data members defined by this class sl@0: CConsoleBase* iConsole; // A console for reading from sl@0: CActiveWriter* iWriter; // Client wrapper for CObexClient sl@0: CActiveReader* iReader; // Client wrapper for CObexServer sl@0: RDevFir iPort; sl@0: TBool iInit1; sl@0: TBool iInit2; sl@0: TBool iInit3; sl@0: TBps iBaudRate; sl@0: }; sl@0: sl@0: sl@0: class CActiveWriter : public CActive sl@0: //----------------------------------------------------------- sl@0: { sl@0: public: sl@0: // Construction sl@0: CActiveWriter(CConsoleBase* aConsole,RDevFir* aPort); sl@0: static CActiveWriter* NewL(CConsoleBase* aConsole,RDevFir* aPort); sl@0: void ConstructL(); sl@0: sl@0: ~CActiveWriter(); sl@0: sl@0: void Start(); sl@0: void Stop(); sl@0: private: sl@0: void RunL (); sl@0: void DoCancel (); sl@0: sl@0: sl@0: private: sl@0: CConsoleBase* iConsole; sl@0: RDevFir* iPort; sl@0: TInt iLength; sl@0: }; sl@0: sl@0: sl@0: class CActiveReader : public CActive sl@0: //----------------------------------------------------------- sl@0: { sl@0: public: sl@0: // Construction sl@0: CActiveReader(CConsoleBase* aConsole,RDevFir* aPort); sl@0: static CActiveReader* NewL(CConsoleBase* aConsole,RDevFir* aPort); sl@0: void ConstructL(); sl@0: sl@0: virtual ~CActiveReader(); sl@0: sl@0: void Start(); sl@0: void Stop(); sl@0: private: sl@0: void RunL (); sl@0: void DoCancel (); sl@0: sl@0: void ResetReadBuffer(); sl@0: TBool CompareBuffers(TInt aLen); sl@0: sl@0: private: sl@0: CConsoleBase* iConsole; sl@0: RDevFir* iPort; sl@0: sl@0: }; sl@0: sl@0: #endif // __T_FIR__