os/ossrv/genericopenlibs/openenvcore/backend/inc/serialstream.h
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
     1 /*
     2 * Copyright (c) 2006-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 "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description:
    15 * Name        : serialstream.h
    16 * Part of     : stdio server
    17 * To handle the read and write on serial(comm)
    18 * 
    19 *
    20 */
    21 
    22 
    23 
    24 #ifndef _SERIALSTREAM_H_
    25 #define _SERIALSTREAM_H_
    26 
    27 #include "StdioServer.h"
    28 #include "streambase.h" //CStreamBase2
    29 #include "ReadRequestHandler.h" //CReadRequestHandler
    30 
    31 //-----------------------------------------------------------------------
    32 //Class name: 	CSerialStream
    33 //Description: 	This class represents the serial stream.
    34 //-----------------------------------------------------------------------
    35 
    36 class CSerialStream : public CStreamBase
    37     {
    38 public:
    39 	static CSerialStream* NewL(TInt aBaudRate,TDesC& aPortName);
    40     virtual void WriteL(TDes8& aDes);
    41     virtual void Read(TRequestStatus& aStatus, const TInt aLength);
    42     ~CSerialStream();
    43 	virtual void ReadCancel();
    44 	TStreamType Type() { return ESerial;}
    45 	
    46 private:
    47    	CSerialStream(TInt aBaudRate,TDesC& aPortName);
    48     void ConstructL();
    49     RComm iPort;
    50     TInt iOpenErr;
    51     TInt iConfigErr;
    52     TSerialInfo iPortInfo;
    53     TFileName iPortName;
    54     TInt iBaudRate;
    55     };
    56 
    57 #endif //_SERIALSTREAM_H_