diff -r 000000000000 -r bde4ae8d615e os/kernelhwsrv/kerneltest/e32test/examples/exdriver/exdriver_chnk/inc/exchnk.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/os/kernelhwsrv/kerneltest/e32test/examples/exdriver/exdriver_chnk/inc/exchnk.h Fri Jun 15 03:10:57 2012 +0200 @@ -0,0 +1,132 @@ +// Copyright (c) 2007-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: +// This file defines the interface provided by the driver to the user. +// It will be included both in the application (user) and the driver (kernel). +// This file typically defines the RBusLogicalChannel derived class that will +// inturn provide the driver API to the user application. +// ifndef __EXCHNK_H__ will resolve the multiple inclusion of this header +// file in different source files. If the file is already included, then the +// following switch will not re-include the file. +// +// + +#ifndef __EXCHNK_H__ +#define __EXCHNK_H__ + +// include files +// +// e32ver.h (for KE32BuildVersionNumber), e32cmn.h and e32std.h are already +// included in d32comm.h and hence not repeating here. +// +#include + +// Literal string descriptor constants for driver name. These descriptors +// are used by the driver to associate a name for registering to the +// Symbian OS. LDD will have a name to associate with. +// + +_LIT(KDriverName, "d_exchnk"); + +// Internal loopback modes +const TInt KIntLoopbackDisable=0; +const TInt KIntLoopbackEnable=1; + +/** + User interface for tutorial driver + + RExDriverChannel class is derived from the RBusLogicalChannel and provides + the interface for user. User application accesses the driver functionality + using only these API. + */ +class RExDriverChannel:public RBusLogicalChannel + { +public: + // TVer is an enumeration for the version related information. Driver will + // need to set and validate version related information while installing. + // Version numbers are validated to check if this version of driver as + // expected by the client/user application + // + enum TVer + { + EUartMajorVersionNumber=1, // Major number for driver + EUartMinorVersionNumber=0, // Minor number for device + EUartBuildVersionNumber=KE32BuildVersionNumber // Build version number for driver + }; + // TControl is the enumeration for control and synchronous messages + // supported by the driver. User application can request for any of + // the following control messages to the driver through DoControl() + // API provided by the RBusLogicalChannel class. + // + enum TControl // Synchronous control messages used with DoControl() + { + EControlCaps, // Get the channel capabilities on uart + EControlSetConfig, // Configure the device (uart) + EControlSetIntLoopback, // Configure the device's internal looback mode + EGetTxChunkHandle, // Get handle to transmit chunk + EGetRxChunkHandle, // Get handle to Receive chunk + EPassTxChunkHandle, // Pass handle to transmit chunk from user side. + EPassRxChunkHandle // Pass handle to Receive chunk from user side. + }; + // TRequest is the enumeration for asynchronous requests supported + // by the driver. User application can request for any of the + // following messages to the driver through DoRequest() API provided + // by the RBusLogicalChannel class. + // + enum TRequest // Asynchronous request messages used with DoRequest() + { + ERequestTransmitData, // Transmit data over the device (uart) + ERequestReceiveData, // Receive the data from the device (uart) + ENumRequests, // Total number of supported asynchrnous requests + EAllRequests = (1<