adaptationlayer/modematadaptation/modematcontroller_exe/inc/cmodematpipecontroller.h
changeset 8 6295dc2169f3
parent 5 8ccc39f9d787
child 9 8486d82aef45
equal deleted inserted replaced
7:fa67e03b87df 8:6295dc2169f3
    18 
    18 
    19 #ifndef CMODEMATPIPECONTROLLER_H
    19 #ifndef CMODEMATPIPECONTROLLER_H
    20 #define CMODEMATPIPECONTROLLER_H
    20 #define CMODEMATPIPECONTROLLER_H
    21 
    21 
    22 #include <e32base.h>
    22 #include <e32base.h>
    23 #include "cmodemathandler.h" //KMaxDteIdCount
    23 #include "cmodemathandler.h"
    24 
    24 const TUint8 KInvalidPipeHandle = 0xff;
    25 
    25 
    26 class TPipeInfo
    26 class TPipeInfo
    27 {
    27 {
    28 public:
    28 public:
    29 
    29 
    34         EPipeEnabled,
    34         EPipeEnabled,
    35         EPipeDisabled,
    35         EPipeDisabled,
    36         EPipeRemoving,
    36         EPipeRemoving,
    37         EPipeNoPipe
    37         EPipeNoPipe
    38         };
    38         };
    39         
    39 
    40     TInt iHandle;
    40     TUint8 pipeHandle;
    41     TUint8 iFirstObjId;
    41     TUint8 firstObjId;
    42     TUint8 iFirstDevId;
    42     TUint8 firstDevId;
    43     TUint8 iSecondObjId;
    43     TUint8 secondObjId;
    44     TUint8 iSecondDevId;
    44     TUint8 secondDevId;
    45     EPipeState iPipeState;
    45     EPipeState pipeState;
    46 };
    46 };
    47 
    47 
    48 /**
    48 /**
    49 *   CModemAtPipeController receives ISI-messages from CModemAtHandler. CModemAtPipeController creates, 
    49 *   CModemAtPipeController receives ISI-messages from CModemAtHandler. CModemAtPipeController creates, 
    50 *   redirects and removes pipes.  
    50 *   redirects and removes pipes.  
    76      * @param TUint8 aDteId Connection DteId   
    76      * @param TUint8 aDteId Connection DteId   
    77      */
    77      */
    78     void RemovePipe( const TUint8 aDteId);
    78     void RemovePipe( const TUint8 aDteId);
    79     
    79     
    80     /**
    80     /**
    81       * Redirects pipe
    81      * Redirects pipe
    82       * @param TUint8 aDteId Connection DteId   
    82      * @param TUint8 aDteId Connection DteId   
    83       * @param TUint8 aNewDevId New PEP
    83      * @param TUint8 aNewDevId New PEP
    84       * @param TUint8 aNewObjId New PEP
    84      * @param TUint8 aNewObjId New PEP
    85       */
    85      */
    86     
       
    87     void RedirectPipe( const TUint8 aDteId, const TUint8 aNewDevId, const TUint8 aNewObjId );
    86     void RedirectPipe( const TUint8 aDteId, const TUint8 aNewDevId, const TUint8 aNewObjId );
    88 
    87 
    89     /**
    88     /**
    90       * Links dteId to created Pipe
       
    91       * @param TUint8 aDteId Connection DteId   
       
    92       */
       
    93     void LinkDteIdToPipe( const TUint8 aDteId );
       
    94     
       
    95     /**
       
    96      * Queries AT MODEM object id. 
    89      * Queries AT MODEM object id. 
    97      */
    90      */
    98     void QueryModemAtFromNameService();
    91     void QueryModemAtFromNameService();
       
    92 
       
    93     /**
       
    94      * GetPipeHandle
       
    95      * @return pipehandle
       
    96      */
       
    97     TUint8 GetPipeHandle();
       
    98 
    99 #endif
    99 #endif
   100 private:
   100 private:
   101     /**
   101     /**
   102      * Default C++ constructor.
   102      * Default C++ constructor.
   103      * @param None
   103      * @param RIscApi& aIscApi
   104      * @return
   104      * @param TUint& aObjId
       
   105      * @param CModemAtHandler& aHandler
   105      */
   106      */
   106     CModemAtPipeController( RIscApi& aIscApi, TUint& aObjId, CModemAtHandler& aHandler );
   107     CModemAtPipeController( RIscApi& aIscApi, TUint& aObjId, CModemAtHandler& aHandler );
   107 
   108 
   108     /**
   109     /**
   109      *  Used to send At command to modem
   110      *  ConstructL
   110      *  @param
       
   111      *  @return Send status
       
   112      */
   111      */
   113 
   112 
   114     void ConstructL();
   113     void ConstructL();
   115 
   114 
   116 #ifndef NCP_COMMON_BRIDGE_FAMILY
   115 #ifndef NCP_COMMON_BRIDGE_FAMILY
   185     /**
   184     /**
   186      * Sends PNS_PIPE_ENABLE_REQ
   185      * Sends PNS_PIPE_ENABLE_REQ
   187      * @param TUint8 aPipeHandle Pipehandle
   186      * @param TUint8 aPipeHandle Pipehandle
   188      */
   187      */
   189     void SendEnablePipeReq( const TUint8 aPipeHandle);
   188     void SendEnablePipeReq( const TUint8 aPipeHandle);
   190     /**
       
   191      * Finds dteid of pipe
       
   192      * @param const TInt aHandle pipe handle
       
   193      */
       
   194     TInt FindDteId( const TInt aHandle );
       
   195 
   189 
   196     /**
   190     /**
   197      * ChangePipeState
   191      * ChangePipeState
   198      * @param const TInt aDteId
       
   199      * @param TPipeInfo::EPipeState aState
   192      * @param TPipeInfo::EPipeState aState
   200      */
   193      */
   201     void ChangePipeState( const TInt aDteId, TPipeInfo::EPipeState aState );
   194     void ChangePipeState( TPipeInfo::EPipeState aState );
       
   195     
   202 #endif
   196 #endif
   203 private:
   197 private:
   204     
   198     
   205     RIscApi& iIscApi;
   199     RIscApi& iIscApi;
   206     TUint iModemAtObjId;            //Modem AT Controller Obj-id
   200     TUint iModemAtObjId;            //Modem AT Controller Obj-id
   207     TUint iModemAtDevId;            //Modem AT Controller device-id
   201     TUint iModemAtDevId;            //Modem AT Controller device-id
   208     TInt  iPipeHandle;              //handle of created pipe 
       
   209     TUint iDataportDevId;           //Dataport device-id
   202     TUint iDataportDevId;           //Dataport device-id
   210     TUint iDataportObjId;           //Dataport obj-id
   203     TUint iDataportObjId;           //Dataport obj-id
   211     TPipeInfo iPipeTable[KMaxDteIdCount];   //created pipes
   204     TPipeInfo iPipe;                //Pipehandle, pipe status and pipe id's
   212     CModemAtHandler& iAtHandler;    //forwards AT-commands to the AT MODEM
   205     CModemAtHandler& iAtHandler;    //forwards AT-commands to the AT MODEM
   213     CActiveSchedulerWait* iSchedulerWait;
   206     CActiveSchedulerWait* iSchedulerWait;
   214     TUint8 iDteId;                  // temporary dte id for creating the connection
       
   215     };
   207     };
   216 
   208 
   217 #endif  // CMODEMATPIPECONTROLLER_H
   209 #endif  // CMODEMATPIPECONTROLLER_H
   218 
   210