epoc32/include/d32comm.h
branchSymbian2
changeset 2 2fe1408b6811
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
       
     1 // Copyright (c) 1995-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // 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
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // e32\include\d32comm.h
       
    15 // 
       
    16 //
       
    17 
       
    18 //#define _DEBUG_DEVCOMM
       
    19 
       
    20 /**
       
    21 @file
       
    22 @publishedPartner
       
    23 @released
       
    24 */
       
    25 
       
    26 #ifndef __D32COMM_H__
       
    27 #define __D32COMM_H__
       
    28 #include <e32cmn.h>
       
    29 #include <e32ver.h>
       
    30 
       
    31 /**
       
    32  Enumeration of number of data bits for serial port configuration.
       
    33  Typically, these values are used to initialize the iDataBits of 
       
    34  TCommConfigV01 before calling DComm::Configure() or any other serial
       
    35  comm API to configure the serial port's databits size.
       
    36  */
       
    37 enum TDataBits {EData5,EData6,EData7,EData8};
       
    38 /**
       
    39  Enumeration of number of stop bits for serial port configuration.
       
    40  Typically, these values are used to initialize the iStopBits of 
       
    41  TCommConfigV01 before calling DComm::Configure() or any other serial
       
    42  comm API to configure the serial port's stopbits.
       
    43  */
       
    44 enum TStopBits {EStop1,EStop2};
       
    45 /**
       
    46  Enumeration of types of parity for serial port configuration.
       
    47  Typically, these values are used to initialize the iParity of 
       
    48  TCommConfigV01 before calling DComm::Configure() or any other serial
       
    49  comm API to configure the serial port's parity setting.
       
    50  */
       
    51 enum TParity {EParityNone,EParityEven,EParityOdd,EParityMark,EParitySpace};
       
    52 /**
       
    53  Enumeration of baud rates in bits per second for serial port configuration.
       
    54  * e.g EBps115200 is for 115200Bps data rate  
       
    55  Typically, these values are used to initialize the iRate of TCommConfigV01 
       
    56  before calling DComm::Configure() or any other serial comm API to configure
       
    57  the serial port's baud rate.
       
    58  */
       
    59 enum TBps
       
    60 	{
       
    61 	EBps50,
       
    62 	EBps75,
       
    63 	EBps110,
       
    64 	EBps134,
       
    65 	EBps150,
       
    66 	EBps300,
       
    67 	EBps600,
       
    68 	EBps1200,
       
    69 	EBps1800,
       
    70 	EBps2000,
       
    71 	EBps2400,
       
    72 	EBps3600,
       
    73 	EBps4800,
       
    74 	EBps7200,
       
    75 	EBps9600,
       
    76 	EBps19200,
       
    77 	EBps38400,
       
    78 	EBps57600,
       
    79 	EBps115200,
       
    80 	EBps230400,
       
    81 	EBps460800,
       
    82 	EBps576000,
       
    83 	EBps1152000,
       
    84 	EBps4000000,
       
    85 	EBps921600,
       
    86 	EBpsAutobaud=0x40000000,
       
    87 	EBpsSpecial=0x80000000,
       
    88 	};
       
    89 /**
       
    90  Enumeration of Fifo status (enable and disable) for serial port configuration.
       
    91  Typically, these values are used to initialize the iFifo of TCommConfigV01 
       
    92  before calling DComm::Configure() or any other serial comm API to configure
       
    93  the serial port's fifo.
       
    94  */
       
    95 enum TFifo
       
    96 	{
       
    97 	EFifoEnable,EFifoDisable,
       
    98 	};
       
    99 /**
       
   100  Enumeration of SIR status (enable and disable) for serial comm configuration.
       
   101  Typically, these values are used to initialize the iSIREnable of TCommConfigV01 
       
   102  before calling DComm::Configure() or any other serial comm API to configure
       
   103  the serial port's SIR (infrared) settings.
       
   104  */
       
   105 enum TSir 
       
   106 	{
       
   107 	ESIREnable,ESIRDisable,
       
   108 	};
       
   109 
       
   110 enum TFlowControl
       
   111 	{
       
   112 	EFlowControlOn,EFlowControlOff
       
   113 	};
       
   114 //
       
   115 
       
   116 const TInt KConfigMaxTerminators=4;
       
   117 // DTE Constants
       
   118 const TUint KConfigObeyXoff=0x01;
       
   119 const TUint KConfigSendXoff=0x02;
       
   120 const TUint KConfigObeyCTS=0x04;
       
   121 const TUint KConfigFailCTS=0x08;
       
   122 const TUint KConfigObeyDSR=0x10;
       
   123 const TUint KConfigFailDSR=0x20;
       
   124 const TUint KConfigObeyDCD=0x40;
       
   125 const TUint KConfigFailDCD=0x80;
       
   126 const TUint KConfigFreeRTS=0x100;
       
   127 const TUint KConfigFreeDTR=0x200;
       
   128 // DCE Constants
       
   129 const TUint KConfigObeyDTR=0x400;
       
   130 const TUint KConfigFailDTR=0x800;
       
   131 const TUint KConfigObeyRTS=0x1000;
       
   132 const TUint KConfigFailRTS=0x2000;
       
   133 const TUint KConfigFreeDSR=0x4000;
       
   134 const TUint KConfigFreeCTS=0x8000;
       
   135 const TUint KConfigFreeDCD=0x10000;
       
   136 const TUint KConfigFreeRI=0x20000;
       
   137 const TUint KConfigWriteBufferedComplete=0x80000000;
       
   138 //
       
   139 const TUint KConfigParityErrorFail=0;
       
   140 const TUint KConfigParityErrorIgnore=0x01;
       
   141 const TUint KConfigParityErrorReplaceChar=0x02;
       
   142 const TUint KConfigXonXoffDebug=0x80000000;
       
   143 //
       
   144 const TUint KSignalCTS=0x01;
       
   145 const TUint KSignalDSR=0x02;
       
   146 const TUint KSignalDCD=0x04;
       
   147 const TUint KSignalRNG=0x08;
       
   148 const TUint KSignalRTS=0x10; 
       
   149 const TUint KSignalDTR=0x20;
       
   150 const TUint KSignalBreak=0x40;
       
   151 
       
   152 const TUint KSignalChanged=0x1000;
       
   153 const TUint KCTSChanged=KSignalCTS*KSignalChanged;
       
   154 const TUint KDSRChanged=KSignalDSR*KSignalChanged;
       
   155 const TUint KDCDChanged=KSignalDCD*KSignalChanged;
       
   156 const TUint KRNGChanged=KSignalRNG*KSignalChanged;
       
   157 const TUint KRTSChanged=KSignalRTS*KSignalChanged;
       
   158 const TUint KDTRChanged=KSignalDTR*KSignalChanged;
       
   159 const TUint KBreakChanged=KSignalBreak*KSignalChanged;
       
   160 
       
   161 const TUint KSignalDTEOutputs=KSignalRTS|KSignalDTR;
       
   162 const TUint KSignalDTEInputs=KSignalCTS|KSignalDSR|KSignalDCD|KSignalRNG;
       
   163 const TUint KSignalDCEInputs=KSignalDTEOutputs;
       
   164 const TUint KSignalDCEOutputs=KSignalDTEInputs;
       
   165 
       
   166 const TUint KConfigSIRPulseWidthMaximum=0x01;
       
   167 const TUint KConfigSIRPulseWidthMinimum=0x02;
       
   168 
       
   169 // more SIRSettings for selecting the IR range
       
   170 const TUint KConfigSIRShutDown=0x10;
       
   171 const TUint KConfigSIRMinimumRange=0x20;
       
   172 const TUint KConfigSIRMediumRange=0x40;
       
   173 const TUint KConfigSIRMaximumRange=0x80;
       
   174 
       
   175 /**
       
   176  Comms configuration structure.
       
   177  Class to hold the configuration settings for serial comm port
       
   178  
       
   179  This class provides the serial port configuration block interface of serial comms (c32).
       
   180  A serial comm client sets up a serial port before use, by providing a configuration block. 
       
   181  TCommConfigV01 is initialized with settings for serial port and used to configure the 
       
   182  serial port by calling DComm::Configure(TCommConfigV01 &aConfig) or any other serial comm 
       
   183  API to configure the serial port.
       
   184  */
       
   185 class TCommConfigV01
       
   186     {
       
   187 public:
       
   188 	/** 
       
   189 	 Data rate in bits per second.
       
   190 	 @see TBps 	
       
   191 	 */
       
   192 	TBps iRate;
       
   193 	/** 
       
   194 	 Character width in bits.
       
   195 	 @see TDataBits
       
   196 	 */	
       
   197 	TDataBits iDataBits;
       
   198 	/**
       
   199 	 Number of stop bits.
       
   200 	 @see TStopBits
       
   201 	 */
       
   202 	TStopBits iStopBits;
       
   203 	/**
       
   204 	 Type of parity.
       
   205 	 @see TParity 
       
   206 	 */
       
   207 	TParity iParity;
       
   208 	/**
       
   209 	 Type of Handshaking control.
       
   210 	 Possible values can be KConfigObeyXXX or KConfigSendXXX or KConfigFailXXX or KConfigFreeXXX
       
   211 	 */
       
   212 	TUint iHandshake;
       
   213 	/**
       
   214 	 Type of error to generate on a parity failure.
       
   215 	 Possible values can be KConfigParityErrorFail or KConfigParityErrorIgnore or KConfigParityErrorReplaceChar
       
   216 	 */
       
   217 	TUint iParityError;
       
   218 	/**
       
   219 	 FIFO status, enabled or disabled.
       
   220 	 @see TFifo 
       
   221 	 */
       
   222 	TUint iFifo;
       
   223 	/**
       
   224 	 Special data rate, not listed under TBps. Use this, when iRate is set to EBpsSpecial 
       
   225 	 */
       
   226 	TInt iSpecialRate;
       
   227 	/**
       
   228 	 Count of number of special characters used as terminators (<=KConfigMaxTerminators) 
       
   229 	 */				
       
   230 	TInt iTerminatorCount;
       
   231 	/**
       
   232 	 Array of special characters which can be used as terminators 
       
   233 	 */
       
   234 	TText8 iTerminator[KConfigMaxTerminators];
       
   235 	/**
       
   236 	 Character used to signal the transmitter to resume sending when using XON/XOFF handshaking
       
   237 	 i.e character used as XON - software flow control
       
   238 	 */
       
   239 	TText8 iXonChar;
       
   240 	/**
       
   241 	 Character used to signal the transmitter to suspend sending when using XON/XOFF handshaking
       
   242 	 i.e character used as XOFF - software flow control
       
   243 	 */
       
   244 	TText8 iXoffChar;
       
   245 	/**
       
   246 	 Character used to replace the characters received with a parity error.
       
   247 	 This is used when iParityError is set to KConfigParityErrorReplaceChar 
       
   248 	 */	
       
   249 	TText8 iParityErrorChar;
       
   250 	/**
       
   251 	 Switch the SIR encoding hardware on and off.
       
   252 	 @see TSir
       
   253 	 */
       
   254 	TSir iSIREnable;
       
   255 	/**
       
   256 	 SIR hardware control setting. Possible value can be one of KConfigSIRXXX
       
   257 	 */
       
   258 	TUint iSIRSettings;
       
   259 	};
       
   260 /** 
       
   261  Package buffer for a TCommConfigV01 object.
       
   262  
       
   263  TCommConfig packages the comms configuration structure TCommConfigV01 to a buffer. 
       
   264  This is used with API of serial comms like RComm::Config(TDes8 &aConfig) and 
       
   265  RComm::SetConfig(TDesC8 &aConfig) where config structure is passed as buffer.
       
   266  
       
   267  @see TCommConfigV01
       
   268  */		
       
   269 typedef TPckgBuf<TCommConfigV01> TCommConfig;
       
   270 
       
   271 // TCommConfigV02 is deprecated.
       
   272 //
       
   273 class TCommConfigV02: public TCommConfigV01
       
   274 	{
       
   275 public:		
       
   276 	TInt iTxShutdownTimeout;
       
   277 	};
       
   278 
       
   279 // TCommConfig2 is deprecated
       
   280 // 
       
   281 typedef TPckgBuf<TCommConfigV02> TCommConfig2;
       
   282 
       
   283 //
       
   284 const TUint KCapsBps50=0x00000001;
       
   285 const TUint KCapsBps75=0x00000002;
       
   286 const TUint KCapsBps110=0x00000004;
       
   287 const TUint KCapsBps134=0x00000008;
       
   288 const TUint KCapsBps150=0x00000010;
       
   289 const TUint KCapsBps300=0x00000020;
       
   290 const TUint KCapsBps600=0x00000040;
       
   291 const TUint KCapsBps1200=0x00000080;
       
   292 const TUint KCapsBps1800=0x00000100;
       
   293 const TUint KCapsBps2000=0x00000200;
       
   294 const TUint KCapsBps2400=0x00000400;
       
   295 const TUint KCapsBps3600=0x00000800;
       
   296 const TUint KCapsBps4800=0x00001000;
       
   297 const TUint KCapsBps7200=0x00002000;
       
   298 const TUint KCapsBps9600=0x00004000;
       
   299 const TUint KCapsBps19200=0x00008000;
       
   300 const TUint KCapsBps38400=0x00010000;
       
   301 const TUint KCapsBps57600=0x00020000;
       
   302 const TUint KCapsBps115200=0x00040000;
       
   303 const TUint KCapsBps230400=0x00080000;
       
   304 const TUint KCapsBps460800=0x00100000;
       
   305 const TUint KCapsBps576000 =0x00200000;
       
   306 const TUint KCapsBps1152000=0x00400000;
       
   307 const TUint KCapsBps4000000=0x00800000;
       
   308 const TUint KCapsBps921600=0x01000000;
       
   309 const TUint KCapsBpsAutobaud=0x40000000;
       
   310 const TUint KCapsBpsSpecial=0x80000000;
       
   311 //
       
   312 const TUint KCapsData5=0x01;
       
   313 const TUint KCapsData6=0x02;
       
   314 const TUint KCapsData7=0x04;
       
   315 const TUint KCapsData8=0x08;
       
   316 //
       
   317 const TUint KCapsStop1=0x01;
       
   318 const TUint KCapsStop2=0x02;
       
   319 //
       
   320 const TUint KCapsParityNone=0x01;
       
   321 const TUint KCapsParityEven=0x02;
       
   322 const TUint KCapsParityOdd=0x04;
       
   323 const TUint KCapsParityMark=0x08;
       
   324 const TUint KCapsParitySpace=0x10;
       
   325 //
       
   326 const TUint KCapsSignalCTSSupported=0x01;
       
   327 const TUint KCapsSignalDSRSupported=0x02;
       
   328 const TUint KCapsSignalDCDSupported=0x04;
       
   329 const TUint KCapsSignalRNGSupported=0x08;
       
   330 const TUint KCapsSignalRTSSupported=0x10;
       
   331 const TUint KCapsSignalDTRSupported=0x20;
       
   332 //
       
   333 const TUint KCapsObeyXoffSupported=0x01;
       
   334 const TUint KCapsSendXoffSupported=0x02;
       
   335 const TUint KCapsObeyCTSSupported=0x04;
       
   336 const TUint KCapsFailCTSSupported=0x08;
       
   337 const TUint KCapsObeyDSRSupported=0x10;
       
   338 const TUint KCapsFailDSRSupported=0x20;
       
   339 const TUint KCapsObeyDCDSupported=0x40;
       
   340 const TUint KCapsFailDCDSupported=0x80;
       
   341 const TUint KCapsFreeRTSSupported=0x100;
       
   342 const TUint KCapsFreeDTRSupported=0x200;
       
   343 // DCE Constants
       
   344 const TUint KCapsObeyRTSSupported=0x400;
       
   345 const TUint KCapsObeyDTRSupported=0x800;
       
   346 //
       
   347 const TUint KCapsHasFifo=0x01;
       
   348 //
       
   349 const TUint KCapsSIR115kbps=0x01;
       
   350 const TUint KCapsSIR2400bpsOnly=0x02;
       
   351 const TUint KCapsSIR4Mbs=0x04;
       
   352 //
       
   353 const TUint KNotifySignalsChangeSupported=0x01;
       
   354 const TUint KNotifyRateChangeSupported=0x02;
       
   355 const TUint KNotifyDataFormatChangeSupported=0x04;
       
   356 const TUint KNotifyHandshakeChangeSupported=0x08;
       
   357 const TUint KNotifyBreakSupported=0x10;
       
   358 const TUint KNotifyFlowControlChangeSupported=0x20;
       
   359 const TUint KNotifyDataAvailableSupported=0x40;
       
   360 const TUint KNotifyOutputEmptySupported=0x80;
       
   361 //
       
   362 const TUint KCapsRoleSwitchSupported=0x01;
       
   363 //
       
   364 const TUint KCapsFlowControlStatusSupported=0x01;
       
   365 //
       
   366 const TUint KRateChanged=0x01;
       
   367 const TUint KDataFormatChanged=0x02;
       
   368 const TUint KHandshakeChanged=0x04;
       
   369 //
       
   370 class TCommCapsV01
       
   371 	{
       
   372 public:
       
   373 	TUint iRate;
       
   374 	TUint iDataBits;
       
   375 	TUint iStopBits;
       
   376 	TUint iParity;
       
   377 	TUint iHandshake;
       
   378 	TUint iSignals;
       
   379 	TUint iFifo;
       
   380 	TUint iSIR;
       
   381 	};
       
   382 typedef TPckgBuf<TCommCapsV01> TCommCaps;
       
   383 
       
   384 class TCommCapsV02 : public TCommCapsV01
       
   385 	{
       
   386 public:
       
   387 	TUint iNotificationCaps;
       
   388 	TUint iRoleCaps;
       
   389 	TUint iFlowControlCaps;
       
   390 	};
       
   391 typedef TPckgBuf<TCommCapsV02> TCommCaps2;
       
   392 
       
   393 class TCommCapsV03 : public TCommCapsV02
       
   394 	{
       
   395 public:
       
   396 	TBool iBreakSupported;
       
   397 	};
       
   398 typedef TPckgBuf<TCommCapsV03> TCommCaps3;
       
   399 
       
   400 //
       
   401 class TCapsDevCommV01
       
   402 	{
       
   403 public:
       
   404 	TVersion version;
       
   405 	};
       
   406 
       
   407 class TCommNotificationV01
       
   408 	{
       
   409 public:
       
   410 	TUint iChangedMembers;
       
   411 	TBps iRate;
       
   412 	TDataBits iDataBits;
       
   413 	TStopBits iStopBits;
       
   414 	TParity iParity;
       
   415 	TUint iHandshake;
       
   416 	};
       
   417 typedef TPckgBuf<TCommNotificationV01> TCommNotificationPckg;
       
   418 //
       
   419 const TUint KDataAvailableNotifyFlag=0x80000000;
       
   420 //
       
   421 #ifdef _DEBUG_DEVCOMM
       
   422 class TCommDebugInfo
       
   423 	{
       
   424 public:
       
   425 	TBool iRxBusy;
       
   426 	TBool iRxHeld;
       
   427 	TInt iRxLength;
       
   428 	TInt iRxOffset;
       
   429 	TInt iRxIntCount;
       
   430 	TInt iRxErrCount;
       
   431 	TInt iRxBufCount;
       
   432 	TBool iTxBusy;
       
   433 	TBool iTxHeld;
       
   434 	TInt iTxLength;
       
   435 	TInt iTxOffset;
       
   436 	TInt iTxIntCount;
       
   437 	TInt iTxErrCount;
       
   438 	TInt iTxBufCount;
       
   439 	TBool iDrainingRxBuf;
       
   440 	TBool iFillingTxBuf;
       
   441 	TBool iRunningDfc;
       
   442 	TInt iDfcCount;
       
   443 	TInt iDfcReqSeq;
       
   444 	TInt iDfcHandlerSeq;
       
   445 	TInt iDoDrainSeq;
       
   446 	TBool iTxDfcPend;
       
   447 	TBool iRxDfcPend;
       
   448 	TInt iTxChars, iRxChars;
       
   449 	TInt iTxXon, iTxXoff, iRxXon, iRxXoff;
       
   450 	};
       
   451 typedef TPckgBuf<TCommDebugInfo> TCommDebugInfoPckg;
       
   452 #endif
       
   453 //
       
   454 class RBusDevComm : public RBusLogicalChannel
       
   455 	{
       
   456 public:
       
   457 	enum TVer {EMajorVersionNumber=1,EMinorVersionNumber=0,EBuildVersionNumber=KE32BuildVersionNumber};
       
   458 	enum TRequest
       
   459 		{
       
   460 		ERequestRead=0x0,ERequestReadCancel=0x1,
       
   461 		ERequestWrite=0x1,ERequestWriteCancel=0x2,
       
   462 		ERequestBreak=0x2,ERequestBreakCancel=0x4,
       
   463 		ERequestNotifySignalChange=0x3,ERequestNotifySignalChangeCancel=0x8,
       
   464 		};
       
   465 	enum TControl
       
   466 		{
       
   467 		EControlConfig,EControlSetConfig,EControlCaps,
       
   468 		EControlSignals,EControlSetSignals,
       
   469 		EControlQueryReceiveBuffer,EControlResetBuffers,
       
   470 		EControlReceiveBufferLength,EControlSetReceiveBufferLength,
       
   471 		EControlMinTurnaroundTime,EControlSetMinTurnaroundTime,
       
   472 #ifdef _DEBUG_DEVCOMM
       
   473 		EControlDebugInfo
       
   474 #endif
       
   475 		};
       
   476 public:
       
   477 #ifndef __KERNEL_MODE__
       
   478 	inline TInt Open(TInt aUnit);
       
   479 	inline TVersion VersionRequired() const;
       
   480 	inline void Read(TRequestStatus &aStatus,TDes8 &aDes);
       
   481 	inline void Read(TRequestStatus &aStatus,TDes8 &aDes,TInt aLength);
       
   482 	inline void ReadOneOrMore(TRequestStatus &aStatus,TDes8 &aDes);
       
   483 	inline void ReadCancel();
       
   484 	inline void Write(TRequestStatus &aStatus,const TDesC8 &aDes);
       
   485 	inline void Write(TRequestStatus &aStatus,const TDesC8 &aDes,TInt aLength);
       
   486 	inline void WriteCancel();
       
   487 	inline void Break(TRequestStatus &aStatus,TInt aTime);
       
   488 	inline void BreakCancel();
       
   489 	inline void Config(TDes8 &aConfig);
       
   490 	inline TInt SetConfig(const TDesC8 &aConfig);
       
   491 	inline void Caps(TDes8 &aCaps);
       
   492 	inline TUint Signals();
       
   493 	inline void SetSignals(TUint aSetMask,TUint aClearMask);
       
   494 	inline TInt QueryReceiveBuffer();
       
   495 	inline void ResetBuffers();
       
   496 	inline TInt ReceiveBufferLength();
       
   497 	inline TInt SetReceiveBufferLength(TInt aLength);
       
   498 	inline void NotifySignalChange(TRequestStatus& aStatus,TUint& aSignals,TUint aSignalMask=0x3F);
       
   499 	inline void NotifySignalChangeCancel();
       
   500 	inline void NotifyReceiveDataAvailable(TRequestStatus& aStatus);
       
   501 	inline void NotifyReceiveDataAvailableCancel();
       
   502 	inline TUint MinTurnaroundTime();
       
   503 	inline TInt SetMinTurnaroundTime(TUint aMicroSeconds);
       
   504 #ifdef _DEBUG_DEVCOMM
       
   505 	inline void DebugInfo(TDes8 &aInfo);
       
   506 #endif
       
   507 #endif
       
   508 	};
       
   509 
       
   510 class RBusDevCommDCE : public RBusLogicalChannel
       
   511 	{
       
   512 public:
       
   513 	enum TVer {EMajorVersionNumber=1,EMinorVersionNumber=0,EBuildVersionNumber=KE32BuildVersionNumber};
       
   514 	enum TRequest
       
   515 		{
       
   516 		ERequestRead=0x0,ERequestReadCancel=0x1,
       
   517 		ERequestWrite=0x1,ERequestWriteCancel=0x2,
       
   518 		ERequestBreak=0x2,ERequestBreakCancel=0x4,
       
   519 		ERequestNotifySignalChange=0x3,ERequestNotifySignalChangeCancel=0x8,
       
   520 		ERequestNotifyFlowControlChange=0x4,ERequestNotifyFlowControlChangeCancel=0x10,
       
   521 		ERequestNotifyConfigChange=0x5,ERequestNotifyConfigChangeCancel=0x20
       
   522 		};
       
   523 	enum TControl
       
   524 		{
       
   525 		EControlConfig,EControlSetConfig,EControlCaps,
       
   526 		EControlSignals,EControlSetSignals,
       
   527 		EControlQueryReceiveBuffer,EControlResetBuffers,
       
   528 		EControlReceiveBufferLength,EControlSetReceiveBufferLength,
       
   529 		EControlFlowControlStatus,
       
   530 #ifdef _DEBUG_DEVCOMM
       
   531 		EControlDebugInfo
       
   532 #endif
       
   533 		};
       
   534 public:
       
   535 #ifndef __KERNEL_MODE__
       
   536 	inline TInt Open(TInt aUnit);
       
   537 	inline TVersion VersionRequired() const;
       
   538 	inline void Read(TRequestStatus &aStatus,TDes8 &aDes);
       
   539 	inline void Read(TRequestStatus &aStatus,TDes8 &aDes,TInt aLength);
       
   540 	inline void ReadOneOrMore(TRequestStatus &aStatus,TDes8 &aDes);
       
   541 	inline void ReadCancel();
       
   542 	inline void Write(TRequestStatus &aStatus,const TDesC8 &aDes);
       
   543 	inline void Write(TRequestStatus &aStatus,const TDesC8 &aDes,TInt aLength);
       
   544 	inline void WriteCancel();
       
   545 	inline void Break(TRequestStatus &aStatus,TInt aTime);
       
   546 	inline void BreakCancel();
       
   547 	inline void Config(TDes8 &aConfig);
       
   548 	inline TInt SetConfig(const TDesC8 &aConfig);
       
   549 	inline void Caps(TDes8 &aCaps);
       
   550 	inline TUint Signals();
       
   551 	inline void SetSignals(TUint aSetMask,TUint aClearMask);
       
   552 	inline TInt QueryReceiveBuffer();
       
   553 	inline void ResetBuffers();
       
   554 	inline TInt ReceiveBufferLength();
       
   555 	inline TInt SetReceiveBufferLength(TInt aLength);
       
   556 	inline void NotifySignalChange(TRequestStatus& aStatus,TUint& aSignals,TUint aSignalMask=0x3F);
       
   557 	inline void NotifySignalChangeCancel();
       
   558 	inline void NotifyReceiveDataAvailable(TRequestStatus& aStatus);
       
   559 	inline void NotifyReceiveDataAvailableCancel();
       
   560 	inline void NotifyFlowControlChange(TRequestStatus& aStatus);
       
   561 	inline void NotifyFlowControlChangeCancel();
       
   562 	inline void GetFlowControlStatus(TFlowControl& aFlowControl);
       
   563 	inline void NotifyConfigChange(TRequestStatus& aStatus, TDes8& aNewConfig);
       
   564 	inline void NotifyConfigChangeCancel();
       
   565 #ifdef _DEBUG_DEVCOMM
       
   566 	inline void DebugInfo(TDes8 &aInfo);
       
   567 #endif
       
   568 #endif
       
   569 	};
       
   570 
       
   571 #include <d32comm.inl>
       
   572 #endif