diff -r 000000000000 -r 96e5fb8b040d kerneltest/e32test/examples/driver1/driver1.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/kerneltest/e32test/examples/driver1/driver1.h Thu Dec 17 09:24:54 2009 +0200 @@ -0,0 +1,213 @@ +// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of the License "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// + +/** + @file Interface to example Logical Device Driver + @publishedPartner + @released +*/ + +#ifndef __DRIVER1_H__ +#define __DRIVER1_H__ + +#include +#include +#ifndef __KERNEL_MODE__ +#include +#endif + +/** +User interface for 'Driver1' +*/ +class RDriver1 : public RBusLogicalChannel + { +public: + /** + Structure for holding driver capabilities information + (Just a version number in this example.) + */ + class TCaps + { + public: + TVersion iVersion; + }; + + /** + Structure for holding driver configuration data + */ + class TConfig + { + public: + TInt iSpeed; /**< Data transfer speed in microseconds/byte */ + TInt iPddBufferSize; /**< Size of the PDD's data buffer (not modifiable) */ + TInt iMaxSendDataSize; /**< Maximum size of data which can be sent in one go (not modifiable) */ + TInt iMaxReceiveDataSize; /**< Maximum size of data which can be received in one go (not modifiable) */ + }; + typedef TPckgBuf TConfigBuf; + +public: + TInt Open(); + TInt GetConfig(TConfigBuf& aConfig); + TInt SetConfig(const TConfigBuf& aConfig); + void SendData(TRequestStatus &aStatus,const TDesC8& aData); + void SendDataCancel(); + void ReceiveData(TRequestStatus &aStatus,TDes8& aBuffer); + void ReceiveDataCancel(); + inline static const TDesC& Name(); + inline static TVersion VersionRequired(); +private: + /** + Enumeration of Control messages. + */ + enum TControl + { + EGetConfig, + ESetConfig + }; + + /** + Enumeration of Request messages. + */ + enum TRequest + { + ESendData, + EReceiveData, + ENumRequests, + EAllRequests = (1<