adaptationlayer/bcaiscadapter/bcatoisc_dll/inc/bcatoisc.h
changeset 0 63b37f68c1ce
child 9 8486d82aef45
equal deleted inserted replaced
-1:000000000000 0:63b37f68c1ce
       
     1 /*
       
     2 * Copyright (c) 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 the License "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 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef BCATOISC_H
       
    21 #define BCATOISC_H
       
    22 #include <networking/bca.h>
       
    23 #include <iscapi.h>
       
    24 #include <e32std.h>
       
    25 #include <e32base.h>
       
    26 #include <e32def.h>
       
    27 
       
    28 
       
    29         
       
    30 
       
    31 
       
    32 /**
       
    33 * BCATOISC Panic code.
       
    34 * @internalComponent.
       
    35 */
       
    36 
       
    37 enum TBcaToIscPanic
       
    38     {
       
    39 
       
    40     /** Monitor already existrs, we have a memory leak */
       
    41     EMonitorAlreadyExists,
       
    42 
       
    43     };
       
    44         
       
    45 
       
    46 
       
    47 /** This namespace includes the BCA component names.*/
       
    48 namespace BasebandChannelAdaptation
       
    49 {
       
    50     
       
    51     class CBcaToIsc;
       
    52         
       
    53     /**
       
    54     * Monitors the ISCAPI flow control
       
    55     */        
       
    56     NONSHARABLE_CLASS(CNotifyFlowControlMonitor): public CActive
       
    57         {
       
    58         
       
    59         public:
       
    60         
       
    61         CNotifyFlowControlMonitor(RIscApi& aIscApi);
       
    62         void NotifyFlowControlStatus();
       
    63         void RequestFlowcontrolChange( TRequestStatus& aClientStatus );
       
    64         void RunL();
       
    65         void DoCancel();
       
    66         TInt GetFlowControlState();
       
    67         ~CNotifyFlowControlMonitor();
       
    68         
       
    69         private:
       
    70         
       
    71         RIscApi& iIscApi;
       
    72         TInt iFlowControlValue;
       
    73         TRequestStatus* iWriteStatus;
       
    74 
       
    75         };
       
    76         
       
    77   
       
    78     NONSHARABLE_CLASS(CNotifyWriteStatusMonitor): public CActive
       
    79         {
       
    80         
       
    81         public:
       
    82         
       
    83         CNotifyWriteStatusMonitor(CBcaToIsc& aUser, RIscApi& aIscApi);
       
    84         void Write( TRequestStatus& aStatus, const TDesC8& aBuf );
       
    85         void SendAndComplete();
       
    86         void RunL();
       
    87         void DoCancel();
       
    88         ~CNotifyWriteStatusMonitor();
       
    89 
       
    90         private:
       
    91 
       
    92         CBcaToIsc& iUser;
       
    93         RIscApi& iIscApi;
       
    94         TRequestStatus* iClientStatus;
       
    95         const TDesC8* iBuf;
       
    96      //   TPtr8* iBuf;
       
    97 
       
    98         };
       
    99 
       
   100     /**
       
   101     * The interface between NIF and Isc Bearer Transport.     
       
   102     */
       
   103     NONSHARABLE_CLASS(CBcaToIsc): public CBase, 
       
   104                                   public MBca  // BCA is accessed via this interface by clients.
       
   105         {
       
   106         
       
   107         public:
       
   108             
       
   109         CBcaToIsc(); 
       
   110         virtual ~CBcaToIsc();
       
   111             virtual void Release();
       
   112 
       
   113         void ConstructL();
       
   114 
       
   115         virtual void Open(TRequestStatus& aStatus, const TDesC& aChannelId);
       
   116             
       
   117         virtual void Shutdown(TRequestStatus& aStatus);
       
   118         virtual void Close();
       
   119 
       
   120         virtual void Read(TRequestStatus& aStatus, TDes8& aBuf);
       
   121         virtual void Write(TRequestStatus& aStatus, const TDesC8& aBuf);
       
   122 
       
   123         virtual void CancelRead();
       
   124         virtual void CancelWrite();
       
   125         
       
   126         virtual void Ioctl(TRequestStatus& aStatus, TUint aOptLevel, TUint aOptName, TDes8& aOpt);
       
   127         virtual void CancelIoctl();
       
   128           
       
   129 
       
   130         // Ownership
       
   131         CNotifyWriteStatusMonitor* iWriteStatusMonitor;
       
   132         CNotifyFlowControlMonitor* iFlowControlMonitor;
       
   133    
       
   134 
       
   135         private:
       
   136 
       
   137         RIscApi iIscApi;
       
   138         // no ownership
       
   139         TRequestStatus* iClientShutdownStatus;
       
   140         TUint16 iReadLength;
       
   141         TUint16 iChannelNumber;
       
   142 
       
   143         };
       
   144 
       
   145 } // namespace BasebandChannelAdaptation
       
   146 
       
   147 #endif //BCATOISC_H