CObexTransportControllerBase Class Reference

class CObexTransportControllerBase : public CBase

Abstraction for transport controller implementations. Defines an interface to be used by Obex protocol layer as the facade to the transport layer.

In a concrete transport controller's NewL, the following things must be done: (a) CObexTransportControllerBase::iConnector must be assigned to a CObexConnector-derived type. (This may be reliant on the TObexTransportInfo object passed in at this time.) iConnector is owned by CObexTransportControllerBase. (b) CObexTransportControllerBase::iTransportInfo must be assigned to a persistent (i.e. heap-based) TObexTransportInfo or derived type. The derived transport controller may cast the TObexTransportInfo given at construction time to a known derived type and copy the data from it to the new instance on the heap. Note that ownership of the given TObexTransportInfo *remains with the client*. iTransportInfo is then owned by CObexTransportControllerBase.

In a concrete transport controller's NewTransportL, two instances of types derived from CObexActiveRW must be created, and stored in CObexTransportControllerBase::iActiveReader and CObexTransportControllerBase::iActiveWriter. CObexTransportControllerBase owns these.

Inherits from

  • CObexTransportControllerBase
Public Member Functions
~CObexTransportControllerBase()
IMPORT_C voidAcceptConnectionL()
IMPORT_C TBoolBringTransportDown()
IMPORT_C voidCancelAccept()
IMPORT_C voidCancelConnect()
IMPORT_C voidCancelTransfers()
IMPORT_C voidConnectL()
IMPORT_C TBoolExtractRemoteConnectInfo(CObexPacket &, TUint8 &, TUint8 &)
IMPORT_C TIntInsertLocalConnectInfo(CObexPacket &, TUint8, TUint8)
IMPORT_C TBoolIsTransportRestartable()
IMPORT_C TBoolIsWriteActive()
IMPORT_C CObexTransportControllerBase *NewL(TObexTransportInfo &)
IMPORT_C voidReceive()
IMPORT_C CObexPacket &ReceivePacket()
IMPORT_C voidRemoteAddr(TSockAddr &)
IMPORT_C voidSend()
IMPORT_C voidSend(TObexOpcode)
IMPORT_C CObexPacket &SendPacket()
IMPORT_C voidSetOwner(MObexNotifyExtend &)
IMPORT_C voidSignalTransportError()
IMPORT_C const TObexTransportInfo *TransportInfo()
Protected Member Functions
CObexTransportControllerBase()
IMPORT_C voidDoError(TInt)
IMPORT_C voidDoProcess(CObexPacket &)
IMPORT_C voidDoSignalPacketProcessEvent(TObexPacketProcessEvent)
IMPORT_C voidDoTransportUp(TObexConnectionInfo &)
IMPORT_C TAny *GetInterface(TUid)
Private Member Functions
voidBaseConstructL()
voidConstructPacketsL()
voidDeleteTransport()
TBool DoIsTransportRestartable()
voidDoRemoteAddr(TSockAddr &)
TUint16 GetReceivePacketDataLimit()
voidInitialiseTransportL(TObexConnectionInfo &)
voidNewTransportL(TObexConnectionInfo &)
voidTransportUpError(TInt)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
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()
Protected Attributes
CObexActiveRW *iActiveReader
CObexActiveRW *iActiveWriter
TObexConnectionInfo iConnectionInfo
CObexConnector *iConnector
TObexTransportInfo *iTransportInfo
Private Attributes
TAny *iFuture1
MObexNotifyExtend *iOwner
TUid iPrivateEComUID
CObexPacket *iReceivePacket
CObexPacket *iSendPacket

Constructor & Destructor Documentation

CObexTransportControllerBase()

IMPORT_CCObexTransportControllerBase()[protected]

Constructor.

~CObexTransportControllerBase()

IMPORT_C~CObexTransportControllerBase()

Destructor.

Member Functions Documentation

AcceptConnectionL()

IMPORT_C voidAcceptConnectionL()

Calls accept connection on the connector

BaseConstructL()

voidBaseConstructL()[private]

This function is a place holder for future use. If iFuture1 variable is used it will need this function for any allocation required. This function is called from CObexTransportControllerBase::NewL.

BringTransportDown()

IMPORT_C TBoolBringTransportDown()

Calls on the constructor to take down the transport

CancelAccept()

IMPORT_C voidCancelAccept()

Calls Cancel Accept on he connector

CObexTransportControllerBase::AcceptConnectionL

CancelConnect()

IMPORT_C voidCancelConnect()

Ask Connector to cancel connect

CObexTransportControllerBase::ConnectL

CancelTransfers()

IMPORT_C voidCancelTransfers()

Cancels outstanding reads or writes

ConnectL()

IMPORT_C voidConnectL()

Calls ConnectL on the connector

ConstructPacketsL()

voidConstructPacketsL()[private]

DeleteTransport()

voidDeleteTransport()[private]

DoError(TInt)

IMPORT_C voidDoError(TIntaError)[protected, virtual]

Reports and error to the owner

Parameters

TInt aError

DoIsTransportRestartable()

TBool DoIsTransportRestartable()const [private, pure virtual]

DoProcess(CObexPacket &)

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

Process a Packet. Upcall to the owner

Parameters

CObexPacket & aPacket

DoRemoteAddr(TSockAddr &)

voidDoRemoteAddr(TSockAddr &aAddr)[private, pure virtual]

Parameters

TSockAddr & aAddr

DoSignalPacketProcessEvent(TObexPacketProcessEvent)

IMPORT_C voidDoSignalPacketProcessEvent(TObexPacketProcessEventaEvent)[protected, virtual]

Signals that an event related to processing the packet has occurred.

Parameters

TObexPacketProcessEvent aEventThe event that has occurred.

DoTransportUp(TObexConnectionInfo &)

IMPORT_C voidDoTransportUp(TObexConnectionInfo &aInfo)[protected, virtual]

Create the transport objects and reports that the transport is up to the owner

Parameters

TObexConnectionInfo & aInfo

ExtractRemoteConnectInfo(CObexPacket &, TUint8 &, TUint8 &)

IMPORT_C TBoolExtractRemoteConnectInfo(CObexPacket &aPacket,
TUint8 &aVersion,
TUint8 &aFlags
)

Extract the local information from the received packet

Parameters

CObexPacket & aPacketThe packet from which local connection info is extracted
TUint8 & aVersion
TUint8 & aFlags

GetInterface(TUid)

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

This function is part of the extension pattern and must be implemented by all derived instantiable classes. 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

GetReceivePacketDataLimit()

TUint16 GetReceivePacketDataLimit()[private, pure virtual]

InitialiseTransportL(TObexConnectionInfo &)

voidInitialiseTransportL(TObexConnectionInfo &aInfo)[private]

Parameters

TObexConnectionInfo & aInfo

InsertLocalConnectInfo(CObexPacket &, TUint8, TUint8)

IMPORT_C TIntInsertLocalConnectInfo(CObexPacket &aPacket,
TUint8aVersion,
TUint8aFlags
)

Insert local Connection info with the received, aVersion, aFlags and from iReceivePacket into the receive packet, aPacket

Parameters

CObexPacket & aPacketthe packet that is updated with local connection info
TUint8 aVersion
TUint8 aFlags

IsTransportRestartable()

IMPORT_C TBoolIsTransportRestartable()const

Returns true if the derived transport can re-connect when an obex connection is re-connected This is used to determine whether to take the transport down when an obex connection has been disconnected

DoIsTransportRestartable

IsWriteActive()

IMPORT_C TBoolIsWriteActive()const

Is there a write outstanding

NewL(TObexTransportInfo &)

IMPORT_C CObexTransportControllerBase *NewL(TObexTransportInfo &aTransportInfo)[static]

Constructs a CObexTransportControllerBase PlugIn object.

panic
TransCTBase EInvalidNumberOfTransportImplementations if there is more than one implementation for a given interface uid and transport name (equal to the default data in the plugin resource file

Parameters

TObexTransportInfo & aTransportInfo

NewTransportL(TObexConnectionInfo &)

voidNewTransportL(TObexConnectionInfo &aInfo)[private, pure virtual]

Parameters

TObexConnectionInfo & aInfo

Receive()

IMPORT_C voidReceive()

Ask activer reader to do a read

ReceivePacket()

IMPORT_C CObexPacket &ReceivePacket()

Returns the packet received

RemoteAddr(TSockAddr &)

IMPORT_C voidRemoteAddr(TSockAddr &aAddr)

Gets the socket associated with the connector and asks the socket for its remote name. This can be cast to the appropriate TSockAddr-derived class TIrdaSockAddr for IrDA.

Parameters

TSockAddr & aAddr

Send()

IMPORT_C voidSend()

Ask active writer to do a send

Send(TObexOpcode)

IMPORT_C voidSend(TObexOpcodeaOpcode)

Init the send packet wtih the received, aOpcode, set final to true, and send the packet

Parameters

TObexOpcode aOpcode

SendPacket()

IMPORT_C CObexPacket &SendPacket()

returns the send packet

SetOwner(MObexNotifyExtend &)

IMPORT_C voidSetOwner(MObexNotifyExtend &aOwner)

Sets the owner information from the received aOwner

Parameters

MObexNotifyExtend & aOwner

SignalTransportError()

IMPORT_C voidSignalTransportError()

Calls signal transport error on the connector

TransportInfo()

IMPORT_C const TObexTransportInfo *TransportInfo()const

Returns a pointer to the transport info being used by the transport. This may be cast to the transport info type associated with the known concrete transport controller.

TransportUpError(TInt)

voidTransportUpError(TIntaError)[private]

Parameters

TInt aError

Member Data Documentation

CObexActiveRW * iActiveReader

CObexActiveRW *iActiveReader[protected]

CObexActiveRW * iActiveWriter

CObexActiveRW *iActiveWriter[protected]

TObexConnectionInfo iConnectionInfo

TObexConnectionInfo iConnectionInfo[protected]

CObexConnector * iConnector

CObexConnector *iConnector[protected]

TAny * iFuture1

TAny *iFuture1[private]

MObexNotifyExtend * iOwner

MObexNotifyExtend *iOwner[private]

TUid iPrivateEComUID

TUid iPrivateEComUID[private]

CObexPacket * iReceivePacket

CObexPacket *iReceivePacket[private]

CObexPacket * iSendPacket

CObexPacket *iSendPacket[private]

TObexTransportInfo * iTransportInfo

TObexTransportInfo *iTransportInfo[protected]