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
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 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 |
IMPORT_C | CObexReaderBase | ( | TPriority | aPriority, |
MObexTransportNotify & | aOwner, | |||
TObexConnectionInfo & | aInfo | |||
) | [protected] |
Constructor
TPriority aPriority | |
MObexTransportNotify & aOwner | |
TObexConnectionInfo & aInfo |
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.
IMPORT_C TBool | CompleteTransfer | ( | ) | [protected, virtual] |
Check if the packet read is complete
void | DoTransfer | ( | ) | [protected, pure virtual] |
This method issues either a read of data over the relevant transport object. NewRequest
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.
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.
TUid aUid | The uid associated with the M Class that is being implemented |
TInt | GetMaxPacketSize | ( | ) | [protected, pure virtual] |
Returns the maximum packet size that can be received
IMPORT_C TInt | GetObexPacketBufferSize | ( | ) | [protected] |
This function returns the buffer size of the read packet.
IMPORT_C TInt | GetObexPacketDataLimit | ( | ) | [protected] |
This function return the maximum limit the received data can be
IMPORT_C TInt | GetObexPacketHeaderSize | ( | ) | [protected] |
This function returns the size of the obex packet's header
IMPORT_C void | OnCompleteTransfer | ( | ) | [protected, virtual] |
Performs any actions necessary on completion of a read.
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.
IMPORT_C TInt | Remaining | ( | ) | [protected, virtual] |
Return the number bytes left to transfer
IMPORT_C void | StartTransfer | ( | CObexPacket & | aPacket | ) | [protected, virtual] |
Start transfer. Calls into CObexActiveRW , which eventually queues a read
CObexPacket & aPacket | The Obex packet to read into. |
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.