cbsref/telephonyrefplugins/atltsy/atcommand/generic/inc/asynchelperrequest.h
branchRCL_3
changeset 65 630d2f34d719
equal deleted inserted replaced
61:17af172ffa5f 65:630d2f34d719
       
     1 // Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // @file asynchelperrequest.h
       
    15 // 
       
    16 
       
    17 #ifndef __ASYNCHELPERREQUEST_H__
       
    18 #define __ASYNCHELPERREQUEST_H__
       
    19 
       
    20 //system include
       
    21 #include <e32base.h>
       
    22 //user include
       
    23 #include "cltsypacketserviceshandler.h"
       
    24 // forward class
       
    25 class CCtsyDispatcherCallback;
       
    26 class CGlobalPhonemanager;
       
    27 /**
       
    28  * This is a helper class. 
       
    29  * There are sometimes, CTSY passed an asynchronous request to LTSY, and LTSY alreay know what should be returned(No need to Send AT command to Baseband).
       
    30  * But as the passed request is 'Asynchronous', so we have to somehow return this value to CTSY in an asynchronous way.
       
    31  * So we just inherit form CTimer which an Active object, and reuturn the alreay-known value to CTSY some time later.
       
    32  *  
       
    33  */
       
    34 class CAsyncHelperRequest : public CTimer
       
    35 	{
       
    36 public:
       
    37 	/**
       
    38 	 * 2nd Constructor
       
    39 	 *
       
    40 	 * @param aGloblePhone
       
    41 	 * @param aCtsyDispatcherCallback
       
    42 	 * @param aPriority
       
    43 	 */
       
    44 	static CAsyncHelperRequest* NewL(CGlobalPhonemanager& aGloblePhone,
       
    45 			                   CCtsyDispatcherCallback& aCallBack,
       
    46 			                   TInt aPriority = CActive::EPriorityLow);	
       
    47 	/**
       
    48 	 * Destructor
       
    49 	 *
       
    50 	 */
       
    51 	virtual ~CAsyncHelperRequest();
       
    52 	
       
    53 	/**
       
    54 	 * Set request IPC
       
    55 	 */
       
    56 	void SetRequestId(const TInt aIpc);
       
    57 protected:
       
    58     /**
       
    59      * constructor
       
    60      */
       
    61 	CAsyncHelperRequest(CGlobalPhonemanager& aGloblePhone,CCtsyDispatcherCallback& aCallBack,TInt aPriority);
       
    62 	
       
    63 	/**
       
    64 	 * Typicl RunL which inherit from CActive
       
    65 	 */
       
    66 	virtual void RunL();
       
    67 private:
       
    68     /**
       
    69      * Start the timer
       
    70      */
       
    71 	void StartTimer(const TTimeIntervalMicroSeconds32 aTimeout = 100000);
       
    72 	
       
    73 	/**
       
    74 	 * Stop the timer
       
    75 	 */
       
    76 	void StopTimer();
       
    77 protected:	
       
    78     /**
       
    79      * Call back dispatcher
       
    80      */
       
    81     CCtsyDispatcherCallback& iCallBack;
       
    82     
       
    83     /**
       
    84      * The global phone reference
       
    85      */
       
    86     CGlobalPhonemanager& iGloblePhone;	
       
    87 private:
       
    88     /**
       
    89      * The IPC requtest ID which is used to identiy what callback function should be returned
       
    90      */
       
    91 	TInt iRequestId;
       
    92 	
       
    93 	/**
       
    94 	 * Store the IPC request ID
       
    95 	 */
       
    96 	RArray<TInt> iReqArray;
       
    97 	/*
       
    98 	 * The context to be set configuration
       
    99 	 */
       
   100 	TInt iContextId;
       
   101 	};
       
   102 
       
   103 
       
   104 
       
   105 #endif //__ASYNCHELPERREQUEST_H__