linklayercontrol/networkinterfacemgr/netcfgext/src/rconfigdaemon.cpp
changeset 0 af10295192d8
equal deleted inserted replaced
-1:000000000000 0:af10295192d8
       
     1 // Copyright (c) 2003-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 // CS_Daemon.CPP
       
    15 // 
       
    16 //
       
    17 
       
    18 #include "rconfigdaemon.h"
       
    19 #include "rconfigdaemonmess.h"
       
    20 
       
    21 const TInt KConfigDaemonMajorVersionNumber = 2;
       
    22 const TInt KConfigDaemonMinorVersionNumber = 0;
       
    23 const TInt KConfigDaemonBuildVersionNumber = 0;
       
    24 
       
    25  	
       
    26 TVersion RConfigDaemon::Version() const
       
    27 /**
       
    28  * The RConfigDaemon::Version method
       
    29  *
       
    30  * Extract the version of the API
       
    31  *
       
    32  * @internalTechnology
       
    33  *
       
    34  * @return	Version of the API
       
    35  */
       
    36 	{
       
    37 	return TVersion(KConfigDaemonMajorVersionNumber,KConfigDaemonMinorVersionNumber,KConfigDaemonBuildVersionNumber);
       
    38 	}
       
    39 
       
    40 void RConfigDaemon::Configure(const TDes8& aInfo, TRequestStatus& aStatus )
       
    41 /**
       
    42  * The RConfigDaemon::Connect method
       
    43  *
       
    44  * Connect the Handle to the Server
       
    45  * Must be called before all other methods except Version()
       
    46  *
       
    47  * @internalTechnology
       
    48  *
       
    49  * @param aInfo The startup info for the connection
       
    50  * @param aStatus The request status of the active object to be completed
       
    51  *
       
    52  * @return	KErrNone if successful, otherwise the error that occurred
       
    53  */
       
    54 	{
       
    55    	SendReceive(EConfigDaemonConfigure,TIpcArgs(&aInfo), aStatus);
       
    56 	}
       
    57 
       
    58 void RConfigDaemon::LinkLayerDown()
       
    59 /**
       
    60  * Informs the daemon of the start of link layer renegotiation. 
       
    61  *
       
    62  * @internalTechnology
       
    63  *
       
    64  * @param aStatus Active object iStatus to complete
       
    65  */
       
    66 	{
       
    67    	Send(EConfigDaemonLinkLayerDown);		
       
    68 	}	
       
    69 
       
    70 void RConfigDaemon::LinkLayerUp()
       
    71 /**
       
    72  * Informs the daemon of the completion of link layer renegotiation. 
       
    73  *
       
    74  * @internalTechnology
       
    75  *
       
    76  * @param aStatus Active object iStatus to complete
       
    77  */
       
    78 	{
       
    79    	Send(EConfigDaemonLinkLayerUp);		
       
    80 	}	
       
    81 
       
    82 void RConfigDaemon::Deregister(TInt aCause, TDes8* aActionStatus, TRequestStatus& aStatus)
       
    83 /**
       
    84  * Issues a deregistration request. 
       
    85  *
       
    86  * @internalTechnology
       
    87  * @param aCause Specifies what caused the deregister call (idle timer or Stop call)	
       
    88  * @param aActionStatus	Returns the action to be executed by Nifman 
       
    89  *						(shut down the NIF and the agent or keep them up)
       
    90  * @param aStatus Active object iStatus to complete
       
    91  */
       
    92 	{
       
    93    	SendReceive(EConfigDaemonDeregister, TIpcArgs(aCause, aActionStatus), aStatus);		
       
    94 	}	
       
    95 
       
    96 void RConfigDaemon::ProgressNotification(TDaemonProgressBuf& aProgressBuf, TRequestStatus& aStatus)
       
    97 /**
       
    98  * Issues a progress notification request. This request will be completed when the daemon has 
       
    99  * something to report.
       
   100  *
       
   101  * @internalTechnology
       
   102  * @param aProgressBuf Returns the progress information
       
   103  * @param aStatus Active object iStatus to complete
       
   104  */
       
   105 	{
       
   106 	SendReceive(EConfigDaemonProgress, TIpcArgs(&aProgressBuf), aStatus);	
       
   107 	}	
       
   108 
       
   109 void RConfigDaemon::Ioctl(TUint aOptionLevel, TUint aOptionName, TRequestStatus& aStatus, TDes8* aDes)
       
   110 /**
       
   111   * Issues an asynchronous command. Various option's levels & names could be supported
       
   112   * by the loaded daemon
       
   113   *
       
   114   * @internalTechnology
       
   115   * @return TInt An error code
       
   116   * @param aOptionLevel - Control level
       
   117   * @param aOptionName - Name of control request
       
   118   * @param aStatus - active object iStatus to complete
       
   119   * @param aOption - Buffer for data to be retrieved
       
   120   */
       
   121 	{
       
   122   	SendReceive(EConfigDaemonIoctl, TIpcArgs(aOptionLevel, aOptionName, aDes, aDes ? aDes->MaxLength() : 0), aStatus);
       
   123 	}
       
   124 
       
   125 void RConfigDaemon::Cancel(TRequestStatus& aStatus)
       
   126 /**
       
   127   * Cancels current request asynchronously => 
       
   128   * just one request at the time could be issued see
       
   129   * CNifConfigurationControl::StoreClientStatus functinon in NIFConfigurationControl.cpp
       
   130   *
       
   131   * @internalTechnology
       
   132   * @param aStatus - active object iStatus to complete
       
   133   * @return TInt An error code
       
   134   */
       
   135 	{
       
   136    //!!This async call assumes there will be always place in the daemon queue to send the 
       
   137    //cancel message. The msg queue is 10 requests long, each daemon processes one request at the
       
   138    //time => dangerous situation occures when there'r running more than 3 different links, each
       
   139    //configured by daemon, each having outstanding request 
       
   140    //and we cancel all of them at the same time. Very, very unlikely situation.
       
   141    	SendReceive(EConfigDaemonCancel, TIpcArgs(), aStatus);
       
   142 	}
       
   143 
       
   144 void RConfigDaemon::Cancel(TUint aOpMask, TRequestStatus& aStatus)
       
   145 /**
       
   146  * Cancels an asynchronous operation. The operation to be canceled is specified 
       
   147  * in the mask.
       
   148  *
       
   149  * @internalTechnology
       
   150  * @param aOpMask Specifies the operation to be canceled
       
   151  * @param aStatus active object iStatus to complete
       
   152  */
       
   153 	{
       
   154    	SendReceive(EConfigDaemonCancelMask, TIpcArgs(aOpMask), aStatus);	
       
   155 	}
       
   156 
       
   157