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