os/mm/devsound/a3fcharacterisationtest/src/char_a3f_devsound_testbase.cpp
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
// Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0
     2
// All rights reserved.
sl@0
     3
// This component and the accompanying materials are made available
sl@0
     4
// under the terms of "Eclipse Public License v1.0"
sl@0
     5
// which accompanies this distribution, and is available
sl@0
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0
     7
//
sl@0
     8
// Initial Contributors:
sl@0
     9
// Nokia Corporation - initial contribution.
sl@0
    10
//
sl@0
    11
// Contributors:
sl@0
    12
//
sl@0
    13
// Description:
sl@0
    14
//
sl@0
    15
sl@0
    16
#include "char_a3f_devsound_testbase.h"
sl@0
    17
#include "char_a3f_devsound_playrecordclients.h"
sl@0
    18
#include "char_a3f_devsound_toneclient.h"
sl@0
    19
sl@0
    20
const TUint KRateLookup[] =
sl@0
    21
	{	
sl@0
    22
	EMMFSampleRate8000Hz, 
sl@0
    23
	EMMFSampleRate11025Hz, 
sl@0
    24
	EMMFSampleRate16000Hz,
sl@0
    25
	EMMFSampleRate22050Hz, 
sl@0
    26
	EMMFSampleRate32000Hz, 
sl@0
    27
	EMMFSampleRate44100Hz, 
sl@0
    28
	EMMFSampleRate48000Hz, 
sl@0
    29
	EMMFSampleRate88200Hz, 
sl@0
    30
	EMMFSampleRate96000Hz,
sl@0
    31
	EMMFSampleRate12000Hz,
sl@0
    32
	EMMFSampleRate24000Hz,
sl@0
    33
	EMMFSampleRate64000Hz 
sl@0
    34
	};
sl@0
    35
sl@0
    36
const TUint KChannelsLookup[] =
sl@0
    37
	{
sl@0
    38
	EMMFMono,
sl@0
    39
	EMMFStereo
sl@0
    40
	};
sl@0
    41
sl@0
    42
RA3FDevSoundTestBase::RA3FDevSoundTestBase(const TDesC& aTestName)
sl@0
    43
	:	iFourCCString(KNullDesC), 
sl@0
    44
		iFourCCCode(KMMFFourCCCodeNULL), 
sl@0
    45
		iDevSoundState(EStateInitial), 
sl@0
    46
		iDevsoundToneClient(NULL), 
sl@0
    47
		iDevsoundPlayClient(NULL),
sl@0
    48
		iDevsoundRecordClient(NULL), 
sl@0
    49
		iMMFDevSound(NULL),
sl@0
    50
		iTimer(NULL), iBuffer(NULL)
sl@0
    51
	{
sl@0
    52
	iTestStepName = aTestName;
sl@0
    53
	}
sl@0
    54
sl@0
    55
void RA3FDevSoundTestBase::KickoffTestL()
sl@0
    56
	{
sl@0
    57
	INFO_PRINTF1(_L("__________  Creating DevSound object ___________"));
sl@0
    58
	
sl@0
    59
	// Create devsound object	
sl@0
    60
	TRAPD(err,  iMMFDevSound = CMMFDevSound::NewL());
sl@0
    61
	if (err != KErrNone)
sl@0
    62
		{
sl@0
    63
		ERR_PRINTF2(_L("Could not create DevSound object. Error = %d"), err);
sl@0
    64
		StopTest(err);
sl@0
    65
		return;
sl@0
    66
		}
sl@0
    67
	INFO_PRINTF1(_L("DevSound State: EStateCreated"));
sl@0
    68
	iDevSoundState = EStateCreated;
sl@0
    69
	// Connect RFs
sl@0
    70
	err = iFs.Connect();
sl@0
    71
	if (err != KErrNone)
sl@0
    72
		{
sl@0
    73
		ERR_PRINTF2(_L("Could not connect to Filesystem. Error = %d"), err);
sl@0
    74
		StopTest(err);
sl@0
    75
		return;
sl@0
    76
		}
sl@0
    77
	DoKickoffTestL();
sl@0
    78
	INFO_PRINTF1(_L("DevSound Event: EEventInitialize"));
sl@0
    79
	Fsm(EEventInitialize, KErrNone);
sl@0
    80
	}
sl@0
    81
sl@0
    82
void RA3FDevSoundTestBase::CloseTest()
sl@0
    83
	{
sl@0
    84
	if (iMMFDevSound)
sl@0
    85
		{
sl@0
    86
		INFO_PRINTF1(KMsgDeleteDevsound);
sl@0
    87
		delete iMMFDevSound;
sl@0
    88
		}
sl@0
    89
	if(iTimer)
sl@0
    90
		{
sl@0
    91
		delete iTimer;
sl@0
    92
		}
sl@0
    93
	if(iDevsoundToneClient)
sl@0
    94
		{
sl@0
    95
		delete iDevsoundToneClient;
sl@0
    96
		}
sl@0
    97
	if(iDevsoundPlayClient)
sl@0
    98
		{
sl@0
    99
		delete iDevsoundPlayClient;
sl@0
   100
		}
sl@0
   101
	if(iDevsoundRecordClient)
sl@0
   102
		{
sl@0
   103
		delete iDevsoundRecordClient;
sl@0
   104
		}
sl@0
   105
	if (iAsyncWriteBTFAO)
sl@0
   106
		{
sl@0
   107
		delete iAsyncWriteBTFAO;
sl@0
   108
		iAsyncWriteBTFAO = NULL;
sl@0
   109
		}
sl@0
   110
	
sl@0
   111
	iFile.Close();
sl@0
   112
	iFs.Close();
sl@0
   113
	}
sl@0
   114
	
sl@0
   115
/*
sl@0
   116
 *
sl@0
   117
 * CallStopTest
sl@0
   118
 *
sl@0
   119
 */
sl@0
   120
void RA3FDevSoundTestBase::CallStopTest(TInt aError)
sl@0
   121
	{
sl@0
   122
	StopTest(aError);
sl@0
   123
	}
sl@0
   124
sl@0
   125
sl@0
   126
void RA3FDevSoundTestBase::StartTimer(TTimeIntervalMicroSeconds32 aWaitTime)
sl@0
   127
	{
sl@0
   128
	TTimeIntervalMicroSeconds32 timeInterval;
sl@0
   129
	
sl@0
   130
	if(aWaitTime <= TTimeIntervalMicroSeconds32(0))
sl@0
   131
		{
sl@0
   132
		timeInterval = KMicroSecsInOneSec;
sl@0
   133
		}
sl@0
   134
	else
sl@0
   135
		{
sl@0
   136
		timeInterval = aWaitTime;
sl@0
   137
		}
sl@0
   138
	TCallBack callback (TimerCallback, this);
sl@0
   139
	iTimer->Start(timeInterval, timeInterval, callback);
sl@0
   140
	INFO_PRINTF1(_L("Timer has been started"));
sl@0
   141
	}
sl@0
   142
sl@0
   143
TInt RA3FDevSoundTestBase::TimerCallback(TAny* aPtr)
sl@0
   144
	{
sl@0
   145
	static_cast<RA3FDevSoundTestBase*>(aPtr)->DoTimerCallback();
sl@0
   146
	return KErrNone;
sl@0
   147
	}
sl@0
   148
sl@0
   149
void RA3FDevSoundTestBase::DoTimerCallback()
sl@0
   150
	{
sl@0
   151
	__ASSERT_ALWAYS(0, Panic(_L("RA3FDevSoundTestBase"), EInvalidCallbackCall));	
sl@0
   152
	}
sl@0
   153
sl@0
   154
void RA3FDevSoundTestBase::EncodingFromStringToTFourCC(const TDesC& aFourCCString)
sl@0
   155
	{
sl@0
   156
	iFourCCString.Copy(aFourCCString);
sl@0
   157
	if(aFourCCString.Length() <= KTFourCC)
sl@0
   158
		{
sl@0
   159
		while( iFourCCString.Length() < KTFourCC )
sl@0
   160
			{
sl@0
   161
			iFourCCString.Insert(0, _L(" "));  
sl@0
   162
			}
sl@0
   163
		iFourCCCode = TFourCC(iFourCCString[3] << 24 | iFourCCString[2] << 16 | iFourCCString[1] << 8 | iFourCCString[0]);
sl@0
   164
		}
sl@0
   165
	else
sl@0
   166
		{
sl@0
   167
		ERR_PRINTF2(KMsgErrorFourccLength,iFourCCString.Length());
sl@0
   168
		StopTest(KErrUnknown);
sl@0
   169
		}
sl@0
   170
	}
sl@0
   171
sl@0
   172
void RA3FDevSoundTestBase::InitializeComplete(TInt aError)
sl@0
   173
	{
sl@0
   174
	INFO_PRINTF1(_L("========== DevSound InitializeComplete() callback =========="));
sl@0
   175
	INFO_PRINTF3(KMsgErrorDevSoundCallback, &KInitializeCompleteText, aError);
sl@0
   176
	if(iDevSoundState == EStateInitializing)
sl@0
   177
		{
sl@0
   178
		INFO_PRINTF1(_L("DevSound Event: EEventInitComplete"));
sl@0
   179
		Fsm(EEventInitComplete, aError);
sl@0
   180
		}
sl@0
   181
	}
sl@0
   182
sl@0
   183
void RA3FDevSoundTestBase::ToneFinished(TInt aError)
sl@0
   184
	{
sl@0
   185
	INFO_PRINTF1(_L("========== DevSound ToneFinished() callback =========="));
sl@0
   186
	if (aError == KErrUnderflow)
sl@0
   187
		{
sl@0
   188
		INFO_PRINTF2(_L("DevSound called CMMFDevSound::ToneFinished with error = %d as expected"), aError);
sl@0
   189
		StopTest(aError,EPass);
sl@0
   190
		}
sl@0
   191
	else
sl@0
   192
		{
sl@0
   193
		ERR_PRINTF2(_L("DevSound called CMMFDevSound::ToneFinished with error = %d"), aError);
sl@0
   194
		ERR_PRINTF2(_L("Expected error = %d"), KErrUnderflow);
sl@0
   195
		StopTest(aError);
sl@0
   196
		}
sl@0
   197
	}
sl@0
   198
sl@0
   199
void RA3FDevSoundTestBase::BufferToBeFilled(CMMFBuffer* aBuffer)
sl@0
   200
	{
sl@0
   201
	INFO_PRINTF1(_L("========== DevSound BufferToBeFilled() callback =========="));
sl@0
   202
	if (!aBuffer)
sl@0
   203
		{
sl@0
   204
		ERR_PRINTF1(_L("BufferToBeFilled callback received a NULL CMMFBuffer!"));
sl@0
   205
		StopTest(KErrGeneral);
sl@0
   206
		}
sl@0
   207
	else
sl@0
   208
		{
sl@0
   209
		iBuffer = aBuffer;	
sl@0
   210
		INFO_PRINTF1(_L("DevSound Event: EEventBTBF"));
sl@0
   211
		Fsm(EEventBTBF, KErrNone);
sl@0
   212
		}	
sl@0
   213
	}
sl@0
   214
sl@0
   215
void RA3FDevSoundTestBase::PlayError(TInt aError)
sl@0
   216
	{
sl@0
   217
	INFO_PRINTF1(_L("========== DevSound PlayError() callback =========="));
sl@0
   218
	INFO_PRINTF3(KMsgErrorDevSoundCallback, &KPlayErrorText, aError);
sl@0
   219
	if(iBuffer->LastBuffer() && (aError == KErrUnderflow))
sl@0
   220
		{
sl@0
   221
		INFO_PRINTF1(_L("Playback completed normally"));
sl@0
   222
		StopTest();
sl@0
   223
		}
sl@0
   224
	else
sl@0
   225
		{
sl@0
   226
		INFO_PRINTF1(_L("Playback completed with error"));
sl@0
   227
		StopTest(aError, EFail);
sl@0
   228
		}	
sl@0
   229
	}
sl@0
   230
sl@0
   231
void RA3FDevSoundTestBase::BufferToBeEmptied(CMMFBuffer* aBuffer)
sl@0
   232
	{
sl@0
   233
	INFO_PRINTF1(_L("DevSound called BufferToBeEmptied."));
sl@0
   234
	if (!aBuffer)
sl@0
   235
		{
sl@0
   236
		INFO_PRINTF1(_L("BufferToBeEmptied callback received a NULL CMMFBuffer"));
sl@0
   237
		StopTest(KErrGeneral);
sl@0
   238
		return;
sl@0
   239
		}
sl@0
   240
	iBuffer = aBuffer;
sl@0
   241
	if(aBuffer->LastBuffer())
sl@0
   242
		{
sl@0
   243
		if(iDevSoundState == EStatePause)
sl@0
   244
			{
sl@0
   245
			// We need to call CMMFDevSound->Stop() here if last buffer flag set
sl@0
   246
			INFO_PRINTF1(_L("Devsound is in Paused state and CMMFBuffer::LastBuffer is set"));
sl@0
   247
			INFO_PRINTF1(_L("iMMFDevSound->Stop()"));
sl@0
   248
			iMMFDevSound->Stop();
sl@0
   249
			StopTest();
sl@0
   250
			}
sl@0
   251
		else
sl@0
   252
			{
sl@0
   253
			INFO_PRINTF1(_L("***** Unknown behaviour: Last buffer flag set before calling CMMFDevSound->Pause()"));
sl@0
   254
			StopTest(KErrUnknown);
sl@0
   255
			}
sl@0
   256
		}
sl@0
   257
	else
sl@0
   258
		{
sl@0
   259
		INFO_PRINTF1(_L("DevSound Event: EEventBTBE"));
sl@0
   260
		Fsm(EEventBTBE, KErrNone);
sl@0
   261
		}	
sl@0
   262
	}
sl@0
   263
sl@0
   264
void RA3FDevSoundTestBase::RecordError(TInt aError)
sl@0
   265
	{
sl@0
   266
	INFO_PRINTF2(_L("DevSound called RecordError with error = %d"), aError);
sl@0
   267
	if (aError == KErrUnderflow)
sl@0
   268
		{
sl@0
   269
		StopTest(aError);	
sl@0
   270
		}
sl@0
   271
	}
sl@0
   272
sl@0
   273
void RA3FDevSoundTestBase::ConvertError(TInt /*aError*/)
sl@0
   274
	{
sl@0
   275
	__ASSERT_ALWAYS(0, Panic(_L("RA3FDevSoundTestBase"), EInvalidCallbackCall));
sl@0
   276
	}
sl@0
   277
sl@0
   278
void RA3FDevSoundTestBase::DeviceMessage(TUid /*aMessageType*/, const TDesC8& /*aMsg*/)
sl@0
   279
	{
sl@0
   280
	__ASSERT_ALWAYS(0, Panic(_L("RA3FDevSoundTestBase"), EInvalidCallbackCall));
sl@0
   281
	}
sl@0
   282
sl@0
   283
void RA3FDevSoundTestBase::SendEventToClient(const TMMFEvent& aEvent)
sl@0
   284
	{
sl@0
   285
	INFO_PRINTF3(_L("RA3FDevSoundTestBase::SendEventToClient type=0x%08x errorCode=%d"),aEvent.iEventType, aEvent.iErrorCode);
sl@0
   286
	if(aEvent.iEventType == KMMFEventCategoryAudioResourceAvailable)
sl@0
   287
		{
sl@0
   288
		INFO_PRINTF1(_L("Received KMMFEventCategoryAudioResourceAvailable"));
sl@0
   289
		Fsm(EResourceAvailable, aEvent.iErrorCode);
sl@0
   290
		}
sl@0
   291
	}
sl@0
   292
sl@0
   293
void RA3FDevSoundTestBase::SampleRateFromTIntToTMMFSampleRate(TInt aSampleRate, TMMFSampleRate &aESampleRate)
sl@0
   294
	{
sl@0
   295
	const TSampleRateToTMMFSampleRate SampleRateLookUp [] =
sl@0
   296
	{
sl@0
   297
	{8000,	EMMFSampleRate8000Hz},
sl@0
   298
	{11025,	EMMFSampleRate11025Hz},
sl@0
   299
	{16000,	EMMFSampleRate16000Hz},
sl@0
   300
	{22050,	EMMFSampleRate22050Hz},
sl@0
   301
	{32000,	EMMFSampleRate32000Hz},
sl@0
   302
	{44100,	EMMFSampleRate44100Hz},
sl@0
   303
	{48000,	EMMFSampleRate48000Hz},
sl@0
   304
	{88200,	EMMFSampleRate88200Hz},
sl@0
   305
	{96000,	EMMFSampleRate96000Hz},
sl@0
   306
	{12000,	EMMFSampleRate12000Hz},
sl@0
   307
	{24000,	EMMFSampleRate24000Hz},
sl@0
   308
	{64000,	EMMFSampleRate64000Hz}
sl@0
   309
	};
sl@0
   310
	
sl@0
   311
	const TInt length = sizeof SampleRateLookUp / sizeof *SampleRateLookUp;
sl@0
   312
	
sl@0
   313
	for(TInt i = 0; i < length; i++)
sl@0
   314
		{
sl@0
   315
		if(aSampleRate == SampleRateLookUp[i].iTIntSampleRate)
sl@0
   316
			{
sl@0
   317
			aESampleRate = SampleRateLookUp[i].iTMMFSampleRate;
sl@0
   318
			return;
sl@0
   319
			}
sl@0
   320
		}
sl@0
   321
		ERR_PRINTF1(_L("User SampleRate doesn't match any of the specified sample rates"));
sl@0
   322
		StopTest(KErrGeneral);
sl@0
   323
	}
sl@0
   324
	
sl@0
   325
sl@0
   326
void RA3FDevSoundTestBase::SampleRateFromTUintToString(TUint aSampleRate, TDes& aStringSampleRate)
sl@0
   327
	{
sl@0
   328
	const TSampleRateToString SampleRateLookUp [] =
sl@0
   329
	{
sl@0
   330
	{0x00000001,	KEMMFSampleRate8000Hz() },
sl@0
   331
	{0x00000002,	KEMMFSampleRate11025Hz()},
sl@0
   332
	{0x00000004,  	KEMMFSampleRate16000Hz()},
sl@0
   333
	{0x00000008,	KEMMFSampleRate22050Hz()},
sl@0
   334
	{0x00000010,	KEMMFSampleRate32000Hz()},
sl@0
   335
	{0x00000020,	KEMMFSampleRate44100Hz()},
sl@0
   336
	{0x00000040,	KEMMFSampleRate48000Hz()},
sl@0
   337
	{0x00000080,	KEMMFSampleRate88200Hz()},
sl@0
   338
	{0x00000100,	KEMMFSampleRate96000Hz()},
sl@0
   339
	{0x00000200,	KEMMFSampleRate12000Hz()},
sl@0
   340
	{0x00000400,	KEMMFSampleRate24000Hz()},
sl@0
   341
	{0x00000800,	KEMMFSampleRate64000Hz()}
sl@0
   342
	};
sl@0
   343
sl@0
   344
	const TInt length = sizeof SampleRateLookUp / sizeof *SampleRateLookUp;
sl@0
   345
sl@0
   346
	for (TInt i =0; i < length; i++)
sl@0
   347
		{
sl@0
   348
		if(aSampleRate == SampleRateLookUp[i].iTUIntSampleRate)
sl@0
   349
			{
sl@0
   350
			aStringSampleRate.Copy(SampleRateLookUp[i].iTPtrSampleRate);
sl@0
   351
			return;
sl@0
   352
			}
sl@0
   353
		}
sl@0
   354
		ERR_PRINTF1(_L("SampleRate doesn't match any of the specified sample rates"));
sl@0
   355
		StopTest(KErrGeneral);
sl@0
   356
	}
sl@0
   357
sl@0
   358
void RA3FDevSoundTestBase::ChannelsFromTUintToString(TUint aChannels,TDes& aStringChannels)
sl@0
   359
	{
sl@0
   360
	const TChannelsToString ChannelsLookUp [] =
sl@0
   361
		{
sl@0
   362
		{0x00000001,	KEMMFMono() },
sl@0
   363
		{0x00000002,	KEMMFStereo()},
sl@0
   364
		};	
sl@0
   365
	const TInt length = sizeof ChannelsLookUp / sizeof *ChannelsLookUp;
sl@0
   366
sl@0
   367
	for (TInt i =0; i < length; i++)
sl@0
   368
		{
sl@0
   369
		if(aChannels == ChannelsLookUp[i].iTUIntChannels)
sl@0
   370
			{
sl@0
   371
			aStringChannels.Copy(ChannelsLookUp[i].iTPtrChannels);
sl@0
   372
			return;
sl@0
   373
			}
sl@0
   374
		}
sl@0
   375
		ERR_PRINTF1(_L("Channels doesn't match any of the specified channels"));
sl@0
   376
		StopTest(KErrGeneral);
sl@0
   377
	}
sl@0
   378
sl@0
   379
sl@0
   380
void RA3FDevSoundTestBase::PrintSupportedCapabilities(TUint aSampleRate,TUint aChannel)
sl@0
   381
	{
sl@0
   382
	TInt length = sizeof KRateLookup / sizeof *KRateLookup;
sl@0
   383
	TBuf<KMaxSampleRateStringLength> stringSampleRate;
sl@0
   384
	TBuf<KMaxChannelsStringLength> channels;
sl@0
   385
	
sl@0
   386
	for(TInt i = 0; i < length ; i++)
sl@0
   387
		{
sl@0
   388
		if(aSampleRate & KRateLookup[i])
sl@0
   389
			{
sl@0
   390
			SampleRateFromTUintToString(KRateLookup[i],stringSampleRate);
sl@0
   391
			INFO_PRINTF3(_L("Supported Sample rate 0x%08x %S"),KRateLookup[i],&stringSampleRate);
sl@0
   392
			}
sl@0
   393
		}
sl@0
   394
	length = sizeof KChannelsLookup / sizeof *KChannelsLookup;
sl@0
   395
	
sl@0
   396
	for(TInt i = 0; i < length ; i++)
sl@0
   397
		{
sl@0
   398
		if(aChannel & KChannelsLookup[i])
sl@0
   399
			{
sl@0
   400
			ChannelsFromTUintToString(KChannelsLookup[i],channels);
sl@0
   401
			INFO_PRINTF3(_L("Supported channels 0x%08x %S"),KChannelsLookup[i],&channels);
sl@0
   402
			}
sl@0
   403
		}
sl@0
   404
	}
sl@0
   405
sl@0
   406
//
sl@0
   407
// CAsyncWriteBufferToFile
sl@0
   408
//
sl@0
   409
sl@0
   410
CAsyncWriteBufferToFile::CAsyncWriteBufferToFile(RFile& aFile, CMMFDevSound* aDevSound, RA3FDevSoundTestBase& aTestStep)
sl@0
   411
:CActive(EPriorityStandard),
sl@0
   412
 iFile(aFile),
sl@0
   413
 iDevSound(aDevSound),
sl@0
   414
 iTestStep(aTestStep)
sl@0
   415
	{
sl@0
   416
	CActiveScheduler::Add(this);
sl@0
   417
	}
sl@0
   418
sl@0
   419
CAsyncWriteBufferToFile::~CAsyncWriteBufferToFile()
sl@0
   420
	{
sl@0
   421
	Cancel();
sl@0
   422
	}
sl@0
   423
sl@0
   424
CAsyncWriteBufferToFile* CAsyncWriteBufferToFile::NewL(RFile& aFile, CMMFDevSound* aDevSound, RA3FDevSoundTestBase& aTestStep)
sl@0
   425
	{
sl@0
   426
	CAsyncWriteBufferToFile* self = new(ELeave) CAsyncWriteBufferToFile(aFile, aDevSound, aTestStep);
sl@0
   427
	CleanupStack::PushL(self);
sl@0
   428
	self->ConstructL();
sl@0
   429
	CleanupStack::Pop(self);
sl@0
   430
	return self;
sl@0
   431
	}
sl@0
   432
sl@0
   433
void CAsyncWriteBufferToFile::ConstructL()
sl@0
   434
	{
sl@0
   435
	// Nothing to do here
sl@0
   436
	}
sl@0
   437
sl@0
   438
void CAsyncWriteBufferToFile::RunL()
sl@0
   439
	{
sl@0
   440
	//If error occurs then deal with problem in RunError()
sl@0
   441
	User::LeaveIfError(iStatus.Int());
sl@0
   442
	// Continue recording data to a buffer
sl@0
   443
	iDevSound->RecordData();
sl@0
   444
sl@0
   445
	}
sl@0
   446
sl@0
   447
void CAsyncWriteBufferToFile::Start(CMMFDataBuffer* aBuffer)
sl@0
   448
	{
sl@0
   449
	iFile.Write(aBuffer->Data(), iStatus);
sl@0
   450
	SetActive();
sl@0
   451
	}
sl@0
   452
sl@0
   453
void CAsyncWriteBufferToFile::DoCancel()
sl@0
   454
	{
sl@0
   455
	// Can't cancel an async write request
sl@0
   456
	}
sl@0
   457
sl@0
   458
TInt CAsyncWriteBufferToFile::RunError(TInt aError)
sl@0
   459
	{
sl@0
   460
	iTestStep.CallStopTest(aError);
sl@0
   461
	return KErrNone;
sl@0
   462
	}