usbmgmt/usbmgr/device/classdrivers/acm/classimplementation/ecacm/inc/ActiveDataAvailableNotifier.h
changeset 0 c9bc50fca66e
equal deleted inserted replaced
-1:000000000000 0:c9bc50fca66e
       
     1 /*
       
     2 * Copyright (c) 2007-2009 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 #ifndef __ACTIVEDATAAVAILABLENOTIFIER_H__
       
    19 #define __ACTIVEDATAAVAILABLENOTIFIER_H__
       
    20 
       
    21 #include <e32base.h>
       
    22 #include <d32usbc.h>
       
    23 
       
    24 class RDevUsbcClient;
       
    25 class MNotifyDataAvailableObserver;
       
    26 
       
    27 NONSHARABLE_CLASS(CActiveDataAvailableNotifier) : public CActive
       
    28 /**
       
    29  * Active object used to notify the parent when there is data available 
       
    30  * to be read from the LDD.  Since the LDD does not support this functionality 
       
    31  * directly RDevUsbcClient::ReadOneOrMore() is used instead, specifying a 
       
    32  * zero byte read into a descriptor which is owned by the class.
       
    33  */
       
    34 	{
       
    35 public: 									   
       
    36 	static CActiveDataAvailableNotifier* NewL(MNotifyDataAvailableObserver& aParent, 
       
    37 		RDevUsbcClient& aLdd, TEndpointNumber aEndpoint);
       
    38 	~CActiveDataAvailableNotifier();
       
    39 
       
    40 public:
       
    41 	void NotifyDataAvailable();
       
    42 
       
    43 private:
       
    44 	CActiveDataAvailableNotifier(MNotifyDataAvailableObserver& aParent, 
       
    45 		RDevUsbcClient& aLdd, TEndpointNumber aEndpoint);
       
    46 
       
    47 private: // from CActive
       
    48 	virtual void DoCancel();
       
    49 	virtual void RunL();
       
    50 
       
    51 private: // unowned
       
    52 	MNotifyDataAvailableObserver& iParent;
       
    53 	RDevUsbcClient& iLdd;
       
    54 
       
    55 private: // owned
       
    56 	TEndpointNumber iEndpoint;
       
    57 	TBuf8<1> iUnusedBuf;	// passed to the LDD in order to carry out the zero byte read (length must be > 0)
       
    58 	};
       
    59 
       
    60 #endif // __ACTIVEDATAAVAILABLENOTIFIER_H__