CRemConInterfaceSelector Class Reference

class CRemConInterfaceSelector : public CBase

CRemConInterfaceSelector is only instantiable via its NewL function. It is not derivable.

Inherits from

Public Member Functions
~CRemConInterfaceSelector ()
void BulkError ( TInt )
void BulkReceiveComplete ( TUid , TUint , const TDesC8 &)
void BulkSessionConnectL ()
IMPORT_C void ConnectBearer ( TRequestStatus &)
IMPORT_C TInt ConnectBearerCancel ()
IMPORT_C TBool ControllerOpened ()
IMPORT_C void DisconnectBearer ( TRequestStatus &)
IMPORT_C TInt DisconnectBearerCancel ()
void Error ( TInt )
IMPORT_C TInt GetConnections ( TSglQue < TRemConAddress > &)
IMPORT_C void GoConnectionOrientedL (const TRemConAddress &)
IMPORT_C void GoConnectionlessL ()
IMPORT_C CRemConInterfaceSelector * NewL ()
IMPORT_C void NotifyConnectionsChange ( TRequestStatus &)
IMPORT_C TInt NotifyConnectionsChangeCancel ()
IMPORT_C void OpenControllerL ()
IMPORT_C void OpenTargetL ()
IMPORT_C void OpenTargetL ( TPlayerType , TPlayerSubType , const TDesC8 &)
void ReceiveComplete ( TUid , TUint , TRemConMessageSubType , const TRemConAddress &, const TDesC8 &, TRemConClientType )
IMPORT_C void RegisterErrorObserver ( MRemConErrorObserver *)
IMPORT_C void RegisterInterfaceL ( CRemConInterfaceBase &)
void RegisterInterfaceL ( CRemConInterfaceBase &, RRemConInterfaceFeatures &)
IMPORT_C void Send ( TRequestStatus &, TUid , TUint , TUint &, TRemConMessageType , const TDesC8 &)
IMPORT_C void Send ( TRequestStatus &, TUid , TUint , TUint &, TRemConMessageType , TRemConMessageSubType , const TDesC8 &)
IMPORT_C void SendBulk ( TRequestStatus &, TUid , TUint , const TDesC8 &)
IMPORT_C TInt SendBulkCancel ()
IMPORT_C TInt SendBulkUnreliable ( TUid , TUint , const TDesC8 &)
IMPORT_C TInt SendCancel ( TRemConMessageType )
IMPORT_C void SendNotify ( TRequestStatus &, TUid , TUint , TRemConMessageType , TRemConMessageSubType , const TDesC8 &)
IMPORT_C TInt SendUnreliable ( TUid , TUint , TRemConMessageType , const TDesC8 &)
IMPORT_C TInt SendUnreliable ( TUid , TUint , TRemConMessageType , TRemConMessageSubType , const TDesC8 &)
IMPORT_C TBool TargetOpened ()
Private Member Functions
CRemConInterfaceSelector ()
void AssertSession ( RRemCon *, TInt )
void BulkCleanup ()
TBool BulkOpened ()
void ConstructL ()
void EstablishBulkThreadBindingL ()
void OpenTargetCommonL ()
void RegisterInterestedApisL ( TRemConClientType )
void RegisterInterfaceCommonL ( CRemConInterfaceBase &, const TDesC8 &)
TInt StaticBulkCleanup ( TAny *)
TInt TryToReconnect ()
TInt TryToReconnectBulk ()
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
TRemConAddress iAddress
RSpecificThreadCallBack * iBulkCleanupCall
RHeap * iBulkHeap
TUint iBulkMaxDataLength
CBulkReceiver * iBulkReceiver
RRemConBulk * iBulkSession
RThread iBulkThread
TUint iControlMaxDataLength
CReceiver * iControllerReceiver
RRemConController * iControllerSession
MRemConErrorObserver * iErrorObserver
CRemConInterfaceDetailsArray * iInterfaces
RNestableLock * iLock
RRemCon * iNotificationSession
RHeap * iSharedThreadHeap
CReceiver * iTargetReceiver
RRemConTarget * iTargetSession

Constructor & Destructor Documentation

CRemConInterfaceSelector()

CRemConInterfaceSelector ( ) [private]

~CRemConInterfaceSelector()

IMPORT_C ~CRemConInterfaceSelector ( )

Destructor.

Member Functions Documentation

AssertSession(RRemCon *, TInt)

void AssertSession ( RRemCon * aSess,
TInt aPanicCode
) const [private]

Parameters

RRemCon * aSess
TInt aPanicCode

BulkCleanup()

void BulkCleanup ( ) [private]

BulkError(TInt)

void BulkError ( TInt aError )

Only called internally, by the Active Object which sucks messages out of RemCon Bulk Server. This is called in the case of a session error.

Parameters

TInt aError

BulkOpened()

TBool BulkOpened ( ) const [private]

BulkReceiveComplete(TUid, TUint, const TDesC8 &)

void BulkReceiveComplete ( TUid aInterfaceUid,
TUint aOperationId,
const TDesC8 & aData
)

Only called internally, by the Active Object which sucks messages out of RemCon. Note that the message type is not given- it is interpolated from the type of the session doing the receiving.

Parameters

TUid aInterfaceUid Interface UID of the new message.
TUint aOperationId Operation ID of the new message.
const TDesC8 & aData Data associated with the new message.

BulkSessionConnectL()

void BulkSessionConnectL ( )

Only called internally, by the Active Object which sucks messages out of RemCon (bulk server).

This should be run from the thread in which the bulk interfaces are to run.

ConnectBearer(TRequestStatus &)

IMPORT_C void ConnectBearer ( TRequestStatus & aStatus )

Brings up a bearer-level connection. The controller session must already exist (use OpenControllerL) and be connection-oriented.

Parameters

TRequestStatus & aStatus TRequestStatus for asynchronous completion.

ConnectBearerCancel()

IMPORT_C TInt ConnectBearerCancel ( )

Cancels interest in the completion of a ConnectBearer request.

ConstructL()

void ConstructL ( ) [private]

ControllerOpened()

IMPORT_C TBool ControllerOpened ( ) const

To determine if a controller session has been opened.

DisconnectBearer(TRequestStatus &)

IMPORT_C void DisconnectBearer ( TRequestStatus & aStat )

Destroys a bearer-level connection. The controller session must already exist (use OpenControllerL) and be connection-oriented.

Parameters

TRequestStatus & aStat

DisconnectBearerCancel()

IMPORT_C TInt DisconnectBearerCancel ( )

Cancels interest in the completion of a DisconnectBearer request.

Error(TInt)

void Error ( TInt aError )

Only called internally, by the Active Object which sucks messages out of RemCon. This is called in the case of a session error.

Parameters

TInt aError

EstablishBulkThreadBindingL()

void EstablishBulkThreadBindingL ( ) [private]

GetConnections(TSglQue< TRemConAddress > &)

IMPORT_C TInt GetConnections ( TSglQue < TRemConAddress > & aConnections )

Getter for the current set of connections in the system (not just those associated with this session). The client is responsible for cleaning up aConnections- the addresses will be on the heap.

Parameters

TSglQue < TRemConAddress > & aConnections A collection of remote addresses, representing all the currently extant connections.

GoConnectionOrientedL(const TRemConAddress &)

IMPORT_C void GoConnectionOrientedL ( const TRemConAddress & aConnection )

Makes the controller session (which must already exist- use OpenControllerL) connection-oriented.

Parameters

const TRemConAddress & aConnection The remote to talk to.

GoConnectionlessL()

IMPORT_C void GoConnectionlessL ( )

Makes the controller session (which must already exist- use OpenControllerL) connectionless.

NewL()

IMPORT_C CRemConInterfaceSelector * NewL ( ) [static]

Factory method.

NotifyConnectionsChange(TRequestStatus &)

IMPORT_C void NotifyConnectionsChange ( TRequestStatus & aStatus )

Notification for changes in the set of connections.

Parameters

TRequestStatus & aStatus TRequestStatus for asynchronous completion.

NotifyConnectionsChangeCancel()

IMPORT_C TInt NotifyConnectionsChangeCancel ( )

Cancels interest in the completion of an outstanding NotifyConnectionsChange operation.

OpenControllerL()

IMPORT_C void OpenControllerL ( )
Opens a controller session to RemCon. The session is connectionless until such time as GoConnectionOriented may be called.
leave
KErrInUse If a controller session is already open.

OpenTargetCommonL()

void OpenTargetCommonL ( ) [private]

OpenTargetL()

IMPORT_C void OpenTargetL ( )
Opens a target session to RemCon.
leave
KErrInUse If a target session is already open.

OpenTargetL(TPlayerType, TPlayerSubType, const TDesC8 &)

IMPORT_C void OpenTargetL ( TPlayerType aPlayerType,
TPlayerSubType aPlayerSubType,
const TDesC8 & aPlayerName
)
Opens a target session to RemCon.
leave
KErrInUse If a target session is already open.
Opens a target session to RemCon.

If any bulk interfaces have been registered on this interface selector the the thread in which the first bulk interface was created must be ready to run and not blocked waiting for the completion of this function. Failure to do so will lead to deadlock.

leave
KErrInUse If a target session is already open.

Parameters

TPlayerType aPlayerType The type of player
TPlayerSubType aPlayerSubType The sub-type of the player
const TDesC8 & aPlayerName The name of the player

ReceiveComplete(TUid, TUint, TRemConMessageSubType, const TRemConAddress &, const TDesC8 &, TRemConClientType)

void ReceiveComplete ( TUid aInterfaceUid,
TUint aOperationId,
TRemConMessageSubType aMsgSubType,
const TRemConAddress & aRemoteAddress,
const TDesC8 & aData,
TRemConClientType aType
)

Only called internally, by the Active Object which sucks messages out of RemCon. Note that the message type is not given- it is interpolated from the type of the session doing the receiving.

Parameters

TUid aInterfaceUid Interface UID of the new message.
TUint aOperationId Operation ID of the new message.
TRemConMessageSubType aMsgSubType The message subtype.
const TRemConAddress & aRemoteAddress The address of the remote which sent the message.
const TDesC8 & aData Data associated with the new message.
TRemConClientType aType The type of session which received the message (from which the type of the message can be interpolated).

RegisterErrorObserver(MRemConErrorObserver *)

IMPORT_C void RegisterErrorObserver ( MRemConErrorObserver * aObserver )

Register an error observer. This is provided to allow the client to discover when an error has occurred passively.

Parameters

MRemConErrorObserver * aObserver An error observer to be notified on a passive error. NULL to stop receiving notifications.

RegisterInterestedApisL(TRemConClientType)

void RegisterInterestedApisL ( TRemConClientType aType ) [private]

Parameters

TRemConClientType aType

RegisterInterfaceCommonL(CRemConInterfaceBase &, const TDesC8 &)

void RegisterInterfaceCommonL ( CRemConInterfaceBase & aInterface,
const TDesC8 & aFeatures
) [private]

Parameters

CRemConInterfaceBase & aInterface
const TDesC8 & aFeatures

RegisterInterfaceL(CRemConInterfaceBase &)

IMPORT_C void RegisterInterfaceL ( CRemConInterfaceBase & aInterface )

Register the interface with the selector. This is called by the interface's BaseConstructL. Takes ownership of aInterface. This function is not to be called outside of remconinterfacebase.dll. It is available for compatibility with previous versions, but it is intended to be called only by CRemConInterfaceBase::BaseConstructL . CRemConInterfaceBase-derived classes should indirectly perform a RegisterInterfaceL, by calling CRemConInterfaceBase::BaseConstructL from their construction functions.

Parameters

CRemConInterfaceBase & aInterface The interface.

RegisterInterfaceL(CRemConInterfaceBase &, RRemConInterfaceFeatures &)

void RegisterInterfaceL ( CRemConInterfaceBase & aInterface,
RRemConInterfaceFeatures & aRemConInterfaceFeatures
)

Register the interface with the selector. This is called by the interface's BaseConstructL. Takes ownership of aInterface. This function is not to be called outside of remconinterfacebase.dll. It is available for compatibility with previous versions, but it is intended to be called only by CRemConInterfaceBase::BaseConstructL . CRemConInterfaceBase-derived classes should indirectly perform a RegisterInterfaceL, by calling CRemConInterfaceBase::BaseConstructL from their construction functions.

Parameters

CRemConInterfaceBase & aInterface The interface.
RRemConInterfaceFeatures & aRemConInterfaceFeatures The operation IDs of the interface. Ownership is retained by the caller. Any necessary data will be copied by the interface selector.

Send(TRequestStatus &, TUid, TUint, TUint &, TRemConMessageType, const TDesC8 &)

IMPORT_C void Send ( TRequestStatus & aStatus,
TUid aInterfaceUid,
TUint aOperationId,
TUint & aNumRemotes,
TRemConMessageType aMsgType,
const TDesC8 & aData =  KNullDesC8 ()
)
Sends a message to the remote device(s). There should be only one command and response outstanding at any one time. Send cannot be called again until aStatus is completed.
panic
RemConClient 4 If a send is already outstanding

Parameters

TRequestStatus & aStatus TRequestStatus for asynchronous completion.
TUid aInterfaceUid The UID of the concrete (outer-layer) interface sending the message.
TUint aOperationId The interface-specific operation identifier.
TUint & aNumRemotes On success, the number of remotes the message was successfully sent to.
TRemConMessageType aMsgType Whether the message is a command or a response.
const TDesC8 & aData =  KNullDesC8 () Any associated message data in interface-specific format.

Send(TRequestStatus &, TUid, TUint, TUint &, TRemConMessageType, TRemConMessageSubType, const TDesC8 &)

IMPORT_C void Send ( TRequestStatus & aStatus,
TUid aInterfaceUid,
TUint aOperationId,
TUint & aNumRemotes,
TRemConMessageType aMsgType,
TRemConMessageSubType aMsgSubType,
const TDesC8 & aData =  KNullDesC8 ()
)

Sends a message to the remote device(s).

Parameters

TRequestStatus & aStatus TRequestStatus for asynchronous completion.
TUid aInterfaceUid The UID of the concrete (outer-layer) interface sending the message.
TUint aOperationId The interface-specific operation identifier.
TUint & aNumRemotes On success, the number of remotes the message was successfully sent to.
TRemConMessageType aMsgType Whether the message is a command or a response.
TRemConMessageSubType aMsgSubType The subtype of the command of response
const TDesC8 & aData =  KNullDesC8 () Any associated message data in interface-specific format.

SendBulk(TRequestStatus &, TUid, TUint, const TDesC8 &)

IMPORT_C void SendBulk ( TRequestStatus & aStatus,
TUid aInterfaceUid,
TUint aOperationId,
const TDesC8 & aData =  KNullDesC8 ()
)
This method is for internal sub-system use only and should be not be used otherwise. Sends a message to the remote device(s) through the bulk path. There should be only one response outstanding at any one time. Send cannot be called again until aStatus is completed.
panic
RemConClient 4 If a send is already outstanding

Parameters

TRequestStatus & aStatus TRequestStatus for asynchronous completion.
TUid aInterfaceUid The UID of the concrete (outer-layer) interface sending the message.
TUint aOperationId The interface-specific operation identifier.
const TDesC8 & aData =  KNullDesC8 () Any associated message data in interface-specific format.

SendBulkCancel()

IMPORT_C TInt SendBulkCancel ( )

This method is for internal sub-system use only and should be not be used otherwise. Cancels interest in the completion of a BulkSend request.

SendBulkUnreliable(TUid, TUint, const TDesC8 &)

IMPORT_C TInt SendBulkUnreliable ( TUid aInterfaceUid,
TUint aOperationId,
const TDesC8 & aData =  KNullDesC8 ()
)

This method is for internal sub-system use only and should be not be used otherwise. Sends a message to the remote device(s) through the bulk path, without waiting for the send to complete.

Parameters

TUid aInterfaceUid The UID of the concrete (outer-layer) interface sending the message.
TUint aOperationId The interface-specific operation identifier.
const TDesC8 & aData =  KNullDesC8 () Any associated message data in interface-specific format.

SendCancel(TRemConMessageType)

IMPORT_C TInt SendCancel ( TRemConMessageType aMsgType )

Cancels interest in the completion of a Send request.

Parameters

TRemConMessageType aMsgType The type of the message, the completion of the send of which we are not interested in. This is needed because a single CRemConInterfaceSelector may have two sends outstanding at once, one on a controller session and another on a target session.

SendNotify(TRequestStatus &, TUid, TUint, TRemConMessageType, TRemConMessageSubType, const TDesC8 &)

IMPORT_C void SendNotify ( TRequestStatus & aStatus,
TUid aInterfaceUid,
TUint aOperationId,
TRemConMessageType aMsgType,
TRemConMessageSubType aMsgSubType,
const TDesC8 & aData =  KNullDesC8 ()
)

Sends a

Sends a notify command to the remote device.

CRemConInterfaceSelector::Send()

Parameters

TRequestStatus & aStatus
TUid aInterfaceUid
TUint aOperationId
TRemConMessageType aMsgType
TRemConMessageSubType aMsgSubType
const TDesC8 & aData =  KNullDesC8 ()

SendUnreliable(TUid, TUint, TRemConMessageType, const TDesC8 &)

IMPORT_C TInt SendUnreliable ( TUid aInterfaceUid,
TUint aOperationId,
TRemConMessageType aMsgType,
const TDesC8 & aData =  KNullDesC8 ()
)

This method is for internal sub-system use only and should be not be used otherwise. Sends a message to the remote device(s), without waiting for the send to complete

Parameters

TUid aInterfaceUid The UID of the concrete (outer-layer) interface sending the message.
TUint aOperationId The interface-specific operation identifier.
TRemConMessageType aMsgType Whether the message is a command or a response.
const TDesC8 & aData =  KNullDesC8 () Any associated message data in interface-specific format.

SendUnreliable(TUid, TUint, TRemConMessageType, TRemConMessageSubType, const TDesC8 &)

IMPORT_C TInt SendUnreliable ( TUid aInterfaceUid,
TUint aOperationId,
TRemConMessageType aMsgType,
TRemConMessageSubType aMsgSubType,
const TDesC8 & aData =  KNullDesC8 ()
)

This method is for internal sub-system use only and should be not be used otherwise. Sends a message to the remote device(s), without waiting for the send to complete

Parameters

TUid aInterfaceUid The UID of the concrete (outer-layer) interface sending the message.
TUint aOperationId The interface-specific operation identifier.
TRemConMessageType aMsgType Whether the message is a command or a response.
TRemConMessageSubType aMsgSubType The subtype of the command of response
const TDesC8 & aData =  KNullDesC8 () Any associated message data in interface-specific format.

StaticBulkCleanup(TAny *)

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

Parameters

TAny * aSelf

TargetOpened()

IMPORT_C TBool TargetOpened ( ) const

To determine if a target session has been opened.

TryToReconnect()

TInt TryToReconnect ( ) [private]

Resurrects sessions in case of server death.

For the target and controller session we try to open a new session. If this succeeds we can then set the old session to point to the new one after closing our old defunct session.

On success we are left with happy functioning handles. On failure we are left with defunct handles, which are still valid but will complete all requests with KErrServerTerminated.

This means that we won't cause an application to get a bad handle panic if it hasn't done anything wrong.

TryToReconnectBulk()

TInt TryToReconnectBulk ( ) [private]

Resurrects bulk sessions in case of server death.

For the bulk session we try to open a new session. If this succeeds we can then set the old session to point to the new one after closing our old defunct session.

On success we are left with happy functioning handles. On failure we are left with defunct handles, which are still valid but will complete all requests with KErrServerTerminated.

This means that we won't cause an application to get a bad handle panic if it hasn't done anything wrong.

Member Data Documentation

TRemConAddress iAddress

TRemConAddress iAddress [private]

RSpecificThreadCallBack * iBulkCleanupCall

RSpecificThreadCallBack * iBulkCleanupCall [private]

RHeap * iBulkHeap

RHeap * iBulkHeap [private]

TUint iBulkMaxDataLength

TUint iBulkMaxDataLength [private]

CBulkReceiver * iBulkReceiver

CBulkReceiver * iBulkReceiver [private]

RRemConBulk * iBulkSession

RRemConBulk * iBulkSession [private]

RThread iBulkThread

RThread iBulkThread [private]

TUint iControlMaxDataLength

TUint iControlMaxDataLength [private]

For all registered interfaces, this is the size of the biggest operation-associated data lump.

CReceiver * iControllerReceiver

CReceiver * iControllerReceiver [private]

RRemConController * iControllerSession

RRemConController * iControllerSession [private]

MRemConErrorObserver * iErrorObserver

MRemConErrorObserver * iErrorObserver [private]

CRemConInterfaceDetailsArray * iInterfaces

CRemConInterfaceDetailsArray * iInterfaces [private]

RNestableLock * iLock

RNestableLock * iLock [private]

RRemCon * iNotificationSession

RRemCon * iNotificationSession [private]

RHeap * iSharedThreadHeap

RHeap * iSharedThreadHeap [private]

CReceiver * iTargetReceiver

CReceiver * iTargetReceiver [private]

RRemConTarget * iTargetSession

RRemConTarget * iTargetSession [private]