linklayercontrol/nullagt/src/NullAgent.h
changeset 0 af10295192d8
equal deleted inserted replaced
-1:000000000000 0:af10295192d8
       
     1 // Copyright (c) 1997-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 // NullAgent
       
    15 // 
       
    16 //
       
    17 
       
    18 /**
       
    19  @file 
       
    20  @internalComponent
       
    21 */
       
    22 
       
    23 
       
    24 #if !defined(__NULL_AGENT_H__)
       
    25 #define __NULL_AGENT_H__
       
    26 
       
    27 #include <comms-infras/cagentbase.h>
       
    28 #include <comms-infras/ni_log.h>
       
    29 #include "nullagtprog.h"
       
    30 #include <etelpckt.h> 
       
    31 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
       
    32 #include <comms-infras/nifprvar_internal.h>
       
    33 #include <nifman_internal.h>
       
    34 #endif
       
    35 
       
    36 const TInt KMajorVersionNumber=8; //< Null Agent MajorVersionNumber
       
    37 const TInt KMinorVersionNumber=0; //< Null Agent MinorVersionNumber
       
    38 const TInt KBuildVersionNumber=1; //< Null Agent BuildVersionNumber
       
    39 
       
    40 namespace NullAgent
       
    41 	{
       
    42 /**
       
    43 panic codes for a CNullAgent
       
    44 */
       
    45 	enum TNullAgentPanic
       
    46 		{
       
    47 		ENullNifmanNotifyPointer,
       
    48 		ENullTAnyPointer
       
    49 		};
       
    50 }
       
    51 
       
    52 _LIT(KNullAgentName,"nullagt"); //< Name of the Null Agent
       
    53 
       
    54 
       
    55 GLDEF_C void NullAgentPanic(NullAgent::TNullAgentPanic aPanic);
       
    56 
       
    57 class CNullAgentFactory : public CNifAgentFactory
       
    58 /**
       
    59 A Factory for creating a NullAgent
       
    60 
       
    61 @internalComponent  
       
    62 */
       
    63 	{
       
    64 protected:
       
    65 	void InstallL();
       
    66 	CNifAgentBase *NewAgentL(const TDesC& aName);
       
    67 	TInt Info(TNifAgentInfo& aInfo, TInt aIndex) const;
       
    68 	};
       
    69 
       
    70 class CNullAgent : public CAgentBase
       
    71 /**
       
    72 The CNullAgent class owns a CAsyncCallback , which is used to control the asynchronous 
       
    73 ServiceStarted() and DisconnectComplete() call from the Agent to Nifman.
       
    74 
       
    75 @internalComponent
       
    76 */
       
    77 	{
       
    78 public:
       
    79 	static CNullAgent* NewL();
       
    80 	virtual ~CNullAgent();
       
    81 protected:
       
    82 	void ConstructL();
       
    83 	CNullAgent();
       
    84 public:
       
    85 
       
    86 	// from CNifAgentBase
       
    87 	void Info(TNifAgentInfo& aInfo) const;
       
    88 	void Connect(TAgentConnectType aType);
       
    89 	void Connect(TAgentConnectType aType, CStoreableOverrideSettings* aOverrideSettings);
       
    90 	void CancelConnect();
       
    91 	void Disconnect(TInt aReason);
       
    92 	void ServiceStarted(TInt aError);
       
    93 	void ConnectionComplete(TInt aError);
       
    94 	void DisconnectionComplete();
       
    95 
       
    96 //	void MDPOLoginComplete(TInt aError);
       
    97 //	void MDPOReadPctComplete(TInt aError);
       
    98 //	void MDPODestroyPctComplete(TInt aError);
       
    99 //	void MDPOQoSWarningComplete(TInt aError, TBool aResponse);
       
   100 
       
   101 	TInt GetExcessData(TDes8& aBuffer);
       
   102 	TInt Notification(TNifToAgentEventType aEvent, TAny* aInfo);
       
   103 	void GetLastError(TInt& aError);
       
   104 	TBool IsReconnect() const {return (ETrue);};
       
   105 
       
   106 	TInt IncomingConnectionReceived();
       
   107 	
       
   108 #ifdef SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW	
       
   109 	virtual TUint32 GetBearerInfo() const ;
       
   110 #endif //SYMBIAN_ADAPTIVE_TCP_RECEIVE_WINDOW
       
   111 
       
   112 private:
       
   113 	static TInt ServiceStartedCb(TAny* aThisPtr);
       
   114 	static TInt ConnectCompleteCb(TAny* aThisPtr);
       
   115 	static TInt DisconnectCompleteCb(TAny* aThisPtr);
       
   116 	
       
   117 	TUint CommDbModemBearerRate();
       
   118 
       
   119 private:
       
   120 	CAsyncCallBack iServiceStartedCallback;
       
   121 	CAsyncCallBack iConnectCompleteCallback;
       
   122 	CAsyncCallBack iDisconnectCallback;
       
   123 	TBool iConnected;
       
   124 	TBool iCancelled;
       
   125 	
       
   126 	/**
       
   127 	TSY Configuration parameters 
       
   128 	Used for provisioning RawIP NIF in a test environment only.	*/
       
   129 	RPacketContext::TContextConfigGPRS iTsyConfig;
       
   130 	};
       
   131 
       
   132 #endif