diff -r d3e8e7d462dd -r f92a4f87e424 usbmgmt/usbmgr/device/classdrivers/ncm/classimplementation/ncmpktdrv/pktdrv/inc/ncmntb16builder.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/usbmgmt/usbmgr/device/classdrivers/ncm/classimplementation/ncmpktdrv/pktdrv/inc/ncmntb16builder.h Tue Aug 31 17:01:47 2010 +0300 @@ -0,0 +1,92 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* header file for NTB16 build class +* +*/ + + +/** +@file +@internalComponent +*/ + + +#ifndef NCMNTB16BUILDER_H +#define NCMNTB16BUILDER_H + +#include +#include "ncmntbbuilder.h" +#include "ncmpktdrvcommon.h" + + +class MNcmNtbBuildObserver; + + +NONSHARABLE_CLASS(TDatagramEntry) + { +public: + TUint16 iWDatagramIndex; + TUint16 iWDatagramLength; + }; + +/** +Responsible for build NTB16 payload +*/ + +NONSHARABLE_CLASS(CNcmNtb16Builder) : public CNcmNtbBuilder + { +public: + static CNcmNtbBuilder* NewL(MNcmNtbBuildObserver&); + ~CNcmNtb16Builder(); + +public: +/** +*derived from CNcmNtbBuilder +*/ + void StartNewNtb(const TNcmBuffer& aBuffer); + TInt AppendPacket(const RMBufChain& aPacket); + TInt SetNtbInMaxSize(TInt aSize); + void CompleteNtbBuild(); + void Reset(); + +private: + CNcmNtb16Builder(MNcmNtbBuildObserver&); + void ConstructL(); + void BuildNtbHeader(); + void BuildNdp(); + + +private: + /** + * offset of NDP in buffer + */ + TUint16 iNdpOffset; + /** + * length of NDP + */ + TUint16 iNdpLength; + /** + * offset of next datagram can be in. + */ + TUint16 iDatagramOffset; + /** + * array of datagrams index and length in NTB. + */ + RArray iPacketsArray; + }; + + +#endif //NCMNTB16BUILDER_H +