1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/serialdriverext.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,97 @@
1.4 +/*
1.5 +* Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description:
1.18 +*
1.19 +*/
1.20 +
1.21 +/**
1.22 +@file
1.23 +@internalComponent
1.24 +
1.25 +The interface of the serial driver stuff for users of the serial
1.26 +driver library - not users of the class itself.
1.27 +
1.28 +*/
1.29 +
1.30 +#ifndef __SERIAL_DRIVER_EXT_H
1.31 +#define __SERIAL_DRIVER_EXT_H
1.32 +
1.33 +#include <d32comm.h> // gives us 'TCommConfig'
1.34 +
1.35 +typedef TAny * SerialServer;
1.36 +typedef TAny * SerialPort;
1.37 +
1.38 +// The external interface to users of the library,
1.39 +
1.40 +IMPORT_C SerialServer OpenSerialServerL(void);
1.41 +
1.42 +IMPORT_C void CloseSerialServer(SerialServer aServer);
1.43 +
1.44 +IMPORT_C SerialPort OpenSerialPortL(SerialServer aServer, TUint aPort);
1.45 +
1.46 +IMPORT_C TBool CloseSerialPort(SerialPort aPort);
1.47 +
1.48 +IMPORT_C TBool Read(SerialPort aPort,
1.49 + TRequestStatus & aStatus,
1.50 + TTimeIntervalMicroSeconds32 aTimeout,
1.51 + TDes8 &aDes,
1.52 + TInt aLength);
1.53 +
1.54 +IMPORT_C TBool Write(SerialPort aPort,
1.55 + TRequestStatus & aStatus,
1.56 + TTimeIntervalMicroSeconds32 aTimeout,
1.57 + const TDesC8 &aDes,
1.58 + TInt aLength);
1.59 +
1.60 +IMPORT_C TInt SetConfig(SerialPort aPort, const TCommConfig & aRequiredConfig);
1.61 +
1.62 +IMPORT_C TBool GetPortConfig (SerialPort aPort, TCommConfig & config);
1.63 +
1.64 +IMPORT_C TBool ReadCancel(SerialPort aPort);
1.65 +
1.66 +IMPORT_C TBool WriteCancel(SerialPort aPort);
1.67 +
1.68 +IMPORT_C TBool SetReceiveBufferLength(SerialPort aPort, TInt aSize);
1.69 +
1.70 +IMPORT_C TBool ReceiveBufferLength(SerialPort aPort, TInt & aSize);
1.71 +
1.72 +// typedef equivalents
1.73 +
1.74 +
1.75 +typedef SerialServer (*TLibOpenSerialServerL)(void);
1.76 +typedef void (*TLibCloseSerialServer)(SerialServer aServer);
1.77 +typedef SerialPort (*TLibOpenSerialPortL)(SerialServer aServer, TUint aPort);
1.78 +typedef TBool (*TLibCloseSerialPort)(SerialPort aPort);
1.79 +typedef TBool (*TLibRead)(SerialPort aPort,
1.80 + TRequestStatus & aStatus,
1.81 + TTimeIntervalMicroSeconds32 aTimeout,
1.82 + TDes8 &aDes,
1.83 + TInt aLength);
1.84 +typedef TBool (*TLibWrite)(SerialPort aPort,
1.85 + TRequestStatus & aStatus,
1.86 + TTimeIntervalMicroSeconds32 aTimeout,
1.87 + const TDesC8 &aDes,
1.88 + TInt aLength);
1.89 +typedef TInt (*TLibSetConfig)(SerialPort aPort, const TCommConfig & aRequiredConfig );
1.90 +
1.91 +typedef TBool (*TLibReadCancel)(SerialPort aPort);
1.92 +
1.93 +typedef TBool (*TLibWriteCancel)(SerialPort aPort);
1.94 +
1.95 +typedef TBool (*TLibSetReceiveBufferLength)(SerialPort aPort, TInt aSize);
1.96 +
1.97 +typedef TBool (*TLibReceiveBufferLength)(SerialPort aPort, TInt & aSize);
1.98 +
1.99 +
1.100 +#endif