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 ()
void ConnectionCloseComplete (const TUint &)
TUint ConnectionCount ()
IMPORT_C CMTPConnection & ConnectionL ( TUint )
CMTPConnectionMgr * NewL ()
IMPORT_C void QueueTransportL ( TUid , const TAny *)
IMPORT_C void SetBTResumeParameter (const TBTDevAddr &, const TUint16 &)
IMPORT_C void SetClientSId ( TUid )
IMPORT_C void StartTransportL ( TUid )
IMPORT_C void StartTransportL ( TUid , const TAny *)
IMPORT_C void StopTransport ( TUid )
IMPORT_C void StopTransport ( TUid , TBool )
IMPORT_C void StopTransports ()
IMPORT_C TInt TransportCount ()
IMPORT_C TUid TransportUid ()
CMTPConnection & operator[] ( TInt )
Private Member Functions
CMTPConnectionMgr ()
TUid ClientSId ()
TBool ConnectionClosed ( MMTPTransportConnection &)
TInt ConnectionFind ( TUint )
void ConnectionOpenedL ( MMTPTransportConnection &)
TInt ConnectionOrderCompare (const CMTPConnection &, const CMTPConnection &)
TInt DoResumeSuspendedTransport ( TAny *)
void ResumeSuspendedTransport ()
void SuspendTransportL ( TUid )
void UnsuspendTransport ( 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 &)

void ConnectionCloseComplete ( 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 ( TUint aConnectionId ) const [private]

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

Parameters

TUint aConnectionId

ConnectionL(TUint)

IMPORT_C CMTPConnection & ConnectionL ( TUint aConnectionId ) 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 aConnectionId The connection identifier.

ConnectionOpenedL(MMTPTransportConnection &)

void ConnectionOpenedL ( 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 void QueueTransportL ( TUid aTransport,
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()

void ResumeSuspendedTransport ( ) [private]

Prepare to resume suspended transport

SetBTResumeParameter(const TBTDevAddr &, const TUint16 &)

IMPORT_C void SetBTResumeParameter ( const TBTDevAddr & aBTAddr,
const TUint16 & aPSMPort
)

Parameters

const TBTDevAddr & aBTAddr
const TUint16 & aPSMPort

SetClientSId(TUid)

IMPORT_C void SetClientSId ( TUid aSecureId )

Parameters

TUid aSecureId

StartTransportL(TUid)

IMPORT_C void StartTransportL ( TUid aTransport )

Parameters

TUid aTransport

StartTransportL(TUid, const TAny *)

IMPORT_C void StartTransportL ( TUid aTransport,
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 void StopTransport ( TUid aTransport )

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

Parameters

TUid aTransport

StopTransport(TUid, TBool)

IMPORT_C void StopTransport ( TUid aTransport,
TBool aByBearer
)

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

Parameters

TUid aTransport The CMTPTransportPlugin interface implementation UID.
TBool aByBearer If ETrue, it means the transport plugin is stopped because the bearer is turned off or not activated.

StopTransports()

IMPORT_C void StopTransports ( )

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

SuspendTransportL(TUid)

void SuspendTransportL ( TUid aTransport ) [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 TInt TransportCount ( ) const

Returns the number of active Transports.

TransportUid()

IMPORT_C TUid TransportUid ( )

Returns the current transportID.

UnsuspendTransport(TUid)

void UnsuspendTransport ( TUid aTransport ) [private]

Remove transport from the suspended transports list

Parameters

TUid aTransport

operator[](TInt)

CMTPConnection & operator[] ( TInt aIndex ) 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]