usbmgmt/usbmgr/device/classdrivers/acm/classimplementation/ecacm/src/ClassDescriptor.cpp
branchRCL_3
changeset 15 f92a4f87e424
parent 0 c9bc50fca66e
child 16 012cc2ee6408
equal deleted inserted replaced
14:d3e8e7d462dd 15:f92a4f87e424
     1 /*
     1 /*
     2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 #include "ClassDescriptor.h"
    18 #include "ClassDescriptor.h"
    19 #include "AcmPanic.h"
    19 #include "AcmPanic.h"
    20 #include <usb/usblogger.h>
    20 #include "OstTraceDefinitions.h"
       
    21 #ifdef OST_TRACE_COMPILER_IN_USE
       
    22 #include "ClassDescriptorTraces.h"
       
    23 #endif
    21 
    24 
    22 #ifdef __FLOG_ACTIVE
       
    23 _LIT8(KLogComponent, "ECACM");
       
    24 #endif
       
    25 
    25 
    26 TDes8& TUsbCsClassDescriptor::Des()
    26 TDes8& TUsbCsClassDescriptor::Des()
    27 /**
    27 /**
    28  * This function packs the TUsbCsClassDescriptor class into a descriptor with 
    28  * This function packs the TUsbCsClassDescriptor class into a descriptor with 
    29  * the correct byte alignment for transmission on the USB bus.
    29  * the correct byte alignment for transmission on the USB bus.
    30  *
    30  *
    31  * @return Correctly-aligned buffer. NB The buffer returned is a member of 
    31  * @return Correctly-aligned buffer. NB The buffer returned is a member of 
    32  * this class and has the same lifetime.
    32  * this class and has the same lifetime.
    33  */
    33  */
    34 	{
    34 	{
       
    35 	OstTraceFunctionEntry0( TUSBCSCLASSDESCRIPTOR_DES_ENTRY );
       
    36 	
    35 	TUint index = 0;
    37 	TUint index = 0;
    36 
    38 
    37 	iBuffer.SetLength(KUsbClassSpecificBufferSize);
    39 	iBuffer.SetLength(KUsbClassSpecificBufferSize);
    38 
    40 
    39 	iBuffer[index++] = iHdrSize;
    41 	iBuffer[index++] = iHdrSize;
    69 		iBuffer[index++] = (TUint8) ((iCsCountryCode[scan] & 0xff00) >> 8);
    71 		iBuffer[index++] = (TUint8) ((iCsCountryCode[scan] & 0xff00) >> 8);
    70 		}
    72 		}
    71 
    73 
    72 #endif
    74 #endif
    73 
    75 
    74 	__ASSERT_DEBUG(index == KUsbClassSpecificBufferSize, 
    76 	if (index != KUsbClassSpecificBufferSize)
    75 		_USB_PANIC(KAcmPanicCat, EPanicInternalError));
    77 		{
       
    78 		OstTrace1( TRACE_FATAL, TUSBCSCLASSDESCRIPTOR_DES, "TUsbCsClassDescriptor::Des;index=%d", (TInt)index );
       
    79 		__ASSERT_DEBUG( EFalse, User::Panic(KAcmPanicCat, EPanicInternalError) );
       
    80 		}
    76 
    81 
       
    82 	OstTraceFunctionExit0( TUSBCSCLASSDESCRIPTOR_DES_EXIT );
    77 	return iBuffer;
    83 	return iBuffer;
    78 	}
    84 	}
    79 
    85 
    80 //
    86 //
    81 // End of file
    87 // End of file