connectionmonitoring/connmon/connectionmonitor/inc/ConnMonIAP.h
changeset 71 9f263f780e41
parent 52 bbe4544dfd31
child 72 0c32cf868819
equal deleted inserted replaced
70:ac5daea24fb0 71:9f263f780e41
    59 const TInt KPhoneRetryCount = 7;
    59 const TInt KPhoneRetryCount = 7;
    60 const TInt KPhoneRetryTimeout = 100000;
    60 const TInt KPhoneRetryTimeout = 100000;
    61 const TInt KConnMonSmallBufferLen = 30;
    61 const TInt KConnMonSmallBufferLen = 30;
    62 const TInt KBitsInByte = 8;
    62 const TInt KBitsInByte = 8;
    63 const TInt KAttributeParameterIndex = 3;
    63 const TInt KAttributeParameterIndex = 3;
       
    64 const TInt KMaxConnectionCount = 16;
       
    65 
       
    66 // Used to track async stop thread status for a connection
       
    67 enum TConnMonAsyncStopStatus
       
    68     {
       
    69     EConnMonAsyncStopNotStarted = 0, // Async stop has not been requested
       
    70     EConnMonAsyncStopStarted,        // Stop thread is running
       
    71     EConnMonStopCompleted            // Connection has been stopped (sync. or async.)
       
    72     };
       
    73 
       
    74 
       
    75 /**
       
    76  * TAsyncStopQueueElement
       
    77  * Object to hold async. connection stop request related information.
       
    78  */
       
    79 NONSHARABLE_CLASS( TAsyncStopQueueElement )
       
    80     {
       
    81 public:
       
    82     TAsyncStopQueueElement( const RMessage2& aMessage );
       
    83     /**
       
    84      * Add a connection ID to the ID array. Does nothing if the array is already full. 
       
    85      */
       
    86     void Add( TUint aConnectionId );
       
    87 
       
    88 public:
       
    89     RMessage2 iMessage;             // Client message that will be completed when stop is done.
       
    90     TInt iStatus;                   // Error status for the stop operation
       
    91     TInt iIdCount;                  // Number of connections to be stopped
       
    92     TInt iStopCount;                // Number of stopped connections
       
    93     TUint iId[KMaxConnectionCount]; // IDs of connections to be stopped
       
    94     };
    64 
    95 
    65 /**
    96 /**
    66 * TConnInfo
    97 * TConnInfo
    67 * Connection information record.
    98 * Connection information record.
    68 */
    99 */
   124         // Bearer info
   155         // Bearer info
   125         TBearerInfo iBearerInfo;
   156         TBearerInfo iBearerInfo;
   126 
   157 
   127         // BearerInfo/BearerGroup notifier
   158         // BearerInfo/BearerGroup notifier
   128         CConnMonBearerNotifier* iBearerNotifier;
   159         CConnMonBearerNotifier* iBearerNotifier;
       
   160         
       
   161         // Status flag to track status of possible async. stop request
       
   162         TConnMonAsyncStopStatus iAsyncStopStatus;
   129     };
   163     };
   130 
   164 
   131 /**
   165 /**
   132 * CConnMonIAP
   166 * CConnMonIAP
   133 */
   167 */
   237          * @since
   271          * @since
   238          * @param aMessage Reference to client message, containing the attribute information.
   272          * @param aMessage Reference to client message, containing the attribute information.
   239          * @return KErrNone if successfull, otherwise a system wide error code.
   273          * @return KErrNone if successfull, otherwise a system wide error code.
   240          */
   274          */
   241         TInt SetBoolAttribute( const RMessage2& aMessage );
   275         TInt SetBoolAttribute( const RMessage2& aMessage );
       
   276         
       
   277         /**
       
   278          * Stops a connection asynchronously.
       
   279          *
       
   280          * @param aMessage Reference to client message, containing the attribute information.
       
   281          * @return KRequestPending, KErrNone or a system wide error code.
       
   282          */
       
   283         TInt AsyncConnectionStopL( const RMessage2& aMessage );
       
   284 
       
   285         /**
       
   286          * Stops all connections asynchronously.
       
   287          *
       
   288          * @param aMessage Reference to client message, containing the attribute information.
       
   289          * @return KRequestPending, KErrNone or a system wide error code.
       
   290          */
       
   291         TInt AsyncConnectionStopAllL( const RMessage2& aMessage );
       
   292 
       
   293         /**
       
   294          * Starts a new thread to asynchronously stop a specific connection.
       
   295          *
       
   296          * @param aIndex Index number of the connection in internal connection array.
       
   297          * @return KErrNone if successfull, otherwise a system wide error code.
       
   298          */
       
   299         TInt StartAsyncStopThreadL( TInt aIndex );
       
   300 
       
   301         /**
       
   302          * Completes any asynchronous connection stop requests that are ready,
       
   303          * and verifies that the connection and its notifiers are cleaned up.
       
   304          *
       
   305          * @param aConnectionId ID of the connection that was stopped.
       
   306          * @param aError Error status for the connection stop operation.
       
   307          * @return void.
       
   308          */
       
   309         void CompleteAsyncStopReqs( const TUint aConnectionId, const TInt aError );
       
   310 
       
   311         /**
       
   312          * If the stopped connection is still in the connection info array and
       
   313          * connection up/down notifier isn't running, removes the obsolete
       
   314          * information and notifiers from the connection info array.
       
   315          *
       
   316          * @param aConnectionId ID of the connection to be cleaned.
       
   317          * @return KErrNone if successfull, otherwise a system wide error code.
       
   318          */
       
   319         TInt CleanupConnectionInfo( const TUint& aConnectionId );
       
   320 
       
   321         /**
       
   322          * Cancels all asynchronous connection stop request for a specific client.
       
   323          *
       
   324          * @param aSession Pointer to the session, used for identification.
       
   325          * @return void.
       
   326          */
       
   327         void CancelAsyncStopReqs( CSession2* aSession );
   242 
   328 
   243         /**
   329         /**
   244          * Sets a String attribute.
   330          * Sets a String attribute.
   245          * @since
   331          * @since
   246          * @param aMessage Reference to client message.
   332          * @param aMessage Reference to client message.
   907         // Phone call status watcher.
   993         // Phone call status watcher.
   908         CConnMonTelNotifier* iTelephonyNotifier;
   994         CConnMonTelNotifier* iTelephonyNotifier;
   909 
   995 
   910         // DTM status watcher.
   996         // DTM status watcher.
   911         CConnMonDtmNotifier* iDualTransferModeNotifier;
   997         CConnMonDtmNotifier* iDualTransferModeNotifier;
       
   998         
       
   999         // Array for holding async. connection stop requests
       
  1000         RArray<TAsyncStopQueueElement> iAsyncStopQueue;
   912     };
  1001     };
   913 
  1002 
   914 #endif // CONNMONIAP_H
  1003 #endif // CONNMONIAP_H
   915 
  1004 
   916 // End-of-file
  1005 // End-of-file