CrashFlash Class Reference

class CrashFlash

Abstract class defining interface to all CrashFlash classes. This is used by the CrashLogger to log to a specific type of flash.

Public Member Functions
TUint BytesWritten()
voidEndTransaction()
voidEraseFlashBlock(const TUint)
voidEraseLogArea()
TInt Initialise()
voidRead(TDes8 &)
voidSetReadPos(TUint)
voidSetWritePos(const TUint)
voidStartTransaction()
voidWrite(const TDesC8 &)
voidWriteSignature(const TDesC8 &)

Member Functions Documentation

BytesWritten()

TUint BytesWritten()[pure virtual]

Returns the number of bytes written to the flash. This is used by reading programs to figure out how much to read back.

EndTransaction()

voidEndTransaction()[pure virtual]

Called last. Commits any buffered data and sets the flag for the underlying crash flash device indicating that the transaction finished succesfully.

EraseFlashBlock(const TUint)

voidEraseFlashBlock(const TUintaBlock)[pure virtual]

Erases the data in a given flash block

Parameters

const TUint aBlockThe block to be erased

EraseLogArea()

voidEraseLogArea()[pure virtual]

Called third. Performs the operations necessary to erase a block of flash large enough to store a log of KMaxCrashLogSize.

Initialise()

TInt Initialise()[pure virtual]

Called first. Should initialise underlying crash flash device to the state that it can read, write, and erase.

Read(TDes8 &)

voidRead(TDes8 &aDes)[pure virtual]

Reads the next aDes.Length() characters and places them in aDes starting from aDes[0]. The read position is modifiable using SetReadPos(). The underlying implementation may buffer as required.

Parameters

TDes8 & aDes

SetReadPos(TUint)

voidSetReadPos(TUintaPos)[pure virtual]

Sets the internal state such that the next read will take place at aPos bytes from the base address.

Parameters

TUint aPos

SetWritePos(const TUint)

voidSetWritePos(const TUintaPos)[pure virtual]

Sets the internal state of the write position aPos bytes from the base address.

Parameters

const TUint aPos

StartTransaction()

voidStartTransaction()[pure virtual]

Called second. Allows underlying implementation to set any flags required to indicate that a transaction has started.

Write(const TDesC8 &)

voidWrite(const TDesC8 &aDes)[pure virtual]

Writes aDes to the underlying crash flash device. The underlying implementation may buffer as required.

Parameters

const TDesC8 & aDes

WriteSignature(const TDesC8 &)

voidWriteSignature(const TDesC8 &aDes)[pure virtual]

Writes aDes to the signature section of the underlying cras flash device. The descriptor should include both the signature and the length written.

Parameters

const TDesC8 & aDes