CObexActiveRW Class Reference

class CObexActiveRW : public CActive

Base class for a specific transport's active reader and writer classes. The derived classes are responsible for sending and receiving data for their transport.

CObexReaderBase CObexWriterBase

Inherits from

Constructor & Destructor Documentation

CObexActiveRW(TPriority, MObexTransportNotify &, TObexConnectionInfo &)

CObexActiveRW ( TPriority aP,
MObexTransportNotify & aOwner,
TObexConnectionInfo & aInfo
)

Constructor

Parameters

TPriority aP a priority
MObexTransportNotify & aOwner the owner
TObexConnectionInfo & aInfo connection information

~CObexActiveRW()

~CObexActiveRW ( )

Destructor

Member Functions Documentation

CompleteTransfer()

TBool CompleteTransfer ( ) [protected, pure virtual]

This method compares the number of bytes, iCount, read/ written, against the packet size. In the case of a write, ETrue is returned if all the bytes have been written, otherwise EFalse.

For reads, check if the header is received and if so assign iPacketSize with the packet size indicated in the header of the received packet. Note that the claimed packet size must be greater than the required obex header size and no more than the maximum packet size this transport handles.

CObexTransportControllerBase::Process()

DoTransfer()

void DoTransfer ( ) [protected, pure virtual]

This method issues either a read or write of data over the relevant transport object. This method is called from NewRequest.

NewRequest

NewRequest(CObexPacket &)

void NewRequest ( CObexPacket & aPacket ) [protected]

Start a new write or read Reset the pointer descriptor to the start of the buffer and make the call to start the transfer

Parameters

CObexPacket & aPacket the obex packet to read or write

OnCompleteTransfer()

void OnCompleteTransfer ( ) [protected, pure virtual]

This method is called when a transfer is complete. Any actions associated with completion of a transfer should be performed here, for instance sending the packet to the owner of the reader to be processed.

Remaining()

TInt Remaining ( ) [protected, pure virtual]

Return the number bytes left to transfer

RunL()

IMPORT_C void RunL ( ) [protected, virtual]

RunL called after a read/write has completed Check to see if we need to issue another request, otherwise process the complete packet

StartTransfer(CObexPacket &)

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

This method does any required initialisation of data for the transfer, including the received, aPacket, before calling NewRequest.

Transfer NewRequest(CObexPacket& aPacket)

Parameters

CObexPacket & aPacket The packet to read into or written

Transfer(CObexPacket &)

void Transfer ( CObexPacket & aPacket )

Parameters

CObexPacket & aPacket

Member Data Documentation

TInt iCount

TInt iCount [protected]

The number of bytes that have been read or written

TPtr8 iLocation

TPtr8 iLocation [protected]

A pointer to the iPacket buffer at the point where data is to be written from or read into. The maximum length is the remaining bytes to be read or written. Data is read from this buffer into the transport, or written from the transport into this buffer.

MObexTransportNotify & iOwner

MObexTransportNotify & iOwner [protected]

The owner of the derived reader or writer class. Required at construction.

CObexPacket * iPacket

CObexPacket * iPacket [protected]

The obex packet, received from the owner, that will be sent or written into iLocation.

TBool iPacketBased

TBool iPacketBased [protected]

Is true if the transport is a packet based transport

TInt iPacketSize

TInt iPacketSize [protected]

The size of the obex packet