--- a/kerneltest/e32test/usbho/t_usbdi/src/TestInterfaceBase.cpp Thu Aug 19 11:14:22 2010 +0300
+++ b/kerneltest/e32test/usbho/t_usbdi/src/TestInterfaceBase.cpp Tue Aug 31 16:34:26 2010 +0300
@@ -1,4 +1,4 @@
-// Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
+// Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies).
// All rights reserved.
// This component and the accompanying materials are made available
// under the terms of the License "Eclipse Public License v1.0"
@@ -22,6 +22,10 @@
#include "testdebug.h"
#include "controltransferrequests.h"
#include "endpointwriter.h"
+#include "OstTraceDefinitions.h"
+#ifdef OST_TRACE_COMPILER_IN_USE
+#include "TestInterfaceBaseTraces.h"
+#endif
namespace NUnitTesting_USBDI
@@ -33,11 +37,13 @@
iInterfaceName(aName),
iCurrentAlternateInterfaceSetting(0) // The default alternate interface setting will be zero when opened
{
+ OstTraceFunctionEntryExt( CINTERFACEBASE_CINTERFACEBASE_ENTRY, this );
+ OstTraceFunctionExit1( CINTERFACEBASE_CINTERFACEBASE_EXIT, this );
}
CInterfaceBase::~CInterfaceBase()
{
- LOG_FUNC
+ OstTraceFunctionEntry1( CINTERFACEBASE_CINTERFACEBASE_ENTRY_DUP01, this );
delete iAuxBuffer;
delete iStallWatcher;
@@ -54,17 +60,18 @@
// Close the channel to the driver
iClientDriver.Close();
+ OstTraceFunctionExit1( CINTERFACEBASE_CINTERFACEBASE_EXIT_DUP01, this );
}
void CInterfaceBase::BaseConstructL()
{
- LOG_FUNC
+ OstTraceFunctionEntry1( CINTERFACEBASE_BASECONSTRUCTL_ENTRY, this );
// Open channel to driver
TInt err(iClientDriver.Open(0));
if(err != KErrNone)
{
- RDebug::Printf("<Error %d> Unable to open a channel to USB client driver",err);
+ OstTrace1(TRACE_NORMAL, CINTERFACEBASE_BASECONSTRUCTL, "<Error %d> Unable to open a channel to USB client driver",err);
User::Leave(err);
}
@@ -80,18 +87,19 @@
// Hide bus from host while interfaces are being set up
iClientDriver.DeviceDisconnectFromHost();
+ OstTraceFunctionExit1( CINTERFACEBASE_BASECONSTRUCTL_EXIT, this );
}
void CInterfaceBase::AddInterfaceSettingL(CInterfaceSettingBase* aInterfaceSetting)
{
- LOG_FUNC
+ OstTraceFunctionEntryExt( CINTERFACEBASE_ADDINTERFACESETTINGL_ENTRY, this );
// Append to the container
TInt err(iAlternateSettings.Append(aInterfaceSetting));
if(err != KErrNone)
{
- RDebug::Printf("<Error %d> Unable to add interface setting",err);
+ OstTrace1(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL, "<Error %d> Unable to add interface setting",err);
User::Leave(err);
}
@@ -102,14 +110,14 @@
if(endpointSettingCount > 0)
{
- RDebug::Printf("%u endpoint(s) to configure for this interface setting",endpointSettingCount);
+ OstTrace1(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP01, "%u endpoint(s) to configure for this interface setting",endpointSettingCount);
// Device capabilities
TUsbDeviceCaps devCaps;
err = iClientDriver.DeviceCaps(devCaps);
if(err != KErrNone)
{
- RDebug::Printf("<Error %d> Unable to retrieve device capabilities",err);
+ OstTrace1(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP02, "<Error %d> Unable to retrieve device capabilities",err);
User::Leave(err);
}
@@ -119,7 +127,7 @@
err = iClientDriver.EndpointCaps(dataptr);
if(err != KErrNone)
{
- RDebug::Printf("<Error %d> Unable to get endpoint capabilities",err);
+ OstTrace1(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP03, "<Error %d> Unable to get endpoint capabilities",err);
User::Leave(err);
}
@@ -133,13 +141,13 @@
for(; epIndex<totalEndpoints; epIndex++)
{
- RDebug::Printf("Examining hardware endpoint %u",epIndex);
+ OstTrace1(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP04, "Examining hardware endpoint %u",epIndex);
const TUsbcEndpointData ep = endpointCaps[epIndex];
// Check the endpoint index to see if already claimed
if(!ep.iInUse)
{
- RDebug::Printf("...its free");
+ OstTrace0(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP05, "...its free");
const TUsbcEndpointCaps caps(ep.iCaps);
// Information about the endpoint we are looking for
@@ -157,18 +165,18 @@
// Create an endpoint writer for this endpoint
aInterfaceSetting->CreateEndpointWriterL(iClientDriver,(epCount+1));
- RDebug::Printf("Created endpoint writer for endpoint%d",epCount+1);
+ OstTrace1(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP06, "Created endpoint writer for endpoint%d",epCount+1);
}
else if(endpointSpec.iDir == KUsbEpDirOut)
{
// Create an endpoint reader for this endpoint
aInterfaceSetting->CreateEndpointReaderL(iClientDriver,epCount+1);
- RDebug::Printf("Created endpoint reader for endpoint%d",epCount+1);
+ OstTrace1(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP07, "Created endpoint reader for endpoint%d",epCount+1);
}
epCount++; // Increment to next endpoint spec
- RDebug::Printf("Endpoint %u configured",epCount);
+ OstTrace1(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP08, "Endpoint %u configured",epCount);
endpointSpec.iSize = caps.MaxPacketSize();
if(epCount >= endpointSettingCount)
@@ -180,98 +188,107 @@
}
else
{
- RDebug::Printf("...its busy");
+ OstTrace0(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP09, "...its busy");
}
}
- RDebug::Printf("Configure %u out of %u endpoints",epCount,endpointSettingCount);
+ OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP10, "Configure %u out of %u endpoints",epCount,endpointSettingCount);
if(epCount < endpointSettingCount)
{
- RDebug::Printf("<Error %d> Only managed to configure %u out of %u endpoints",KErrNotFound,epCount,endpointSettingCount);
+ OstTraceExt3(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP11, "<Error %d> Only managed to configure %u out of %u endpoints",KErrNotFound,epCount,endpointSettingCount);
User::Leave(KErrNotFound);
}
}
else
{
- RDebug::Printf("No endpoints for this interface setting");
+ OstTrace0(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP12, "No endpoints for this interface setting");
}
// Add the new setting to the device
err = iClientDriver.SetInterface(alternateSettingNumber,aInterfaceSetting->iInterfaceInfo);
if(err != KErrNone)
{
- RDebug::Printf("<Error %d> Unable to set the alternate interface setting %d",err,alternateSettingNumber);
+ OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP13, "<Error %d> Unable to set the alternate interface setting %d",err,alternateSettingNumber);
User::Leave(err);
}
- RDebug::Printf("Alternate interface setting %d set",alternateSettingNumber);
+ OstTrace1(TRACE_NORMAL, CINTERFACEBASE_ADDINTERFACESETTINGL_DUP14, "Alternate interface setting %d set",alternateSettingNumber);
+ OstTraceFunctionExit1( CINTERFACEBASE_ADDINTERFACESETTINGL_EXIT, this );
}
TInt CInterfaceBase::StallEndpoint(TUint16 aEndpointNumber)
{
- LOG_FUNC
+ OstTraceFunctionEntryExt( CINTERFACEBASE_STALLENDPOINT_ENTRY, this );
- RDebug::Printf("Stalling endpoint%d",aEndpointNumber);
+ OstTrace1(TRACE_NORMAL, CINTERFACEBASE_STALLENDPOINT, "Stalling endpoint%d",aEndpointNumber);
return iClientDriver.HaltEndpoint(static_cast<TEndpointNumber>(aEndpointNumber));
}
CInterfaceSettingBase& CInterfaceBase::AlternateSetting(TInt aSettingNumber) const
{
+ OstTraceFunctionEntryExt( CINTERFACEBASE_ALTERNATESETTING_ENTRY, this );
+ OstTraceFunctionExit1( CINTERFACEBASE_ALTERNATESETTING_EXIT, this );
return *iAlternateSettings[aSettingNumber];
}
TInt CInterfaceBase::InterfaceSettingCount() const
{
+ OstTraceFunctionEntry1( CINTERFACEBASE_INTERFACESETTINGCOUNT_ENTRY, this );
return iAlternateSettings.Count();
}
TUint32 CInterfaceBase::ExtractNumberL(const TDesC8& aPayload)
{
- LOG_FUNC
+OstTraceFunctionEntryExt( CINTERFACEBASE_EXTRACTNUMBERL_ENTRY, this );
// Read the number of repeats and the data supplied by the host, on the specified endpoint
TLex8 lex(aPayload.Left(KNumberStringLength));
TUint32 numBytes;
User::LeaveIfError(lex.Val(numBytes, EDecimal));
- RDebug::Printf("Writing %d bytes using string pattern below to IN endpoint",numBytes);
- RDebug::RawPrint(aPayload.Mid(KNumberStringLength));
- RDebug::Printf(""); //new line
+ OstTrace1(TRACE_NORMAL, CINTERFACEBASE_EXTRACTNUMBERL, "Writing %d bytes using string pattern below to IN endpoint",numBytes);
+ const TPtrC8& midPayload = aPayload.Mid(KNumberStringLength);
+ OstTraceData(TRACE_NORMAL, CINTERFACEBASE_EXTRACTNUMBERL_DUP50, "", midPayload.Ptr(), midPayload.Length());
+ OstTrace0(TRACE_NORMAL, CINTERFACEBASE_EXTRACTNUMBERL_DUP01, "");
+ OstTraceFunctionExitExt( CINTERFACEBASE_EXTRACTNUMBERL_EXIT, this, ( TUint )( numBytes ) );
return numBytes;
}
void CInterfaceBase::ExtractTwoNumbersL(const TDesC8& aPayload, TUint32& aFirstNum, TUint32& aSecondNum)
{
- LOG_FUNC
+OstTraceFunctionEntryExt( CINTERFACEBASE_EXTRACTTWONUMBERSL_ENTRY, this );
// Read the number of repeats and the data supplied by the host, on the specified endpoint
TLex8 lex1(aPayload.Left(KNumberStringLength));
User::LeaveIfError(lex1.Val(aFirstNum, EDecimal));
TLex8 lex2(aPayload.Mid(KNumberStringLength, KNumberStringLength));
User::LeaveIfError(lex2.Val(aSecondNum, EDecimal));
- RDebug::Printf("Writing or Reading a total of %d bytes in repeats of %d bytes using string pattern below to IN endpoint",aFirstNum,aSecondNum);
- RDebug::RawPrint(aPayload.Mid(2*KNumberStringLength));
- RDebug::Printf(""); //new line
+ OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_EXTRACTTWONUMBERSL, "Writing or Reading a total of %d bytes in repeats of %d bytes using string pattern below to IN endpoint",aFirstNum,aSecondNum);
+ const TPtrC8& midPayload = aPayload.Mid(2*KNumberStringLength);
+ OstTraceData(TRACE_NORMAL, CINTERFACEBASE_EXTRACTTWONUMBERSL_DUP50, "", midPayload.Ptr(), midPayload.Length());
+ OstTrace0(TRACE_NORMAL, CINTERFACEBASE_EXTRACTTWONUMBERSL_DUP01, "");
+ OstTraceFunctionExit1( CINTERFACEBASE_EXTRACTTWONUMBERSL_EXIT, this );
return;
}
void CInterfaceBase::AlternateInterfaceSelectedL(TInt aAlternateInterfaceSetting)
{
- LOG_FUNC
- RDebug::Printf("Interface %S:",&iInterfaceName);
+ OstTraceFunctionEntryExt( CINTERFACEBASE_ALTERNATEINTERFACESELECTEDL_ENTRY, this );
+ OstTraceExt1(TRACE_NORMAL, CINTERFACEBASE_ALTERNATEINTERFACESELECTEDL, "Interface %S:",iInterfaceName);
iCurrentAlternateInterfaceSetting = aAlternateInterfaceSetting;
+ OstTraceFunctionExit1( CINTERFACEBASE_ALTERNATEINTERFACESELECTEDL_EXIT, this );
}
TInt CInterfaceBase::ProcessRequestL(TUint8 aRequest,TUint16 aValue,TUint16 aIndex,
TUint16 aDataReqLength,const TDesC8& aPayload)
{
- LOG_FUNC
- RDebug::Printf("Interface %S:",&iInterfaceName);
+ OstTraceFunctionEntryExt( CINTERFACEBASE_PROCESSREQUESTL_ENTRY, this );
+ OstTraceExt1(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL, "Interface %S:",iInterfaceName);
switch(aRequest)
{
@@ -279,34 +296,34 @@
// Acknowledge the request and do nothing
iEp0Reader->Acknowledge();
- RDebug::Printf("Request: Empty");
+ OstTrace0(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP01, "Request: Empty");
break;
case KVendorPutPayloadRequest:
// Acknowledge the request
iEp0Reader->Acknowledge();
- RDebug::Printf("Put payload");
+ OstTrace0(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP02, "Put payload");
if(aPayload.Compare(_L8("DEADBEEF")) != 0)
{
- RDebug::Printf("<Error %d> Payload not as expected",KErrCorrupt);
+ OstTrace1(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP03, "<Error %d> Payload not as expected",KErrCorrupt);
iDevice.ReportError(KErrCorrupt);
}
break;
case KVendorGetPayloadRequest:
{
- RDebug::Printf("Get payload");
+ OstTrace0(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP04, "Get payload");
__ASSERT_DEBUG(iAuxBuffer, User::Panic(_L("Trying to write non-allocated buffer"), KErrGeneral));
- RDebug::Printf("iAuxBuffer = ....");
- RDebug::RawPrint(*iAuxBuffer);
- RDebug::Printf("\n");
+ OstTrace0(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP05, "iAuxBuffer = ....");
+ OstTraceData(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP55, "", iAuxBuffer->Ptr(), iAuxBuffer->Length());
+ OstTrace0(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP06, "\n");
//Perform synchronous write to EP0
//This allows the subsequent 'Read' request to
//take place
TInt ret = iEp0Writer->WriteSynchronous(*iAuxBuffer, ETrue);
- RDebug::Printf("Write (from interface callback) executed with error %d", ret);
+ OstTrace1(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP07, "Write (from interface callback) executed with error %d", ret);
}
break;
@@ -324,7 +341,7 @@
//This allows the subsequent 'Read' request to
//take place
TInt ret = iEp0Writer->WriteSynchronous(*iAuxBuffer, ETrue);
- RDebug::Printf("Write (from interface callback) executed with error %d", ret);
+ OstTrace1(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP08, "Write (from interface callback) executed with error %d", ret);
}
break;
@@ -342,7 +359,7 @@
//This allows the subsequent 'Read' request to
//take place
TInt ret = iEp0Writer->WriteSynchronous(*iAuxBuffer, ETrue);
- RDebug::Printf("Write (from interface callback) executed with error %d", ret);
+ OstTrace1(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP09, "Write (from interface callback) executed with error %d", ret);
}
break;
@@ -350,7 +367,7 @@
// Acknowledge the request
iEp0Reader->Acknowledge();
- RDebug::Printf("Writing %d bytes to IN endpoint (index %d)",aPayload.Length(),aValue);
+ OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP10, "Writing %d bytes to IN endpoint (index %d)",aPayload.Length(),aValue);
// Write the data supplied by the host, back to the host though the specified endpoint
@@ -361,7 +378,7 @@
// Acknowledge the request
iEp0Reader->Acknowledge();
- RDebug::Printf("CANCEL Writing to IN endpoint (index %d)",aValue);
+ OstTrace1(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP11, "CANCEL Writing to IN endpoint (index %d)",aValue);
// CANCEL writing the data supplied by the host, back to the host though the specified endpoint
@@ -416,7 +433,7 @@
TUint32 numBytesPerRead = 0;
TUint32 totalNumBytes = 0;
ExtractTwoNumbersL(aPayload, numBytesPerRead, totalNumBytes);
- RDebug::Printf("Extracted: Number of Bytes per Read = %d, Total Number of Bytes = %d",numBytesPerRead,totalNumBytes);
+ OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP12, "Extracted: Number of Bytes per Read = %d, Total Number of Bytes = %d",numBytesPerRead,totalNumBytes);
// Write the data supplied by the host, back to the host though the specified endpoint
AlternateSetting(iCurrentAlternateInterfaceSetting).RepeatedReadAndValidateFromEndpointL(aPayload.Mid(KTwoNumberStringLength),numBytesPerRead,totalNumBytes,aValue);
@@ -432,7 +449,7 @@
TUint32 numBytesPerWrite = 0;
TUint32 totalNumBytes = 0;
ExtractTwoNumbersL(aPayload, numBytesPerWrite, totalNumBytes);
- RDebug::Printf("Extracted: Number of Bytes per Read = %d, Total Number of Bytes = %d",numBytesPerWrite,totalNumBytes);
+ OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP13, "Extracted: Number of Bytes per Read = %d, Total Number of Bytes = %d",numBytesPerWrite,totalNumBytes);
// Write the data supplied by the host, back to the host though the specified endpoint
AlternateSetting(iCurrentAlternateInterfaceSetting).RepeatedWriteSpecifiedDataToEndpointL(aPayload.Mid(KTwoNumberStringLength),numBytesPerWrite,totalNumBytes,aValue);
@@ -447,7 +464,7 @@
TUint16 readEndpoint = aValue >> 8; //HI 8 buts
TUint16 writeEndpoint = aValue & 0x00ff; //LO 8 bits
- RDebug::Printf("Writing data cached on OUT endpoint (index %d) to IN endpoint (index %d)",readEndpoint,writeEndpoint);
+ OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP14, "Writing data cached on OUT endpoint (index %d) to IN endpoint (index %d)",readEndpoint,writeEndpoint);
// Write the data supplied by the host, back to the host though the specified endpoint
@@ -463,7 +480,7 @@
TUint16 readEndpoint = aValue >> 8; //HI 8 buts
TUint16 writeEndpoint = aValue & 0x00ff; //LO 8 bits
- RDebug::Printf("Writing data cached on OUT endpoint (index %d) to IN endpoint (index %d)",readEndpoint,writeEndpoint);
+ OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP15, "Writing data cached on OUT endpoint (index %d) to IN endpoint (index %d)",readEndpoint,writeEndpoint);
// Write the data supplied by the host, back to the host though the specified endpoint
@@ -478,7 +495,7 @@
TUint16 readEndpoint = aValue >> 8; //HI 8 buts
TUint16 writeEndpoint = aValue & 0x00ff; //LO 8 bits
- RDebug::Printf("Writing data cached on OUT endpoint (index %d) to IN endpoint (index %d) in sections of....",readEndpoint,writeEndpoint);
+ OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP16, "Writing data cached on OUT endpoint (index %d) to IN endpoint (index %d) in sections of....",readEndpoint,writeEndpoint);
// Read the number of bytes to use for each Write
TUint numBytes[KNumSplitWriteSections];
@@ -487,7 +504,7 @@
{
TLex8 lex(aPayload.Mid(i*KNumberStringLength, KNumberStringLength));
User::LeaveIfError(lex.Val(numBytes[i], EDecimal));
- RDebug::Printf("%d bytes", numBytes[i]);
+ OstTrace1(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP17, "%d bytes", numBytes[i]);
// Write the data supplied by the host, back to the host though the specified endpoint
AlternateSetting(iCurrentAlternateInterfaceSetting).WriteSynchronousCachedEndpointDataToEndpointL(readEndpoint,writeEndpoint,numBytesWritten,numBytes[i]);
// Updates bytes written for next round of 'for'loop
@@ -505,7 +522,7 @@
TLex8 lex(aPayload);
TUint32 numBytes;
User::LeaveIfError(lex.Val(numBytes, EDecimal));
- RDebug::Printf("Reading %d bytes on OUT endpoint (index %d)",numBytes,aValue);
+ OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP18, "Reading %u bytes on OUT endpoint (index %u)",numBytes,(TUint32)aValue);
AlternateSetting(iCurrentAlternateInterfaceSetting).ReadDataFromEndpointL(numBytes,aValue);
}
break;
@@ -519,7 +536,7 @@
TLex8 lex(aPayload);
TUint32 numBytes;
User::LeaveIfError(lex.Val(numBytes, EDecimal));
- RDebug::Printf("Reading %d bytes on OUT endpoint (index %d) ... then halting endpoint",numBytes,aValue);
+ OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP19, "Reading %u bytes on OUT endpoint (index %u) ... then halting endpoint",numBytes,(TUint32)aValue);
AlternateSetting(iCurrentAlternateInterfaceSetting).ReadDataFromAndHaltEndpointL(numBytes,aValue);
}
break;
@@ -529,7 +546,7 @@
// Acknowledge the request
iEp0Reader->Acknowledge();
- RDebug::Printf("CANCEL Reading on OUT endpoint (index %d)",aValue);
+ OstTrace1(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP20, "CANCEL Reading on OUT endpoint (index %u)",(TUint32)aValue);
AlternateSetting(iCurrentAlternateInterfaceSetting).CancelAnyReadDataFromEndpointL(aValue);
}
break;
@@ -543,7 +560,7 @@
TLex8 lex(aPayload);
TUint32 numBytes;
User::LeaveIfError(lex.Val(numBytes, EDecimal));
- RDebug::Printf("Reading %d bytes on OUT endpoint (index %d)",numBytes,aValue);
+ OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP21, "Reading %u bytes on OUT endpoint (index %u)",numBytes,(TUint32)aValue);
AlternateSetting(iCurrentAlternateInterfaceSetting).ReadDataUntilShortFromEndpointL(numBytes,aValue);
}
break;
@@ -555,12 +572,13 @@
// Read the number of repeats and the data supplied by the host, on the specified endpoint
TLex8 lex(aPayload.Left(KNumberStringLength));
- RDebug::Printf("NUMBER STRING LENGTH CALCULATED AS %d",KNumberStringLength);
+ OstTrace1(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP22, "NUMBER STRING LENGTH CALCULATED AS %d",KNumberStringLength);
TUint32 numBytes;
User::LeaveIfError(lex.Val(numBytes, EDecimal));
- RDebug::Printf("Validation");
- RDebug::Printf("Checking %d bytes using string pattern below exist in the buffer for endpoint %d",numBytes,aValue);
- RDebug::RawPrint(aPayload.Mid(KNumberStringLength));
+ OstTrace0(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP23, "Validation");
+ OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP24, "Checking %u bytes using string pattern below exist in the buffer for endpoint %u",numBytes,(TUint32)aValue);
+ const TPtrC8& midPayload = aPayload.Mid(KNumberStringLength);
+ OstTraceData(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP54, "", midPayload.Ptr(), midPayload.Length());
delete iAuxBuffer;
iAuxBuffer = HBufC8::NewL(KPassFailStringLength);
@@ -598,18 +616,18 @@
case KVendorUnrespondRequest:
// Do not acknowledge this request
- RDebug::Printf("Unrespond request: continually NAK the host");
+ OstTrace0(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP25, "Unrespond request: continually NAK the host");
break;
case KVendorStallRequest:
{
// Stall the specified endpoint
iEp0Reader->Acknowledge();
- RDebug::Printf("Stalling endpoint%d",aValue);
+ OstTrace1(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP26, "Stalling endpoint%d",aValue);
TInt err = StallEndpoint(aValue);
if(err != KErrNone)
{
- RDebug::Printf("<Error %d> unable to stall endpoint index %d",err,aValue);
+ OstTraceExt2(TRACE_NORMAL, CINTERFACEBASE_PROCESSREQUESTL_DUP27, "<Error %d> unable to stall endpoint index %d",err,aValue);
iDevice.ReportError(err);
}
}
@@ -619,23 +637,26 @@
break;
}
+ OstTraceFunctionExitExt( CINTERFACEBASE_PROCESSREQUESTL_EXIT, this, KErrNone );
return KErrNone;
}
void CInterfaceBase::StartEp0Reading()
{
- LOG_FUNC
+ OstTraceFunctionEntry1( CINTERFACEBASE_STARTEP0READING_ENTRY, this );
iEp0Reader->ReadRequestsL();
+ OstTraceFunctionExit1( CINTERFACEBASE_STARTEP0READING_EXIT, this );
}
void CInterfaceBase::StopEp0Reading()
{
- LOG_FUNC
+ OstTraceFunctionEntry1( CINTERFACEBASE_STOPEP0READING_ENTRY, this );
iEp0Reader->Cancel();
+ OstTraceFunctionExit1( CINTERFACEBASE_STOPEP0READING_EXIT, this );
}
}