--- a/usbmgmt/usbmgr/device/classdrivers/acm/classimplementation/ecacm/src/AcmReader.cpp Tue Aug 31 17:01:47 2010 +0300
+++ b/usbmgmt/usbmgr/device/classdrivers/acm/classimplementation/ecacm/src/AcmReader.cpp Wed Sep 01 12:35:00 2010 +0100
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 2003-2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 2003-2009 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"
@@ -23,12 +23,12 @@
#include "CdcAcmClass.h"
#include "AcmPanic.h"
#include "AcmPort.h"
-#include "OstTraceDefinitions.h"
-#ifdef OST_TRACE_COMPILER_IN_USE
-#include "AcmReaderTraces.h"
+#include <usb/usblogger.h>
+
+#ifdef __FLOG_ACTIVE
+_LIT8(KLogComponent, "ECACM");
#endif
-
CAcmReader* CAcmReader::NewL(CAcmPort& aPort,
TUint aBufSize)
/**
@@ -39,12 +39,12 @@
* @return Ownership of a new CAcmReader.
*/
{
- OstTraceFunctionEntry0( CACMREADER_NEWL_ENTRY );
+ LOG_STATIC_FUNC_ENTRY
+
CAcmReader* self = new(ELeave) CAcmReader(aPort, aBufSize);
CleanupStack::PushL(self);
self->ConstructL();
CLEANUPSTACK_POP(self);
- OstTraceFunctionExit0( CACMREADER_NEWL_EXIT );
return self;
}
@@ -53,10 +53,11 @@
* Destructor.
*/
{
- OstTraceFunctionEntry0( CACMREADER_CACMREADER_DES_ENTRY );
+ LOG_FUNC
+
ReadCancel();
+
delete iBuffer;
- OstTraceFunctionExit0( CACMREADER_CACMREADER_DES_EXIT );
}
CAcmReader::CAcmReader(CAcmPort& aPort,
@@ -71,8 +72,6 @@
iInBuf(NULL,0,0),
iPort(aPort)
{
- OstTraceFunctionEntry0( CACMREADER_CACMREADER_CONS_ENTRY );
- OstTraceFunctionExit0( CACMREADER_CACMREADER_CONS_EXIT );
}
void CAcmReader::ConstructL()
@@ -80,16 +79,9 @@
* 2nd-phase construction.
*/
{
- OstTraceFunctionEntry0( CACMREADER_CONSTRUCTL_ENTRY );
// Create iBuffer.
- OstTrace0( TRACE_NORMAL, CACMREADER_CONSTRUCTL, "CAcmReader::ConstructL;\tabout to create iBuffer" );
- TInt err = SetBufSize(iBufSize);
- if (err < 0)
- {
- OstTrace1( TRACE_ERROR, CACMREADER_CONSTRUCTL_DUP1, "CAcmReader::ConstructL;err=%d", err );
- User::Leave(err);
- }
- OstTraceFunctionExit0( CACMREADER_CONSTRUCTL_EXIT );
+ LOGTEXT(_L8("\tabout to create iBuffer"));
+ LEAVEIFERRORL(SetBufSize(iBufSize));
}
void CAcmReader::Read(const TAny* aClientBuffer, TUint aMaxLen)
@@ -100,8 +92,9 @@
* @param aMaxLen Maximum length to read.
*/
{
- OstTraceFunctionEntry0( CACMREADER_READ_ENTRY );
- OstTraceExt2( TRACE_NORMAL, CACMREADER_READ, "CAcmReader::Read;\taClientBuffer=%p, aMaxLen=%d", aClientBuffer, (TInt)aMaxLen );
+ LOG_FUNC
+ LOGTEXT3(_L8("\taClientBuffer=0x%08x, aMaxLen=%d"),
+ aClientBuffer, aMaxLen);
// Check we're open to requests and make a note of interesting data.
// including iLengthToGo
@@ -119,7 +112,6 @@
{
ReadWithTerminators();
}
- OstTraceFunctionExit0( CACMREADER_READ_EXIT );
}
void CAcmReader::ReadWithoutTerminators()
@@ -127,22 +119,18 @@
* Process a read request given that no terminator characters are set.
*/
{
- OstTraceFunctionEntry0( CACMREADER_READWITHOUTTERMINATORS_ENTRY );
+ LOG_FUNC
+
// Can we complete immediately from the buffer?
const TUint bufLen = BufLen();
- OstTraceExt2( TRACE_NORMAL, CACMREADER_READWITHOUTTERMINATORS,
- "CAcmReader::ReadWithoutTerminators;\thave %d bytes in buffer;\tLength to go is %d bytes",
- (TInt)bufLen, (TInt)iLengthToGo );
+ LOGTEXT2(_L8("\thave %d bytes in buffer"), bufLen);
+ LOGTEXT2(_L8("\tLength to go is %d bytes"), iLengthToGo);
if ( iLengthToGo <= bufLen )
{
- OstTrace1( TRACE_NORMAL, CACMREADER_READWITHOUTTERMINATORS_DUP1,
- "CAcmReader::ReadWithoutTerminators;\tcompleting "
- "request immediately from buffer with %d bytes",
- (TInt)iLengthToGo );
-
+ LOGTEXT2(_L8("\tcompleting request immediately from buffer with %d "
+ "bytes"), iLengthToGo);
WriteBackData(iLengthToGo);
CompleteRequest(KErrNone);
- OstTraceFunctionExit0( CACMREADER_READWITHOUTTERMINATORS_EXIT );
return;
}
@@ -150,17 +138,14 @@
// back as much as we have, and issue a Read for more.
if ( bufLen )
{
- OstTrace1( TRACE_NORMAL, CACMREADER_READWITHOUTTERMINATORS_DUP2,
- "CAcmReader::ReadWithoutTerminators;\twriting back %d bytes", (TInt)bufLen );
+ LOGTEXT2(_L8("\twriting back %d bytes"), bufLen);
// Write back as much data as we've got already.
WriteBackData(bufLen);
}
// Issue a read for the data we still need.
- OstTrace1( TRACE_NORMAL, CACMREADER_READWITHOUTTERMINATORS_DUP3,
- "CAcmReader::ReadWithoutTerminators;iLengthToGo=%d", (TInt)iLengthToGo );
+ LOGTEXT2(_L8("\tRequesting read - require %d bytes"),iLengthToGo);
IssueRead();
- OstTraceFunctionExit0( CACMREADER_READWITHOUTTERMINATORS_EXIT_DUP1 );
}
void CAcmReader::ReadWithTerminators()
@@ -168,24 +153,23 @@
* Process a read request given that terminator characters are set.
*/
{
- OstTraceFunctionEntry0( CACMREADER_READWITHTERMINATORS_ENTRY );
+ LOG_FUNC
+
// Can we complete immediately from the buffer? Search the buffer we have
// for any terminators. If found, complete back to the client. If not
// found, start issuing ReadOneOrMores until we either find one or run out
// of client buffer.
const TUint bufLen = BufLen();
- OstTrace1( TRACE_NORMAL, CACMREADER_READWITHTERMINATORS, "CAcmReader::ReadWithTerminators;bufLen=%d", (TInt)bufLen );
+ LOGTEXT2(_L8("\tbufLen = %d"), bufLen);
if ( bufLen )
{
CheckForBufferedTerminatorsAndProceed();
- OstTraceFunctionExit0( CACMREADER_READWITHTERMINATORS_EXIT );
return;
}
// There's no buffered data. Get some.
IssueReadOneOrMore();
- OstTraceFunctionExit0( CACMREADER_READWITHTERMINATORS_EXIT_DUP1 );
}
void CAcmReader::ReadOneOrMore(const TAny* aClientBuffer, TUint aMaxLen)
@@ -197,31 +181,31 @@
* @param aMaxLen Maximum length to read.
*/
{
- OstTraceFunctionEntry0( CACMREADER_READONEORMORE_ENTRY );
- OstTraceExt2( TRACE_NORMAL, CACMREADER_READONEORMORE,
- "CAcmReader::ReadOneOrMore;aClientBuffer=%p;aMaxLen=%d", aClientBuffer, (TInt)aMaxLen );
+ LOG_FUNC
+ LOGTEXT3(_L8("\taClientBuffer=0x%08x, aMaxLen=%d"),
+ aClientBuffer, aMaxLen);
+
// Check we're open to requests and make a note of interesting data.
CheckNewRequest(aClientBuffer, aMaxLen);
+
iCurrentRequest.iRequestType = EReadOneOrMore;
-
+
// Check to see if there's anything in our buffer- if there is, we can
// complete immediately.
const TUint bufLen = BufLen();
- OstTrace1( TRACE_NORMAL, CACMREADER_READONEORMORE_DUP1, "CAcmReader::ReadOneOrMore;bufLen=%d", (TInt)bufLen );
+ LOGTEXT2(_L8("\tbufLen = %d"), bufLen);
if ( bufLen )
{
// Complete request with what's in the buffer
- OstTrace1( TRACE_FLOW, CACMREADER_READONEORMORE_DUP2,
- "CAcmReader::ReadOneOrMore;\tcompleting request immediately from buffer with %d bytes", (TInt)bufLen );
+ LOGTEXT2(_L8("\tcompleting request immediately from buffer with %d "
+ "bytes"), bufLen);
WriteBackData(bufLen);
CompleteRequest(KErrNone);
- OstTraceFunctionExit0( CACMREADER_READONEORMORE_EXIT );
return;
}
// Get some more data.
IssueReadOneOrMore();
- OstTraceFunctionExit0( CACMREADER_READONEORMORE_EXIT_DUP1 );
}
void CAcmReader::NotifyDataAvailable()
@@ -229,17 +213,15 @@
* NotifyDataAvailable API. If a request is pending completes the client with KErrInUse.
*/
{
- OstTraceFunctionEntry0( CACMREADER_NOTIFYDATAAVAILABLE_ENTRY );
+ LOG_FUNC
if(iCurrentRequest.iClientPtr) // a request is pending
{
iPort.NotifyDataAvailableCompleted(KErrInUse);
- OstTraceFunctionExit0( CACMREADER_NOTIFYDATAAVAILABLE_EXIT );
return;
}
iCurrentRequest.iClientPtr = iBuffer;
iCurrentRequest.iRequestType = ENotifyDataAvailable;
iPort.Acm()->NotifyDataAvailable(*this);
- OstTraceFunctionExit0( CACMREADER_NOTIFYDATAAVAILABLE_EXIT_DUP1 );
}
void CAcmReader::NotifyDataAvailableCancel()
@@ -248,21 +230,19 @@
*
*/
{
- OstTraceFunctionEntry0( CACMREADER_NOTIFYDATAAVAILABLECANCEL_ENTRY );
+ LOG_FUNC
if (ENotifyDataAvailable == iCurrentRequest.iRequestType)
{
// Cancel any outstanding request on the LDD.
if (iPort.Acm())
{
- OstTrace0( TRACE_NORMAL, CACMREADER_NOTIFYDATAAVAILABLECANCEL,
- "CAcmReader::NotifyDataAvailableCancel;\tiPort.Acm() exists- calling NotifyDataAvailableCancel() on it" );
+ LOGTEXT(_L8("\tiPort.Acm() exists- calling NotifyDataAvailableCancel() on it"));
iPort.Acm()->NotifyDataAvailableCancel();
}
// Reset our flag to say there's no current outstanding request. What's
// already in our buffer can stay there.
iCurrentRequest.iClientPtr = NULL;
}
- OstTraceFunctionExit0( CACMREADER_NOTIFYDATAAVAILABLECANCEL_EXIT );
}
void CAcmReader::ReadCancel()
@@ -270,14 +250,14 @@
* Cancel API. Cancels any outstanding (Read or ReadOneOrMore) request.
*/
{
- OstTraceFunctionEntry0( CACMREADER_READCANCEL_ENTRY );
+ LOG_FUNC
+
if (ENotifyDataAvailable != iCurrentRequest.iRequestType)
{
// Cancel any outstanding request on the LDD.
if (iPort.Acm())
{
- OstTrace0( TRACE_NORMAL, CACMREADER_READCANCEL,
- "CAcmReader::ReadCancel;\tiPort.Acm() exists- calling ReadCancel on it" );
+ LOGTEXT(_L8("\tiPort.Acm() exists- calling ReadCancel on it"));
iPort.Acm()->ReadCancel();
}
@@ -285,7 +265,6 @@
// already in our buffer can stay there.
iCurrentRequest.iClientPtr = NULL;
}
- OstTraceFunctionExit0( CACMREADER_READCANCEL_EXIT );
}
TUint CAcmReader::BufLen() const
@@ -296,22 +275,21 @@
* @return Length of data in buffer.
*/
{
- OstTraceFunctionEntry0( CACMREADER_BUFLEN_ENTRY );
- OstTrace0( TRACE_NORMAL, CACMREADER_BUFLEN, "CAcmReader::BufLen;>>CAcmReader::BufLen" );
+ LOGTEXT(_L8(">>CAcmReader::BufLen"));
+
TUint len = 0;
if ( BufWrap() )
{
- OstTrace0( TRACE_NORMAL, CACMREADER_BUFLEN_DUP1, "CAcmReader::BufLen;\tbuf wrapped" );
+ LOGTEXT(_L8("\tbuf wrapped"));
len = iBufSize - ( iOutPtr - iInPtr );
}
else
{
- OstTrace0( TRACE_NORMAL, CACMREADER_BUFLEN_DUP2, "CAcmReader::BufLen;\tbuf not wrapped" );
+ LOGTEXT(_L8("\tbuf not wrapped"));
len = iInPtr - iOutPtr;
}
- OstTrace1( TRACE_NORMAL, CACMREADER_BUFLEN_DUP3, "CAcmReader::BufLen;len=%d", (TInt)len );
- OstTraceFunctionExit0( CACMREADER_BUFLEN_EXIT );
+ LOGTEXT2(_L8("<<CAcmReader::BufLen len=%d"), len);
return len;
}
@@ -320,18 +298,14 @@
* Called by the port to clear the buffer.
*/
{
- OstTraceFunctionEntry0( CACMREADER_RESETBUFFER_ENTRY );
+ LOG_FUNC
+
// A request is outstanding- C32 should protect against this.
- if (iCurrentRequest.iClientPtr)
- {
- OstTraceExt1( TRACE_FATAL, CACMREADER_RESETBUFFER,
- "CAcmReader::ResetBuffer;iCurrentRequest.iClientPtr=%p", iCurrentRequest.iClientPtr );
- __ASSERT_DEBUG( EFalse, User::Panic(KAcmPanicCat, EPanicInternalError) );
- }
+ __ASSERT_DEBUG(!iCurrentRequest.iClientPtr,
+ _USB_PANIC(KAcmPanicCat, EPanicInternalError));
// Reset the pointers. All data is 'lost'.
iOutPtr = iInPtr = iBufStart;
- OstTraceFunctionExit0( CACMREADER_RESETBUFFER_EXIT );
}
TInt CAcmReader::SetBufSize(TUint aSize)
@@ -343,14 +317,13 @@
* @param aSize The required size of the buffer.
*/
{
- OstTraceFunctionEntry0( CACMREADER_SETBUFSIZE_ENTRY );
- OstTrace1( TRACE_NORMAL, CACMREADER_SETBUFSIZE, "CAcmReader::SetBufSize;aSize=%d", (TInt)aSize );
+ LOG_FUNC
+ LOGTEXT2(_L8("\taSize=%d"), aSize);
+
if ( iCurrentRequest.iClientPtr )
{
// A request is outstanding. C32 does not protect us against this.
- OstTrace0( TRACE_NORMAL, CACMREADER_SETBUFSIZE_DUP1,
- "CAcmReader::SetBufSize;\t***a request is outstanding- returning KErrInUse" );
- OstTraceFunctionExit0( CACMREADER_SETBUFSIZE_EXIT );
+ LOGTEXT(_L8("\t***a request is outstanding- returning KErrInUse"));
return KErrInUse;
}
@@ -358,9 +331,7 @@
HBufC8* newBuf = HBufC8::New(aSize);
if ( !newBuf )
{
- OstTrace0( TRACE_NORMAL, CACMREADER_SETBUFSIZE_DUP2,
- "CAcmReader::SetBufSize;\tfailed to create new buffer- returning KErrNoMemory" );
- OstTraceFunctionExit0( CACMREADER_SETBUFSIZE_EXIT_DUP1 );
+ LOGTEXT(_L8("\tfailed to create new buffer- returning KErrNoMemory"));
return KErrNoMemory;
}
delete iBuffer;
@@ -372,7 +343,6 @@
iBufSize = aSize;
CheckBufferEmptyAndResetPtrs();
- OstTraceFunctionExit0( CACMREADER_SETBUFSIZE_EXIT_DUP2 );
return KErrNone;
}
@@ -383,28 +353,20 @@
* @param aConfig The new configuration.
*/
{
- OstTraceFunctionEntry0( CACMREADER_SETTERMINATORS_ENTRY );
+ LOG_FUNC
// C32 protects the port against having config set while there's a request
// outstanding.
- if (iCurrentRequest.iClientPtr)
- {
- OstTraceExt1( TRACE_FATAL, CACMREADER_SETTERMINATORS_DUP2,
- "CAcmReader::SetTerminators;iCurrentRequest.iClientPtr=%p", iCurrentRequest.iClientPtr );
- __ASSERT_DEBUG( EFalse, User::Panic(KAcmPanicCat, EPanicInternalError) );
- }
+ __ASSERT_DEBUG(!iCurrentRequest.iClientPtr,
+ _USB_PANIC(KAcmPanicCat, EPanicInternalError));
iTerminatorCount = aConfig.iTerminatorCount;
- OstTrace1( TRACE_NORMAL, CACMREADER_SETTERMINATORS,
- "CAcmReader::SetTerminators;\tnow %d terminators:", (TInt)iTerminatorCount );
-
+ LOGTEXT2(_L8("\tnow %d terminators:"), iTerminatorCount);
for ( TUint ii = 0; ii < static_cast<TUint>(KConfigMaxTerminators) ; ii++ )
{
iTerminator[ii] = aConfig.iTerminator[ii];
- OstTrace1( TRACE_NORMAL, CACMREADER_SETTERMINATORS_DUP1,
- "CAcmReader::SetTerminators;\t\t%d", iTerminator[ii]);
+ LOGTEXT2(_L8("\t\t%d"), iTerminator[ii]);
}
- OstTraceFunctionExit0( CACMREADER_SETTERMINATORS_EXIT );
}
void CAcmReader::ReadCompleted(TInt aError)
@@ -414,20 +376,18 @@
* @param aError Error.
*/
{
- OstTraceFunctionEntry0( CACMREADER_READCOMPLETED_ENTRY );
- OstTrace1( TRACE_NORMAL, CACMREADER_READCOMPLETED,
- "CAcmReader::ReadCompleted;>>CAcmReader::ReadCompleted aError=%d", aError );
+ LOGTEXT2(_L8(">>CAcmReader::ReadCompleted aError=%d"), aError);
const TUint justRead = static_cast<TUint>(iInBuf.Length());
- OstTraceExt2( TRACE_NORMAL, CACMREADER_READCOMPLETED_DUP1,
- "CAcmReader::ReadCompleted;\tiInBuf length=%d, iLengthToGo=%d", (TInt)justRead, (TInt)iLengthToGo );
+ LOGTEXT3(_L8("\tiInBuf length=%d, iLengthToGo=%d"),
+ justRead,
+ iLengthToGo);
// This protects against a regression in the LDD- read requests shouldn't
// ever complete with zero bytes and KErrNone.
if ( justRead == 0 && aError == KErrNone )
{
- OstTrace0( TRACE_FATAL, CACMREADER_READCOMPLETED_DUP3, "CAcmReader::ReadCompleted;ustRead == 0 && aError == KErrNone" );
- __ASSERT_DEBUG( EFalse, User::Panic(KAcmPanicCat, EPanicInternalError) );
+ _USB_PANIC(KAcmPanicCat, EPanicInternalError);
}
// The new data will have been added to our buffer. Move iInPtr up by the
@@ -441,7 +401,6 @@
// multi-stage Read the client will get any data already written back
// to them with IPCWrite.
CompleteRequest(aError);
- OstTraceFunctionExit0( CACMREADER_READCOMPLETED_EXIT );
return;
}
@@ -449,8 +408,8 @@
// it will also complete the request if we've given the client enough data
// or will reissue another read if not
ReadWithoutTerminators();
- OstTrace0( TRACE_NORMAL, CACMREADER_READCOMPLETED_DUP2, "CAcmReader::ReadCompleted;<<CAcmReader::ReadCompleted" );
- OstTraceFunctionExit0( CACMREADER_READCOMPLETED_EXIT_DUP1 );
+
+ LOGTEXT(_L8("<<CAcmReader::ReadCompleted"));
}
void CAcmReader::ReadOneOrMoreCompleted(TInt aError)
@@ -460,24 +419,21 @@
* @param aError Error.
*/
{
- OstTraceFunctionEntry0( CACMREADER_READONEORMORECOMPLETED_ENTRY );
- OstTrace1( TRACE_NORMAL, CACMREADER_READONEORMORECOMPLETED,
- "CAcmReader::ReadOneOrMoreCompleted;>>CAcmReader::ReadOneOrMoreCompleted aError=%d", aError );
+ LOGTEXT2(_L8(">>CAcmReader::ReadOneOrMoreCompleted aError=%d"), aError);
const TUint justRead = static_cast<TUint>(iInBuf.Length());
- OstTrace1( TRACE_NORMAL, CACMREADER_READONEORMORECOMPLETED_DUP1,
- "CAcmReader::ReadOneOrMoreCompleted;\tjustRead = %d", (TInt)justRead );
+ LOGTEXT2(_L8("\tjustRead = %d"), justRead);
// The new data will have been added to our buffer. Move iInPtr
// up by the length just read.
iInPtr += justRead;
+
if ( aError )
{
// If the ReadOneOrMore failed, we complete back to the client and
// don't do anything more. The client will get any data already
// written back to them with IPCWrite.
CompleteRequest(aError);
- OstTraceFunctionExit0( CACMREADER_READONEORMORECOMPLETED_EXIT );
return;
}
@@ -488,10 +444,8 @@
// data.
if ( justRead == 0 )
{
- OstTrace0( TRACE_NORMAL, CACMREADER_READONEORMORECOMPLETED_DUP2,
- "CAcmReader::ReadOneOrMoreCompleted;\twe appear to have a ZLP- reissuing ReadOneOrMore" );
+ LOGTEXT(_L8("\twe appear to have a ZLP- reissuing ReadOneOrMore"));
IssueReadOneOrMore();
- OstTraceFunctionExit0( CACMREADER_READONEORMORECOMPLETED_EXIT_DUP1 );
return;
}
@@ -500,8 +454,8 @@
// Complete the client's request with as much data as we can. NB
// Opinion may be divided over whether to do this, or complete with
// just 1 byte. We implement the more generous approach.
- OstTrace1( TRACE_NORMAL, CACMREADER_READONEORMORECOMPLETED_DUP3,
- "CAcmReader::ReadOneOrMoreCompleted;\tcurrent request is ReadOneOrMore- completing with %d bytes", (TInt)justRead );
+ LOGTEXT2(_L8("\tcurrent request is ReadOneOrMore- completing with "
+ "%d bytes"), justRead);
WriteBackData(justRead);
CompleteRequest(KErrNone);
}
@@ -511,33 +465,28 @@
// ReadOneOrMore, we only request LDD::ReadOneOrMore in this case.)
// Process the buffer for terminators.
- OstTrace0( TRACE_NORMAL, CACMREADER_READONEORMORECOMPLETED_DUP4,
- "CAcmReader::ReadOneOrMoreCompleted;\tcurrent request is Read with terminators" );
+ LOGTEXT(_L8("\tcurrent request is Read with terminators"));
CheckForBufferedTerminatorsAndProceed();
}
- OstTrace0( TRACE_NORMAL, CACMREADER_READONEORMORECOMPLETED_DUP5,
- "CAcmReader::ReadOneOrMoreCompleted;<<CAcmReader::ReadOneOrMoreCompleted" );
- OstTraceFunctionExit0( CACMREADER_READONEORMORECOMPLETED_EXIT_DUP2 );
+ LOGTEXT(_L8("<<CAcmReader::ReadOneOrMoreCompleted"));
}
void CAcmReader::NotifyDataAvailableCompleted(TInt aError)
{
- OstTraceFunctionEntry0( CACMREADER_NOTIFYDATAAVAILABLECOMPLETED_ENTRY );
/**
* Called by lower classes when data has arrived at the LDD after a
* NotifyDataAvailable request has been posted on the port.
*
* @param aError Error.
*/
- OstTrace1( TRACE_NORMAL, CACMREADER_NOTIFYDATAAVAILABLECOMPLETED,
- "CAcmReader::NotifyDataAvailableCompleted;aError=%d", aError );
-
+ LOGTEXT2(_L8(">>CAcmReader::NotifyDataAvailableCompleted aError=%d"), aError);
+
// If the NotifyDataAvailable request failed, we complete back
// to the client and don't do anything more.
- CompleteRequest(aError);
- OstTrace0( TRACE_NORMAL, CACMREADER_NOTIFYDATAAVAILABLECOMPLETED_DUP2, "<<CAcmReader::NotifyDataAvailableCompleted" );
- OstTraceFunctionExit0( CACMREADER_NOTIFYDATAAVAILABLECOMPLETED_EXIT );
+ CompleteRequest(aError);
+
+ LOGTEXT(_L8("<<CAcmReader::NotifyDataAvailableCompleted"));
}
void CAcmReader::CheckBufferEmptyAndResetPtrs()
@@ -547,16 +496,14 @@
* fiddling around wrapping at the end of the buffer.
*/
{
- OstTraceFunctionEntry0( CACMREADER_CHECKBUFFEREMPTYANDRESETPTRS_ENTRY );
- TInt blen = BufLen();
- if ( blen != 0 )
+ LOGTEXT(_L8("CAcmReader::CheckBufferEmptyAndResetPtrs"));
+
+ if ( BufLen() != 0 )
{
- OstTrace1( TRACE_FATAL, CACMREADER_CHECKBUFFEREMPTYANDRESETPTRS, "CAcmReader::CheckBufferEmptyAndResetPtrs;blen=%d", blen );
- __ASSERT_DEBUG( EFalse, User::Panic(KAcmPanicCat, EPanicInternalError) );
+ _USB_PANIC(KAcmPanicCat, EPanicInternalError);
}
iOutPtr = iInPtr = iBufStart;
- OstTraceFunctionExit0( CACMREADER_CHECKBUFFEREMPTYANDRESETPTRS_EXIT );
}
void CAcmReader::CheckNewRequest(const TAny* aClientBuffer, TUint aMaxLen)
@@ -569,41 +516,25 @@
* @param aMaxLen Maximum length to read.
*/
{
- OstTraceFunctionEntry0( CACMREADER_CHECKNEWREQUEST_ENTRY );
-
// The port should handle zero-length reads, not us.
- if (aMaxLen <= 0)
- {
- OstTrace0( TRACE_FATAL, CACMREADER_CHECKNEWREQUEST, "CAcmReader::CheckNewRequest;aMaxLen <= 0" );
-
- __ASSERT_DEBUG( EFalse, User::Panic(KAcmPanicCat, EPanicInternalError) );
- }
+ __ASSERT_DEBUG(aMaxLen > 0, _USB_PANIC(KAcmPanicCat, EPanicInternalError));
+ __ASSERT_DEBUG(aMaxLen <= static_cast<TUint>(KMaxTInt),
+ _USB_PANIC(KAcmPanicCat, EPanicInternalError));
- if (aMaxLen > static_cast<TUint>(KMaxTInt))
- {
- OstTrace0( TRACE_FATAL, CACMREADER_CHECKNEWREQUEST_DUP1, "CAcmReader::CheckNewRequest;aMaxLen > static_cast<TUint>(KMaxTInt)" );
- __ASSERT_DEBUG( EFalse, User::Panic(KAcmPanicCat, EPanicInternalError) );
- }
// Check we have no outstanding request already.
if ( iCurrentRequest.iClientPtr )// just panic in case of concurrent Read or ReadOneOrMore queries.
{ // in case of NotifyDataAvailable queries, we already have completed the client with KErrInUse.
// This code is kept for legacy purpose. That justifies the existence of IsNotifyDataAvailableQueryPending
- OstTraceExt1( TRACE_FATAL, CACMREADER_CHECKNEWREQUEST_DUP3,
- "CAcmReader::CheckNewRequest;iCurrentRequest.iClientPtr=%p", iCurrentRequest.iClientPtr );
- __ASSERT_DEBUG( EFalse, User::Panic(KAcmPanicCat, EPanicInternalError) );
+ _USB_PANIC(KAcmPanicCat, EPanicInternalError);
}
// Sanity check on what C32 gave us.
- if (!aClientBuffer)
- {
- OstTrace0( TRACE_FATAL, CACMREADER_CHECKNEWREQUEST_DUP2, "CAcmReader::CheckNewRequest;aClientBuffer = NULL" );
- __ASSERT_DEBUG( EFalse, User::Panic(KAcmPanicCat, EPanicInternalError) );
- }
+ __ASSERT_DEBUG(aClientBuffer,
+ _USB_PANIC(KAcmPanicCat, EPanicInternalError));
// Make a note of interesting data.
iCurrentRequest.iClientPtr = aClientBuffer;
iLengthToGo = aMaxLen;
iOffsetIntoClientsMemory = 0;
- OstTraceFunctionExit0( CACMREADER_CHECKNEWREQUEST_EXIT );
}
void CAcmReader::CheckForBufferedTerminatorsAndProceed()
@@ -613,29 +544,23 @@
* amount if not.
*/
{
- OstTraceFunctionEntry0( CACMREADER_CHECKFORBUFFEREDTERMINATORSANDPROCEED_ENTRY );
-
+ LOG_FUNC
+
TInt ret = FindTerminator();
- OstTrace1( TRACE_NORMAL, CACMREADER_CHECKFORBUFFEREDTERMINATORSANDPROCEED_DUP6,
- "CAcmReader::CheckForBufferedTerminatorsAndProceed;\tFindTerminator = %d", ret );
-
+ LOGTEXT2(_L8("\tFindTerminator = %d"), ret);
if ( ret < KErrNone )
{
- OstTrace0( TRACE_NORMAL, CACMREADER_CHECKFORBUFFEREDTERMINATORSANDPROCEED,
- "CAcmReader::CheckForBufferedTerminatorsAndProceed;\tno terminator found" );
-
+ LOGTEXT(_L8("\tno terminator found"));
const TUint bufLen = BufLen();
- OstTrace1( TRACE_NORMAL, CACMREADER_CHECKFORBUFFEREDTERMINATORSANDPROCEED_DUP1,
- "CAcmReader::CheckForBufferedTerminatorsAndProceed;\tbufLen = %d", (TInt)bufLen );
-
+ LOGTEXT2(_L8("\tbufLen = %d"), bufLen);
// No terminator was found. Does the buffer already exceed the
// client's descriptor?
if ( bufLen >= iLengthToGo )
{
// Yes- complete as much data to the client as their
// descriptor can handle.
- OstTrace1( TRACE_NORMAL, CACMREADER_CHECKFORBUFFEREDTERMINATORSANDPROCEED_DUP2,
- "CAcmReader::CheckForBufferedTerminatorsAndProceed;iLengthToGo=%d", (TInt)iLengthToGo );
+ LOGTEXT2(_L8("\tbuffer >= client descriptor- "
+ "writing back %d bytes"), iLengthToGo);
WriteBackData(iLengthToGo);
CompleteRequest(KErrNone);
}
@@ -649,15 +574,13 @@
}
else
{
- OstTrace0( TRACE_NORMAL, CACMREADER_CHECKFORBUFFEREDTERMINATORSANDPROCEED_DUP3,
- "CAcmReader::CheckForBufferedTerminatorsAndProceed;\tterminator found!" );
+ LOGTEXT(_L8("\tterminator found!"));
// Will the terminator position fit within the client's descriptor?
if ( static_cast<TUint>(ret) <= iLengthToGo )
{
// Yes- complete (up to the terminator) back to the client.
- OstTrace1( TRACE_NORMAL, CACMREADER_CHECKFORBUFFEREDTERMINATORSANDPROCEED_DUP4,
- "CAcmReader::CheckForBufferedTerminatorsAndProceed;\tterminator will fit "
- "in client's descriptor- writing back %d bytes ", (TInt)ret );
+ LOGTEXT2(_L8("\tterminator will fit in client's descriptor- "
+ "writing back %d bytes"), ret);
WriteBackData(static_cast<TUint>(ret));
CompleteRequest(KErrNone);
}
@@ -665,14 +588,12 @@
{
// No- complete as much data to the client as their descriptor can
// handle.
- OstTrace1( TRACE_NORMAL, CACMREADER_CHECKFORBUFFEREDTERMINATORSANDPROCEED_DUP5,
- "CAcmReader::CheckForBufferedTerminatorsAndProceed; "
- "\tterminator won't fit in client's descriptor- writing back %d bytes", (TInt)iLengthToGo );
+ LOGTEXT2(_L8("\tterminator won't fit in client's descriptor- "
+ "writing back %d bytes"), iLengthToGo);
WriteBackData(iLengthToGo);
CompleteRequest(KErrNone);
}
}
- OstTraceFunctionExit0( CACMREADER_CHECKFORBUFFEREDTERMINATORSANDPROCEED_EXIT );
}
void CAcmReader::WriteBackData(TUint aLength)
@@ -687,44 +608,36 @@
* @param aLength Amount of data to write back.
*/
{
- OstTraceFunctionEntry0( CACMREADER_WRITEBACKDATA_ENTRY );
- OstTrace1( TRACE_DUMP, CACMREADER_WRITEBACKDATA, "CAcmReader::WriteBackData;aLength=%d", (TInt)aLength );
- OstTrace1( TRACE_DUMP, CACMREADER_WRITEBACKDATA_DUP1, "CAcmReader::WriteBackData;\tBufLen() = %d", (TInt)BufLen() );
+ LOGTEXT2(_L8("CAcmReader::WriteBackData aLength = %d"), aLength);
+ LOGTEXT2(_L8("\tBufLen() = %d"), BufLen());
- if (aLength > BufLen())
- {
- OstTrace0( TRACE_FATAL, CACMREADER_WRITEBACKDATA_DUP15, "CAcmReader::WriteBackData;aLength > BufLen()" );
- __ASSERT_DEBUG( EFalse, User::Panic(KAcmPanicCat, EPanicInternalError) );
- }
+ LOGTEXT2(_L8("\tBufLen() = %d"), BufLen());
+
+ __ASSERT_DEBUG(aLength <= BufLen(),
+ _USB_PANIC(KAcmPanicCat, EPanicInternalError));
const TUint lenBeforeWrap = iBufStart + iBufSize - iOutPtr;
- OstTrace1( TRACE_DUMP, CACMREADER_WRITEBACKDATA_DUP2, "CAcmReader::WriteBackData;\tiOutPtr=%d", (TInt)(iOutPtr - iBufStart) );
- OstTrace1( TRACE_DUMP, CACMREADER_WRITEBACKDATA_DUP3, "CAcmReader::WriteBackData;\tiInPtr=%d", (TInt)(iInPtr - iBufStart) );
- OstTrace1( TRACE_DUMP, CACMREADER_WRITEBACKDATA_DUP4, "CAcmReader::WriteBackData;\tiOffsetIntoClientsMemory=%d", (TInt)iOffsetIntoClientsMemory );
- OstTrace1( TRACE_DUMP, CACMREADER_WRITEBACKDATA_DUP5, "CAcmReader::WriteBackData;\tlenBeforeWrap=%d", (TInt)lenBeforeWrap );
+ LOGTEXT2(_L8("\tiOutPtr=%d"), iOutPtr - iBufStart);
+ LOGTEXT2(_L8("\tiInPtr=%d"), iInPtr - iBufStart);
+ LOGTEXT2(_L8("\tiOffsetIntoClientsMemory=%d"), iOffsetIntoClientsMemory);
+ LOGTEXT2(_L8("\tlenBeforeWrap=%d"), lenBeforeWrap);
if ( aLength > lenBeforeWrap )
{
// We'll have to do this in two stages...
- OstTrace0( TRACE_NORMAL, CACMREADER_WRITEBACKDATA_DUP6, "CAcmReader::WriteBackData;\twriting back in two stages" );
- if (!BufWrap())
- {
- OstTrace0( TRACE_FATAL, CACMREADER_WRITEBACKDATA_DUP16, "CAcmReader::WriteBackData;BufWrap() is NULL" );
- __ASSERT_DEBUG( EFalse, User::Panic(KAcmPanicCat, EPanicInternalError) );
- }
+ LOGTEXT(_L8("\twriting back in two stages"));
+
+ __ASSERT_DEBUG(BufWrap(),
+ _USB_PANIC(KAcmPanicCat, EPanicInternalError));
// Stage 1...
TPtrC8 ptrBeforeWrap(iOutPtr, lenBeforeWrap);
TInt err = iPort.IPCWrite(iCurrentRequest.iClientPtr,
ptrBeforeWrap,
iOffsetIntoClientsMemory);
- OstTrace1( TRACE_NORMAL, CACMREADER_WRITEBACKDATA_DUP7, "CAcmReader::WriteBackData;\tIPCWrite = %d", (TInt)err );
- if (err)
- {
- OstTrace1( TRACE_FATAL, CACMREADER_WRITEBACKDATA_DUP17, "CAcmReader::WriteBackData;err=%d", err );
- __ASSERT_DEBUG( EFalse, User::Panic(KAcmPanicCat, EPanicInternalError) );
- }
+ LOGTEXT2(_L8("\tIPCWrite = %d"), err);
+ __ASSERT_DEBUG(!err, _USB_PANIC(KAcmPanicCat, EPanicInternalError));
static_cast<void>(err);
iOffsetIntoClientsMemory += lenBeforeWrap;
@@ -734,54 +647,39 @@
err = iPort.IPCWrite(iCurrentRequest.iClientPtr,
ptrAfterWrap,
iOffsetIntoClientsMemory);
- OstTrace1( TRACE_NORMAL, CACMREADER_WRITEBACKDATA_DUP8, "CAcmReader::WriteBackData;\tIPCWrite = %d", (TInt)err );
- if (err)
- {
- OstTrace1( TRACE_FATAL, CACMREADER_WRITEBACKDATA_DUP18, "CAcmReader::WriteBackData;err=%d", err );
- __ASSERT_DEBUG( EFalse, User::Panic(KAcmPanicCat, EPanicInternalError) );
- }
+ LOGTEXT2(_L8("\tIPCWrite = %d"), err);
+ __ASSERT_DEBUG(!err, _USB_PANIC(KAcmPanicCat, EPanicInternalError));
iOffsetIntoClientsMemory += seg2Len;
// and set the pointers to show that we've consumed the data...
iOutPtr = iBufStart + seg2Len;
- OstTrace0( TRACE_NORMAL, CACMREADER_WRITEBACKDATA_DUP9, "CAcmReader::WriteBackData;\twrite in two segments completed" );
+ LOGTEXT(_L8("\twrite in two segments completed"));
}
else // We can do it in one go...
{
- OstTrace0( TRACE_NORMAL, CACMREADER_WRITEBACKDATA_DUP10, "CAcmReader::WriteBackData;\twriting in one segment" );
+ LOGTEXT(_L8("\twriting in one segment"));
TPtrC8 ptr(iOutPtr, aLength);
TInt err = iPort.IPCWrite(iCurrentRequest.iClientPtr,
ptr,
iOffsetIntoClientsMemory);
- OstTrace1( TRACE_NORMAL, CACMREADER_WRITEBACKDATA_DUP11, "CAcmReader::WriteBackData;\tIPCWrite = %d", (TInt)err );
- if (err)
- {
- OstTrace1( TRACE_FATAL, CACMREADER_WRITEBACKDATA_DUP19, "CAcmReader::WriteBackData;err=%d", err );
- __ASSERT_DEBUG( EFalse, User::Panic(KAcmPanicCat, EPanicInternalError) );
- }
+ LOGTEXT2(_L8("\tIPCWrite = %d"), err);
+ __ASSERT_DEBUG(!err, _USB_PANIC(KAcmPanicCat, EPanicInternalError));
static_cast<void>(err);
iOffsetIntoClientsMemory += aLength;
// Set the pointers to show that we've consumed the data...
iOutPtr += aLength;
- OstTrace0( TRACE_NORMAL, CACMREADER_WRITEBACKDATA_DUP12, "CAcmReader::WriteBackData;\twrite in one segments completed" );
+ LOGTEXT(_L8("\twrite in one segment completed"));
}
- OstTrace1( TRACE_NORMAL, CACMREADER_WRITEBACKDATA_DUP13,
- "CAcmReader::WriteBackData;\tiOutPtr=%d", (TInt)(iOutPtr - iBufStart) );
- OstTrace1( TRACE_NORMAL, CACMREADER_WRITEBACKDATA_DUP14,
- "CAcmReader::WriteBackData;\tiOffsetIntoClientsMemory=%d", (TInt)iOffsetIntoClientsMemory );
+ LOGTEXT2(_L8("\tiOutPtr=%d"), iOutPtr - iBufStart);
+ LOGTEXT2(_L8("\tiOffsetIntoClientsMemory=%d"), iOffsetIntoClientsMemory);
// Adjust iLengthToGo
- if (iLengthToGo < aLength)
- {
- OstTraceExt2( TRACE_FATAL, CACMREADER_WRITEBACKDATA_DUP20,
- "CAcmReader::WriteBackData;iLengthToGo=%d;aLength=%d", (TInt)iLengthToGo, (TInt)aLength );
- __ASSERT_DEBUG( EFalse, User::Panic(KAcmPanicCat, EPanicInternalError) );
- }
+ __ASSERT_DEBUG(iLengthToGo >= aLength,
+ _USB_PANIC(KAcmPanicCat, EPanicInternalError));
iLengthToGo -= aLength;
- OstTraceFunctionExit0( CACMREADER_WRITEBACKDATA_EXIT );
}
void CAcmReader::CompleteRequest(TInt aError)
@@ -793,24 +691,21 @@
* @param aError The error code to complete with.
*/
{
- OstTraceFunctionEntry0( CACMREADER_COMPLETEREQUEST_ENTRY );
- OstTrace1( TRACE_NORMAL, CACMREADER_COMPLETEREQUEST, "CAcmReader::CompleteRequest;aError=%d", (TInt)aError );
+ LOGTEXT2(_L8("CAcmReader::CompleteRequest aError=%d"), aError);
// Set our flag to say that we no longer have an outstanding request.
iCurrentRequest.iClientPtr = NULL;
+
if(ENotifyDataAvailable==iCurrentRequest.iRequestType)
{
- OstTrace1( TRACE_NORMAL, CACMREADER_COMPLETEREQUEST_DUP1,
- "CAcmReader::CompleteRequest;\tcalling NotifyDataAvailableCompleted with error %d", aError );
+ LOGTEXT2(_L8("\tcalling NotifyDataAvailableCompleted with error %d"), aError);
iPort.NotifyDataAvailableCompleted(aError);
}
else // read and readoneormore
{
- OstTrace1( TRACE_NORMAL, CACMREADER_COMPLETEREQUEST_DUP2,
- "CAcmReader::CompleteRequest;\tcalling ReadCompleted with error %d", aError );
+ LOGTEXT2(_L8("\tcalling ReadCompleted with error %d"), aError);
iPort.ReadCompleted(aError);
}
- OstTraceFunctionExit0( CACMREADER_COMPLETEREQUEST_EXIT );
}
void CAcmReader::IssueRead()
@@ -822,27 +717,25 @@
* buffer being wrapped and the consequent risk of overwriting.
*/
{
- OstTraceFunctionEntry0( CACMREADER_ISSUEREAD_ENTRY );
+ LOG_FUNC
+
CheckBufferEmptyAndResetPtrs();
- OstTrace1( TRACE_DUMP, CACMREADER_ISSUEREAD, "CAcmReader::IssueRead;iBufSize=%d", (TInt)iBufSize );
- OstTrace1( TRACE_DUMP, CACMREADER_ISSUEREAD_DUP1, "CAcmReader::IssueRead;\tiInPtr = %d", (TInt)(iInPtr - iBufStart) );
+ LOGTEXT2(_L8("\tiBufSize = %d"), iBufSize);
+ LOGTEXT2(_L8("\tiInPtr = %d"), iInPtr - iBufStart);
+
const TUint lenBeforeWrap = iBufStart + iBufSize - iInPtr;
- OstTrace1( TRACE_DUMP, CACMREADER_ISSUEREAD_DUP2, "CAcmReader::IssueRead;\tiLengthToGo = %d", (TInt)iLengthToGo );
- OstTrace1( TRACE_DUMP, CACMREADER_ISSUEREAD_DUP3, "CAcmReader::IssueRead;\tlenBeforeWrap = %d", (TInt)lenBeforeWrap );
+ LOGTEXT2(_L8("\tiLengthToGo = %d"), iLengthToGo);
+ LOGTEXT2(_L8("\tlenBeforeWrap = %d"), lenBeforeWrap);
const TUint limit = Min(static_cast<TInt>(iLengthToGo),
static_cast<TInt>(lenBeforeWrap));
- OstTrace1( TRACE_DUMP, CACMREADER_ISSUEREAD_DUP4, "CAcmReader::IssueRead;\tissuing read for %d bytes", (TInt)limit );
+ LOGTEXT2(_L8("\tissuing read for %d bytes"), limit);
iInBuf.Set(iInPtr, 0, limit);
- if (!iPort.Acm())
- {
- OstTrace0( TRACE_FATAL, CACMREADER_ISSUEREAD_DUP5, "CAcmReader::IssueRead;iPort.Acm() is null" );
- __ASSERT_DEBUG( EFalse, User::Panic(KAcmPanicCat, EPanicInternalError) );
- }
+ __ASSERT_DEBUG(iPort.Acm(),
+ _USB_PANIC(KAcmPanicCat, EPanicInternalError));
iPort.Acm()->Read(*this, iInBuf, limit);
- OstTraceFunctionExit0( CACMREADER_ISSUEREAD_EXIT );
}
void CAcmReader::IssueReadOneOrMore()
@@ -854,29 +747,25 @@
* buffer being wrapped and the consequent risk of overwriting.
*/
{
- OstTraceFunctionEntry0( CACMREADER_ISSUEREADONEORMORE_ENTRY );
+ LOG_FUNC
+
CheckBufferEmptyAndResetPtrs();
- OstTrace1( TRACE_DUMP, CACMREADER_ISSUEREADONEORMORE, "CAcmReader::IssueReadOneOrMore;iBufSize=%d", (TInt)iBufSize );
- OstTrace1( TRACE_DUMP, CACMREADER_ISSUEREADONEORMORE_DUP1,
- "CAcmReader::IssueReadOneOrMore;\tiInPtr = %d",(TInt)(iInPtr - iBufStart) );
+ LOGTEXT2(_L8("\tiBufSize = %d"), iBufSize);
+ LOGTEXT2(_L8("\tiInPtr = %d"), iInPtr - iBufStart);
+
const TUint lenBeforeWrap = iBufStart + iBufSize - iInPtr;
- OstTrace1( TRACE_DUMP, CACMREADER_ISSUEREADONEORMORE_DUP2, "CAcmReader::IssueReadOneOrMore;iLengthToGo=%d", (TInt)iLengthToGo );
- OstTrace1( TRACE_DUMP, CACMREADER_ISSUEREADONEORMORE_DUP3, "CAcmReader::IssueReadOneOrMore;lenBeforeWrap=%d", (TInt)lenBeforeWrap );
+ LOGTEXT2(_L8("\tiLengthToGo = %d"), iLengthToGo);
+ LOGTEXT2(_L8("\tlenBeforeWrap = %d"), lenBeforeWrap);
const TUint limit1 = Min(static_cast<TInt>(lenBeforeWrap), iLengthToGo);
- OstTrace1( TRACE_DUMP, CACMREADER_ISSUEREADONEORMORE_DUP4,
- "CAcmReader::IssueReadOneOrMore;\tissuing read one or more for %d bytes", (TInt)limit1 );
-
+
+ LOGTEXT2(_L8("\tissuing read one or more for %d bytes"), limit1);
iInBuf.Set(iInPtr, 0, limit1);
- if (!iPort.Acm())
- {
- OstTrace0( TRACE_FATAL, CACMREADER_ISSUEREADONEORMORE_DUP5, "CAcmReader::IssueReadOneOrMore;iPort.Acm() is null" );
- __ASSERT_DEBUG( EFalse, User::Panic(KAcmPanicCat, EPanicInternalError) );
- }
+ __ASSERT_DEBUG(iPort.Acm(),
+ _USB_PANIC(KAcmPanicCat, EPanicInternalError));
iPort.Acm()->ReadOneOrMore(*this, iInBuf, limit1);
- OstTraceFunctionExit0( CACMREADER_ISSUEREADONEORMORE_EXIT );
}
TInt CAcmReader::FindTerminator() const
@@ -891,8 +780,8 @@
* account. If negative: error.
*/
{
- OstTraceFunctionEntry0( CACMREADER_FINDTERMINATOR_ENTRY );
-
+ LOGTEXT(_L8(">>CAcmReader::FindTerminator"));
+
TInt pos = 0;
TInt ret = KErrNone;
if ( !BufWrap() )
@@ -927,14 +816,10 @@
}
// Check we're returning what we said we would.
- if (ret == KErrNone)
- {
- OstTrace0( TRACE_FATAL, CACMREADER_FINDTERMINATOR_DUP1, "CAcmReader::FindTerminator;ret == KErrNone" );
- __ASSERT_DEBUG( EFalse, User::Panic(KAcmPanicCat, EPanicInternalError) );
- }
+ __ASSERT_DEBUG(ret != KErrNone,
+ _USB_PANIC(KAcmPanicCat, EPanicInternalError));
- OstTrace1( TRACE_NORMAL, CACMREADER_FINDTERMINATOR, "CAcmReader::FindTerminator;ret=%d", ret );
- OstTraceFunctionExit0( CACMREADER_FINDTERMINATOR_EXIT );
+ LOGTEXT2(_L8("<<CAcmReader::FindTerminator ret=%d"), ret);
return ret;
}
@@ -958,33 +843,26 @@
* found.
*/
{
- OstTraceFunctionEntry0( CACMREADER_PARTIALFINDTERMINATOR_ENTRY );
-
+ LOG_FUNC
+
aPos = 1;
- OstTraceExt2( TRACE_NORMAL, CACMREADER_PARTIALFINDTERMINATOR,
- "CAcmReader::PartialFindTerminator;\taFrom=%d, aTo=%d", (TInt)(aFrom-iBufStart), (TInt)(aTo-iBufStart) );
-
+ LOGTEXT3(_L8("\taFrom=%d, aTo=%d"), aFrom-iBufStart, aTo-iBufStart);
+
for ( TUint8* p = aFrom ; p < aTo ; p++, aPos++ )
{
for ( TUint i = 0 ; i < iTerminatorCount ; i++ )
{
- if (!p)
- {
- OstTraceExt1( TRACE_FATAL, CACMREADER_PARTIALFINDTERMINATOR_DUP3, "CAcmReader::PartialFindTerminator;p=%p", p );
- __ASSERT_DEBUG( EFalse, User::Panic(KAcmPanicCat, EPanicInternalError) );
- }
+ __ASSERT_DEBUG(p, _USB_PANIC(KAcmPanicCat, EPanicInternalError));
if ( *p == iTerminator[i] )
{
- OstTraceExt2( TRACE_FLOW, CACMREADER_PARTIALFINDTERMINATOR_DUP1,
- "CAcmReader::PartialFindTerminator;\tterminator %d found at aPos %d", (TInt)iTerminator[i], (TInt)aPos );
- OstTraceFunctionExit0( CACMREADER_PARTIALFINDTERMINATOR_EXIT );
+ LOGTEXT3(_L8("\tterminator %d found at aPos %d"),
+ iTerminator[i], aPos);
return KErrNone;
}
}
}
- OstTrace0( TRACE_NORMAL, CACMREADER_PARTIALFINDTERMINATOR_DUP2, "CAcmReader::PartialFindTerminator;\tno terminator found" );
- OstTraceFunctionExit0( CACMREADER_PARTIALFINDTERMINATOR_EXIT_DUP2 );
+ LOGTEXT(_L8("\tno terminator found"));
return KErrNotFound;
}