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 void BaseConstructL ()
IMPORT_C TBool CompleteTransfer ()
void DoTransfer ()
TInt GetInitialPacketSize ()
IMPORT_C TAny * GetInterface ( TUid )
TInt GetMaxPacketSize ()
IMPORT_C TInt GetObexPacketBufferSize ()
IMPORT_C TInt GetObexPacketDataLimit ()
IMPORT_C TInt GetObexPacketHeaderSize ()
IMPORT_C void OnCompleteTransfer ()
IMPORT_C void OnReadActivity ()
IMPORT_C TInt Remaining ()
IMPORT_C void StartTransfer ( 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_C CObexReaderBase ( TPriority aPriority,
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 void BaseConstructL ( ) [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 TBool CompleteTransfer ( ) [protected, virtual]

Check if the packet read is complete

DoTransfer()

void DoTransfer ( ) [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 ( TUid aUid ) [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 aUid The 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 TInt GetObexPacketBufferSize ( ) [protected]

This function returns the buffer size of the read packet.

GetObexPacketDataLimit()

IMPORT_C TInt GetObexPacketDataLimit ( ) [protected]

This function return the maximum limit the received data can be

GetObexPacketHeaderSize()

IMPORT_C TInt GetObexPacketHeaderSize ( ) [protected]

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

OnCompleteTransfer()

IMPORT_C void OnCompleteTransfer ( ) [protected, virtual]

Performs any actions necessary on completion of a read.

OnReadActivity()

IMPORT_C void OnReadActivity ( ) [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 TInt Remaining ( ) [protected, virtual]

Return the number bytes left to transfer

StartTransfer(CObexPacket &)

IMPORT_C void StartTransfer ( CObexPacket & aPacket ) [protected, virtual]

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

Parameters

CObexPacket & aPacket The Obex packet to read into.

Member Data Documentation

TAny * iFuture1

TAny * iFuture1 [private]

TBool iGotHeader

TBool iGotHeader [private]

TInt iTransferError

TInt iTransferError [private]