usbmgmt/usbmgr/device/classdrivers/ncm/classimplementation/ncmpktdrv/pktdrv/inc/ncmsharedstatemanager.h
branchRCL_3
changeset 16 012cc2ee6408
parent 15 f92a4f87e424
equal deleted inserted replaced
15:f92a4f87e424 16:012cc2ee6408
     1 /*
       
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 /**
       
    19 @file
       
    20 @internalComponent
       
    21 */
       
    22 
       
    23 #ifndef NCMSHAREDSTATEMANAGER_H
       
    24 #define NCMSHAREDSTATEMANAGER_H
       
    25 
       
    26 #include <e32base.h>
       
    27 #include <e32property.h>
       
    28 
       
    29 #include "ncmpktdrvcommon.h"
       
    30 #include "ncmcoexistbearerwatcher.h"
       
    31 
       
    32 
       
    33 /**
       
    34 The interface to Ncm Engine.
       
    35 */
       
    36 NONSHARABLE_CLASS(MShareStateObserver)
       
    37     {
       
    38 public:
       
    39     virtual void NotifyDhcpStarted() = 0;
       
    40     };
       
    41 
       
    42 using namespace UsbNcm;
       
    43 
       
    44 /**
       
    45 Maintain the shared state between the Paket Driver and NCM class controller
       
    46 */
       
    47 NONSHARABLE_CLASS(CNcmSharedStateManager) : public CActive
       
    48     {
       
    49 public:
       
    50     static CNcmSharedStateManager* NewL(MShareStateObserver& aEngine);
       
    51     ~CNcmSharedStateManager();
       
    52 
       
    53     TInt NotifyDhcpProvisionRequested();
       
    54     void NotifyNcmConnected();
       
    55     void NotifyNcmDisconnected(TInt aReason);
       
    56 
       
    57     TInt SetStateValue(TInt aType, TInt aValue);
       
    58     TInt RegisterNotify(const RMessage2& aMsg);
       
    59     TInt DeRegisterNotify();
       
    60 
       
    61 private:
       
    62     CNcmSharedStateManager(MShareStateObserver& aEngine);
       
    63     void ConstructL();
       
    64 
       
    65     //From CActive
       
    66     void RunL();
       
    67     void DoCancel();
       
    68 
       
    69     TInt DoDhcpProvisionRequest();
       
    70 
       
    71 private:
       
    72     RProperty                    iProperty;
       
    73     RMessage2                    iNotifyMsg;
       
    74     TPckgBuf<TNcmConnectionEvent> iNcmState;
       
    75     MShareStateObserver&         iEngine;
       
    76     CNcmCoexistBearerWatcher*    iCoexistBearer;
       
    77     };
       
    78 
       
    79 #endif // NCMSHAREDSTATEMANAGER_H