|
1 /* |
|
2 * Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
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". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 /** |
|
19 @file |
|
20 @internalComponent |
|
21 |
|
22 The interface of the serial driver stuff for users of the serial |
|
23 driver library - not users of the class itself. |
|
24 |
|
25 */ |
|
26 |
|
27 #ifndef __SERIAL_DRIVER_EXT_H |
|
28 #define __SERIAL_DRIVER_EXT_H |
|
29 |
|
30 #include <d32comm.h> // gives us 'TCommConfig' |
|
31 |
|
32 typedef TAny * SerialServer; |
|
33 typedef TAny * SerialPort; |
|
34 |
|
35 // The external interface to users of the library, |
|
36 |
|
37 IMPORT_C SerialServer OpenSerialServerL(void); |
|
38 |
|
39 IMPORT_C void CloseSerialServer(SerialServer aServer); |
|
40 |
|
41 IMPORT_C SerialPort OpenSerialPortL(SerialServer aServer, TUint aPort); |
|
42 |
|
43 IMPORT_C TBool CloseSerialPort(SerialPort aPort); |
|
44 |
|
45 IMPORT_C TBool Read(SerialPort aPort, |
|
46 TRequestStatus & aStatus, |
|
47 TTimeIntervalMicroSeconds32 aTimeout, |
|
48 TDes8 &aDes, |
|
49 TInt aLength); |
|
50 |
|
51 IMPORT_C TBool Write(SerialPort aPort, |
|
52 TRequestStatus & aStatus, |
|
53 TTimeIntervalMicroSeconds32 aTimeout, |
|
54 const TDesC8 &aDes, |
|
55 TInt aLength); |
|
56 |
|
57 IMPORT_C TInt SetConfig(SerialPort aPort, const TCommConfig & aRequiredConfig); |
|
58 |
|
59 IMPORT_C TBool GetPortConfig (SerialPort aPort, TCommConfig & config); |
|
60 |
|
61 IMPORT_C TBool ReadCancel(SerialPort aPort); |
|
62 |
|
63 IMPORT_C TBool WriteCancel(SerialPort aPort); |
|
64 |
|
65 IMPORT_C TBool SetReceiveBufferLength(SerialPort aPort, TInt aSize); |
|
66 |
|
67 IMPORT_C TBool ReceiveBufferLength(SerialPort aPort, TInt & aSize); |
|
68 |
|
69 // typedef equivalents |
|
70 |
|
71 |
|
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, |
|
79 TDes8 &aDes, |
|
80 TInt aLength); |
|
81 typedef TBool (*TLibWrite)(SerialPort aPort, |
|
82 TRequestStatus & aStatus, |
|
83 TTimeIntervalMicroSeconds32 aTimeout, |
|
84 const TDesC8 &aDes, |
|
85 TInt aLength); |
|
86 typedef TInt (*TLibSetConfig)(SerialPort aPort, const TCommConfig & aRequiredConfig ); |
|
87 |
|
88 typedef TBool (*TLibReadCancel)(SerialPort aPort); |
|
89 |
|
90 typedef TBool (*TLibWriteCancel)(SerialPort aPort); |
|
91 |
|
92 typedef TBool (*TLibSetReceiveBufferLength)(SerialPort aPort, TInt aSize); |
|
93 |
|
94 typedef TBool (*TLibReceiveBufferLength)(SerialPort aPort, TInt & aSize); |
|
95 |
|
96 |
|
97 #endif |