CMTPConnectionMgr Class Reference

class CMTPConnectionMgr : public CBase

Implements the connection manager singleton. The connection manager is a container class responsible for loading, storing, and managing CMTPTransportPlugin instances. The connection manager uses the ECOM framework to load and unload transport plug-ins on demand.The connection manager is not responsible for controlling or scheduling transport connections, but is notified by the loaded transport plug-ins as MMTPTransportConnection instances are created. At which time it will create and bind a new CMTPConnection instance to the MMTPTransportConnection instance being registered.

Inherits from

Public Member Functions
~CMTPConnectionMgr()
voidConnectionCloseComplete(const TUint &)
TUint ConnectionCount()
IMPORT_C CMTPConnection &ConnectionL(TUint)
CMTPConnectionMgr *NewL()
IMPORT_C voidQueueTransportL(TUid, const TAny *)
IMPORT_C voidSetBTResumeParameter(const TBTDevAddr &, const TUint16 &)
IMPORT_C voidSetClientSId(TUid)
IMPORT_C voidStartTransportL(TUid)
IMPORT_C voidStartTransportL(TUid, const TAny *)
IMPORT_C voidStopTransport(TUid)
IMPORT_C voidStopTransport(TUid, TBool)
IMPORT_C voidStopTransports()
IMPORT_C TIntTransportCount()
IMPORT_C TUidTransportUid()
CMTPConnection &operator[](TInt)
Private Member Functions
CMTPConnectionMgr()
TUid ClientSId()
TBool ConnectionClosed(MMTPTransportConnection &)
TInt ConnectionFind(TUint)
voidConnectionOpenedL(MMTPTransportConnection &)
TInt ConnectionOrderCompare(const CMTPConnection &, const CMTPConnection &)
TInt DoResumeSuspendedTransport(TAny *)
voidResumeSuspendedTransport()
voidSuspendTransportL(TUid)
voidUnsuspendTransport(TUid)
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()
Private Attributes
__FLOG_DECLARATION_MEMBER_MUTABLE
TLinearOrder< CMTPConnection >iConnectionOrder
RPointerArray< CMTPConnection >iConnections
TMTPBTRemoteDevice iRemoteDevice
TBool iResumeCalled
TUid iSecureId
TInt iShutdownConnectionIdx
RArray< TUid >iSuspendedTransports
CMTPTransportPlugin *iTransport
TUint iTransportCount
CAsyncCallBack *iTransportTrigger
TUid iTransportUid

Constructor & Destructor Documentation

CMTPConnectionMgr()

CMTPConnectionMgr()[private]

Constructor.

~CMTPConnectionMgr()

~CMTPConnectionMgr()

Destructor.

Member Functions Documentation

ClientSId()

TUid ClientSId()[private]

ConnectionCloseComplete(const TUint &)

voidConnectionCloseComplete(const TUint &aConnUid)

Parameters

const TUint & aConnUid

ConnectionClosed(MMTPTransportConnection &)

TBool ConnectionClosed(MMTPTransportConnection &aTransportConnection)[private]

Parameters

MMTPTransportConnection & aTransportConnection

ConnectionCount()

TUint ConnectionCount()const

Provides a count of the number of currently open connections.

ConnectionFind(TUint)

TInt ConnectionFind(TUintaConnectionId)const [private]

Provides the connections table index of the connection with the specified connection identifier.

Parameters

TUint aConnectionId

ConnectionL(TUint)

IMPORT_C CMTPConnection &ConnectionL(TUintaConnectionId)const
Provides a reference to the connection with the specified connection identifier.
leave
KErrNotFound If a connection with the specified identifier does not exist.

Parameters

TUint aConnectionIdThe connection identifier.

ConnectionOpenedL(MMTPTransportConnection &)

voidConnectionOpenedL(MMTPTransportConnection &aTransportConnection)[private]

Parameters

MMTPTransportConnection & aTransportConnection

ConnectionOrderCompare(const CMTPConnection &, const CMTPConnection &)

TInt ConnectionOrderCompare(const CMTPConnection &aFirst,
const CMTPConnection &aSecond
)[private, static]

Determines the relative order of two CMTPConnection objects based on their connection IDs.

Parameters

const CMTPConnection & aFirst
const CMTPConnection & aSecond

DoResumeSuspendedTransport(TAny *)

TInt DoResumeSuspendedTransport(TAny *aSelf)[private, static]

Resume suspended transport

Parameters

TAny * aSelf

NewL()

CMTPConnectionMgr *NewL()[static]
CMTPConnectionMgr factory method.
leave
If a failure occurs, one of the system wide error codes.

QueueTransportL(TUid, const TAny *)

IMPORT_C voidQueueTransportL(TUidaTransport,
const TAny *aParameter
)
Queue the transport to start when there is no running transport
leave
One of the system wide error codes, if the operation fails.

Parameters

TUid aTransport
const TAny * aParameter

ResumeSuspendedTransport()

voidResumeSuspendedTransport()[private]

Prepare to resume suspended transport

SetBTResumeParameter(const TBTDevAddr &, const TUint16 &)

IMPORT_C voidSetBTResumeParameter(const TBTDevAddr &aBTAddr,
const TUint16 &aPSMPort
)

Parameters

const TBTDevAddr & aBTAddr
const TUint16 & aPSMPort

SetClientSId(TUid)

IMPORT_C voidSetClientSId(TUidaSecureId)

Parameters

TUid aSecureId

StartTransportL(TUid)

IMPORT_C voidStartTransportL(TUidaTransport)

Parameters

TUid aTransport

StartTransportL(TUid, const TAny *)

IMPORT_C voidStartTransportL(TUidaTransport,
const TAny *aParameter
)
Loads and starts up the MTP transport plug-in with the specified CMTPTransportPlugin interface implementation UID. Only one MTP transport plug-in can be loaded at any given time.
leave
KErrNotSupported If an attempt is made to load a second MTP transport plug-in.
leave
One of the system wide error codes, if a processing failure occurs.
StopTransport

Parameters

TUid aTransport
const TAny * aParameter

StopTransport(TUid)

IMPORT_C voidStopTransport(TUidaTransport)

Shuts down and unloads the MTP transport plug-in with the specified CMTPTransportPlugin interface implementation UID.

Parameters

TUid aTransport

StopTransport(TUid, TBool)

IMPORT_C voidStopTransport(TUidaTransport,
TBoolaByBearer
)

Shuts down and unloads the MTP transport plug-in with the specified CMTPTransportPlugin interface implementation UID.

Parameters

TUid aTransportThe CMTPTransportPlugin interface implementation UID.
TBool aByBearerIf ETrue, it means the transport plugin is stopped because the bearer is turned off or not activated.

StopTransports()

IMPORT_C voidStopTransports()

Shuts down and unloads all active MTP transport plug-ins.

SuspendTransportL(TUid)

voidSuspendTransportL(TUidaTransport)[private]
Append the transport to the suspended transport list
leave
One of the system wide error codes, if the operation fails.

Parameters

TUid aTransport

TransportCount()

IMPORT_C TIntTransportCount()const

Returns the number of active Transports.

TransportUid()

IMPORT_C TUidTransportUid()

Returns the current transportID.

UnsuspendTransport(TUid)

voidUnsuspendTransport(TUidaTransport)[private]

Remove transport from the suspended transports list

Parameters

TUid aTransport

operator[](TInt)

CMTPConnection &operator[](TIntaIndex)const

Provide a non-const reference to the located at the specified position within the connection table.

Parameters

TInt aIndex

Member Data Documentation

__FLOG_DECLARATION_MEMBER_MUTABLE

__FLOG_DECLARATION_MEMBER_MUTABLE[private]

FLOGGER debug trace member variable.

TLinearOrder< CMTPConnection > iConnectionOrder

TLinearOrder< CMTPConnection >iConnectionOrder[private]

RPointerArray< CMTPConnection > iConnections

RPointerArray< CMTPConnection >iConnections[private]

TMTPBTRemoteDevice iRemoteDevice

TMTPBTRemoteDevice iRemoteDevice[private]

It will store the bluetooth address of remote device.

TBool iResumeCalled

TBool iResumeCalled[private]

Set ETrue when Resumetransport need to be called.

TUid iSecureId

TUid iSecureId[private]

TInt iShutdownConnectionIdx

TInt iShutdownConnectionIdx[private]

RArray< TUid > iSuspendedTransports

RArray< TUid >iSuspendedTransports[private]

Array storing the UIDs of the suspended transport plugins

CMTPTransportPlugin * iTransport

CMTPTransportPlugin *iTransport[private]

TUint iTransportCount

TUint iTransportCount[private]

CAsyncCallBack * iTransportTrigger

CAsyncCallBack *iTransportTrigger[private]

Active object which starts suspended transport asynchronously

TUid iTransportUid

TUid iTransportUid[private]