CPort Class Reference

class CPort : public CObject

Base class for implementations of serial protocol module ports. Its functions are called by the comms server in response to client calls to RComm .

The class implements CObject to obtain reference counting behaviour. The reference count is incremented when a port is first created, and, for ports in shared mode, on every later opening.

CPort is an abstract class which defines many pure virtual functions which derived classes must implement. Most of these pure virtual functions correspond to the client interface of the RComm class.

Created when the first client does an Open request passing its name. Destroyed only when it deletes itself (following a call to Destruct).

Inherits from

Nested Classes and Structures

Public Member Functions
CPort ()
~CPort ()
TBool AreAnyPending ()
void Break ( TInt )
void BreakCancel ()
IMPORT_C void BreakCompleted ( TInt )
IMPORT_C void BreakNotifyCompleted ( TInt )
IMPORT_C void Close ()
void CommBreak (const RMessage2 &, CCommSession *)
void CommBreakCancel ( TInt , CCommSession *)
void CommCancel ( TInt , CCommSession *)
void CommCaps (const RMessage2 &, CCommSession &)
void CommConfig (const RMessage2 &, CCommSession &)
void CommDebugState (const RMessage2 &, CCommSession &)
void CommGetFlowControlStatus (const RMessage2 &, CCommSession *)
void CommGetRole (const RMessage2 &, CCommSession *)
void CommGetServerConfig (const RMessage2 &, CCommSession &)
void CommNotifyBreak (const RMessage2 &, CCommSession *)
void CommNotifyBreakCancel ( TInt , CCommSession *)
void CommNotifyConfigChange (const RMessage2 &, CCommSession *)
void CommNotifyConfigChangeCancel ( TInt , CCommSession *)
void CommNotifyDataAvailable (const RMessage2 &, CCommSession *)
void CommNotifyDataAvailableCancel ( TInt , CCommSession *)
void CommNotifyFlowControlChange (const RMessage2 &, CCommSession *)
void CommNotifyFlowControlChangeCancel ( TInt , CCommSession *)
void CommNotifyOutputEmpty (const RMessage2 &, CCommSession *)
void CommNotifyOutputEmptyCancel ( TInt , CCommSession *)
void CommNotifySignalChange (const RMessage2 &, CCommSession *)
void CommNotifySignalChangeCancel ( TInt , CCommSession *)
void CommQueryReceiveBuffer (const RMessage2 &, CCommSession &)
void CommRead (const RMessage2 &, CCommSession *)
void CommReadCancel ( TInt , CCommSession *)
void CommReceiveBufferLength (const RMessage2 &, CCommSession &)
void CommResetBuffers (const RMessage2 &, CCommSession &)
void CommSetAccess (const RMessage2 &, CCommSession &)
void CommSetAccessCancel ( TInt , CCommSession *)
void CommSetConfig (const RMessage2 &, CCommSession &)
void CommSetReceiveBufferLength (const RMessage2 &, CCommSession &)
void CommSetServerConfig (const RMessage2 &, CCommSession &)
void CommSetSignalsToMark (const RMessage2 &, CCommSession &)
void CommSetSignalsToSpace (const RMessage2 &, CCommSession &)
void CommSignals (const RMessage2 &, CCommSession &)
void CommWrite (const RMessage2 &, CCommSession *)
void CommWriteCancel ( TInt , CCommSession *)
IMPORT_C void ConfigChangeCompleted (const TDesC8 &, TInt )
void Destruct ()
IMPORT_C void FlowControlChangeCompleted (const TFlowControl &, TInt )
void FreeMemory ()
void FreeSession ( CCommSession *)
TInt GetCaps ( TDes8 &)
TInt GetConfig ( TDes8 &)
TInt GetFlowControlStatus ( TFlowControl &)
TInt GetReceiveBufferLength ( TInt &)
TInt GetRole ( TCommRole &)
TInt GetServerConfig ( TDes8 &)
TInt GetSignals ( TUint &)
IMPORT_C TInt IPCRead (const TAny *, TDes8 &, TInt )
IMPORT_C TInt IPCWrite (const TAny *, const TDesC8 &, TInt )
void InitL ( TDesC8 &)
TBool IsBlockedSetAccessWaiting ( CCommSession &)
void NotifyBreak ()
void NotifyBreakCancel ()
void NotifyConfigChange ()
void NotifyConfigChangeCancel ()
void NotifyDataAvailable ()
void NotifyDataAvailableCancel ()
IMPORT_C void NotifyDataAvailableCompleted ( TInt )
void NotifyFlowControlChange ()
void NotifyFlowControlChangeCancel ()
void NotifyOutputEmpty ()
void NotifyOutputEmptyCancel ()
IMPORT_C void NotifyOutputEmptyCompleted ( TInt )
void NotifySignalChange ( TUint )
void NotifySignalChangeCancel ()
TInt QueryReceiveBuffer ( TInt &)
void ReadCancel ()
IMPORT_C void ReadCompleted ( TInt )
TInt ReadTimerExpiredHandler ( TAny *)
void ResetBuffers ( TUint )
TBool SessionHasBeenPreempted ( CCommSession *)
TBool SessionIsAwaitingOpen ( CCommSession *)
TInt SetConfig (const TDesC8 &)
TInt SetReceiveBufferLength ( TInt )
TInt SetRole ( TCommRole )
TInt SetServerConfig (const TDesC8 &)
TInt SetSignalsToMark ( TUint )
TInt SetSignalsToSpace ( TUint )
IMPORT_C void SignalChangeCompleted (const TUint &, TInt )
void StartRead (const TAny *, TInt )
void StartWrite (const TAny *, TInt )
TBool TakeOwnershipForBreak (const RMessage2 &, CCommSession *)
TBool TakeOwnershipForBreaking (const RMessage2 &, CCommSession *)
TBool TakeOwnershipForConfig (const RMessage2 &, CCommSession *)
TBool TakeOwnershipForFlowControl (const RMessage2 &, CCommSession *)
TBool TakeOwnershipForNotifyDataAvailable (const RMessage2 &, CCommSession *)
TBool TakeOwnershipForNotifyOutputEmpty (const RMessage2 &, CCommSession *)
TBool TakeOwnershipForReading (const RMessage2 &, CCommSession *)
TBool TakeOwnershipForSignals (const RMessage2 &, CCommSession *)
TBool TakeOwnershipForWriting (const RMessage2 &, CCommSession *)
void WriteCancel ()
IMPORT_C void WriteCompleted ( TInt )
TInt WriteTimerExpiredHandler ( TAny *)
Private Member Functions
IMPORT_C void CPort_Reserved1 ()
void DoOpenL ( CCommSession *, TInternalCommAccess , TCommRole , TBool )
void DoPreemption ()
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
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()
CObject::AccessCount()const
CObject::CObject()
CObject::Dec()
CObject::Extension_(TUint,TAny *&,TAny *)
CObject::FullName()const
CObject::Inc()
CObject::Name()const
CObject::Open()
CObject::Owner()const
CObject::SetName(const TDesC *)
CObject::SetNameL(const TDesC *)
CObject::SetOwner(CObject *)
CObject::UniqueID()const
CObject::~CObject()
Public Member Type Definitions
typedef TCommAccess TAccess
Private Attributes
RMessagePtr2 iBlockedBreak
RMessagePtr2 iBlockedBreakNotify
RMessagePtr2 iBlockedConfigChange
TInt iBlockedConfigChangeDummyPadding
RMessagePtr2 iBlockedFlowControlChange
TInt iBlockedFlowControlChangeDummyPadding
RMessagePtr2 iBlockedNotifyDataAvailable
RMessagePtr2 iBlockedNotifyOutputEmpty
RMessagePtr2 iBlockedRead
RMessagePtr2 iBlockedSignalChange
TInt iBlockedSignalChangeDummyPadding
RMessagePtr2 iBlockedWrite
CCommSession * iBreakNotifyOwner
TInt iBreakNotifyOwnerHandle
TInt iBreakOwnerHandle
TAny * iCPort_Reserved
CCommSession * iConfigOwner
TInt iConfigOwnerHandle
CExtra * iExtra
CCommSession * iFlowControlOwner
TInt iFlowControlOwnerHandle
TInternalCommAccess iMode
CCommSession * iNotifyDataAvailableOwner
TInt iNotifyDataAvailableOwnerHandle
CCommSession * iNotifyOutputEmptyOwner
TInt iNotifyOutputEmptyOwnerHandle
CPortManager * iPortManager
CCommSession * iReadOwner
TInt iReadOwnerHandle
TDeltaTimerEntry iReadTimer
TBool iReadTimerPending
CCommSession * iSignalOwner
TInt iSignalOwnerHandle
CCommSession * iWriteOwner
TInt iWriteOwnerHandle
TDeltaTimerEntry iWriteTimer
TBool iWriteTimerPending

Constructor & Destructor Documentation

CPort()

IMPORT_C CPort ( )

Default constructor. Derived classes should implement a NewL() function to perform their two-phase construction.

TSerialNewL

~CPort()

IMPORT_C ~CPort ( ) [virtual]

Destructor.

Closes the owner (which is our CSerial ) and removes any timers.

Derived classes can implement the destructor but must only call synchronous functions within it. Any cleanup requiring asynchronous operations must be done in Destruct() .

Member Functions Documentation

AreAnyPending()

TBool AreAnyPending ( )

Return true if there is an outstanding Read/Write/Break on the CSY.

Break(TInt)

void Break ( TInt aTime ) [pure virtual]

Specifies the protocol for setting a break condition at the port. It is called by the comms server in response to a RComm::Break() request from the client.

When the break is complete, the function should call BreakCompleted() .

Parameters

TInt aTime Time period to break for in microseconds

BreakCancel()

void BreakCancel ( ) [pure virtual]

Specifies the protocol for cancelling a break request. It is called by the comms server in response to a RComm::BreakCancel() request from the client.

The implementation should abort any processing which was taking place as a result of the break request. Do not call BreakCompleted() .

BreakCompleted(TInt)

IMPORT_C void BreakCompleted ( TInt anError )

Tells the comms server that a break request initiated through Break() is complete.

The comms server will then notify the client that its break request is complete.

Called by C32 server or CSY.

Parameters

TInt anError Return code to be passed back to the client through its TRequestStatus argument.

BreakNotifyCompleted(TInt)

IMPORT_C void BreakNotifyCompleted ( TInt anError )

Tells the comms server that a request initiated through NotifyBreak() is complete.

The comms server will then notify the client that its request is complete.

Called by the CSY module.

Parameters

TInt anError Error code

CPort_Reserved1()

IMPORT_C void CPort_Reserved1 ( ) [private, virtual]

Reserved virtual function.

Close()

IMPORT_C void Close ( ) [virtual]

Closes the port.

The base class implements CObject::Close() to handle reference counting on the port. It decrements the reference count, and calls Destruct() if the count is 0.

CommBreak(const RMessage2 &, CCommSession *)

void CommBreak ( const RMessage2 & aMessage,
CCommSession * aClient
)

Perform a break making sure of the port's owner

Parameters

const RMessage2 & aMessage message from the client
CCommSession * aClient handle to the client session.

CommBreakCancel(TInt, CCommSession *)

void CommBreakCancel ( TInt aHandle,
CCommSession * aClient
)

Cancel outstanding break

Parameters

TInt aHandle handle to the client
CCommSession * aClient handle to the client session.

CommCancel(TInt, CCommSession *)

void CommCancel ( TInt aHandle,
CCommSession * aClient
)

Cancel any outstanding requests

Parameters

TInt aHandle handle to the client
CCommSession * aClient handle to the client session.

CommCaps(const RMessage2 &, CCommSession &)

void CommCaps ( const RMessage2 & aMessage,
CCommSession & aSession
)

Read capabilities

Parameters

const RMessage2 & aMessage message from the client
CCommSession & aSession handle to the client session.

CommConfig(const RMessage2 &, CCommSession &)

void CommConfig ( const RMessage2 & aMessage,
CCommSession & aSession
) const

Get config

Parameters

const RMessage2 & aMessage message from the client
CCommSession & aSession handle to the client session.

CommDebugState(const RMessage2 &, CCommSession &)

void CommDebugState ( const RMessage2 & aMessage,
CCommSession & aSession
)

Parameters

const RMessage2 & aMessage
CCommSession & aSession

CommGetFlowControlStatus(const RMessage2 &, CCommSession *)

void CommGetFlowControlStatus ( const RMessage2 & aMessage,
CCommSession * aClient
)

Get flow control state ON/OFF from CSY module

Parameters

const RMessage2 & aMessage handle to the IPC message from the client
CCommSession * aClient pointer to the Comm session

CommGetRole(const RMessage2 &, CCommSession *)

void CommGetRole ( const RMessage2 & aMessage,
CCommSession * aClient
)

Get role DCE/DTE from CSY module

Parameters

const RMessage2 & aMessage handle to the IPC message from the client
CCommSession * aClient pointer to the Comm session

CommGetServerConfig(const RMessage2 &, CCommSession &)

void CommGetServerConfig ( const RMessage2 & aMessage,
CCommSession & aSession
)

Get server config

Parameters

const RMessage2 & aMessage message from the client
CCommSession & aSession handle to the client session.

CommNotifyBreak(const RMessage2 &, CCommSession *)

void CommNotifyBreak ( const RMessage2 & aMessage,
CCommSession * aClient
)

Set break signal notifying on

Parameters

const RMessage2 & aMessage handle to the IPC message from the client
CCommSession * aClient pointer to the Comm session

CommNotifyBreakCancel(TInt, CCommSession *)

void CommNotifyBreakCancel ( TInt aHandle,
CCommSession * aClient
)

Cancel outstanding break notification

Parameters

TInt aHandle Handle to the session
CCommSession * aClient pointer to the Comm session

CommNotifyConfigChange(const RMessage2 &, CCommSession *)

void CommNotifyConfigChange ( const RMessage2 & aMessage,
CCommSession * aClient
)

Set configuration change (data format, speed, ...) notifying on

Parameters

const RMessage2 & aMessage handle to the IPC message from the client
CCommSession * aClient pointer to the Comm session

CommNotifyConfigChangeCancel(TInt, CCommSession *)

void CommNotifyConfigChangeCancel ( TInt aHandle,
CCommSession * aClient
)

Cancel outstanding configuration change notification

Parameters

TInt aHandle Handle to the session
CCommSession * aClient pointer to the Comm session

CommNotifyDataAvailable(const RMessage2 &, CCommSession *)

void CommNotifyDataAvailable ( const RMessage2 & aMessage,
CCommSession * aClient
)

Set input buffer data notifying on

Parameters

const RMessage2 & aMessage handle to the IPC message from the client
CCommSession * aClient pointer to the Comm session

CommNotifyDataAvailableCancel(TInt, CCommSession *)

void CommNotifyDataAvailableCancel ( TInt aHandle,
CCommSession * aClient
)

Cancel outstanding input buffer data notification

Parameters

TInt aHandle Handle to the session
CCommSession * aClient pointer to the Comm session

CommNotifyFlowControlChange(const RMessage2 &, CCommSession *)

void CommNotifyFlowControlChange ( const RMessage2 & aMessage,
CCommSession * aClient
)

Set flow control notifying on

Parameters

const RMessage2 & aMessage handle to the IPC message from the client
CCommSession * aClient pointer to the Comm session

CommNotifyFlowControlChangeCancel(TInt, CCommSession *)

void CommNotifyFlowControlChangeCancel ( TInt aHandle,
CCommSession * aClient
)

Cancel outstanding flow control notification

Parameters

TInt aHandle Handle to the session
CCommSession * aClient pointer to the Comm session

CommNotifyOutputEmpty(const RMessage2 &, CCommSession *)

void CommNotifyOutputEmpty ( const RMessage2 & aMessage,
CCommSession * aClient
)

Set output buffer empty notifying on

Parameters

const RMessage2 & aMessage handle to the IPC message from the client
CCommSession * aClient pointer to the Comm session

CommNotifyOutputEmptyCancel(TInt, CCommSession *)

void CommNotifyOutputEmptyCancel ( TInt aHandle,
CCommSession * aClient
)

Cancel outstanding output buffer empty notification

Parameters

TInt aHandle Handle to the session
CCommSession * aClient pointer to the Comm session

CommNotifySignalChange(const RMessage2 &, CCommSession *)

void CommNotifySignalChange ( const RMessage2 & aMessage,
CCommSession * aClient
)

Set DCE/DTE signal notifying on

Parameters

const RMessage2 & aMessage handle to the IPC message from the client
CCommSession * aClient pointer to the Comm session

CommNotifySignalChangeCancel(TInt, CCommSession *)

void CommNotifySignalChangeCancel ( TInt aHandle,
CCommSession * aClient
)

Cancel outstanding signal notification

Parameters

TInt aHandle Handle to the session
CCommSession * aClient pointer to the Comm session

CommQueryReceiveBuffer(const RMessage2 &, CCommSession &)

void CommQueryReceiveBuffer ( const RMessage2 & aMessage,
CCommSession & aSession
) const

Set the receive buffer length

Parameters

const RMessage2 & aMessage message from the client
CCommSession & aSession handle to the client session.

CommRead(const RMessage2 &, CCommSession *)

void CommRead ( const RMessage2 & aMessage,
CCommSession * aClient
)

Perform a read making sure of the port's owner

Parameters

const RMessage2 & aMessage message from the client
CCommSession * aClient handle to the client session.

CommReadCancel(TInt, CCommSession *)

void CommReadCancel ( TInt aHandle,
CCommSession * aClient
)

Cancel outstanding read

Parameters

TInt aHandle handle to the client
CCommSession * aClient handle to the client session.

CommReceiveBufferLength(const RMessage2 &, CCommSession &)

void CommReceiveBufferLength ( const RMessage2 & aMessage,
CCommSession & aSession
) const

read the receive buffer length

Parameters

const RMessage2 & aMessage message from the client
CCommSession & aSession handle to the client session.

CommResetBuffers(const RMessage2 &, CCommSession &)

void CommResetBuffers ( const RMessage2 & aMessage,
CCommSession & aSession
)

Set the receive buffer length

Parameters

const RMessage2 & aMessage message from the client
CCommSession & aSession handle to the client session.

CommSetAccess(const RMessage2 &, CCommSession &)

void CommSetAccess ( const RMessage2 & aMessage,
CCommSession & aSession
)

set the access mode

Parameters

const RMessage2 & aMessage message from client with the new access mode
CCommSession & aSession handle to the session.

CommSetAccessCancel(TInt, CCommSession *)

void CommSetAccessCancel ( TInt aHandle,
CCommSession * aClient
)

Cancels an outstanding set access request.

Parameters

TInt aHandle
CCommSession * aClient pointer to the CCommSession client.

CommSetConfig(const RMessage2 &, CCommSession &)

void CommSetConfig ( const RMessage2 & aMessage,
CCommSession & aSession
)

Set config

Parameters

const RMessage2 & aMessage message from the client
CCommSession & aSession handle to the client session.

CommSetReceiveBufferLength(const RMessage2 &, CCommSession &)

void CommSetReceiveBufferLength ( const RMessage2 & aMessage,
CCommSession & aSession
)

Set the receive buffer length

Parameters

const RMessage2 & aMessage message from the client
CCommSession & aSession handle to the client session.

CommSetServerConfig(const RMessage2 &, CCommSession &)

void CommSetServerConfig ( const RMessage2 & aMessage,
CCommSession & aSession
)

Set server config

Parameters

const RMessage2 & aMessage message from the client
CCommSession & aSession handle to the client session.

CommSetSignalsToMark(const RMessage2 &, CCommSession &)

void CommSetSignalsToMark ( const RMessage2 & aMessage,
CCommSession & aSession
)

Set signal lines

Parameters

const RMessage2 & aMessage message from the client.
CCommSession & aSession

CommSetSignalsToSpace(const RMessage2 &, CCommSession &)

void CommSetSignalsToSpace ( const RMessage2 & aMessage,
CCommSession & aSession
)

Clear signal lines

Parameters

const RMessage2 & aMessage message from the client.
CCommSession & aSession

CommSignals(const RMessage2 &, CCommSession &)

void CommSignals ( const RMessage2 & aMessage,
CCommSession & aSession
)

Read signals

Parameters

const RMessage2 & aMessage message from the client
CCommSession & aSession handle to the client session.

CommWrite(const RMessage2 &, CCommSession *)

void CommWrite ( const RMessage2 & aMessage,
CCommSession * aClient
)

Perform a write making sure of the port's owner

Parameters

const RMessage2 & aMessage message from the client
CCommSession * aClient handle to the client session.

CommWriteCancel(TInt, CCommSession *)

void CommWriteCancel ( TInt aHandle,
CCommSession * aClient
)

Cancel outstanding write

Parameters

TInt aHandle handle to the client
CCommSession * aClient handle to the client session.

ConfigChangeCompleted(const TDesC8 &, TInt)

IMPORT_C void ConfigChangeCompleted ( const TDesC8 & aNewConfig,
TInt anError
)

Tells the comms server that a request initiated through NotifyConfigChange() is complete.

The comms server will then notify the client that its request is complete.

Called by the CSY module.

Parameters

const TDesC8 & aNewConfig Configuration value to pass to client
TInt anError Error code

Destruct()

void Destruct ( ) [pure virtual]

Specifies the protocol for port destruction. It is called by the comms server when the last client-side reference to a CPort object has been closed and the CPort must be deleted. The comms server will not delete a CPort other than by calling Destruct() .

The implementation should perform any asynchronous shutdown operations on its own resources and, when these operations have completed, should delete this.

DoOpenL(CCommSession *, TInternalCommAccess, TCommRole, TBool)

void DoOpenL ( CCommSession * aSession,
TInternalCommAccess aMode,
TCommRole aRole,
TBool aIsNew
) [private]

Set the access mode and signals for this port if the open request does not conflict with existing usage of this port by other clients.

leave
Leave This function may leave. (Private fn, so this` doco not built into DevLibrary)

Parameters

CCommSession * aSession pointer to the session
TInternalCommAccess aMode access mode
TCommRole aRole port role; DTE or DCE
TBool aIsNew ETrue if new session

DoPreemption()

void DoPreemption ( ) [private]

cancel all outstanding requests and setup the preemted session

FlowControlChangeCompleted(const TFlowControl &, TInt)

IMPORT_C void FlowControlChangeCompleted ( const TFlowControl & aFlowControl,
TInt anError
)

Tells the comms server that a request initiated through NotifyFlowControlChange() is complete.

The comms server will then notify the client that its request is complete.

Called by the CSY module.

Parameters

const TFlowControl & aFlowControl Flow control to pass to client
TInt anError Error code

FreeMemory()

void FreeMemory ( ) [virtual]

Specifies a protocol by which the comms server can request the protocol to release memory. Typically, an implementation may be able to do this by reducing internal buffers.

The default behaviour is to do nothing.

FreeSession(CCommSession *)

void FreeSession ( CCommSession * aSession )

Perform CPort based housekeeping before closing a session

Parameters

CCommSession * aSession pointer to the session to free.

GetCaps(TDes8 &)

TInt GetCaps ( TDes8 & aPackage ) [pure virtual]

Specifies a protocol for getting the port capabilities. It is called by the comms server in response to a RComm::Caps() request from the client.

Parameters

TDes8 & aPackage A TCommCaps package buffer that, on return, holds the port capabilities

GetConfig(TDes8 &)

TInt GetConfig ( TDes8 & aPackage ) const [pure virtual]

Specifies a protocol for getting the current configuration of the serial port. It is called by the comms server in response to a RComm::GetConfig() request from the client.

Parameters

TDes8 & aPackage A packaged TCommConfig buffer, set on return to the current configuration of the serial port

GetFlowControlStatus(TFlowControl &)

TInt GetFlowControlStatus ( TFlowControl & aFlowControl ) [pure virtual]

Gets flow control status. It is called by the comms server in response to a RComm::SetMode() request from the client.

Parameters

TFlowControl & aFlowControl Flow control status to return to the client

GetReceiveBufferLength(TInt &)

TInt GetReceiveBufferLength ( TInt & aLength ) const [pure virtual]

Specifies a protocol for requesting the size of the serial port buffers. It is called by the comms server in response to a RComm::ReceiveBufferLength() request from the client.

Parameters

TInt & aLength The current size of the serial port buffers in bytes

GetRole(TCommRole &)

TInt GetRole ( TCommRole & aRole ) [pure virtual]

Gets DCE/DTE role. It is called by the comms server in response to a RComm::GetRole() request from the client.

Parameters

TCommRole & aRole On return, DCE/DTE role to return to the client

GetServerConfig(TDes8 &)

TInt GetServerConfig ( TDes8 & aPackage ) [pure virtual]

Specifies a protocol for getting the buffer mode. It is called by the comms server in response to a RComm::Mode() request from the client.

Parameters

TDes8 & aPackage A TCommServerConfig package buffer that, on return, holds the current buffer mode settings

GetSignals(TUint &)

TInt GetSignals ( TUint & aSignals ) [pure virtual]

Specifies a protocol for getting the status of the serial port control lines. It is called by the comms server in response to a RComm::GetSignals() request from the client.

Parameters

TUint & aSignals An integer with the bits set to reflect the status of the handshaking lines.

IPCRead(const TAny *, TDes8 &, TInt)

IMPORT_C TInt IPCRead ( const TAny * aPtr,
TDes8 & aDes,
TInt aOffset = 0
) const

Reads data from the client's (the user of the port's) address space.

The client address space pointer is obtained from the aClientBuffer argument to StartRead() .

Note:

This function is normally called by the CSY

Note:

Used as part of RComm::Write

RThread::ReadL() for more information on reading data in other address spaces.

Parameters

const TAny * aPtr Not Used. The client data is now obtained from iBlockedWrite.
TDes8 & aDes A descriptor (8 bit variant) into which the result of the client address space read operation will be stored
TInt aOffset = 0 The read offset from the start of the client's descriptor data.

IPCWrite(const TAny *, const TDesC8 &, TInt)

IMPORT_C TInt IPCWrite ( const TAny * aPtr,
const TDesC8 & aDes,
TInt aOffset = 0
) const

Writes into the client's (the user of the port's) address space.

The client address space pointer is obtained from the aClientBuffer argument to StartWrite() .

Note:

This function is normally called by the CSY

Note:

Used as part of RComm::Read

RThread::WriteL() for more information on writing data to other address spaces.

Parameters

const TAny * aPtr Client address space pointer
const TDesC8 & aDes A descriptor (8 bit variant) into which the result of the client address space read will be stored
TInt aOffset = 0 The offset from aPtr at which to start reading

InitL(TDesC8 &)

void InitL ( TDesC8 & aName )

Parameters

TDesC8 & aName

IsBlockedSetAccessWaiting(CCommSession &)

TBool IsBlockedSetAccessWaiting ( CCommSession & aClient )

Checks if a CommSetAccess() request is waiting for the port.

Parameters

CCommSession & aClient The CCommSession client to check against.

NotifyBreak()

void NotifyBreak ( ) [pure virtual]

Specifies the protocol for setting a "break" notification. It is called by the comms server in response to a RComm::NotifyBreak() request from the client.

NotifyBreakCancel()

void NotifyBreakCancel ( ) [pure virtual]

Specifies the protocol for cancelling a "break" notification. It is called by the comms server in response to a RComm::NotifyBreakCancel() request from the client.

NotifyConfigChange()

void NotifyConfigChange ( ) [pure virtual]

Specifies the protocol for setting a "configuration change" notification. It is called by the comms server in response to a RComm::NotifyConfigChange() request from the client.

NotifyConfigChangeCancel()

void NotifyConfigChangeCancel ( ) [pure virtual]

Specifies the protocol for cancelling a "configuration change" notification. It is called by the comms server in response to a RComm::NotifyConfigChangeCancel() request from the client.

NotifyDataAvailable()

void NotifyDataAvailable ( ) [pure virtual]

Specifies the protocol for setting a "data available" notification. It is called

by the comms server in response to a RComm::NotifyDataAvailable() request from the client.

NotifyDataAvailableCancel()

void NotifyDataAvailableCancel ( ) [pure virtual]

Specifies the protocol for cancelling a "data available" notification. It is called by the comms server in response to a RComm::NotifyDataAvailableCancel() request from the client.

NotifyDataAvailableCompleted(TInt)

IMPORT_C void NotifyDataAvailableCompleted ( TInt anError )

Tells the comms server that a request initiated through NotifyDataAvailable() is complete.

The comms server will then notify the client that its request is complete.

Called by the CSY module.

Parameters

TInt anError Error code

NotifyFlowControlChange()

void NotifyFlowControlChange ( ) [pure virtual]

Specifies the protocol for setting a "flow control change" notification. It is called by the comms server in response to a RComm::NotifyFlowControlChange() request from the client.

NotifyFlowControlChangeCancel()

void NotifyFlowControlChangeCancel ( ) [pure virtual]

Specifies the protocol for cancelling a "flow control change" notification. It is called by the comms server in response to a RComm::NotifyFlowControlChangeCancel() request from the client.

NotifyOutputEmpty()

void NotifyOutputEmpty ( ) [pure virtual]

Specifies the protocol for setting a transmit buffer empty notification. It is called by the comms server in response to a RComm::NotifyOutputEmpty() request from the client.

NotifyOutputEmptyCancel()

void NotifyOutputEmptyCancel ( ) [pure virtual]

Specifies the protocol for cancelling a transmit buffer empty notification. It is called by the comms server in response to a RComm::NotifyOutputEmptyCancel() request from the client.

NotifyOutputEmptyCompleted(TInt)

IMPORT_C void NotifyOutputEmptyCompleted ( TInt anError )

Tells the comms server that a request initiated through NotifyOutputEmpty() is complete.

The comms server will then notify the client that its request is complete.

Called by the CSY module.

Parameters

TInt anError Error code

NotifySignalChange(TUint)

void NotifySignalChange ( TUint aSignalMask ) [pure virtual]

Specifies the protocol for setting a "signal change" notification. It is called by the comms server in response to a RComm::NotifySignalChange() request from the client.

Parameters

TUint aSignalMask Signal mask passed by client

NotifySignalChangeCancel()

void NotifySignalChangeCancel ( ) [pure virtual]

Specifies the protocol for cancelling a "signal change" notification. It is called by the comms server in response to a RComm::NotifySignalChangeCancel() request from the client.

QueryReceiveBuffer(TInt &)

TInt QueryReceiveBuffer ( TInt & aLength ) const [pure virtual]

Specifies a protocol for requesting the number of bytes that are currently waiting in the port's receive buffer. It is called by the comms server in response to a RComm::QueryReceiveBuffer() request from the client.

Parameters

TInt & aLength On return, the number of bytes currently waiting to be read from the receive buffer.

ReadCancel()

void ReadCancel ( ) [pure virtual]

Specifies the protocol for cancelling reading from the port. It is called by the comms server in response to a RComm::ReadCancel() request from the client or when the iReadTimer timer expires.

The implementation should abort any processing which was taking place as a result of the read request. Do not call ReadCompleted() .

ReadCompleted(TInt)

IMPORT_C void ReadCompleted ( TInt anError )

Tells the comms server that a read request initiated through StartRead() is complete.

The comms server will then notify the client that its read request is complete.

Called by C32 server or CSY.

Parameters

TInt anError Return code to be passed back to the client through its TRequestStatus argument.

ReadTimerExpiredHandler(TAny *)

TInt ReadTimerExpiredHandler ( TAny * aPtr ) [static]

This static function is called when the read timer expires. installed by CPort::CommRead as TCallBack

Parameters

TAny * aPtr pointer to the CPort with the timedout read

ResetBuffers(TUint)

void ResetBuffers ( TUint aFlags ) [pure virtual]

Specifies a protocol for resetting the receive and/or transmit buffers to zero length. It is called by the comms server in response to a RComm::ResetBuffers() request from the client.

Parameters

TUint aFlags Bitmask of the following flags: KCommResetRx to reset the receive buffer; KCommResetTx to reset the transmit buffer

SessionHasBeenPreempted(CCommSession *)

TBool SessionHasBeenPreempted ( CCommSession * aSession )

returns true if session has been pre-empted

Parameters

CCommSession * aSession session to be questioned

SessionIsAwaitingOpen(CCommSession *)

TBool SessionIsAwaitingOpen ( CCommSession * aSession )

returns true if session is waiting for open

Parameters

CCommSession * aSession session to be questioned

SetConfig(const TDesC8 &)

TInt SetConfig ( const TDesC8 & aPackage ) [pure virtual]

Specifies a protocol for setting the configuration of the port. It is called by the comms server in response to a RComm::SetConfig() request from the client.

Parameters

const TDesC8 & aPackage A packaged TCommConfig buffer holding the new configuration values

SetReceiveBufferLength(TInt)

TInt SetReceiveBufferLength ( TInt aLength ) [pure virtual]

Specifies a protocol for setting the size of the serial port buffers. It is called by the comms server in response to a RComm::SetReceiveBufferLength() request from the client.

Parameters

TInt aLength Requested size of the serial port buffers in bytes

SetRole(TCommRole)

TInt SetRole ( TCommRole aRole ) [pure virtual]

Sets DCE/DTE role. It is called by the comms server in response to a RComm::Open() request from the client.

Parameters

TCommRole aRole DCE/DTE role

SetServerConfig(const TDesC8 &)

TInt SetServerConfig ( const TDesC8 & aPackage ) [pure virtual]

Specifies a protocol for setting the buffer mode. It is called by the comms server in response to a RComm::SetMode() request from the client.

Parameters

const TDesC8 & aPackage A TCommServerConfig package buffer holding the mode settings

SetSignalsToMark(TUint)

TInt SetSignalsToMark ( TUint aSignals ) [pure virtual]

Specifies a protocol for setting serial port control lines. It is called by the comms server in response to a RComm::SetSignals() request from the client.

Parameters

TUint aSignals A bitmask of the handshaking lines to set

SetSignalsToSpace(TUint)

TInt SetSignalsToSpace ( TUint aSignals ) [pure virtual]

Specifies a protocol for clearing serial port control lines. It is called by the comms server in response to a RComm::SetSignals() request from the client.

Parameters

TUint aSignals A bitmask of the handshaking lines to clear

SignalChangeCompleted(const TUint &, TInt)

IMPORT_C void SignalChangeCompleted ( const TUint & aSignals,
TInt anError
)

Tells the comms server that a request initiated through NotifySignalChange() is complete.

The comms server will then notify the client that its request is complete.

Called by the CSY module.

Parameters

const TUint & aSignals The new signals value to pass to the client.
TInt anError An error code.

StartRead(const TAny *, TInt)

void StartRead ( const TAny * aClientBuffer,
TInt aLength
) [pure virtual]

Specifies the protocol for reading from the port. It is called by the comms server in response to a RComm::Read() or RComm::ReadOneOrMore() request from the client.

A negative value for aLength is used to flag that the read request was from RComm::ReadOneOrMore() rather than from RComm::Read() . The maximum length of data to be read is the absolute value of aLength.

The implementation should use IPCWrite() to write the data to the client's buffer. When all the data has been read, the function should call ReadCompleted() .

Parameters

const TAny * aClientBuffer Pointer into client address space to the descriptor containing the client's buffer
TInt aLength The amount of data to be read

StartWrite(const TAny *, TInt)

void StartWrite ( const TAny * aClientBuffer,
TInt aLength
) [pure virtual]

Specifies the protocol for writing to the port. It is called by the comms server in response to a RComm::Write() request from the client.

The implementation should use IPCRead() to get the data to write from the client's buffer. When all the data has been written, the function should call WriteCompleted() .

Parameters

const TAny * aClientBuffer Pointer into client address space to the descriptor containing the client's buffer
TInt aLength The amount of data to be written

TakeOwnershipForBreak(const RMessage2 &, CCommSession *)

TBool TakeOwnershipForBreak ( const RMessage2 & aMessage,
CCommSession * aClient
)

We check that break notifying is not called twice at the same time

Parameters

const RMessage2 & aMessage
CCommSession * aClient pointer to the Comm session

TakeOwnershipForBreaking(const RMessage2 &, CCommSession *)

TBool TakeOwnershipForBreaking ( const RMessage2 & aMessage,
CCommSession * aClient
)

Check if a Break request is valid and take ownership of port

Parameters

const RMessage2 & aMessage
CCommSession * aClient handle to the client session

TakeOwnershipForConfig(const RMessage2 &, CCommSession *)

TBool TakeOwnershipForConfig ( const RMessage2 & aMessage,
CCommSession * aClient
)

We check that config change notifying is not called twice at the same time

Parameters

const RMessage2 & aMessage
CCommSession * aClient pointer to the Comm session

TakeOwnershipForFlowControl(const RMessage2 &, CCommSession *)

TBool TakeOwnershipForFlowControl ( const RMessage2 & aMessage,
CCommSession * aClient
)

We check that flowcontrol notifying is not called twice at the same time

Parameters

const RMessage2 & aMessage
CCommSession * aClient pointer to the Comm session

TakeOwnershipForNotifyDataAvailable(const RMessage2 &, CCommSession *)

TBool TakeOwnershipForNotifyDataAvailable ( const RMessage2 & aMessage,
CCommSession * aClient
)

We check that input buffer data notifying is not called twice at the same time

Parameters

const RMessage2 & aMessage
CCommSession * aClient pointer to the Comm session

TakeOwnershipForNotifyOutputEmpty(const RMessage2 &, CCommSession *)

TBool TakeOwnershipForNotifyOutputEmpty ( const RMessage2 & aMessage,
CCommSession * aClient
)

We check that output buffer empty notifying is not called twice at the same time

Parameters

const RMessage2 & aMessage
CCommSession * aClient pointer to the Comm session

TakeOwnershipForReading(const RMessage2 &, CCommSession *)

TBool TakeOwnershipForReading ( const RMessage2 & aMessage,
CCommSession * aClient
)

Check if a Read request is valid and take ownership of port

Parameters

const RMessage2 & aMessage
CCommSession * aClient handle to the client session

TakeOwnershipForSignals(const RMessage2 &, CCommSession *)

TBool TakeOwnershipForSignals ( const RMessage2 & aMessage,
CCommSession * aClient
)

We check that signal notifying is not called twice at the same time

Parameters

const RMessage2 & aMessage
CCommSession * aClient pointer to the Comm session

TakeOwnershipForWriting(const RMessage2 &, CCommSession *)

TBool TakeOwnershipForWriting ( const RMessage2 & aMessage,
CCommSession * aClient
)

Check if a Write request is valid and take ownership of port

Parameters

const RMessage2 & aMessage
CCommSession * aClient handle to the client session

WriteCancel()

void WriteCancel ( ) [pure virtual]

Specifies the protocol for cancelling writing to the port. It is called by the comms server in response to a RComm::WriteCancel() request from the client.

The implementation should abort any processing which was taking place as a result of the write request. Do not call WriteCompleted() .

WriteCompleted(TInt)

IMPORT_C void WriteCompleted ( TInt anError )

Tells the comms server that a write request initiated through StartWrite() is complete.

The comms server will then notify the client that its write request is complete.

Called by C32 server or CSY.

Parameters

TInt anError Return code to be passed back to the client through its TRequestStatus argument.

WriteTimerExpiredHandler(TAny *)

TInt WriteTimerExpiredHandler ( TAny * aPtr ) [static]

This static function is called when the write timer expires. installed by CPort::CommWrite as TCallBack

Parameters

TAny * aPtr pointer to the CPort with the timedout write

Member Type Definitions Documentation

Typedef TAccess

typedef TCommAccess TAccess

Member Data Documentation

RMessagePtr2 iBlockedBreak

RMessagePtr2 iBlockedBreak [private]

RMessagePtr2 iBlockedBreakNotify

RMessagePtr2 iBlockedBreakNotify [private]

RMessagePtr2 iBlockedConfigChange

RMessagePtr2 iBlockedConfigChange [private]

The encapsulated message

TInt iBlockedConfigChangeDummyPadding

TInt iBlockedConfigChangeDummyPadding [private]

Private padding to preserve BC with earlier versions

RMessagePtr2 iBlockedFlowControlChange

RMessagePtr2 iBlockedFlowControlChange [private]

The encapsulated message

TInt iBlockedFlowControlChangeDummyPadding

TInt iBlockedFlowControlChangeDummyPadding [private]

Private padding to preserve BC with earlier versions

RMessagePtr2 iBlockedNotifyDataAvailable

RMessagePtr2 iBlockedNotifyDataAvailable [private]

RMessagePtr2 iBlockedNotifyOutputEmpty

RMessagePtr2 iBlockedNotifyOutputEmpty [private]

RMessagePtr2 iBlockedRead

RMessagePtr2 iBlockedRead [private]

RMessagePtr2 iBlockedSignalChange

RMessagePtr2 iBlockedSignalChange [private]

The encapsulated message

TInt iBlockedSignalChangeDummyPadding

TInt iBlockedSignalChangeDummyPadding [private]

Private padding to preserve BC with earlier versions

RMessagePtr2 iBlockedWrite

RMessagePtr2 iBlockedWrite [private]

CCommSession * iBreakNotifyOwner

CCommSession * iBreakNotifyOwner [private]

TInt iBreakNotifyOwnerHandle

TInt iBreakNotifyOwnerHandle [private]

TInt iBreakOwnerHandle

TInt iBreakOwnerHandle [private]

TAny * iCPort_Reserved

TAny * iCPort_Reserved [private]

CCommSession * iConfigOwner

CCommSession * iConfigOwner [private]

TInt iConfigOwnerHandle

TInt iConfigOwnerHandle [private]

CExtra * iExtra

CExtra * iExtra [private]

CCommSession * iFlowControlOwner

CCommSession * iFlowControlOwner [private]

TInt iFlowControlOwnerHandle

TInt iFlowControlOwnerHandle [private]

TInternalCommAccess iMode

TInternalCommAccess iMode [private]

CCommSession * iNotifyDataAvailableOwner

CCommSession * iNotifyDataAvailableOwner [private]

TInt iNotifyDataAvailableOwnerHandle

TInt iNotifyDataAvailableOwnerHandle [private]

CCommSession * iNotifyOutputEmptyOwner

CCommSession * iNotifyOutputEmptyOwner [private]

TInt iNotifyOutputEmptyOwnerHandle

TInt iNotifyOutputEmptyOwnerHandle [private]

CPortManager * iPortManager

CPortManager * iPortManager [private]

CCommSession * iReadOwner

CCommSession * iReadOwner [private]

TInt iReadOwnerHandle

TInt iReadOwnerHandle [private]

TDeltaTimerEntry iReadTimer

TDeltaTimerEntry iReadTimer [private]

TBool iReadTimerPending

TBool iReadTimerPending [private]

CCommSession * iSignalOwner

CCommSession * iSignalOwner [private]

TInt iSignalOwnerHandle

TInt iSignalOwnerHandle [private]

CCommSession * iWriteOwner

CCommSession * iWriteOwner [private]

TInt iWriteOwnerHandle

TInt iWriteOwnerHandle [private]

TDeltaTimerEntry iWriteTimer

TDeltaTimerEntry iWriteTimer [private]

TBool iWriteTimerPending

TBool iWriteTimerPending [private]