2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * 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
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
22 The interface of the serial driver stuff for users of the serial
23 driver library - not users of the class itself.
27 #ifndef __SERIAL_DRIVER_EXT_H
28 #define __SERIAL_DRIVER_EXT_H
30 #include <d32comm.h> // gives us 'TCommConfig'
32 typedef TAny * SerialServer;
33 typedef TAny * SerialPort;
35 // The external interface to users of the library,
37 IMPORT_C SerialServer OpenSerialServerL(void);
39 IMPORT_C void CloseSerialServer(SerialServer aServer);
41 IMPORT_C SerialPort OpenSerialPortL(SerialServer aServer, TUint aPort);
43 IMPORT_C TBool CloseSerialPort(SerialPort aPort);
45 IMPORT_C TBool Read(SerialPort aPort,
46 TRequestStatus & aStatus,
47 TTimeIntervalMicroSeconds32 aTimeout,
51 IMPORT_C TBool Write(SerialPort aPort,
52 TRequestStatus & aStatus,
53 TTimeIntervalMicroSeconds32 aTimeout,
57 IMPORT_C TInt SetConfig(SerialPort aPort, const TCommConfig & aRequiredConfig);
59 IMPORT_C TBool GetPortConfig (SerialPort aPort, TCommConfig & config);
61 IMPORT_C TBool ReadCancel(SerialPort aPort);
63 IMPORT_C TBool WriteCancel(SerialPort aPort);
65 IMPORT_C TBool SetReceiveBufferLength(SerialPort aPort, TInt aSize);
67 IMPORT_C TBool ReceiveBufferLength(SerialPort aPort, TInt & aSize);
69 // typedef equivalents
72 typedef SerialServer (*TLibOpenSerialServerL)(void);
73 typedef void (*TLibCloseSerialServer)(SerialServer aServer);
74 typedef SerialPort (*TLibOpenSerialPortL)(SerialServer aServer, TUint aPort);
75 typedef TBool (*TLibCloseSerialPort)(SerialPort aPort);
76 typedef TBool (*TLibRead)(SerialPort aPort,
77 TRequestStatus & aStatus,
78 TTimeIntervalMicroSeconds32 aTimeout,
81 typedef TBool (*TLibWrite)(SerialPort aPort,
82 TRequestStatus & aStatus,
83 TTimeIntervalMicroSeconds32 aTimeout,
86 typedef TInt (*TLibSetConfig)(SerialPort aPort, const TCommConfig & aRequiredConfig );
88 typedef TBool (*TLibReadCancel)(SerialPort aPort);
90 typedef TBool (*TLibWriteCancel)(SerialPort aPort);
92 typedef TBool (*TLibSetReceiveBufferLength)(SerialPort aPort, TInt aSize);
94 typedef TBool (*TLibReceiveBufferLength)(SerialPort aPort, TInt & aSize);