cbsref/csyrefplugins/csy27010/inc/CommFrameWriterAo.h
branchRCL_3
changeset 65 630d2f34d719
equal deleted inserted replaced
61:17af172ffa5f 65:630d2f34d719
       
     1 //
       
     2 // * Copyright 2004 Neusoft America Inc.
       
     3 // * All rights reserved.
       
     4 // * This component and the accompanying materials are made available
       
     5 // * under the terms of the 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 // * Contributors:
       
    10 // * Keith Collins (Neusoft America Inc.)  original software development and additional code and modifications.
       
    11 // * Thomas Gahagen (Neusoft America Inc.)  additional code and modifications.
       
    12 // * Zhen Yuan (Neusoft America Inc.)  additional code and modifications.
       
    13 // *
       
    14 // * Description: This file contains the declaration for class CCommFrameWriterAo.
       
    15 // *              Class CCommFrameWriterAo is used to perform write operations to
       
    16 // *              the serial port logical device driver. Class CommFrameWriteterAo
       
    17 // *              is an active object and is run by the active scheduler when the
       
    18 // *              LDD has completed the CSY's write request.
       
    19 // *
       
    20 //
       
    21 
       
    22 // CommFrameWriterAo.h
       
    23 
       
    24 /** @file CommFrameWriterAo.h
       
    25  *
       
    26  * 
       
    27  */
       
    28 
       
    29 #ifndef _COMMFRAMEWRITERAO_H_
       
    30 #define _COMMFRAMEWRITERAO_H_
       
    31 
       
    32 #include "CommReadWriteBaseAo.h"
       
    33 
       
    34 class CPortFactory;
       
    35 class CCsyMsgBufBpFrame;
       
    36 
       
    37 /** @class CCommFrameWriterAo CommFrameWriterAo.h "CommFrameWriterAo.h"
       
    38  *  @brief Class CCommFrameWriterAo is used to perform write operations
       
    39  *  to the serial port logical device driver. Class CommFrameWriteterAo
       
    40  *  is an active object and is run by the active scheduler when the
       
    41  *  LDD has completed the CSY's write request. There is one instance 
       
    42  *  of CCommFrameWriterAo.
       
    43  */
       
    44 class CCommFrameWriterAo : public CCommReadWriteBaseAo
       
    45     {
       
    46 public:
       
    47     static CCommFrameWriterAo* NewL(CPortFactory* aParent, CMux0710Protocol* aMux0710Protocol);
       
    48     ~CCommFrameWriterAo();
       
    49 
       
    50     TInt Write(CCsyMsgBufBpFrame* aBpFrame,
       
    51 		TBool aHighPriority = EFalse);
       
    52     void WriteCancel();
       
    53 
       
    54 	void RemoveAnyDlcFramesOnWriteList(TUint8 aDlcNum, TBool aPlaceOnWaitList = ETrue);
       
    55 	void RemoveAnyDlcFramesFromWaitList(TUint8 aDlcNum, TBool aPlaceOnWriteList = ETrue);
       
    56 
       
    57 public:// from CActive
       
    58     virtual void DoCancel();
       
    59     virtual void RunL();
       
    60 
       
    61 private:
       
    62     CCommFrameWriterAo(CPortFactory* aParent, CMux0710Protocol* aMux0710Protocol);
       
    63     void ConstructL();
       
    64 
       
    65 	TInt WriteFrame(CCsyMsgBufBpFrame* aBpFrame);
       
    66 	void CompleteWrite(const TUint8 aDlcNum, TInt aStatus);
       
    67 
       
    68 	CCsyMsgBufBpFrame* GetFrameToWrite();
       
    69 	void AddToWaitingToSendList(CCsyMsgBufBpFrame* aBpFrame, TBool aHighPriority = EFalse);
       
    70 
       
    71 private:
       
    72 	TUint8	iDlcNum;
       
    73 	TBool	iCompleteWhenSent;
       
    74 
       
    75 	// Write Frame Buffer Lists
       
    76 	TSglQue<CCsyMsgBufBpFrame>		iWriteFrameBufList;
       
    77 	TSglQueIter<CCsyMsgBufBpFrame>	iWriteFrameBufIter;
       
    78 
       
    79 	TSglQue<CCsyMsgBufBpFrame>		iWaitingForFcOffList;
       
    80 	TSglQueIter<CCsyMsgBufBpFrame>	iWaitingForFcOffIter;
       
    81 
       
    82 	};
       
    83 
       
    84 #endif  //_COMMFRAMEWRITERAO_H_