adaptationlayer/modematadaptation/modematcontroller_exe/inc/cmodematsrv.h
changeset 8 6295dc2169f3
parent 5 8ccc39f9d787
child 9 8486d82aef45
equal deleted inserted replaced
7:fa67e03b87df 8:6295dc2169f3
    22 
    22 
    23 #include <e32svr.h>
    23 #include <e32svr.h>
    24 #include "cmodemathandler.h"  //KMaxDteIdCount
    24 #include "cmodemathandler.h"  //KMaxDteIdCount
    25 #include "modemattrace.h"
    25 #include "modemattrace.h"
    26 
    26 
    27 const TUint8 KInitialDteId = 999;
       
    28 const TUint8 EAtCmd = 0;
    27 const TUint8 EAtCmd = 0;
    29 const TUint8 EGetNvramStatus = 1;
    28 const TUint8 EGetNvramStatus = 1;
    30 
    29 
    31 /*
    30 /*
    32  * Reference: i_at_modem_fp_3.1.doc (3.5.2)
    31  * Reference: i_at_modem_fp_3.1.doc (3.5.2)
    78     TInt SessionCount();
    77     TInt SessionCount();
    79 
    78 
    80     /**
    79     /**
    81      * Connect session to the modem  
    80      * Connect session to the modem  
    82      * @param CModemAtSession* aSession Pointer to the session
    81      * @param CModemAtSession* aSession Pointer to the session
       
    82      * @param TATPluginInterface aPluginType Atext or common plugin
    83      * @return Connection status: KErrNone, KErrAlreadyExists
    83      * @return Connection status: KErrNone, KErrAlreadyExists
    84      */    
    84      */    
    85     TInt ConnectToModem( CModemAtSession* aSession);
    85     TInt ConnectToModem( CModemAtSession* aSession, TATPluginInterface aPluginType);
    86 
    86 
    87     /**
    87     /**
    88      * HandleSignalInd  
    88      * HandleSignalInd  
    89      * @param aDteId Device Terminal ID
    89      * @param aDteId Device Terminal ID
    90      */ 
    90      */ 
    91     void HandleSignalInd( const TInt aDteId );
    91     void HandleSignalInd( const TUint8 aDteId );
    92     /**
    92     /**
    93      * HandleUnsolicitedData 
    93      * HandleUnsolicitedData 
    94      * @param aDteId Device Terminal ID
    94      * @param aDteId Device Terminal ID
    95      * @param aData Descriptor data
    95      * @param aData Descriptor data
    96      */ 
    96      */ 
    97     void HandleUnsolicitedData( const TInt aDteId, const TDesC8& aData );
    97     void HandleUnsolicitedData( const TUint8 aDteId, const TDesC8& aData );
    98     /**
    98     /**
    99      * HandleIntermediateDataInd
    99      * HandleIntermediateDataInd
   100      * @param aDteId Device Terminal ID
   100      * @param aDteId Device Terminal ID
   101      * @param aPluginType Plugin type
   101      * @param aPluginType Plugin type
   102      * @param aResponse Response buffer
   102      * @param aResponse Response buffer
   103      * @param aCommand Command buffer
   103      * @param aCommand Command buffer
   104      */ 
   104      */ 
   105     void HandleIntermediateDataInd( const TInt aDteId, const TATPluginInterface aPluginType, const TDesC8& aResponse, const TUint8 aCommand );
   105     void HandleIntermediateDataInd( const TUint8 aDteId, const TATPluginInterface aPluginType, const TDesC8& aResponse, const TUint8 aCommand );
   106 
   106 
   107     /**
   107     /**
   108      * HandleATResponse
   108      * HandleATResponse
   109      * @param aDteId Device Terminal ID
   109      * @param aDteId Device Terminal ID
   110      * @param aResponse Response buffer
   110      * @param aResponse Response buffer
   111      */ 
   111      */ 
   112     void HandleATResponse( const TInt aDteId, const TDesC8& aResponse, const TUint8 aCommand );
   112     void HandleATResponse( const TUint8 aDteId, const TDesC8& aResponse, const TUint8 aCommand );
   113     
       
   114     /**
       
   115      * BroadcastModemConnected
       
   116      * @param aDteId Device Terminal ID
       
   117      * @param aErr KErrNone if connected, otherwise KErrGeneral
       
   118      */ 
       
   119     void BroadcastModemConnected(const TUint aDteId, TInt aErr );
       
   120     
   113     
   121     /**
   114     /**
   122      * HandleCommandModeChange
   115      * HandleCommandModeChange
   123      * @param aDteId Device Terminal ID
       
   124      * @param aMode Command mode 0 or data mode 1
   116      * @param aMode Command mode 0 or data mode 1
   125      */ 
   117      */ 
   126     void HandleCommandModeChange( TInt aDteId, TCommandMode aMode );
   118     void HandleCommandModeChange( TCommandMode aMode );
   127     
   119     
   128     /**
   120     /**
   129      * AddToSendFifo
   121      * AddToSendFifo
   130      * @param aDteId Device Terminal ID
       
   131      * @param aPluginType Plugin type
   122      * @param aPluginType Plugin type
   132      * @param aMessage RMessage2 container class
   123      * @param aMessage RMessage2 container class
   133      */ 
   124      */ 
   134     void AddToSendFifo( const TUint8 aDteId, const TATPluginInterface aPluginType, CAtMessage* aMessage );
   125     void AddToSendFifo( const TATPluginInterface aPluginType, CAtMessage* aMessage );
   135 
   126 
   136     /**
   127     /**
   137      * RemoveFirstFromSendFifo 
   128      * RemoveFirstFromSendFifo 
   138      */ 
   129      */ 
   139     void RemoveFirstFromSendFifo();
   130     void RemoveFirstFromSendFifo();
   149      */ 
   140      */ 
   150     void CancelFifoRequests( const CModemAtSession* aSession );
   141     void CancelFifoRequests( const CModemAtSession* aSession );
   151     
   142     
   152     /**
   143     /**
   153      * RemovePipe
   144      * RemovePipe
   154      * @param aDteId Device Terminal ID
       
   155      */ 
   145      */ 
   156     void RemovePipe( const TUint8 aDteId );
   146     void RemovePipe();
       
   147 
       
   148     /**
       
   149       *  Sets DteID for this session
       
   150       *  @param aDteId DteId
       
   151       * @param aConnectionError error
       
   152       */    
       
   153     void SetDteIdAndConnect( const TUint8 aDteId, const TInt aConnectionError );
   157 
   154 
   158 private:
   155 private:
   159 
   156 
   160     /**
   157     /**
   161      * Creates a new session to client
   158      * Creates a new session to client
   181     
   178     
   182 
   179 
   183 private:  // data
   180 private:  // data
   184 
   181 
   185     RPointerArray<CModemAtSession> iSessions;       //Sessions from R-interface
   182     RPointerArray<CModemAtSession> iSessions;       //Sessions from R-interface
   186     CModemAtSession* iRouteTable[KPluginCount][KMaxDteIdCount]; //Messages are routed to session by this table
       
   187     RPointerArray<CAtMessage> iAtMessageArray;
   183     RPointerArray<CAtMessage> iAtMessageArray;
   188     CModemAtHandler* iHandler;
   184     CModemAtHandler* iHandler;
       
   185     TUint8 iDteId;
   189     };
   186     };
   190 
   187 
   191 #endif  // CMODEMATSRV_H
   188 #endif  // CMODEMATSRV_H
   192 
   189