sl@0
|
1 |
// Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of the License "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
// e32\include\d32comm.h
|
sl@0
|
15 |
//
|
sl@0
|
16 |
//
|
sl@0
|
17 |
|
sl@0
|
18 |
//#define _DEBUG_DEVCOMM
|
sl@0
|
19 |
|
sl@0
|
20 |
/**
|
sl@0
|
21 |
@file
|
sl@0
|
22 |
@publishedPartner
|
sl@0
|
23 |
@released
|
sl@0
|
24 |
*/
|
sl@0
|
25 |
|
sl@0
|
26 |
#ifndef __D32COMM_H__
|
sl@0
|
27 |
#define __D32COMM_H__
|
sl@0
|
28 |
#include <e32cmn.h>
|
sl@0
|
29 |
#include <e32ver.h>
|
sl@0
|
30 |
#include <d32public.h>
|
sl@0
|
31 |
|
sl@0
|
32 |
/**
|
sl@0
|
33 |
Enumeration of number of data bits for serial port configuration.
|
sl@0
|
34 |
Typically, these values are used to initialize the iDataBits of
|
sl@0
|
35 |
TCommConfigV01 before calling DComm::Configure() or any other serial
|
sl@0
|
36 |
comm API to configure the serial port's databits size.
|
sl@0
|
37 |
*/
|
sl@0
|
38 |
enum TDataBits {EData5,EData6,EData7,EData8};
|
sl@0
|
39 |
/**
|
sl@0
|
40 |
Enumeration of number of stop bits for serial port configuration.
|
sl@0
|
41 |
Typically, these values are used to initialize the iStopBits of
|
sl@0
|
42 |
TCommConfigV01 before calling DComm::Configure() or any other serial
|
sl@0
|
43 |
comm API to configure the serial port's stopbits.
|
sl@0
|
44 |
*/
|
sl@0
|
45 |
enum TStopBits {EStop1,EStop2};
|
sl@0
|
46 |
/**
|
sl@0
|
47 |
Enumeration of types of parity for serial port configuration.
|
sl@0
|
48 |
Typically, these values are used to initialize the iParity of
|
sl@0
|
49 |
TCommConfigV01 before calling DComm::Configure() or any other serial
|
sl@0
|
50 |
comm API to configure the serial port's parity setting.
|
sl@0
|
51 |
*/
|
sl@0
|
52 |
enum TParity {EParityNone,EParityEven,EParityOdd,EParityMark,EParitySpace};
|
sl@0
|
53 |
/**
|
sl@0
|
54 |
Enumeration of baud rates in bits per second for serial port configuration.
|
sl@0
|
55 |
* e.g EBps115200 is for 115200Bps data rate
|
sl@0
|
56 |
Typically, these values are used to initialize the iRate of TCommConfigV01
|
sl@0
|
57 |
before calling DComm::Configure() or any other serial comm API to configure
|
sl@0
|
58 |
the serial port's baud rate.
|
sl@0
|
59 |
*/
|
sl@0
|
60 |
enum TBps
|
sl@0
|
61 |
{
|
sl@0
|
62 |
EBps50,
|
sl@0
|
63 |
EBps75,
|
sl@0
|
64 |
EBps110,
|
sl@0
|
65 |
EBps134,
|
sl@0
|
66 |
EBps150,
|
sl@0
|
67 |
EBps300,
|
sl@0
|
68 |
EBps600,
|
sl@0
|
69 |
EBps1200,
|
sl@0
|
70 |
EBps1800,
|
sl@0
|
71 |
EBps2000,
|
sl@0
|
72 |
EBps2400,
|
sl@0
|
73 |
EBps3600,
|
sl@0
|
74 |
EBps4800,
|
sl@0
|
75 |
EBps7200,
|
sl@0
|
76 |
EBps9600,
|
sl@0
|
77 |
EBps19200,
|
sl@0
|
78 |
EBps38400,
|
sl@0
|
79 |
EBps57600,
|
sl@0
|
80 |
EBps115200,
|
sl@0
|
81 |
EBps230400,
|
sl@0
|
82 |
EBps460800,
|
sl@0
|
83 |
EBps576000,
|
sl@0
|
84 |
EBps1152000,
|
sl@0
|
85 |
EBps4000000,
|
sl@0
|
86 |
EBps921600,
|
sl@0
|
87 |
EBpsAutobaud=0x40000000,
|
sl@0
|
88 |
EBpsSpecial=0x80000000,
|
sl@0
|
89 |
};
|
sl@0
|
90 |
/**
|
sl@0
|
91 |
Enumeration of Fifo status (enable and disable) for serial port configuration.
|
sl@0
|
92 |
Typically, these values are used to initialize the iFifo of TCommConfigV01
|
sl@0
|
93 |
before calling DComm::Configure() or any other serial comm API to configure
|
sl@0
|
94 |
the serial port's fifo.
|
sl@0
|
95 |
*/
|
sl@0
|
96 |
enum TFifo
|
sl@0
|
97 |
{
|
sl@0
|
98 |
EFifoEnable,EFifoDisable,
|
sl@0
|
99 |
};
|
sl@0
|
100 |
/**
|
sl@0
|
101 |
Enumeration of SIR status (enable and disable) for serial comm configuration.
|
sl@0
|
102 |
Typically, these values are used to initialize the iSIREnable of TCommConfigV01
|
sl@0
|
103 |
before calling DComm::Configure() or any other serial comm API to configure
|
sl@0
|
104 |
the serial port's SIR (infrared) settings.
|
sl@0
|
105 |
*/
|
sl@0
|
106 |
enum TSir
|
sl@0
|
107 |
{
|
sl@0
|
108 |
ESIREnable,ESIRDisable,
|
sl@0
|
109 |
};
|
sl@0
|
110 |
|
sl@0
|
111 |
const TInt KConfigMaxTerminators=4;
|
sl@0
|
112 |
// DTE Constants
|
sl@0
|
113 |
const TUint KConfigObeyXoff=0x01;
|
sl@0
|
114 |
const TUint KConfigSendXoff=0x02;
|
sl@0
|
115 |
const TUint KConfigObeyCTS=0x04;
|
sl@0
|
116 |
const TUint KConfigFailCTS=0x08;
|
sl@0
|
117 |
const TUint KConfigObeyDSR=0x10;
|
sl@0
|
118 |
const TUint KConfigFailDSR=0x20;
|
sl@0
|
119 |
const TUint KConfigObeyDCD=0x40;
|
sl@0
|
120 |
const TUint KConfigFailDCD=0x80;
|
sl@0
|
121 |
const TUint KConfigFreeRTS=0x100;
|
sl@0
|
122 |
const TUint KConfigFreeDTR=0x200;
|
sl@0
|
123 |
// DCE Constants
|
sl@0
|
124 |
const TUint KConfigObeyDTR=0x400;
|
sl@0
|
125 |
const TUint KConfigFailDTR=0x800;
|
sl@0
|
126 |
const TUint KConfigObeyRTS=0x1000;
|
sl@0
|
127 |
const TUint KConfigFailRTS=0x2000;
|
sl@0
|
128 |
const TUint KConfigFreeDSR=0x4000;
|
sl@0
|
129 |
const TUint KConfigFreeCTS=0x8000;
|
sl@0
|
130 |
const TUint KConfigFreeDCD=0x10000;
|
sl@0
|
131 |
const TUint KConfigFreeRI=0x20000;
|
sl@0
|
132 |
const TUint KConfigWriteBufferedComplete=0x80000000;
|
sl@0
|
133 |
//
|
sl@0
|
134 |
const TUint KConfigParityErrorFail=0;
|
sl@0
|
135 |
const TUint KConfigParityErrorIgnore=0x01;
|
sl@0
|
136 |
const TUint KConfigParityErrorReplaceChar=0x02;
|
sl@0
|
137 |
const TUint KConfigXonXoffDebug=0x80000000;
|
sl@0
|
138 |
//
|
sl@0
|
139 |
const TUint KSignalCTS=0x01;
|
sl@0
|
140 |
const TUint KSignalDSR=0x02;
|
sl@0
|
141 |
const TUint KSignalDCD=0x04;
|
sl@0
|
142 |
const TUint KSignalRNG=0x08;
|
sl@0
|
143 |
const TUint KSignalRTS=0x10;
|
sl@0
|
144 |
const TUint KSignalDTR=0x20;
|
sl@0
|
145 |
const TUint KSignalBreak=0x40;
|
sl@0
|
146 |
|
sl@0
|
147 |
const TUint KSignalChanged=0x1000;
|
sl@0
|
148 |
const TUint KCTSChanged=KSignalCTS*KSignalChanged;
|
sl@0
|
149 |
const TUint KDSRChanged=KSignalDSR*KSignalChanged;
|
sl@0
|
150 |
const TUint KDCDChanged=KSignalDCD*KSignalChanged;
|
sl@0
|
151 |
const TUint KRNGChanged=KSignalRNG*KSignalChanged;
|
sl@0
|
152 |
const TUint KRTSChanged=KSignalRTS*KSignalChanged;
|
sl@0
|
153 |
const TUint KDTRChanged=KSignalDTR*KSignalChanged;
|
sl@0
|
154 |
const TUint KBreakChanged=KSignalBreak*KSignalChanged;
|
sl@0
|
155 |
|
sl@0
|
156 |
const TUint KSignalDTEOutputs=KSignalRTS|KSignalDTR;
|
sl@0
|
157 |
const TUint KSignalDTEInputs=KSignalCTS|KSignalDSR|KSignalDCD|KSignalRNG;
|
sl@0
|
158 |
const TUint KSignalDCEInputs=KSignalDTEOutputs;
|
sl@0
|
159 |
const TUint KSignalDCEOutputs=KSignalDTEInputs;
|
sl@0
|
160 |
|
sl@0
|
161 |
const TUint KConfigSIRPulseWidthMaximum=0x01;
|
sl@0
|
162 |
const TUint KConfigSIRPulseWidthMinimum=0x02;
|
sl@0
|
163 |
|
sl@0
|
164 |
// more SIRSettings for selecting the IR range
|
sl@0
|
165 |
const TUint KConfigSIRShutDown=0x10;
|
sl@0
|
166 |
const TUint KConfigSIRMinimumRange=0x20;
|
sl@0
|
167 |
const TUint KConfigSIRMediumRange=0x40;
|
sl@0
|
168 |
const TUint KConfigSIRMaximumRange=0x80;
|
sl@0
|
169 |
|
sl@0
|
170 |
/**
|
sl@0
|
171 |
Comms configuration structure.
|
sl@0
|
172 |
Class to hold the configuration settings for serial comm port
|
sl@0
|
173 |
|
sl@0
|
174 |
This class provides the serial port configuration block interface of serial comms (c32).
|
sl@0
|
175 |
A serial comm client sets up a serial port before use, by providing a configuration block.
|
sl@0
|
176 |
TCommConfigV01 is initialized with settings for serial port and used to configure the
|
sl@0
|
177 |
serial port by calling DComm::Configure(TCommConfigV01 &aConfig) or any other serial comm
|
sl@0
|
178 |
API to configure the serial port.
|
sl@0
|
179 |
*/
|
sl@0
|
180 |
class TCommConfigV01
|
sl@0
|
181 |
{
|
sl@0
|
182 |
public:
|
sl@0
|
183 |
/**
|
sl@0
|
184 |
Data rate in bits per second.
|
sl@0
|
185 |
@see TBps
|
sl@0
|
186 |
*/
|
sl@0
|
187 |
TBps iRate;
|
sl@0
|
188 |
/**
|
sl@0
|
189 |
Character width in bits.
|
sl@0
|
190 |
@see TDataBits
|
sl@0
|
191 |
*/
|
sl@0
|
192 |
TDataBits iDataBits;
|
sl@0
|
193 |
/**
|
sl@0
|
194 |
Number of stop bits.
|
sl@0
|
195 |
@see TStopBits
|
sl@0
|
196 |
*/
|
sl@0
|
197 |
TStopBits iStopBits;
|
sl@0
|
198 |
/**
|
sl@0
|
199 |
Type of parity.
|
sl@0
|
200 |
@see TParity
|
sl@0
|
201 |
*/
|
sl@0
|
202 |
TParity iParity;
|
sl@0
|
203 |
/**
|
sl@0
|
204 |
Type of Handshaking control.
|
sl@0
|
205 |
Possible values can be KConfigObeyXXX or KConfigSendXXX or KConfigFailXXX or KConfigFreeXXX
|
sl@0
|
206 |
*/
|
sl@0
|
207 |
TUint iHandshake;
|
sl@0
|
208 |
/**
|
sl@0
|
209 |
Type of error to generate on a parity failure.
|
sl@0
|
210 |
Possible values can be KConfigParityErrorFail or KConfigParityErrorIgnore or KConfigParityErrorReplaceChar
|
sl@0
|
211 |
*/
|
sl@0
|
212 |
TUint iParityError;
|
sl@0
|
213 |
/**
|
sl@0
|
214 |
FIFO status, enabled or disabled.
|
sl@0
|
215 |
@see TFifo
|
sl@0
|
216 |
*/
|
sl@0
|
217 |
TUint iFifo;
|
sl@0
|
218 |
/**
|
sl@0
|
219 |
Special data rate, not listed under TBps. Use this, when iRate is set to EBpsSpecial
|
sl@0
|
220 |
*/
|
sl@0
|
221 |
TInt iSpecialRate;
|
sl@0
|
222 |
/**
|
sl@0
|
223 |
Count of number of special characters used as terminators (<=KConfigMaxTerminators)
|
sl@0
|
224 |
*/
|
sl@0
|
225 |
TInt iTerminatorCount;
|
sl@0
|
226 |
/**
|
sl@0
|
227 |
Array of special characters which can be used as terminators
|
sl@0
|
228 |
*/
|
sl@0
|
229 |
TText8 iTerminator[KConfigMaxTerminators];
|
sl@0
|
230 |
/**
|
sl@0
|
231 |
Character used to signal the transmitter to resume sending when using XON/XOFF handshaking
|
sl@0
|
232 |
i.e character used as XON - software flow control
|
sl@0
|
233 |
*/
|
sl@0
|
234 |
TText8 iXonChar;
|
sl@0
|
235 |
/**
|
sl@0
|
236 |
Character used to signal the transmitter to suspend sending when using XON/XOFF handshaking
|
sl@0
|
237 |
i.e character used as XOFF - software flow control
|
sl@0
|
238 |
*/
|
sl@0
|
239 |
TText8 iXoffChar;
|
sl@0
|
240 |
/**
|
sl@0
|
241 |
Character used to replace the characters received with a parity error.
|
sl@0
|
242 |
This is used when iParityError is set to KConfigParityErrorReplaceChar
|
sl@0
|
243 |
*/
|
sl@0
|
244 |
TText8 iParityErrorChar;
|
sl@0
|
245 |
/**
|
sl@0
|
246 |
Switch the SIR encoding hardware on and off.
|
sl@0
|
247 |
@see TSir
|
sl@0
|
248 |
*/
|
sl@0
|
249 |
TSir iSIREnable;
|
sl@0
|
250 |
/**
|
sl@0
|
251 |
SIR hardware control setting. Possible value can be one of KConfigSIRXXX
|
sl@0
|
252 |
*/
|
sl@0
|
253 |
TUint iSIRSettings;
|
sl@0
|
254 |
};
|
sl@0
|
255 |
/**
|
sl@0
|
256 |
Package buffer for a TCommConfigV01 object.
|
sl@0
|
257 |
|
sl@0
|
258 |
TCommConfig packages the comms configuration structure TCommConfigV01 to a buffer.
|
sl@0
|
259 |
This is used with API of serial comms like RComm::Config(TDes8 &aConfig) and
|
sl@0
|
260 |
RComm::SetConfig(TDesC8 &aConfig) where config structure is passed as buffer.
|
sl@0
|
261 |
|
sl@0
|
262 |
@see TCommConfigV01
|
sl@0
|
263 |
*/
|
sl@0
|
264 |
typedef TPckgBuf<TCommConfigV01> TCommConfig;
|
sl@0
|
265 |
|
sl@0
|
266 |
// TCommConfigV02 is deprecated.
|
sl@0
|
267 |
//
|
sl@0
|
268 |
class TCommConfigV02: public TCommConfigV01
|
sl@0
|
269 |
{
|
sl@0
|
270 |
public:
|
sl@0
|
271 |
TInt iTxShutdownTimeout;
|
sl@0
|
272 |
};
|
sl@0
|
273 |
|
sl@0
|
274 |
// TCommConfig2 is deprecated
|
sl@0
|
275 |
//
|
sl@0
|
276 |
typedef TPckgBuf<TCommConfigV02> TCommConfig2;
|
sl@0
|
277 |
|
sl@0
|
278 |
//
|
sl@0
|
279 |
const TUint KCapsBps50=0x00000001;
|
sl@0
|
280 |
const TUint KCapsBps75=0x00000002;
|
sl@0
|
281 |
const TUint KCapsBps110=0x00000004;
|
sl@0
|
282 |
const TUint KCapsBps134=0x00000008;
|
sl@0
|
283 |
const TUint KCapsBps150=0x00000010;
|
sl@0
|
284 |
const TUint KCapsBps300=0x00000020;
|
sl@0
|
285 |
const TUint KCapsBps600=0x00000040;
|
sl@0
|
286 |
const TUint KCapsBps1200=0x00000080;
|
sl@0
|
287 |
const TUint KCapsBps1800=0x00000100;
|
sl@0
|
288 |
const TUint KCapsBps2000=0x00000200;
|
sl@0
|
289 |
const TUint KCapsBps2400=0x00000400;
|
sl@0
|
290 |
const TUint KCapsBps3600=0x00000800;
|
sl@0
|
291 |
const TUint KCapsBps4800=0x00001000;
|
sl@0
|
292 |
const TUint KCapsBps7200=0x00002000;
|
sl@0
|
293 |
const TUint KCapsBps9600=0x00004000;
|
sl@0
|
294 |
const TUint KCapsBps19200=0x00008000;
|
sl@0
|
295 |
const TUint KCapsBps38400=0x00010000;
|
sl@0
|
296 |
const TUint KCapsBps57600=0x00020000;
|
sl@0
|
297 |
const TUint KCapsBps115200=0x00040000;
|
sl@0
|
298 |
const TUint KCapsBps230400=0x00080000;
|
sl@0
|
299 |
const TUint KCapsBps460800=0x00100000;
|
sl@0
|
300 |
const TUint KCapsBps576000 =0x00200000;
|
sl@0
|
301 |
const TUint KCapsBps1152000=0x00400000;
|
sl@0
|
302 |
const TUint KCapsBps4000000=0x00800000;
|
sl@0
|
303 |
const TUint KCapsBps921600=0x01000000;
|
sl@0
|
304 |
const TUint KCapsBpsAutobaud=0x40000000;
|
sl@0
|
305 |
const TUint KCapsBpsSpecial=0x80000000;
|
sl@0
|
306 |
//
|
sl@0
|
307 |
const TUint KCapsData5=0x01;
|
sl@0
|
308 |
const TUint KCapsData6=0x02;
|
sl@0
|
309 |
const TUint KCapsData7=0x04;
|
sl@0
|
310 |
const TUint KCapsData8=0x08;
|
sl@0
|
311 |
//
|
sl@0
|
312 |
const TUint KCapsStop1=0x01;
|
sl@0
|
313 |
const TUint KCapsStop2=0x02;
|
sl@0
|
314 |
//
|
sl@0
|
315 |
const TUint KCapsParityNone=0x01;
|
sl@0
|
316 |
const TUint KCapsParityEven=0x02;
|
sl@0
|
317 |
const TUint KCapsParityOdd=0x04;
|
sl@0
|
318 |
const TUint KCapsParityMark=0x08;
|
sl@0
|
319 |
const TUint KCapsParitySpace=0x10;
|
sl@0
|
320 |
//
|
sl@0
|
321 |
const TUint KCapsSignalCTSSupported=0x01;
|
sl@0
|
322 |
const TUint KCapsSignalDSRSupported=0x02;
|
sl@0
|
323 |
const TUint KCapsSignalDCDSupported=0x04;
|
sl@0
|
324 |
const TUint KCapsSignalRNGSupported=0x08;
|
sl@0
|
325 |
const TUint KCapsSignalRTSSupported=0x10;
|
sl@0
|
326 |
const TUint KCapsSignalDTRSupported=0x20;
|
sl@0
|
327 |
//
|
sl@0
|
328 |
const TUint KCapsObeyXoffSupported=0x01;
|
sl@0
|
329 |
const TUint KCapsSendXoffSupported=0x02;
|
sl@0
|
330 |
const TUint KCapsObeyCTSSupported=0x04;
|
sl@0
|
331 |
const TUint KCapsFailCTSSupported=0x08;
|
sl@0
|
332 |
const TUint KCapsObeyDSRSupported=0x10;
|
sl@0
|
333 |
const TUint KCapsFailDSRSupported=0x20;
|
sl@0
|
334 |
const TUint KCapsObeyDCDSupported=0x40;
|
sl@0
|
335 |
const TUint KCapsFailDCDSupported=0x80;
|
sl@0
|
336 |
const TUint KCapsFreeRTSSupported=0x100;
|
sl@0
|
337 |
const TUint KCapsFreeDTRSupported=0x200;
|
sl@0
|
338 |
// DCE Constants
|
sl@0
|
339 |
const TUint KCapsObeyRTSSupported=0x400;
|
sl@0
|
340 |
const TUint KCapsObeyDTRSupported=0x800;
|
sl@0
|
341 |
//
|
sl@0
|
342 |
const TUint KCapsHasFifo=0x01;
|
sl@0
|
343 |
//
|
sl@0
|
344 |
const TUint KCapsSIR115kbps=0x01;
|
sl@0
|
345 |
const TUint KCapsSIR2400bpsOnly=0x02;
|
sl@0
|
346 |
const TUint KCapsSIR4Mbs=0x04;
|
sl@0
|
347 |
//
|
sl@0
|
348 |
const TUint KNotifySignalsChangeSupported=0x01;
|
sl@0
|
349 |
const TUint KNotifyRateChangeSupported=0x02;
|
sl@0
|
350 |
const TUint KNotifyDataFormatChangeSupported=0x04;
|
sl@0
|
351 |
const TUint KNotifyHandshakeChangeSupported=0x08;
|
sl@0
|
352 |
const TUint KNotifyBreakSupported=0x10;
|
sl@0
|
353 |
const TUint KNotifyFlowControlChangeSupported=0x20;
|
sl@0
|
354 |
const TUint KNotifyDataAvailableSupported=0x40;
|
sl@0
|
355 |
const TUint KNotifyOutputEmptySupported=0x80;
|
sl@0
|
356 |
//
|
sl@0
|
357 |
const TUint KCapsRoleSwitchSupported=0x01;
|
sl@0
|
358 |
//
|
sl@0
|
359 |
const TUint KCapsFlowControlStatusSupported=0x01;
|
sl@0
|
360 |
//
|
sl@0
|
361 |
const TUint KRateChanged=0x01;
|
sl@0
|
362 |
const TUint KDataFormatChanged=0x02;
|
sl@0
|
363 |
const TUint KHandshakeChanged=0x04;
|
sl@0
|
364 |
//
|
sl@0
|
365 |
|
sl@0
|
366 |
/**
|
sl@0
|
367 |
Comms capability structure.
|
sl@0
|
368 |
Class to query the capability settings for serial comm port device.
|
sl@0
|
369 |
Members of this class are filled with the capabilities of the comm port device.
|
sl@0
|
370 |
*/
|
sl@0
|
371 |
|
sl@0
|
372 |
class TCommCapsV01
|
sl@0
|
373 |
{
|
sl@0
|
374 |
public:
|
sl@0
|
375 |
/**
|
sl@0
|
376 |
Data rates supported, in bits per second.
|
sl@0
|
377 |
The value is a bitmask made by OR-ing KCapsBpsXXX values.
|
sl@0
|
378 |
Each set bit corresponds to a supported bit rate.
|
sl@0
|
379 |
*/
|
sl@0
|
380 |
TUint iRate;
|
sl@0
|
381 |
/**
|
sl@0
|
382 |
Character widths supported, in bits.
|
sl@0
|
383 |
The value is a bitmask made by OR-ing a combination of KCapsData5, KCapsData6, KCapsData7 and KCapsData8 values.
|
sl@0
|
384 |
Each set bit corresponds to a supported character width.
|
sl@0
|
385 |
*/
|
sl@0
|
386 |
TUint iDataBits;
|
sl@0
|
387 |
/**
|
sl@0
|
388 |
Number of stop bits supported.
|
sl@0
|
389 |
The value is one of KCapsStop1, KCapsStop2 or KCapsStop1|KCapsStop2.
|
sl@0
|
390 |
Each set bit corresponds to a supported number of stop bit.
|
sl@0
|
391 |
*/
|
sl@0
|
392 |
TUint iStopBits;
|
sl@0
|
393 |
/**
|
sl@0
|
394 |
Parity types supported.
|
sl@0
|
395 |
The value is a bitmask made by OR-ing a combination of KCapsParityNone, KCapsParityEven, KCapsParityOdd, KCapsParityMark and KCapsParitySpace values.
|
sl@0
|
396 |
Each set bit corresponds to a supported parity type.
|
sl@0
|
397 |
*/
|
sl@0
|
398 |
TUint iParity;
|
sl@0
|
399 |
/**
|
sl@0
|
400 |
Type of Handshaking protocols supported by the device.
|
sl@0
|
401 |
The value is a bitmask made by OR-ing a combination of KCapsObeyXXX, KCapsSendXXX, KCapsFailXXX and KCapsFreeXXX values.
|
sl@0
|
402 |
Each set bit corresponds to a supported handshaking protocol.
|
sl@0
|
403 |
*/
|
sl@0
|
404 |
TUint iHandshake;
|
sl@0
|
405 |
/**
|
sl@0
|
406 |
Type of Signals supported by the device.
|
sl@0
|
407 |
The value is a bitmask made by OR-ing a combination of KCapsSignalXXX values.
|
sl@0
|
408 |
Each set bit corresponds to a supported signal.
|
sl@0
|
409 |
*/
|
sl@0
|
410 |
TUint iSignals;
|
sl@0
|
411 |
/**
|
sl@0
|
412 |
Whether Fifo is enabled or disabled.
|
sl@0
|
413 |
Value is KCapsHasFifo if enabled, 0 otherwise
|
sl@0
|
414 |
*/
|
sl@0
|
415 |
TUint iFifo;
|
sl@0
|
416 |
/**
|
sl@0
|
417 |
Capabilities of the SIR encoding hardware.
|
sl@0
|
418 |
The value is a bitmask made by OR-ing a combination of KCapsSIR115kbps, KCapsSIR2400bpsOnly and KCapsSIR4Mbps values.
|
sl@0
|
419 |
Each set bit corresponds to a supported SIR capability.
|
sl@0
|
420 |
*/
|
sl@0
|
421 |
TUint iSIR;
|
sl@0
|
422 |
};
|
sl@0
|
423 |
/**
|
sl@0
|
424 |
Package buffer for a TCommCapsV01 object.
|
sl@0
|
425 |
|
sl@0
|
426 |
TCommCaps packages the comms capability structure TCommCapsV01 in a buffer.
|
sl@0
|
427 |
This is used by serial comms APIs to pass the capability structure as a buffer,
|
sl@0
|
428 |
for example in RComm::Caps(TDes8 &aCaps).
|
sl@0
|
429 |
|
sl@0
|
430 |
@see TCommCapsV01
|
sl@0
|
431 |
*/
|
sl@0
|
432 |
typedef TPckgBuf<TCommCapsV01> TCommCaps;
|
sl@0
|
433 |
|
sl@0
|
434 |
/**
|
sl@0
|
435 |
Comms capability structure.
|
sl@0
|
436 |
Class to query the capability settings for serial comm port.
|
sl@0
|
437 |
Members of this class are filled with the capabilities of the comm port.
|
sl@0
|
438 |
|
sl@0
|
439 |
@see TCommCapsV01
|
sl@0
|
440 |
*/
|
sl@0
|
441 |
class TCommCapsV02 : public TCommCapsV01
|
sl@0
|
442 |
{
|
sl@0
|
443 |
public:
|
sl@0
|
444 |
/**
|
sl@0
|
445 |
Specifies the notifications that are supported for the serial comm port.
|
sl@0
|
446 |
The field is a bitmask made by OR-ing a combination of:
|
sl@0
|
447 |
-KNotifySignalsChangeSupported
|
sl@0
|
448 |
-KNotifyRateChangeSupported
|
sl@0
|
449 |
-KNotifyDataFormatChangeSupported
|
sl@0
|
450 |
-KNotifyHandshakeChangeSupported
|
sl@0
|
451 |
-KNotifyBreakSupported
|
sl@0
|
452 |
-KNotifyFlowControlChangeSupported
|
sl@0
|
453 |
-KNotifyDataAvailableSupported
|
sl@0
|
454 |
-KNotifyOutputEmptySupported
|
sl@0
|
455 |
Each set bit corresponds to a supported notification type.
|
sl@0
|
456 |
*/
|
sl@0
|
457 |
TUint iNotificationCaps;
|
sl@0
|
458 |
/**
|
sl@0
|
459 |
Specifies whether Role Switch is supported or not.
|
sl@0
|
460 |
If supported the value is KCapsRoleSwitchSupported, otherwise Zero
|
sl@0
|
461 |
*/
|
sl@0
|
462 |
TUint iRoleCaps;
|
sl@0
|
463 |
/**
|
sl@0
|
464 |
Specifies whether Flow Control Status is supported or not.
|
sl@0
|
465 |
If supported the value is KCapsFlowControlStatusSupported, otherwise Zero
|
sl@0
|
466 |
*/
|
sl@0
|
467 |
TUint iFlowControlCaps;
|
sl@0
|
468 |
};
|
sl@0
|
469 |
|
sl@0
|
470 |
/**
|
sl@0
|
471 |
Package buffer for a TCommCapsV02 object.
|
sl@0
|
472 |
|
sl@0
|
473 |
TCommCaps2 packages the comms capability structure TCommCapsV02 in a buffer.
|
sl@0
|
474 |
This is used by serial comms to pass the capability structure as a buffer,
|
sl@0
|
475 |
for example in RComm::Caps(TDes8 &aCaps)
|
sl@0
|
476 |
|
sl@0
|
477 |
@see TCommCapsV02
|
sl@0
|
478 |
*/
|
sl@0
|
479 |
typedef TPckgBuf<TCommCapsV02> TCommCaps2;
|
sl@0
|
480 |
|
sl@0
|
481 |
|
sl@0
|
482 |
/**
|
sl@0
|
483 |
Comms capability structure.
|
sl@0
|
484 |
Class to hold the capability settings for serial comm port.
|
sl@0
|
485 |
|
sl@0
|
486 |
This class is used to query the capabilities of the serial comm port.
|
sl@0
|
487 |
Members of this class are filled with the capabilities of the comm port.
|
sl@0
|
488 |
|
sl@0
|
489 |
@see TCommCapsV02
|
sl@0
|
490 |
*/
|
sl@0
|
491 |
class TCommCapsV03 : public TCommCapsV02
|
sl@0
|
492 |
{
|
sl@0
|
493 |
public:
|
sl@0
|
494 |
/**
|
sl@0
|
495 |
Specifies whether break is supported or not.
|
sl@0
|
496 |
ETrue if Supported, EFalse otherwise.
|
sl@0
|
497 |
*/
|
sl@0
|
498 |
TBool iBreakSupported;
|
sl@0
|
499 |
};
|
sl@0
|
500 |
|
sl@0
|
501 |
/**
|
sl@0
|
502 |
Package buffer for a TCommCapsV03 object.
|
sl@0
|
503 |
|
sl@0
|
504 |
TCommCaps3 packages the comms capability structure TCommCapsV03 in a buffer.
|
sl@0
|
505 |
This is used by serial comms APIs to pass the capability structure as a buffer,
|
sl@0
|
506 |
for example in RComm::Caps(TDes8 &aCaps)
|
sl@0
|
507 |
|
sl@0
|
508 |
@see TCommCapsV03
|
sl@0
|
509 |
*/
|
sl@0
|
510 |
typedef TPckgBuf<TCommCapsV03> TCommCaps3;
|
sl@0
|
511 |
|
sl@0
|
512 |
/**
|
sl@0
|
513 |
Structure that holds the capabilities of the Comms factory object. Only Version is supported.
|
sl@0
|
514 |
This structure is packaged within a descriptor when passed to methods such as RDevice::GetCaps()
|
sl@0
|
515 |
*/
|
sl@0
|
516 |
class TCapsDevCommV01
|
sl@0
|
517 |
{
|
sl@0
|
518 |
public:
|
sl@0
|
519 |
/**
|
sl@0
|
520 |
Version of the device
|
sl@0
|
521 |
@see TVersion
|
sl@0
|
522 |
*/
|
sl@0
|
523 |
TVersion version;
|
sl@0
|
524 |
};
|
sl@0
|
525 |
|
sl@0
|
526 |
/**
|
sl@0
|
527 |
Comms Notification configuration structure
|
sl@0
|
528 |
Class to hold the notification configuration of the device.
|
sl@0
|
529 |
Notifications are only used with DCE (modem) comms ports.
|
sl@0
|
530 |
*/
|
sl@0
|
531 |
class TCommNotificationV01
|
sl@0
|
532 |
{
|
sl@0
|
533 |
public:
|
sl@0
|
534 |
/**
|
sl@0
|
535 |
Specifies which of the configuration members have changed
|
sl@0
|
536 |
This value is a bitmask made by OR-ing a combination of KRateChanged,KDataFormatChanged and KHandshakeChanged values.
|
sl@0
|
537 |
Each set bit corresponds to a change in the configuration notification.
|
sl@0
|
538 |
@see TCommCapsV01
|
sl@0
|
539 |
*/
|
sl@0
|
540 |
TUint iChangedMembers;
|
sl@0
|
541 |
/**
|
sl@0
|
542 |
Data rate in bits per second.
|
sl@0
|
543 |
@see TBps
|
sl@0
|
544 |
*/
|
sl@0
|
545 |
TBps iRate;
|
sl@0
|
546 |
/**
|
sl@0
|
547 |
Character width in bits.
|
sl@0
|
548 |
@see TDataBits
|
sl@0
|
549 |
*/
|
sl@0
|
550 |
TDataBits iDataBits;
|
sl@0
|
551 |
/**
|
sl@0
|
552 |
Number of stop bits.
|
sl@0
|
553 |
@see TStopBits
|
sl@0
|
554 |
*/
|
sl@0
|
555 |
TStopBits iStopBits;
|
sl@0
|
556 |
/**
|
sl@0
|
557 |
Type of parity.
|
sl@0
|
558 |
@see TParity
|
sl@0
|
559 |
*/
|
sl@0
|
560 |
TParity iParity;
|
sl@0
|
561 |
/**
|
sl@0
|
562 |
Type of Handshaking control.
|
sl@0
|
563 |
Possible values can be any combination of KConfigObeyXXX, KConfigSendXXX, KConfigFailXXX and KConfigFreeXXX.
|
sl@0
|
564 |
*/
|
sl@0
|
565 |
TUint iHandshake;
|
sl@0
|
566 |
};
|
sl@0
|
567 |
/**
|
sl@0
|
568 |
Package buffer for a TCommNotificationV01 object.
|
sl@0
|
569 |
Packages TCommNotificationV01 within a buffer.
|
sl@0
|
570 |
@see TCommNotificationV01
|
sl@0
|
571 |
*/
|
sl@0
|
572 |
typedef TPckgBuf<TCommNotificationV01> TCommNotificationPckg;
|
sl@0
|
573 |
//
|
sl@0
|
574 |
const TUint KDataAvailableNotifyFlag=0x80000000;
|
sl@0
|
575 |
//
|
sl@0
|
576 |
#ifdef _DEBUG_DEVCOMM
|
sl@0
|
577 |
class TCommDebugInfo
|
sl@0
|
578 |
{
|
sl@0
|
579 |
public:
|
sl@0
|
580 |
TBool iRxBusy;
|
sl@0
|
581 |
TBool iRxHeld;
|
sl@0
|
582 |
TInt iRxLength;
|
sl@0
|
583 |
TInt iRxOffset;
|
sl@0
|
584 |
TInt iRxIntCount;
|
sl@0
|
585 |
TInt iRxErrCount;
|
sl@0
|
586 |
TInt iRxBufCount;
|
sl@0
|
587 |
TBool iTxBusy;
|
sl@0
|
588 |
TBool iTxHeld;
|
sl@0
|
589 |
TInt iTxLength;
|
sl@0
|
590 |
TInt iTxOffset;
|
sl@0
|
591 |
TInt iTxIntCount;
|
sl@0
|
592 |
TInt iTxErrCount;
|
sl@0
|
593 |
TInt iTxBufCount;
|
sl@0
|
594 |
TBool iDrainingRxBuf;
|
sl@0
|
595 |
TBool iFillingTxBuf;
|
sl@0
|
596 |
TBool iRunningDfc;
|
sl@0
|
597 |
TInt iDfcCount;
|
sl@0
|
598 |
TInt iDfcReqSeq;
|
sl@0
|
599 |
TInt iDfcHandlerSeq;
|
sl@0
|
600 |
TInt iDoDrainSeq;
|
sl@0
|
601 |
TBool iTxDfcPend;
|
sl@0
|
602 |
TBool iRxDfcPend;
|
sl@0
|
603 |
TInt iTxChars, iRxChars;
|
sl@0
|
604 |
TInt iTxXon, iTxXoff, iRxXon, iRxXoff;
|
sl@0
|
605 |
};
|
sl@0
|
606 |
typedef TPckgBuf<TCommDebugInfo> TCommDebugInfoPckg;
|
sl@0
|
607 |
#endif
|
sl@0
|
608 |
//
|
sl@0
|
609 |
|
sl@0
|
610 |
/**
|
sl@0
|
611 |
The externally visible interface through which the clients can access serial devices.
|
sl@0
|
612 |
It also represents a user side handle to the serial device driver.
|
sl@0
|
613 |
*/
|
sl@0
|
614 |
class RBusDevComm : public RBusLogicalChannel
|
sl@0
|
615 |
{
|
sl@0
|
616 |
public:
|
sl@0
|
617 |
/**
|
sl@0
|
618 |
Serial device driver build version.
|
sl@0
|
619 |
*/
|
sl@0
|
620 |
enum TVer
|
sl@0
|
621 |
{
|
sl@0
|
622 |
/** Major Version */
|
sl@0
|
623 |
EMajorVersionNumber=1,
|
sl@0
|
624 |
/** Minor Version */
|
sl@0
|
625 |
EMinorVersionNumber=0,
|
sl@0
|
626 |
/** Build Version */
|
sl@0
|
627 |
EBuildVersionNumber=KE32BuildVersionNumber
|
sl@0
|
628 |
};
|
sl@0
|
629 |
|
sl@0
|
630 |
/**
|
sl@0
|
631 |
Asynchronous request types
|
sl@0
|
632 |
*/
|
sl@0
|
633 |
enum TRequest
|
sl@0
|
634 |
{
|
sl@0
|
635 |
/** Read request */
|
sl@0
|
636 |
ERequestRead=0x0,
|
sl@0
|
637 |
/** Cancel read request */
|
sl@0
|
638 |
ERequestReadCancel=0x1,
|
sl@0
|
639 |
/** Write reqeust */
|
sl@0
|
640 |
ERequestWrite=0x1,
|
sl@0
|
641 |
/** Cancel write request */
|
sl@0
|
642 |
ERequestWriteCancel=0x2,
|
sl@0
|
643 |
/** Break request */
|
sl@0
|
644 |
ERequestBreak=0x2,
|
sl@0
|
645 |
/** Cancel break request */
|
sl@0
|
646 |
ERequestBreakCancel=0x4,
|
sl@0
|
647 |
/** Signal change notification request */
|
sl@0
|
648 |
ERequestNotifySignalChange=0x3,
|
sl@0
|
649 |
/** Cancel signal change notification request */
|
sl@0
|
650 |
ERequestNotifySignalChangeCancel=0x8,
|
sl@0
|
651 |
};
|
sl@0
|
652 |
|
sl@0
|
653 |
/**
|
sl@0
|
654 |
Synchronous request types
|
sl@0
|
655 |
*/
|
sl@0
|
656 |
enum TControl
|
sl@0
|
657 |
{
|
sl@0
|
658 |
/** Get the current configuration */
|
sl@0
|
659 |
EControlConfig,
|
sl@0
|
660 |
/** Set the device configuration */
|
sl@0
|
661 |
EControlSetConfig,
|
sl@0
|
662 |
/** Get the device capabilities */
|
sl@0
|
663 |
EControlCaps,
|
sl@0
|
664 |
/** Read the state of Modem control signals supported */
|
sl@0
|
665 |
EControlSignals,
|
sl@0
|
666 |
/** Set the state of output modem control signals */
|
sl@0
|
667 |
EControlSetSignals,
|
sl@0
|
668 |
/** Query the driver receive buffer for data availability */
|
sl@0
|
669 |
EControlQueryReceiveBuffer,
|
sl@0
|
670 |
/** Reset the driver buffers */
|
sl@0
|
671 |
EControlResetBuffers,
|
sl@0
|
672 |
/** Get the driver receive buffer length */
|
sl@0
|
673 |
EControlReceiveBufferLength,
|
sl@0
|
674 |
/** Set the driver receive buffer length */
|
sl@0
|
675 |
EControlSetReceiveBufferLength,
|
sl@0
|
676 |
/** Get the minimum turnaround time between a receive and subsequent transmission operation */
|
sl@0
|
677 |
EControlMinTurnaroundTime,
|
sl@0
|
678 |
/** Set the minimum turnaround time between a receive and subsequent transmission operation */
|
sl@0
|
679 |
EControlSetMinTurnaroundTime,
|
sl@0
|
680 |
#ifdef _DEBUG_DEVCOMM
|
sl@0
|
681 |
/** Get debug information from the driver */
|
sl@0
|
682 |
EControlDebugInfo
|
sl@0
|
683 |
#endif
|
sl@0
|
684 |
};
|
sl@0
|
685 |
|
sl@0
|
686 |
public:
|
sl@0
|
687 |
#ifndef __KERNEL_MODE__
|
sl@0
|
688 |
|
sl@0
|
689 |
/**
|
sl@0
|
690 |
This function opens a channel and creates a handle to the serial driver.
|
sl@0
|
691 |
@param aUnit The unit number of the serial device.
|
sl@0
|
692 |
@return KErrNone, if successful;
|
sl@0
|
693 |
otherwise one of the other system-wide error codes.
|
sl@0
|
694 |
KErrPermissionDenied if the port given in aName is wrong or if the request fails the CSY's own security check;
|
sl@0
|
695 |
KErrNotSupported if this port is not supported by the CSY or the hardware;
|
sl@0
|
696 |
KErrLocked if the port has already been opened;
|
sl@0
|
697 |
KErrAccessDenied if the device driver encounteres a problem opening the hardware port.
|
sl@0
|
698 |
*/
|
sl@0
|
699 |
inline TInt Open(TInt aUnit);
|
sl@0
|
700 |
|
sl@0
|
701 |
/**
|
sl@0
|
702 |
Get the version number required by the driver
|
sl@0
|
703 |
@return The version number required by the driver
|
sl@0
|
704 |
@see TVersion
|
sl@0
|
705 |
*/
|
sl@0
|
706 |
inline TVersion VersionRequired() const;
|
sl@0
|
707 |
|
sl@0
|
708 |
/**
|
sl@0
|
709 |
Read from the channel
|
sl@0
|
710 |
@param aStatus The asynchronous request status
|
sl@0
|
711 |
@param aDes Buffer to be filled in by the driver
|
sl@0
|
712 |
*/
|
sl@0
|
713 |
inline void Read(TRequestStatus &aStatus,TDes8 &aDes);
|
sl@0
|
714 |
|
sl@0
|
715 |
/**
|
sl@0
|
716 |
Read from the channel
|
sl@0
|
717 |
@param aStatus The asynchronous request status
|
sl@0
|
718 |
@param aDes Buffer to be filled in by the driver
|
sl@0
|
719 |
@param aLength The length of the data to be read
|
sl@0
|
720 |
*/
|
sl@0
|
721 |
inline void Read(TRequestStatus &aStatus,TDes8 &aDes,TInt aLength);
|
sl@0
|
722 |
|
sl@0
|
723 |
/**
|
sl@0
|
724 |
Read one or more characters from the channel.
|
sl@0
|
725 |
If there is data in the serial driver's buffer when ReadOneOrMore() is called it will
|
sl@0
|
726 |
read as much data as possible (up to the maximum length of the supplied buffer)
|
sl@0
|
727 |
and then return.
|
sl@0
|
728 |
If there is no data in the buffer the request will complete as soon as one or more bytes arrive at the serial hardware.
|
sl@0
|
729 |
@param aStatus The asynchronous request status
|
sl@0
|
730 |
@param aDes Buffer to be filled in by the driver
|
sl@0
|
731 |
*/
|
sl@0
|
732 |
inline void ReadOneOrMore(TRequestStatus &aStatus,TDes8 &aDes);
|
sl@0
|
733 |
|
sl@0
|
734 |
/**
|
sl@0
|
735 |
Cancel a pending read request
|
sl@0
|
736 |
*/
|
sl@0
|
737 |
inline void ReadCancel();
|
sl@0
|
738 |
|
sl@0
|
739 |
/**
|
sl@0
|
740 |
Write to the channel
|
sl@0
|
741 |
@param aStatus The asynchronous request status
|
sl@0
|
742 |
@param aDes Buffer containing the data to be sent
|
sl@0
|
743 |
*/
|
sl@0
|
744 |
inline void Write(TRequestStatus &aStatus,const TDesC8 &aDes);
|
sl@0
|
745 |
|
sl@0
|
746 |
/**
|
sl@0
|
747 |
Write to the channel
|
sl@0
|
748 |
@param aStatus The asynchronous request status
|
sl@0
|
749 |
@param aDes Buffer containing the data to be sent
|
sl@0
|
750 |
@param aLength The length of the data to be sent
|
sl@0
|
751 |
*/
|
sl@0
|
752 |
inline void Write(TRequestStatus &aStatus,const TDesC8 &aDes,TInt aLength);
|
sl@0
|
753 |
|
sl@0
|
754 |
/**
|
sl@0
|
755 |
Cancel a pending write request
|
sl@0
|
756 |
*/
|
sl@0
|
757 |
inline void WriteCancel();
|
sl@0
|
758 |
|
sl@0
|
759 |
/**
|
sl@0
|
760 |
Causes a break condition to be transmitted to the receiving device
|
sl@0
|
761 |
@param aStatus The asynchronous request status
|
sl@0
|
762 |
@param aTime The time interval in microseconds after which the break condition will be released
|
sl@0
|
763 |
*/
|
sl@0
|
764 |
inline void Break(TRequestStatus &aStatus,TInt aTime);
|
sl@0
|
765 |
|
sl@0
|
766 |
/**
|
sl@0
|
767 |
Cancel a pending break request
|
sl@0
|
768 |
*/
|
sl@0
|
769 |
inline void BreakCancel();
|
sl@0
|
770 |
|
sl@0
|
771 |
/**
|
sl@0
|
772 |
Get the current configuration of the serial device
|
sl@0
|
773 |
@param aConfig A packaged object to be filled with the configuration information by the driver
|
sl@0
|
774 |
@see TCommConfigV02
|
sl@0
|
775 |
*/
|
sl@0
|
776 |
inline void Config(TDes8 &aConfig);
|
sl@0
|
777 |
|
sl@0
|
778 |
/**
|
sl@0
|
779 |
Set the cofiguration of the serial device
|
sl@0
|
780 |
@param aConfig A packaged object containing the configuration information
|
sl@0
|
781 |
@see TCommConfigV02
|
sl@0
|
782 |
*/
|
sl@0
|
783 |
inline TInt SetConfig(const TDesC8 &aConfig);
|
sl@0
|
784 |
|
sl@0
|
785 |
/**
|
sl@0
|
786 |
Get the capabilities of the serial device.
|
sl@0
|
787 |
@param aCaps A packaged object to be filled with the capabilities of the device.
|
sl@0
|
788 |
@see TCommCapsV03
|
sl@0
|
789 |
*/
|
sl@0
|
790 |
inline void Caps(TDes8 &aCaps);
|
sl@0
|
791 |
|
sl@0
|
792 |
/**
|
sl@0
|
793 |
Get the status of the control lines
|
sl@0
|
794 |
@return A bitmask of KSignalCTS, KSignalDSR, KSignalDCD, KSignalRNG,
|
sl@0
|
795 |
KSignalRTS, KSignalDTR, KSignalBreak
|
sl@0
|
796 |
*/
|
sl@0
|
797 |
inline TUint Signals();
|
sl@0
|
798 |
|
sl@0
|
799 |
/**
|
sl@0
|
800 |
Set and clear the control lines
|
sl@0
|
801 |
@param aSetMask Bitmask of signals to set
|
sl@0
|
802 |
@param aClearMask Bitmask of signals to clear
|
sl@0
|
803 |
@see Signals for a list of signals
|
sl@0
|
804 |
*/
|
sl@0
|
805 |
inline void SetSignals(TUint aSetMask,TUint aClearMask);
|
sl@0
|
806 |
|
sl@0
|
807 |
/**
|
sl@0
|
808 |
Get the number of unread characters in the receive buffer of the driver
|
sl@0
|
809 |
@return The number of unread characters
|
sl@0
|
810 |
*/
|
sl@0
|
811 |
inline TInt QueryReceiveBuffer();
|
sl@0
|
812 |
|
sl@0
|
813 |
/**
|
sl@0
|
814 |
Reset the receive and transmit buffers.
|
sl@0
|
815 |
*/
|
sl@0
|
816 |
inline void ResetBuffers();
|
sl@0
|
817 |
|
sl@0
|
818 |
/**
|
sl@0
|
819 |
Get the length of the receive buffer
|
sl@0
|
820 |
@return The length of the receive buffer
|
sl@0
|
821 |
*/
|
sl@0
|
822 |
inline TInt ReceiveBufferLength();
|
sl@0
|
823 |
|
sl@0
|
824 |
/**
|
sl@0
|
825 |
Set the length of the receive buffer
|
sl@0
|
826 |
@param aLength The length of the receive buffer to be set
|
sl@0
|
827 |
*/
|
sl@0
|
828 |
inline TInt SetReceiveBufferLength(TInt aLength);
|
sl@0
|
829 |
|
sl@0
|
830 |
/**
|
sl@0
|
831 |
Request notification when one of the signals change.
|
sl@0
|
832 |
The signals that could change are KSignalCTS, KSignalDSR, KSignalDCD, KSignalRNG,
|
sl@0
|
833 |
KSignalRTS, KSignalDTR, KSignalBreak.
|
sl@0
|
834 |
@param aStatus The asynchronous request status
|
sl@0
|
835 |
@param aSignals Pointer to the bitmask containing the changed signals
|
sl@0
|
836 |
@param aSignalMask Bitmask of signals to be monitored
|
sl@0
|
837 |
*/
|
sl@0
|
838 |
inline void NotifySignalChange(TRequestStatus& aStatus,TUint& aSignals,TUint aSignalMask=0x3F);
|
sl@0
|
839 |
|
sl@0
|
840 |
/**
|
sl@0
|
841 |
Cancel a pending signal change notification request
|
sl@0
|
842 |
*/
|
sl@0
|
843 |
inline void NotifySignalChangeCancel();
|
sl@0
|
844 |
|
sl@0
|
845 |
/**
|
sl@0
|
846 |
Request notification when there is data available to be read from the driver receive buffer
|
sl@0
|
847 |
@param aStatus The asynchronous request status
|
sl@0
|
848 |
*/
|
sl@0
|
849 |
inline void NotifyReceiveDataAvailable(TRequestStatus& aStatus);
|
sl@0
|
850 |
|
sl@0
|
851 |
/**
|
sl@0
|
852 |
Cancel a pending data notification request
|
sl@0
|
853 |
*/
|
sl@0
|
854 |
inline void NotifyReceiveDataAvailableCancel();
|
sl@0
|
855 |
|
sl@0
|
856 |
/**
|
sl@0
|
857 |
Get the minimum turnaround time before a transmission can begin after a receive operation
|
sl@0
|
858 |
@return The turnaround time in microseconds
|
sl@0
|
859 |
*/
|
sl@0
|
860 |
inline TUint MinTurnaroundTime();
|
sl@0
|
861 |
|
sl@0
|
862 |
/**
|
sl@0
|
863 |
Set the minimum turnaround time between a receive and the next transmission operation
|
sl@0
|
864 |
@param aMicroSeconds The turnaround time in microseconds
|
sl@0
|
865 |
*/
|
sl@0
|
866 |
inline TInt SetMinTurnaroundTime(TUint aMicroSeconds);
|
sl@0
|
867 |
|
sl@0
|
868 |
#ifdef _DEBUG_DEVCOMM
|
sl@0
|
869 |
/**
|
sl@0
|
870 |
Get the debug information
|
sl@0
|
871 |
@param aInfo a packaged object to be filled by the driver with debug information
|
sl@0
|
872 |
@see TCommDebugInfo
|
sl@0
|
873 |
*/
|
sl@0
|
874 |
inline void DebugInfo(TDes8 &aInfo);
|
sl@0
|
875 |
#endif
|
sl@0
|
876 |
#endif
|
sl@0
|
877 |
};
|
sl@0
|
878 |
|
sl@0
|
879 |
class RBusDevCommDCE : public RBusLogicalChannel
|
sl@0
|
880 |
{
|
sl@0
|
881 |
public:
|
sl@0
|
882 |
enum TVer {EMajorVersionNumber=1,EMinorVersionNumber=0,EBuildVersionNumber=KE32BuildVersionNumber};
|
sl@0
|
883 |
enum TRequest
|
sl@0
|
884 |
{
|
sl@0
|
885 |
ERequestRead=0x0,ERequestReadCancel=0x1,
|
sl@0
|
886 |
ERequestWrite=0x1,ERequestWriteCancel=0x2,
|
sl@0
|
887 |
ERequestBreak=0x2,ERequestBreakCancel=0x4,
|
sl@0
|
888 |
ERequestNotifySignalChange=0x3,ERequestNotifySignalChangeCancel=0x8,
|
sl@0
|
889 |
ERequestNotifyFlowControlChange=0x4,ERequestNotifyFlowControlChangeCancel=0x10,
|
sl@0
|
890 |
ERequestNotifyConfigChange=0x5,ERequestNotifyConfigChangeCancel=0x20
|
sl@0
|
891 |
};
|
sl@0
|
892 |
enum TControl
|
sl@0
|
893 |
{
|
sl@0
|
894 |
EControlConfig,EControlSetConfig,EControlCaps,
|
sl@0
|
895 |
EControlSignals,EControlSetSignals,
|
sl@0
|
896 |
EControlQueryReceiveBuffer,EControlResetBuffers,
|
sl@0
|
897 |
EControlReceiveBufferLength,EControlSetReceiveBufferLength,
|
sl@0
|
898 |
EControlFlowControlStatus,
|
sl@0
|
899 |
#ifdef _DEBUG_DEVCOMM
|
sl@0
|
900 |
EControlDebugInfo
|
sl@0
|
901 |
#endif
|
sl@0
|
902 |
};
|
sl@0
|
903 |
public:
|
sl@0
|
904 |
#ifndef __KERNEL_MODE__
|
sl@0
|
905 |
inline TInt Open(TInt aUnit);
|
sl@0
|
906 |
inline TVersion VersionRequired() const;
|
sl@0
|
907 |
inline void Read(TRequestStatus &aStatus,TDes8 &aDes);
|
sl@0
|
908 |
inline void Read(TRequestStatus &aStatus,TDes8 &aDes,TInt aLength);
|
sl@0
|
909 |
inline void ReadOneOrMore(TRequestStatus &aStatus,TDes8 &aDes);
|
sl@0
|
910 |
inline void ReadCancel();
|
sl@0
|
911 |
inline void Write(TRequestStatus &aStatus,const TDesC8 &aDes);
|
sl@0
|
912 |
inline void Write(TRequestStatus &aStatus,const TDesC8 &aDes,TInt aLength);
|
sl@0
|
913 |
inline void WriteCancel();
|
sl@0
|
914 |
inline void Break(TRequestStatus &aStatus,TInt aTime);
|
sl@0
|
915 |
inline void BreakCancel();
|
sl@0
|
916 |
inline void Config(TDes8 &aConfig);
|
sl@0
|
917 |
inline TInt SetConfig(const TDesC8 &aConfig);
|
sl@0
|
918 |
inline void Caps(TDes8 &aCaps);
|
sl@0
|
919 |
inline TUint Signals();
|
sl@0
|
920 |
inline void SetSignals(TUint aSetMask,TUint aClearMask);
|
sl@0
|
921 |
inline TInt QueryReceiveBuffer();
|
sl@0
|
922 |
inline void ResetBuffers();
|
sl@0
|
923 |
inline TInt ReceiveBufferLength();
|
sl@0
|
924 |
inline TInt SetReceiveBufferLength(TInt aLength);
|
sl@0
|
925 |
inline void NotifySignalChange(TRequestStatus& aStatus,TUint& aSignals,TUint aSignalMask=0x3F);
|
sl@0
|
926 |
inline void NotifySignalChangeCancel();
|
sl@0
|
927 |
inline void NotifyReceiveDataAvailable(TRequestStatus& aStatus);
|
sl@0
|
928 |
inline void NotifyReceiveDataAvailableCancel();
|
sl@0
|
929 |
inline void NotifyFlowControlChange(TRequestStatus& aStatus);
|
sl@0
|
930 |
inline void NotifyFlowControlChangeCancel();
|
sl@0
|
931 |
inline void GetFlowControlStatus(TFlowControl& aFlowControl);
|
sl@0
|
932 |
inline void NotifyConfigChange(TRequestStatus& aStatus, TDes8& aNewConfig);
|
sl@0
|
933 |
inline void NotifyConfigChangeCancel();
|
sl@0
|
934 |
#ifdef _DEBUG_DEVCOMM
|
sl@0
|
935 |
inline void DebugInfo(TDes8 &aInfo);
|
sl@0
|
936 |
#endif
|
sl@0
|
937 |
#endif
|
sl@0
|
938 |
};
|
sl@0
|
939 |
|
sl@0
|
940 |
#include <d32comm.inl>
|
sl@0
|
941 |
#endif
|