CMTPConnection Class Reference
class CMTPConnection : public CBase
|
Implements the connection level portion of the MTP communication model and associated transport layer protocol binding. This class Implements the API portion (
MMTPConnectionProtocol
) of the transport layer API/SPI interface pair by which MTP framework and transport protocol connections (
MMTPTransportConnection
) interact. A unique
CMTPConnection
instance is created and bound to each
MMTPTransportConnection
instance that is loaded.It also implements the data provider layer MTP connection interface (
MMTPConnection
) which represents the virtual circuit between data provider and the transport layer.
Nested Classes and Structures
Private Member Functions
|
|
CMTPConnection
(
TUint
,
MMTPTransportConnection
&)
|
TUint
|
ActiveSessions
()
|
void
|
CloseAllSessions
()
|
void
|
CloseSession
(
TUint
)
|
void
|
CompleteCloseConnection
()
|
void
|
ConstructL
()
|
void
|
DefineConnStatePropertyL
()
|
void
|
DequeueEvent
(
CMTPEventLink
*)
|
void
|
EnqueueEvent
(
CMTPEventLink
*)
|
void
|
InitiateMTPErrorRecoveryL
(const
TMTPTypeRequest
&,
TUint16
)
|
void
|
InitiateTransactionCancelL
(
TInt
)
|
void
|
MTPErrorRecoveryComplete
()
|
void
|
PublishConnState
(
TMTPConnStateType
)
|
void
|
ReceiveDataCompleteL
(
TInt
, const
MMTPType
&, const
TMTPTypeRequest
&)
|
void
|
ReceivedEventL
(const
TMTPTypeEvent
&)
|
void
|
ReceivedRequestL
(const
TMTPTypeRequest
&)
|
void
|
RemoveEventsForSession
(
TUint32
)
|
void
|
SendDataCompleteL
(
TInt
, const
MMTPType
&, const
TMTPTypeRequest
&)
|
void
|
SendEventCompleteL
(
TInt
, const
TMTPTypeEvent
&)
|
void
|
SendResponseCompleteL
(
TInt
, const
TMTPTypeResponse
&, const
TMTPTypeRequest
&)
|
CMTPSession
&
|
SessionL
(const
TMTPTypeFlatBase
&,
TInt
)
|
TInt
|
SessionOrder
(const
TUint32
*, const
CMTPSession
&)
|
TInt
|
SessionOrder
(const
CMTPSession
&, const
CMTPSession
&)
|
void
|
SetState
(
TUint
)
|
TUint
|
State
()
|
void
|
Unbind
(
MMTPTransportConnection
&)
|
void
|
UnrecoverableMTPError
()
|
TBool
|
ValidFrameworkRequest
(
CMTPSession
*,
TUint
,
TRequestStatus
*)
|
void
|
ValidateAndPublishConnState
(
CMTPSession
&,
TInt
)
|
Constructor & Destructor Documentation
CMTPConnection(TUint, MMTPTransportConnection &)
Member Functions Documentation
ActiveSessions()
TUint
|
ActiveSessions
|
(
|
)
|
const [private]
|
Provides a count of the number of sessions with transactions in-progress.
CloseAllSessions()
void
|
CloseAllSessions
|
(
|
)
|
[private]
|
Closes all sessions which have been opened on the connection.
CloseSession(TUint)
void
|
CloseSession
|
(
|
TUint
|
aIdx
|
)
|
[private]
|
Closes the sessions with the specified session index.
Parameters
TUint
aIdx
|
The session index.
|
CompleteCloseConnection()
void
|
CompleteCloseConnection
|
(
|
)
|
[private]
|
ConnectionId()
TUint
|
ConnectionId
|
(
|
)
|
const
|
ConnectionResumedL(MMTPTransportConnection &)
ConnectionSuspended()
TBool
|
ConnectionSuspended
|
(
|
)
|
|
ConstructL()
void
|
ConstructL
|
(
|
)
|
[private]
|
Second phase constructor.
-
leave
-
One of the system wide error code, if a processing failure occurs.
DefineConnStatePropertyL()
void
|
DefineConnStatePropertyL
|
(
|
)
|
[private]
|
This method define and attach the property for publishing connection state events.
DequeueEvent(CMTPEventLink *)
DisconnectionNotifyL()
void
|
DisconnectionNotifyL
|
(
|
)
|
|
EnqueueEvent(CMTPEventLink *)
GetDataReceiveResult()
IMPORT_C
TInt
|
GetDataReceiveResult
|
(
|
)
|
const
|
Get the data receive result.
InitiateMTPErrorRecoveryL(const TMTPTypeRequest &, TUint16)
Initiates an MTP connection level protocol error recovery sequence. This sequence is invoked when a recoverable protocol error is detected that cannot be processed above the connection layer, e.g. when a request is made on a non-existant SessionID, or an out-of-sequence TransactionID is detected. An appropriate MTP response dataset is formed and sent to the MTP initiator. The error recovery sequence is concluded by MTPErrorRecoveryComplete when the connection transport layer signals SendResponseComplete to the MTP connection protocol layer.
-
leave
-
One of the system wide error codes, if a processing failure occurs.
MTPErrorRecoveryComplete
Parameters
const
TMTPTypeRequest
& aRequest
|
The MTP request dataset of the erroneous MTP transaction.
|
TUint16
aResponseCode
|
The MTP response datacode to be returned to the MTP initiator.
|
InitiateTransactionCancelL(TInt)
void
|
InitiateTransactionCancelL
|
(
|
TInt
|
aSessionIdx
|
)
|
[private]
|
Signals the MTP connection transport to terminate any in-progress data phase processing on the specified session.
-
leave
-
One of the system wide error codes, if a processing failure occurs.
MTPErrorRecoveryComplete()
void
|
MTPErrorRecoveryComplete
|
(
|
)
|
[private]
|
NewLC(TUint, MMTPTransportConnection &)
CMTPConnection
factory method. A pointer to the new
CMTPConnection
instance is placed on the cleanup stack.
-
leave
-
One of the system wide error codes if a processing failure occurs.
Parameters
TUint
aConnectionId
|
The unique identifier assigned to this connection by the MTP framework.
|
MMTPTransportConnection
& aTransportConnection
|
The MTP transport layer connection interface to which the CMTPConnection will bind.
|
PublishConnState(TMTPConnStateType)
This method is to publish various connection state.
ReceiveDataCompleteL(TInt, const MMTPType &, const TMTPTypeRequest &)
ReceiveDataL(MMTPType &, const TMTPTypeRequest &, TRequestStatus &)
Initiates MTP transaction data phase processing for initiator-to-responder data flows. This method should only be invoked when the MTP transaction phase state is ERequestPhase. This is an asynchronous method.
-
leave
-
KErrNotFound If the MTP request dataset specifies an invalid SessionID.
-
panic
-
CMTPConnection
0 If an asynchronous request is already pending on the connection.
-
panic
-
CMTPConnection
2 If the MTP transaction phase is invalid.
Parameters
MMTPType
& aData
|
The MTP data object sink.
|
const
TMTPTypeRequest
& aRequest
|
The MTP request dataset of the active MTP transaction.
|
TRequestStatus
& aStatus
|
The status used to return asynchronous completion information regarding the request.
|
ReceivedEventL(const TMTPTypeEvent &)
ReceivedRequestL(const TMTPTypeRequest &)
RemoveEventsForSession(TUint32)
void
|
RemoveEventsForSession
|
(
|
TUint32
|
aMTPId
|
)
|
[private]
|
SendDataCompleteL(TInt, const MMTPType &, const TMTPTypeRequest &)
SendDataL(const MMTPType &, const TMTPTypeRequest &, TRequestStatus &)
Initiates MTP transaction data phase processing for responder-to-initiator data flows. This method should only be invoked when the MTP transaction phase state is ERequestPhase. This is an asynchronous method.
-
leave
-
KErrNotFound If the MTP request dataset specifies an invalid SessionID.
-
panic
-
CMTPConnection
0 If an asynchronous request is already pending on the connection.
-
panic
-
CMTPConnection
2 If the MTP transaction phase is invalid.
Parameters
const
MMTPType
& aData
|
The MTP data object source.
|
const
TMTPTypeRequest
& aRequest
|
The MTP request dataset of the active MTP transaction.
|
TRequestStatus
& aStatus
|
The status used to return asynchronous completion information regarding the request.
|
SendEventCompleteL(TInt, const TMTPTypeEvent &)
SendEventL(const TMTPTypeEvent &)
Sends an MTP event dataset.
-
leave
-
KErrNotFound If the MTP event dataset specifies an invalid SessionID.
SendResponseCompleteL(TInt, const TMTPTypeResponse &, const TMTPTypeRequest &)
SendResponseL(const TMTPTypeResponse &, const TMTPTypeRequest &, TRequestStatus &)
Initiates MTP transaction response phase processing. This method should only be invoked when the MTP transaction phase state is either ERequestPhase, or EResponsePhase. This is an asynchronous method.
-
leave
-
KErrNotFound If the MTP response dataset specifies an invalid SessionID.
-
leave
-
KErrArgument If the MTP response dataset does not match the specified request dataset.
-
panic
-
CMTPConnection
0 If an asynchronous request is already pending on the connection.
-
panic
-
CMTPConnection
2 If the MTP transaction phase is invalid.
Parameters
const
TMTPTypeResponse
& aResponse
|
The MTP response dataset source.
|
const
TMTPTypeRequest
& aRequest
|
The MTP request dataset of the active MTP transaction.
|
TRequestStatus
& aStatus
|
The status used to return asynchronous completion information regarding the request.
|
SessionClosedL(TUint32)
IMPORT_C void
|
SessionClosedL
|
(
|
TUint32
|
aSessionMTPId
|
)
|
|
Deletes the session object assigned to the specified session and notifies all loaded data providers.
-
leave
-
KErrNotFound, if a session with the specified SessionMTPId is not found.
-
leave
-
One of the system wide error codes, if a general processing failure occurs.
Parameters
TUint32
aSessionMTPId
|
The session identifier assigned by the MTP connection initiator.
|
SessionCount()
TUint
|
SessionCount
|
(
|
)
|
const
|
SessionL(const TMTPTypeFlatBase &, TInt)
Provides a reference to the session with the MTP connection assigned identifier specified in the supplied MTP dataset.
-
leave
-
KErrNotFound If the specified session identifier is not currently active on the connection.
Parameters
const
TMTPTypeFlatBase
& aDataset
|
The MTP dataset.
|
TInt
aSessionIdElementNo
|
The element number in the MTP dataset of the MTP connection assigned identifier.
|
SessionOpenedL(TUint32)
IMPORT_C void
|
SessionOpenedL
|
(
|
TUint32
|
aSessionMTPId
|
)
|
|
Creates a new session object for the specified session and notifies all loaded data providers. The session is known by two identifiers: 1. SessionMTPId - Assigned by the MTP connection initiator and unique only to the MTP connection on which the session was opened. In a multiple- connection configuration this identifier may not uniquely identify the session. 2. SessionUniqueId - Assigned by the MTP daemon and guaranteed to uniquely identify the session in a multiple-connection configuration. Currently the MTP daemon does not support multiple-connection configuration and both identifiers are assigned the same value.
-
leave
-
KErrAlreadyExists, if a session with the specified SessionMTPId is already open.
-
leave
-
One of the system wide error codes, if a general processing failure occurs.
Parameters
TUint32
aSessionMTPId
|
The session identifier assigned by the MTP connection initiator.
|
SessionOrder(const TUint32 *, const CMTPSession &)
Implements an order relation for
CMTPSession
objects based on relative MTP connection assigned session IDs.
Parameters
const
TUint32
* aL
|
The first MTP connection assigned session ID.
|
const
CMTPSession
& aR
|
The second object.
|
SessionOrder(const CMTPSession &, const CMTPSession &)
SessionWithMTPIdExists(TUint32)
SessionWithMTPIdL(TUint32)
SessionWithUniqueIdExists(TUint32)
SessionWithUniqueIdL(TUint32)
SetState(TUint)
void
|
SetState
|
(
|
TUint
|
aState
|
)
|
[private]
|
Sets the MTP connection state variable.
Parameters
TUint
aState
|
The new MTP connection state value.
|
State()
TUint
|
State
|
(
|
)
|
const [private]
|
Provide the current MTP connection state.
TransactionCompleteL(const TMTPTypeRequest &)
Signals the completion of the current transaction processing sequence. This method should only be invoked when the MTP transaction phase state is ECompletingPhase.
-
leave
-
KErrNotFound If the MTP request dataset specifies an invalid SessionID.
-
panic
-
CMTPConnection
2 If the MTP transaction phase is invalid.
Parameters
const
TMTPTypeRequest
& aRequest
|
The MTP request dataset of the completed MTP transaction.
|
TransactionPhaseL(TUint32)
Unbind(MMTPTransportConnection &)
UnrecoverableMTPError()
void
|
UnrecoverableMTPError
|
(
|
)
|
[private]
|
Forces the immediate shutdown of the MTP connection. This is invoked when a protocol error is detected that cannot be recovered from, e.g. if an attempt is detected to initiate an MTP transaction before a previous transaction has concluded.
ValidFrameworkRequest(CMTPSession *, TUint, TRequestStatus *)
Performs common validation processing for requests initiated from the data provider framework layer. The following validation checks are performed. 1. Attempt to initiate concurrent asynchronous requests to the same connection. This will result in a panic. 2. Attempt to initiate a request that is invalid for the current transaction phase. This will result in a panic. 3. Attempt to initiate a request when the connection is in an unrecoverable error shutdown mode. This will result in the immediate cancellation of the request.
-
panic
-
CMTPConnection
0 If an asynchronous request is already pending on the connection.
-
panic
-
CMTPConnection
2 If the MTP transaction phase is invalid.
ValidateAndPublishConnState(CMTPSession &, TInt)
void
|
ValidateAndPublishConnState
|
(
|
CMTPSession
&
|
aSession,
|
|
TInt
|
aState
|
|
)
|
[private]
|
This method is used to publish the events based on the TransactionPhase.
Member Enumerations Documentation
Enum TStates
Enumerators
EStateUnknown
|
|
EStateOpen
|
|
EStateErrorRecovery
|
|
EStateErrorShutdown
|
|
EStateShutdown
|
|
Member Data Documentation
__FLOG_DECLARATION_MEMBER_MUTABLE
|
__FLOG_DECLARATION_MEMBER_MUTABLE
|
[private]
|
FLOGGER debug trace member variable.
TUint
iConnectionId
TUint
|
iConnectionId
|
[private]
|
TInt
iDataReceiveResult
TInt
|
iDataReceiveResult
|
[private]
|
TSglQue< CMTPEventLink > iEventQ
TAny * iExtendedInterface
TAny
*
|
iExtendedInterface
|
[private]
|
TInt
iPendingEventCount
TInt
|
iPendingEventCount
|
[private]
|
TMTPTypeResponse
iResponse
RPointerArray< CMTPSession > iSessions
RMTPFramework
iSingletons
MMTPTransportConnection * iTransportConnection
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.