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 void AcceptConnectionL ()
IMPORT_C TBool BringTransportDown ()
IMPORT_C void CancelAccept ()
IMPORT_C void CancelConnect ()
IMPORT_C void CancelTransfers ()
IMPORT_C void ConnectL ()
IMPORT_C TBool ExtractRemoteConnectInfo ( CObexPacket &, TUint8 &, TUint8 &)
IMPORT_C TInt InsertLocalConnectInfo ( CObexPacket &, TUint8 , TUint8 )
IMPORT_C TBool IsTransportRestartable ()
IMPORT_C TBool IsWriteActive ()
IMPORT_C CObexTransportControllerBase * NewL ( TObexTransportInfo &)
IMPORT_C void Receive ()
IMPORT_C CObexPacket & ReceivePacket ()
IMPORT_C void RemoteAddr ( TSockAddr &)
IMPORT_C void Send ()
IMPORT_C void Send ( TObexOpcode )
IMPORT_C CObexPacket & SendPacket ()
IMPORT_C void SetOwner ( MObexNotifyExtend &)
IMPORT_C void SignalTransportError ()
IMPORT_C const TObexTransportInfo * TransportInfo ()
Protected Member Functions
CObexTransportControllerBase ()
IMPORT_C void DoError ( TInt )
IMPORT_C void DoProcess ( CObexPacket &)
IMPORT_C void DoSignalPacketProcessEvent ( TObexPacketProcessEvent )
IMPORT_C void DoTransportUp ( TObexConnectionInfo &)
IMPORT_C TAny * GetInterface ( TUid )
Private Member Functions
void BaseConstructL ()
void ConstructPacketsL ()
void DeleteTransport ()
TBool DoIsTransportRestartable ()
void DoRemoteAddr ( TSockAddr &)
TUint16 GetReceivePacketDataLimit ()
void InitialiseTransportL ( TObexConnectionInfo &)
void NewTransportL ( TObexConnectionInfo &)
void TransportUpError ( 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_C CObexTransportControllerBase ( ) [protected]

Constructor.

~CObexTransportControllerBase()

IMPORT_C ~CObexTransportControllerBase ( )

Destructor.

Member Functions Documentation

AcceptConnectionL()

IMPORT_C void AcceptConnectionL ( )

Calls accept connection on the connector

BaseConstructL()

void BaseConstructL ( ) [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 TBool BringTransportDown ( )

Calls on the constructor to take down the transport

CancelAccept()

IMPORT_C void CancelAccept ( )

Calls Cancel Accept on he connector

CObexTransportControllerBase::AcceptConnectionL

CancelConnect()

IMPORT_C void CancelConnect ( )

Ask Connector to cancel connect

CObexTransportControllerBase::ConnectL

CancelTransfers()

IMPORT_C void CancelTransfers ( )

Cancels outstanding reads or writes

ConnectL()

IMPORT_C void ConnectL ( )

Calls ConnectL on the connector

ConstructPacketsL()

void ConstructPacketsL ( ) [private]

DeleteTransport()

void DeleteTransport ( ) [private]

DoError(TInt)

IMPORT_C void DoError ( TInt aError ) [protected, virtual]

Reports and error to the owner

Parameters

TInt aError

DoIsTransportRestartable()

TBool DoIsTransportRestartable ( ) const [private, pure virtual]

DoProcess(CObexPacket &)

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

Process a Packet. Upcall to the owner

Parameters

CObexPacket & aPacket

DoRemoteAddr(TSockAddr &)

void DoRemoteAddr ( TSockAddr & aAddr ) [private, pure virtual]

Parameters

TSockAddr & aAddr

DoSignalPacketProcessEvent(TObexPacketProcessEvent)

IMPORT_C void DoSignalPacketProcessEvent ( TObexPacketProcessEvent aEvent ) [protected, virtual]

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

Parameters

TObexPacketProcessEvent aEvent The event that has occurred.

DoTransportUp(TObexConnectionInfo &)

IMPORT_C void DoTransportUp ( 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 TBool ExtractRemoteConnectInfo ( CObexPacket & aPacket,
TUint8 & aVersion,
TUint8 & aFlags
)

Extract the local information from the received packet

Parameters

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

GetInterface(TUid)

IMPORT_C TAny * GetInterface ( TUid aUid ) [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 aUid The uid associated with the M Class that is being implemented

GetReceivePacketDataLimit()

TUint16 GetReceivePacketDataLimit ( ) [private, pure virtual]

InitialiseTransportL(TObexConnectionInfo &)

void InitialiseTransportL ( TObexConnectionInfo & aInfo ) [private]

Parameters

TObexConnectionInfo & aInfo

InsertLocalConnectInfo(CObexPacket &, TUint8, TUint8)

IMPORT_C TInt InsertLocalConnectInfo ( CObexPacket & aPacket,
TUint8 aVersion,
TUint8 aFlags
)

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

Parameters

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

IsTransportRestartable()

IMPORT_C TBool IsTransportRestartable ( ) 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 TBool IsWriteActive ( ) 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 &)

void NewTransportL ( TObexConnectionInfo & aInfo ) [private, pure virtual]

Parameters

TObexConnectionInfo & aInfo

Receive()

IMPORT_C void Receive ( )

Ask activer reader to do a read

ReceivePacket()

IMPORT_C CObexPacket & ReceivePacket ( )

Returns the packet received

RemoteAddr(TSockAddr &)

IMPORT_C void RemoteAddr ( 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 void Send ( )

Ask active writer to do a send

Send(TObexOpcode)

IMPORT_C void Send ( TObexOpcode aOpcode )

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 void SetOwner ( MObexNotifyExtend & aOwner )

Sets the owner information from the received aOwner

Parameters

MObexNotifyExtend & aOwner

SignalTransportError()

IMPORT_C void SignalTransportError ( )

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)

void TransportUpError ( TInt aError ) [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]