adaptationlayer/modematadaptation/modematcontroller_exe/inc/cmodematsession.h
changeset 0 63b37f68c1ce
child 8 6295dc2169f3
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 CMODEMATSESSION_H
       
    21 #define CMODEMATSESSION_H
       
    22 
       
    23 #include <e32svr.h>
       
    24 
       
    25 class CModemAtSrv;
       
    26 class RModemAtController;
       
    27 
       
    28 // CLASS DECLARATION
       
    29 
       
    30 /**
       
    31 *  CModemAtSession receives and completes client's requests. CModemAtSession forwards
       
    32 *  requests to the CModemAtSrv.
       
    33 */
       
    34 
       
    35 NONSHARABLE_CLASS( CModemAtSession ) : public CSession2
       
    36     {
       
    37     
       
    38 public:
       
    39 
       
    40     /**
       
    41      * Two-phased constructor.
       
    42      * @param aServer
       
    43      * @return Instance of self
       
    44      */
       
    45     static CModemAtSession* NewL( CModemAtSrv& aServer, const TVersion& aVersion );
       
    46 
       
    47    /**
       
    48     * Destructor.
       
    49     */
       
    50     ~CModemAtSession();
       
    51 
       
    52     /**
       
    53      *  Called by CModemAtHandler, when Unsolicitated data ind is received  
       
    54      */
       
    55     void UnsolicitedData( const TDesC8& aData );
       
    56 
       
    57     /**
       
    58      *  Called by CModemAtHandler, when signal ind is received  
       
    59      */
       
    60     void SignalIndReceived( );
       
    61 
       
    62     /**
       
    63      * Returns DteId of current session
       
    64      *  @return DteID 
       
    65      */    
       
    66     TUint8 GetDteId();
       
    67 
       
    68     /**
       
    69       *  Sets DteID for this session
       
    70       *  @param aDteId DteId
       
    71       */    
       
    72     void SetDteId( const TUint8 aDteId );
       
    73 
       
    74     /**
       
    75       * Returns name of current session  
       
    76       * @return Session name 
       
    77       */    
       
    78     TDesC8& GetName();
       
    79 
       
    80     /**
       
    81       * Returns plugin type (common/atext) 
       
    82       *  @return Plugintype 
       
    83       */    
       
    84     TATPluginInterface GetPluginType();
       
    85 
       
    86     /**
       
    87      *  Modem-Connected-callback. Called when modem is connected.
       
    88      *  @param aDteId DteId
       
    89      *  @param aErr Error code
       
    90      *  @return 
       
    91      */
       
    92     void ModemConnected( const TInt aErr );
       
    93    
       
    94     /**
       
    95      *  CommandModeChanged. Called when pipe handle indicates that mode is changed.
       
    96      *  @param aMode TCommandMode aMode
       
    97      *  @return 
       
    98      */
       
    99     void CommandModeChanged( TCommandMode aMode ) ;
       
   100     
       
   101     /**
       
   102      *  IsUnsolicitedDataReqActive
       
   103      *  @return ETrue if request is active, otherwise EFalse
       
   104      */
       
   105     TBool IsUnsolicitedDataReqActive();
       
   106 
       
   107     /**
       
   108      *  IsSignalIndReqActive
       
   109      *  @return ETrue if request is active, otherwise EFalse
       
   110      */
       
   111     TBool IsSignalIndReqActive();
       
   112 
       
   113     /**
       
   114      *  IsCommandModeReqActive
       
   115      *  @return ETrue if request is active, otherwise EFalse
       
   116      */
       
   117     TBool IsCommandModeReqActive();
       
   118 
       
   119     /**
       
   120      *  IsConnectReqActive
       
   121      *  @return ETrue if request is active, otherwise EFalse
       
   122      */
       
   123     TBool IsConnectReqActive();
       
   124 
       
   125 private:
       
   126 
       
   127     // from base class CSession2    
       
   128     void ServiceL( const RMessage2& aMessage );
       
   129     void DoServiceL( const RMessage2& aMessage );
       
   130 
       
   131     /**
       
   132      *  Checks if there is existing request and completes it.
       
   133      *  @param aMessage Message to be checked.
       
   134      *  @return ETrue if there was request already pending. 
       
   135      */
       
   136 	  TBool CheckAndCompleteExistingRequest( const RMessage2& aMessage );
       
   137 
       
   138        
       
   139 private:  
       
   140 
       
   141     /**
       
   142      * Default C++ constructor.
       
   143      * @param aServer   Reference to the CModemAtsrv
       
   144      * @param aVersion  Version of client
       
   145      * @param aHandler  Reference to the CModemAtHandler
       
   146      */
       
   147     CModemAtSession( CModemAtSrv& aServer, const TVersion& aVersion );
       
   148 
       
   149     // data
       
   150     CModemAtSrv& iServer;
       
   151     RMessage2 iConnectReq;
       
   152     RMessage2 iSignalIndReq;
       
   153     RMessage2 iUnsolicitedDataReq;
       
   154     RMessage2 iCommandModeReq;
       
   155 
       
   156     TVersion iVersion;
       
   157     TUint8 iDteId;
       
   158     HBufC8* iClientName;
       
   159     TATPluginInterface iPluginType;
       
   160     TPtr8 iClientNamePtr;
       
   161     };
       
   162 
       
   163 #endif  // CMODEMATSESSION_H