CObexReaderBase Class Reference

class CObexReaderBase : public CObexActiveRW

CObexReaderBase provides obex specific reader behaviour for concrete readers to use. Derive from this class when providing a reader for a specific transport.

In a concrete reader the following things must be done: (a) In DoTransfer a read data transfer is issued over the reader's transport (b) GetMaxPacketSize must return the maximum packet size that can be received (c) GetInitialPacketSize must return a packet size that can be used in the event that the packet size of the packet to be read is not yet known (for example irda and bt use the obexpacketheadersize and usb uses the buffer size of the packet created to receive the data) (d)The NewL function must call BaseConstructL(). This is future proofing in the event that the iFuture1 variable is used and requires initialisation

Inherits from

Public Member Functions
~CObexReaderBase()
Protected Member Functions
CObexReaderBase(TPriority, MObexTransportNotify &, TObexConnectionInfo &)
IMPORT_C voidBaseConstructL()
IMPORT_C TBoolCompleteTransfer()
voidDoTransfer()
TInt GetInitialPacketSize()
IMPORT_C TAny *GetInterface(TUid)
TInt GetMaxPacketSize()
IMPORT_C TIntGetObexPacketBufferSize()
IMPORT_C TIntGetObexPacketDataLimit()
IMPORT_C TIntGetObexPacketHeaderSize()
IMPORT_C voidOnCompleteTransfer()
IMPORT_C voidOnReadActivity()
IMPORT_C TIntRemaining()
IMPORT_C voidStartTransfer(CObexPacket &)
Inherited Functions
CActive::CActive(TInt)
CActive::Cancel()
CActive::Deque()
CActive::DoCancel()
CActive::Extension_(TUint,TAny *&,TAny *)
CActive::IsActive()const
CActive::IsAdded()const
CActive::Priority()const
CActive::RunError(TInt)
CActive::SetActive()
CActive::SetPriority(TInt)
CActive::~CActive()
CBase::CBase()
CBase::Delete(CBase *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
CObexActiveRW::CObexActiveRW(TPriority,MObexTransportNotify &,TObexConnectionInfo &)
CObexActiveRW::NewRequest(CObexPacket &)
CObexActiveRW::RunL()
CObexActiveRW::Transfer(CObexPacket &)
CObexActiveRW::~CObexActiveRW()
Inherited Enumerations
CActive:TPriority
Private Attributes
TAny *iFuture1
TBool iGotHeader
TInt iTransferError
Inherited Attributes
CActive::iStatus
CObexActiveRW::iCount
CObexActiveRW::iLocation
CObexActiveRW::iOwner
CObexActiveRW::iPacket
CObexActiveRW::iPacketBased
CObexActiveRW::iPacketSize

Constructor & Destructor Documentation

CObexReaderBase(TPriority, MObexTransportNotify &, TObexConnectionInfo &)

IMPORT_CCObexReaderBase(TPriorityaPriority,
MObexTransportNotify &aOwner,
TObexConnectionInfo &aInfo
)[protected]

Constructor

Parameters

TPriority aPriority
MObexTransportNotify & aOwner
TObexConnectionInfo & aInfo

~CObexReaderBase()

IMPORT_C~CObexReaderBase()[virtual]

Destructor

Member Functions Documentation

BaseConstructL()

IMPORT_C voidBaseConstructL()[protected]

This function is a place holder for future use. If the iFuture1 variable is used it will need this function for any allocation required.

To prevent binary compatiblity breaks if the iFuture1 variable is used, this function must be called from the NewL of derived classes.

CompleteTransfer()

IMPORT_C TBoolCompleteTransfer()[protected, virtual]

Check if the packet read is complete

DoTransfer()

voidDoTransfer()[protected, pure virtual]

This method issues either a read of data over the relevant transport object. NewRequest

GetInitialPacketSize()

TInt GetInitialPacketSize()[protected, pure virtual]

Returns a initial packet size when the packet size of iPacket is not know. This is used when determining the remaining bytes to be read.

GetInterface(TUid)

IMPORT_C TAny *GetInterface(TUidaUid)[protected, virtual]

This function is part of the extension pattern and is implemented by all derived instantiable classes that need to extend it's interface.

By default this returns null. Any derived class that is required to extend its interface and that of this base class returns its new interface in the form of an M class, that it extends, if and only if the corresponding TUid, aUid, is received. Otherwise the function calls the base class implementation, returning NULL.

Parameters

TUid aUidThe uid associated with the M Class that is being implemented

GetMaxPacketSize()

TInt GetMaxPacketSize()[protected, pure virtual]

Returns the maximum packet size that can be received

GetObexPacketBufferSize()

IMPORT_C TIntGetObexPacketBufferSize()[protected]

This function returns the buffer size of the read packet.

GetObexPacketDataLimit()

IMPORT_C TIntGetObexPacketDataLimit()[protected]

This function return the maximum limit the received data can be

GetObexPacketHeaderSize()

IMPORT_C TIntGetObexPacketHeaderSize()[protected]

This function returns the size of the obex packet's header

OnCompleteTransfer()

IMPORT_C voidOnCompleteTransfer()[protected, virtual]

Performs any actions necessary on completion of a read.

OnReadActivity()

IMPORT_C voidOnReadActivity()[protected]

Called when read activity is detected. This method will certainly be called when read activity is first detected on an Obex operation, and it may be called from time to time thereafter until that Obex operation is completed.

Remaining()

IMPORT_C TIntRemaining()[protected, virtual]

Return the number bytes left to transfer

StartTransfer(CObexPacket &)

IMPORT_C voidStartTransfer(CObexPacket &aPacket)[protected, virtual]

Start transfer. Calls into CObexActiveRW, which eventually queues a read

Parameters

CObexPacket & aPacketThe Obex packet to read into.

Member Data Documentation

TAny * iFuture1

TAny *iFuture1[private]

TBool iGotHeader

TBool iGotHeader[private]

TInt iTransferError

TInt iTransferError[private]