usbdrv/peripheral/pdd/pil/inc/controltransfersm.inl
changeset 59 bbdce6bffaad
equal deleted inserted replaced
58:84c26be382f0 59:bbdce6bffaad
       
     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 #ifndef CONTROLTRANSFERSM_INL
       
    19 #define CONTROLTRANSFERSM_INL
       
    20 
       
    21 inline MControlTransferIf& DControlTransferManager::CtrTransferIf() 
       
    22     { 
       
    23     return iCtrTransferIf; 
       
    24     }
       
    25     
       
    26 inline TSetupPkgParser& DControlTransferManager::PktParser() 
       
    27     { 
       
    28     return iPacketParser; 
       
    29     }
       
    30 
       
    31 inline void DControlTransferManager::DataReceived(TUint16 aCount)
       
    32     {
       
    33     iDataTransfered += aCount;
       
    34     }
       
    35     
       
    36 inline TBool DControlTransferManager::IsMoreBytesNeeded()
       
    37     {
       
    38     return (iDataTransfered >= iPacketParser.DataLength())?EFalse:ETrue;
       
    39     }
       
    40     
       
    41 inline TUsbDataDir TSetupPkgParser::DataDirection()
       
    42     {
       
    43     return (iSetupPkt.iRequestType & KUSB_SETUPKT_DATA_DIR_MASK) ? 
       
    44                                     EUsbDataDir_ToHost : EUsbDataDir_ToDevice;
       
    45     }
       
    46     
       
    47 inline TBool TSetupPkgParser::IsVendorRequest()
       
    48     {
       
    49     return (iSetupPkt.iRequestType & KUSB_SETUPKT_REQ_TYPE_VENDOR_MASK) ? ETrue : EFalse;
       
    50     }
       
    51    
       
    52 inline TBool TSetupPkgParser::IsClassRequest()
       
    53     {
       
    54     return (iSetupPkt.iRequestType & KUSB_SETUPKT_REQ_TYPE_CLASS_MASK) ? ETrue : EFalse;
       
    55     }
       
    56     
       
    57 inline TBool TSetupPkgParser::IsStandardRequest()
       
    58     {
       
    59     return (iSetupPkt.iRequestType & KUSB_SETUPKT_REQ_TYPE_STANDARD_MASK == 0)? ETrue : EFalse;
       
    60     }
       
    61     
       
    62 inline TUsbRequest TSetupPkgParser::Request()
       
    63     {
       
    64     return iSetupPkt.iRequestType;
       
    65     }
       
    66     
       
    67 inline TUint16 TSetupPkgParser::Value()
       
    68     {
       
    69     return iSetupPkt.iValue;
       
    70     }
       
    71     
       
    72 inline TUint16 TSetupPkgParser::Index()
       
    73     {
       
    74     return iSetupPkt.iIndex;
       
    75     }
       
    76     
       
    77 inline TUint16 TSetupPkgParser::DataLength()
       
    78     {     
       
    79     return iSetupPkt.iLength;
       
    80     }
       
    81     
       
    82 inline TUsbcSetup& TSetupPkgParser::SetupPacket()
       
    83     {
       
    84     return iSetupPkt;
       
    85     } 
       
    86     
       
    87 #endif //CONTROLTRANSFERSM_INL
       
    88 
       
    89 // End of file
       
    90