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).
Private Member Functions | |
---|---|
IMPORT_C void | CPort_Reserved1() |
void | DoOpenL(CCommSession *, TInternalCommAccess, TCommRole, TBool) |
void | DoPreemption() |
Public Member Type Definitions | |
---|---|
typedef | TCommAccess TAccess |
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().
TInt aTime | Time period to break for in microseconds |
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().
void | CommBreak | ( | const RMessage2 & | aMessage, |
CCommSession * | aClient | |||
) |
const RMessage2 & aMessage | |
CCommSession * aClient |
void | CommBreakCancel | ( | TInt | aHandle, |
CCommSession * | aClient | |||
) |
TInt aHandle | |
CCommSession * aClient |
void | CommCancel | ( | TInt | aHandle, |
CCommSession * | aClient | |||
) |
TInt aHandle | |
CCommSession * aClient |
void | CommCaps | ( | const RMessage2 & | aMessage, |
CCommSession & | aSession | |||
) |
const RMessage2 & aMessage | |
CCommSession & aSession |
void | CommConfig | ( | const RMessage2 & | aMessage, |
CCommSession & | aSession | |||
) | const |
const RMessage2 & aMessage | |
CCommSession & aSession |
void | CommDebugState | ( | const RMessage2 & | aMessage, |
CCommSession & | aSession | |||
) |
const RMessage2 & aMessage | |
CCommSession & aSession |
void | CommGetFlowControlStatus | ( | const RMessage2 & | aMessage, |
CCommSession * | aClient | |||
) |
const RMessage2 & aMessage | |
CCommSession * aClient |
void | CommGetRole | ( | const RMessage2 & | aMessage, |
CCommSession * | aClient | |||
) |
const RMessage2 & aMessage | |
CCommSession * aClient |
void | CommGetServerConfig | ( | const RMessage2 & | aMessage, |
CCommSession & | aSession | |||
) |
const RMessage2 & aMessage | |
CCommSession & aSession |
void | CommNotifyBreak | ( | const RMessage2 & | aMessage, |
CCommSession * | aClient | |||
) |
const RMessage2 & aMessage | |
CCommSession * aClient |
void | CommNotifyBreakCancel | ( | TInt | aHandle, |
CCommSession * | aClient | |||
) |
TInt aHandle | |
CCommSession * aClient |
void | CommNotifyConfigChange | ( | const RMessage2 & | aMessage, |
CCommSession * | aClient | |||
) |
const RMessage2 & aMessage | |
CCommSession * aClient |
void | CommNotifyConfigChangeCancel | ( | TInt | aHandle, |
CCommSession * | aClient | |||
) |
TInt aHandle | |
CCommSession * aClient |
void | CommNotifyDataAvailable | ( | const RMessage2 & | aMessage, |
CCommSession * | aClient | |||
) |
const RMessage2 & aMessage | |
CCommSession * aClient |
void | CommNotifyDataAvailableCancel | ( | TInt | aHandle, |
CCommSession * | aClient | |||
) |
TInt aHandle | |
CCommSession * aClient |
void | CommNotifyFlowControlChange | ( | const RMessage2 & | aMessage, |
CCommSession * | aClient | |||
) |
const RMessage2 & aMessage | |
CCommSession * aClient |
void | CommNotifyFlowControlChangeCancel | ( | TInt | aHandle, |
CCommSession * | aClient | |||
) |
TInt aHandle | |
CCommSession * aClient |
void | CommNotifyOutputEmpty | ( | const RMessage2 & | aMessage, |
CCommSession * | aClient | |||
) |
const RMessage2 & aMessage | |
CCommSession * aClient |
void | CommNotifyOutputEmptyCancel | ( | TInt | aHandle, |
CCommSession * | aClient | |||
) |
TInt aHandle | |
CCommSession * aClient |
void | CommNotifySignalChange | ( | const RMessage2 & | aMessage, |
CCommSession * | aClient | |||
) |
const RMessage2 & aMessage | |
CCommSession * aClient |
void | CommNotifySignalChangeCancel | ( | TInt | aHandle, |
CCommSession * | aClient | |||
) |
TInt aHandle | |
CCommSession * aClient |
void | CommQueryReceiveBuffer | ( | const RMessage2 & | aMessage, |
CCommSession & | aSession | |||
) | const |
const RMessage2 & aMessage | |
CCommSession & aSession |
void | CommRead | ( | const RMessage2 & | aMessage, |
CCommSession * | aClient | |||
) |
const RMessage2 & aMessage | |
CCommSession * aClient |
void | CommReadCancel | ( | TInt | aHandle, |
CCommSession * | aClient | |||
) |
TInt aHandle | |
CCommSession * aClient |
void | CommReceiveBufferLength | ( | const RMessage2 & | aMessage, |
CCommSession & | aSession | |||
) | const |
const RMessage2 & aMessage | |
CCommSession & aSession |
void | CommResetBuffers | ( | const RMessage2 & | aMessage, |
CCommSession & | aSession | |||
) |
const RMessage2 & aMessage | |
CCommSession & aSession |
void | CommSetAccess | ( | const RMessage2 & | aMessage, |
CCommSession & | aSession | |||
) |
const RMessage2 & aMessage | |
CCommSession & aSession |
void | CommSetAccessCancel | ( | TInt | aHandle, |
CCommSession * | aClient | |||
) |
TInt aHandle | |
CCommSession * aClient |
void | CommSetConfig | ( | const RMessage2 & | aMessage, |
CCommSession & | aSession | |||
) |
const RMessage2 & aMessage | |
CCommSession & aSession |
void | CommSetReceiveBufferLength | ( | const RMessage2 & | aMessage, |
CCommSession & | aSession | |||
) |
const RMessage2 & aMessage | |
CCommSession & aSession |
void | CommSetServerConfig | ( | const RMessage2 & | aMessage, |
CCommSession & | aSession | |||
) |
const RMessage2 & aMessage | |
CCommSession & aSession |
void | CommSetSignalsToMark | ( | const RMessage2 & | aMessage, |
CCommSession & | aSession | |||
) |
const RMessage2 & aMessage | |
CCommSession & aSession |
void | CommSetSignalsToSpace | ( | const RMessage2 & | aMessage, |
CCommSession & | aSession | |||
) |
const RMessage2 & aMessage | |
CCommSession & aSession |
void | CommSignals | ( | const RMessage2 & | aMessage, |
CCommSession & | aSession | |||
) |
const RMessage2 & aMessage | |
CCommSession & aSession |
void | CommWrite | ( | const RMessage2 & | aMessage, |
CCommSession * | aClient | |||
) |
const RMessage2 & aMessage | |
CCommSession * aClient |
void | CommWriteCancel | ( | TInt | aHandle, |
CCommSession * | aClient | |||
) |
TInt aHandle | |
CCommSession * aClient |
IMPORT_C void | ConfigChangeCompleted | ( | const TDesC8 & | aNewConfig, |
TInt | anError | |||
) |
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.
void | DoOpenL | ( | CCommSession * | aSession, |
TInternalCommAccess | aMode, | |||
TCommRole | aRole, | |||
TBool | aIsNew | |||
) | [private] |
CCommSession * aSession | |
TInternalCommAccess aMode | |
TCommRole aRole | |
TBool aIsNew |
IMPORT_C void | FlowControlChangeCompleted | ( | const TFlowControl & | aFlowControl, |
TInt | anError | |||
) |
const TFlowControl & aFlowControl | |
TInt anError |
void | FreeSession | ( | CCommSession * | aSession | ) |
CCommSession * aSession |
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.
A system error code
TDes8 & aPackage | A TCommCaps package buffer that, on return, holds the port capabilities |
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.
A system wide error code
TDes8 & aPackage | A packaged TCommConfig buffer, set on return to the current configuration of the serial port |
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.
A system-wide error code
TFlowControl & aFlowControl | Flow control status to return to the client |
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.
A system error code
TInt & aLength | The current size of the serial port buffers in bytes |
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.
A system-wide error code
TCommRole & aRole | On return, DCE/DTE role to return to the client |
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.
A system error code
TDes8 & aPackage | A TCommServerConfig package buffer that, on return, holds the current buffer mode settings |
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.
A system error code
TUint & aSignals | An integer with the bits set to reflect the status of the handshaking lines. |
IMPORT_C TInt | IPCRead | ( | const TAny * | aPtr, |
TDes8 & | aDes, | |||
TInt | aOffset = 0 | |||
) | const |
IMPORT_C TInt | IPCWrite | ( | const TAny * | aPtr, |
const TDesC8 & | aDes, | |||
TInt | aOffset = 0 | |||
) | const |
TBool | IsBlockedSetAccessWaiting | ( | CCommSession & | aClient | ) |
CCommSession & aClient |
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.
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.
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.
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.
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.
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.
IMPORT_C void | NotifyDataAvailableCompleted | ( | TInt | anError | ) |
TInt anError |
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.
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.
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.
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.
IMPORT_C void | NotifyOutputEmptyCompleted | ( | TInt | anError | ) |
TInt anError |
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.
TUint aSignalMask | Signal mask passed by client |
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.
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.
A system wide error code.
TInt & aLength | On return, the number of bytes currently waiting to be read from the receive buffer. |
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().
TInt | ReadTimerExpiredHandler | ( | TAny * | aPtr | ) | [static] |
TAny * aPtr |
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.
TUint aFlags | Bitmask of the following flags: KCommResetRx to reset the receive buffer; KCommResetTx to reset the transmit buffer |
TBool | SessionHasBeenPreempted | ( | CCommSession * | aSession | ) |
CCommSession * aSession |
TBool | SessionIsAwaitingOpen | ( | CCommSession * | aSession | ) |
CCommSession * aSession |
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.
A system error code
const TDesC8 & aPackage | A packaged TCommConfig buffer holding the new configuration values |
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.
A system error code
TInt aLength | Requested size of the serial port buffers in bytes |
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.
A system-wide error code
TCommRole aRole | DCE/DTE role |
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.
A system-wide error code
const TDesC8 & aPackage | A TCommServerConfig package buffer holding the mode settings |
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.
A system error code
TUint aSignals | A bitmask of the handshaking lines to set |
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.
A system error code
TUint aSignals | A bitmask of the handshaking lines to clear |
IMPORT_C void | SignalChangeCompleted | ( | const TUint & | aSignals, |
TInt | anError | |||
) |
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().
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().
TBool | TakeOwnershipForBreak | ( | const RMessage2 & | aMessage, |
CCommSession * | aClient | |||
) |
const RMessage2 & aMessage | |
CCommSession * aClient |
TBool | TakeOwnershipForBreaking | ( | const RMessage2 & | aMessage, |
CCommSession * | aClient | |||
) |
const RMessage2 & aMessage | |
CCommSession * aClient |
TBool | TakeOwnershipForConfig | ( | const RMessage2 & | aMessage, |
CCommSession * | aClient | |||
) |
const RMessage2 & aMessage | |
CCommSession * aClient |
TBool | TakeOwnershipForFlowControl | ( | const RMessage2 & | aMessage, |
CCommSession * | aClient | |||
) |
const RMessage2 & aMessage | |
CCommSession * aClient |
TBool | TakeOwnershipForNotifyDataAvailable | ( | const RMessage2 & | aMessage, |
CCommSession * | aClient | |||
) |
const RMessage2 & aMessage | |
CCommSession * aClient |
TBool | TakeOwnershipForNotifyOutputEmpty | ( | const RMessage2 & | aMessage, |
CCommSession * | aClient | |||
) |
const RMessage2 & aMessage | |
CCommSession * aClient |
TBool | TakeOwnershipForReading | ( | const RMessage2 & | aMessage, |
CCommSession * | aClient | |||
) |
const RMessage2 & aMessage | |
CCommSession * aClient |
TBool | TakeOwnershipForSignals | ( | const RMessage2 & | aMessage, |
CCommSession * | aClient | |||
) |
const RMessage2 & aMessage | |
CCommSession * aClient |
TBool | TakeOwnershipForWriting | ( | const RMessage2 & | aMessage, |
CCommSession * | aClient | |||
) |
const RMessage2 & aMessage | |
CCommSession * aClient |
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().
TInt | WriteTimerExpiredHandler | ( | TAny * | aPtr | ) | [static] |
TAny * aPtr |
RMessagePtr2 | iBlockedConfigChange | [private] |
The encapsulated message
TInt | iBlockedConfigChangeDummyPadding | [private] |
Private padding to preserve BC with earlier versions
RMessagePtr2 | iBlockedFlowControlChange | [private] |
The encapsulated message
TInt | iBlockedFlowControlChangeDummyPadding | [private] |
Private padding to preserve BC with earlier versions
RMessagePtr2 | iBlockedSignalChange | [private] |
The encapsulated message
TInt | iBlockedSignalChangeDummyPadding | [private] |
Private padding to preserve BC with earlier versions