mtptransports/mtpusbtransport/usbsic_imp/inc/cmtpusbepcontrol.h
changeset 0 d0791faffa3f
equal deleted inserted replaced
-1:000000000000 0:d0791faffa3f
       
     1 // Copyright (c) 2006-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 //
       
    15 
       
    16 /**
       
    17  @file
       
    18  @internalComponent
       
    19 */
       
    20 
       
    21 #ifndef CMTPUSBEPCONTROL_H
       
    22 #define CMTPUSBEPCONTROL_H
       
    23 
       
    24 #include "cmtpusbepbase.h"
       
    25 
       
    26 class CMTPUsbConnection;
       
    27 class MMTPType;
       
    28 
       
    29 /**
       
    30 Implements the USB MTP device class control endpoint data transfer controller.
       
    31 @internalComponent
       
    32  
       
    33 */
       
    34 class CMTPUsbEpControl: public CMTPUsbEpBase
       
    35     {         
       
    36 public:
       
    37 
       
    38     static CMTPUsbEpControl* NewL(TUint aId, CMTPUsbConnection& aConnection);
       
    39     ~CMTPUsbEpControl();
       
    40     
       
    41     void ReceiveControlRequestDataL(MMTPType& aData);
       
    42     void ReceiveControlRequestSetupL(MMTPType& aData);
       
    43     void SendControlRequestDataL(const MMTPType& aData);
       
    44     void SendControlRequestStatus();
       
    45 
       
    46 private: // From CMTPUsbEpBase
       
    47 
       
    48     void ReceiveDataCompleteL(TInt aError, MMTPType& aSink);
       
    49     void SendDataCompleteL(TInt aError, const MMTPType& aSource);
       
    50     
       
    51 private: // From CActive
       
    52 	void DoCancel();
       
    53     
       
    54 private:
       
    55 
       
    56     CMTPUsbEpControl(TUint aId, CMTPUsbConnection& aConnection);
       
    57     
       
    58     void SetState(TUint aState);
       
    59      
       
    60 private: // Owned
       
    61 
       
    62     /**
       
    63     The control endpoint data send/receive states.
       
    64     */
       
    65     enum TMTPUsbEpControlState
       
    66         {
       
    67         EIdle,
       
    68         EControlRequestSetupPending,
       
    69         EControlRequestSetupComplete,
       
    70         EControlRequestDataReceive,
       
    71         EControlRequestDataSend,
       
    72         EControlRequestStatusSend
       
    73         };
       
    74         
       
    75     /**
       
    76     The control endpoint data send/receive state variable.
       
    77     */
       
    78     TUint iState;
       
    79     
       
    80     };
       
    81 #endif // CMTPUSBEPCONTROL_H