usbmgmt/usbmgr/device/classdrivers/acm/classimplementation/ecacm/inc/CdcControlInterface.h
changeset 0 c9bc50fca66e
equal deleted inserted replaced
-1:000000000000 0:c9bc50fca66e
       
     1 /*
       
     2 * Copyright (c) 1997-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 __CDCCONTROLINTERFACE_H__
       
    19 #define __CDCCONTROLINTERFACE_H__
       
    20 
       
    21 #include "CdcInterfaceBase.h"
       
    22 
       
    23 class CCdcAcmClass;
       
    24 class CCdcControlInterfaceReader;
       
    25 
       
    26 NONSHARABLE_CLASS(CCdcControlInterface) : public CCdcInterfaceBase
       
    27 /**
       
    28  * ACM control interface subclass.
       
    29  */
       
    30 	{
       
    31 public:
       
    32 	static CCdcControlInterface* NewL(CCdcAcmClass& aParent, const TUint8 aProtocolNum, const TDesC16& aIfcName);
       
    33 	~CCdcControlInterface();
       
    34 
       
    35 public:
       
    36 	TInt SetupClassSpecificDescriptor(TUint8 aDataInterfaceNumber);
       
    37 	TInt SendNetworkConnection(TBool aValue);
       
    38 	TInt SendSerialState(TBool aOverRun, 
       
    39 		TBool aParity, 
       
    40 		TBool aFraming, 
       
    41 		TBool aRing, 
       
    42 		TBool aBreak,
       
    43 		TBool aTxCarrier,
       
    44 		TBool aRxCarrier);
       
    45 
       
    46 public:
       
    47 	static inline TReal32 GetF32( TUint8** aPPbuf );
       
    48 	static inline void	  PutF32( TUint8** aPPbuf, TReal32 aF32 );
       
    49 
       
    50 	static inline TUint32 GetU32( TUint8** aPPbuf );
       
    51 	static inline void	  PutU32( TUint8** aPPbuf, TUint32 aU32 );
       
    52 
       
    53 	static inline TUint16 GetU16( TUint8** aPPbuf );
       
    54 	static inline void	  PutU16( TUint8** aPPbuf,TUint16 aU16 );
       
    55 
       
    56 	static inline TUint8 GetU08( TUint8** aPPbuf );
       
    57 	static inline void	 PutU08( TUint8** aPPbuf, TUint8 aU8 );
       
    58 
       
    59 private:
       
    60 	CCdcControlInterface(const TUint8 aProtocolNum, const TDesC16& aIfcName);
       
    61 	void ConstructL(CCdcAcmClass& aParent);
       
    62 
       
    63 private: // from CCdcClassBase
       
    64 	TInt SetUpInterface();
       
    65 
       
    66 private: // utility
       
    67 	TInt WriteData(TEndpointNumber aEndPoint, TDes8& aDes, TInt aLength);
       
    68 
       
    69 private: // owned
       
    70 	CCdcControlInterfaceReader* iReader;	///< Handle on the read object
       
    71 
       
    72 	TUint16 iSerialState;				///< local copy of the flagset
       
    73 	const TUint8 iProtocolNum;
       
    74 
       
    75 	enum
       
    76 		{
       
    77 		///< Max packet size sent on Interrupt endpoint
       
    78 		KMaxPacketTypeInterrupt = 64,	
       
    79 		///< Interrupt endpoint poll time in ms
       
    80 		KPollInterval  = 128, 
       
    81 		KWriteDataTimeout = 500000,
       
    82 		};
       
    83 	};
       
    84 
       
    85 #include "LittleEndianPacker.INL"
       
    86 
       
    87 #endif // __CDCCONTROLINTERFACE_H__