cbsref/telephonyrefplugins/atltsy/atcommand/generic/inc/atswitchonlinemode.h
branchRCL_3
changeset 20 07a122eea281
parent 19 630d2f34d719
child 21 4814c5a49428
equal deleted inserted replaced
19:630d2f34d719 20:07a122eea281
     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 // This contains CATSwitchOnLineMode which switch to online mode
       
    15 // 
       
    16 
       
    17 #ifndef __ATSWITCHONLINEMODE_H__
       
    18 #define __ATSWITCHONLINEMODE_H__
       
    19 
       
    20 #include <callbacktimer.h>
       
    21 //user include
       
    22 #include "atcommandbase.h"
       
    23 
       
    24 /**
       
    25  * \class CATSwitchOnLineMode 
       
    26  * \brief get Modem status.
       
    27  *
       
    28  * CATSwitchOnLineMode inherits from the CAtCommandBase class. 
       
    29  * This file defines the AT command for simple AT command 
       
    30  * which only return OK or Error
       
    31  */
       
    32 class CATSwitchOnLineMode : public CAtCommandBase,
       
    33                             public MTimerObserver
       
    34 {
       
    35 public:
       
    36 	static CATSwitchOnLineMode* NewL(CGlobalPhonemanager& aGloblePhone, 
       
    37 		                             CCtsyDispatcherCallback& aCtsyDispatcherCallback);
       
    38 	/**
       
    39 	 * Destructor
       
    40 	 *
       
    41 	 */
       
    42 	~CATSwitchOnLineMode();
       
    43 
       
    44 	/**
       
    45 	 * Virtual function. Inherited from CAtCommandBase
       
    46 	 *  Start Execute AT Command
       
    47 	 */
       
    48 	virtual void ExecuteCommand();
       
    49 	/**
       
    50 	 * Virtual function. Inherited from CAtCommandBase
       
    51 	 * @param aResponseBuf Line buf reading from baseband 
       
    52 	 */
       
    53 	virtual void ParseResponseL(const TDesC8& aResponseBuf);
       
    54 	/**
       
    55 	 * Will be called by AT Manager whenever a event was triggered
       
    56 	 * 
       
    57 	 * @param aEventSource
       
    58 	 * @param aStatus
       
    59 	 */
       
    60 	virtual void EventSignal(TAtEventSource aEventSource, TInt aStatus);
       
    61 	
       
    62 	/**
       
    63 	 * Start this request
       
    64 	 */
       
    65 	void StartSwitchOnLineMode(CAtCommandBase* aAtCommandBase,MAtCommandExecuteObserver* aAtCommandObserver);
       
    66 	/**
       
    67 	 * 
       
    68 	 * 
       
    69 	 */
       
    70 	void Enable();
       
    71 	/**
       
    72 	 * 
       
    73 	 * 
       
    74 	 */
       
    75 	void Disable();
       
    76 	
       
    77 protected:
       
    78 	/**
       
    79 	 * Constructor
       
    80 	 *
       
    81 	 * @param aGloblePhone
       
    82 	 * @param aCtsyDispatcherCallback
       
    83 	 */
       
    84 	CATSwitchOnLineMode(CGlobalPhonemanager& aGloblePhone, 
       
    85 		                CCtsyDispatcherCallback& aCtsyDispatcherCallback);
       
    86 	/**
       
    87 	 * 2nd Constructor
       
    88 	 */
       
    89 	void ConstructL();
       
    90 private:
       
    91 	//From MTimerObserver
       
    92     virtual void TimerRun(TInt aError);	
       
    93     void StartTimer(const TInt aTimeout);
       
    94 private:
       
    95 	/**
       
    96 	 * The return error value of AT command executed 
       
    97 	 */
       
    98 	TInt iError;
       
    99 	CAtCommandBase* iAtCommandBase;
       
   100 	MAtCommandExecuteObserver* iAtCommandObserver;
       
   101 	CCallbackTimer* iCallbackTimer;	
       
   102 	
       
   103 	enum 
       
   104 		{
       
   105 		ETimerNone,
       
   106 		ETimerDrop,
       
   107 		ETimerRaise,
       
   108 		ETimerReset,
       
   109 		ETimerRead,
       
   110 		ETimerWait
       
   111 		} iWhichTimer;
       
   112 
       
   113 };
       
   114 #endif //__ATSWITCHONLINEMODE_H__